From ossp-cvs-owner@ossp.org Tue Jun 13 16:05:42 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e5DDjsa02443; Tue, 13 Jun 2000 15:45:54 +0200 (CEST) Date: Tue, 13 Jun 2000 15:45:54 +0200 (CEST) Message-Id: <200006131345.e5DDjsa02443@ossp.org> From: "OSSP Project Master" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="MDOHUSCL29E138Y91LHP" Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: CVSROOT modules Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list This is a multi-part message in MIME format. --MDOHUSCL29E138Y91LHP Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: commit summary Content-Disposition: inline OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: OSSP Project Master Root: /e/ossp/cvs Email: ossp@ossp.org Module: CVSROOT Date: 13-Jun-2000 15:45:49 Branch: HEAD Handle: 2000061314454800 Modified files: CVSROOT modules Log: Null commit Summary: Revision Changes Path 1.10 CVSROOT/modules ____________________________________________________________________________ --MDOHUSCL29E138Y91LHP Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to CVSROOT/modules Content-Disposition: attachment Index: CVSROOT/modules ============================================================ $ cvs diff -u -r1.9 -r1.10 modules --- CVSROOT/modules 2000/06/13 13:42:13 1.9 +++ CVSROOT/modules 2000/06/13 13:45:48 1.10 @@ -60,3 +60,4 @@ ossp-web ossp-web ossp-play ossp-play + --MDOHUSCL29E138Y91LHP-- From ossp-cvs-owner@ossp.org Tue Jun 13 16:09:07 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e5DDjsa02443; Tue, 13 Jun 2000 15:45:54 +0200 (CEST) Date: Tue, 13 Jun 2000 15:45:54 +0200 (CEST) Message-Id: <200006131345.e5DDjsa02443@ossp.org> From: "OSSP Project Master" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="MDOHUSCL29E138Y91LHP" Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: CVSROOT modules Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list This is a multi-part message in MIME format. --MDOHUSCL29E138Y91LHP Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: commit summary Content-Disposition: inline OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: OSSP Project Master Root: /e/ossp/cvs Email: ossp@ossp.org Module: CVSROOT Date: 13-Jun-2000 15:45:49 Branch: HEAD Handle: 2000061314454800 Modified files: CVSROOT modules Log: Null commit Summary: Revision Changes Path 1.10 CVSROOT/modules ____________________________________________________________________________ --MDOHUSCL29E138Y91LHP Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to CVSROOT/modules Content-Disposition: attachment Index: CVSROOT/modules ============================================================ $ cvs diff -u -r1.9 -r1.10 modules --- CVSROOT/modules 2000/06/13 13:42:13 1.9 +++ CVSROOT/modules 2000/06/13 13:45:48 1.10 @@ -60,3 +60,4 @@ ossp-web ossp-web ossp-play ossp-play + --MDOHUSCL29E138Y91LHP-- From ossp-cvs-owner@ossp.org Tue Jun 13 16:10:21 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e5DDjsa02443; Tue, 13 Jun 2000 15:45:54 +0200 (CEST) Date: Tue, 13 Jun 2000 15:45:54 +0200 (CEST) Message-Id: <200006131345.e5DDjsa02443@ossp.org> From: "OSSP Project Master" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="MDOHUSCL29E138Y91LHP" Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: CVSROOT modules Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list This is a multi-part message in MIME format. --MDOHUSCL29E138Y91LHP Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: commit summary Content-Disposition: inline OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: OSSP Project Master Root: /e/ossp/cvs Email: ossp@ossp.org Module: CVSROOT Date: 13-Jun-2000 15:45:49 Branch: HEAD Handle: 2000061314454800 Modified files: CVSROOT modules Log: Null commit Summary: Revision Changes Path 1.10 CVSROOT/modules ____________________________________________________________________________ --MDOHUSCL29E138Y91LHP Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to CVSROOT/modules Content-Disposition: attachment Index: CVSROOT/modules ============================================================ $ cvs diff -u -r1.9 -r1.10 modules --- CVSROOT/modules 2000/06/13 13:42:13 1.9 +++ CVSROOT/modules 2000/06/13 13:45:48 1.10 @@ -60,3 +60,4 @@ ossp-web ossp-web ossp-play ossp-play + --MDOHUSCL29E138Y91LHP-- From ossp-cvs-owner@ossp.org Tue Jun 13 16:25:13 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e5DDjsa02443; Tue, 13 Jun 2000 15:45:54 +0200 (CEST) Date: Tue, 13 Jun 2000 15:45:54 +0200 (CEST) Message-Id: <200006131345.e5DDjsa02443@ossp.org> From: "OSSP Project Master" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="MDOHUSCL29E138Y91LHP" Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: CVSROOT modules Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list This is a multi-part message in MIME format. --MDOHUSCL29E138Y91LHP Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: commit summary Content-Disposition: inline OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: OSSP Project Master Root: /e/ossp/cvs Email: ossp@ossp.org Module: CVSROOT Date: 13-Jun-2000 15:45:49 Branch: HEAD Handle: 2000061314454800 Modified files: CVSROOT modules Log: Null commit Summary: Revision Changes Path 1.10 CVSROOT/modules ____________________________________________________________________________ --MDOHUSCL29E138Y91LHP Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to CVSROOT/modules Content-Disposition: attachment Index: CVSROOT/modules ============================================================ $ cvs diff -u -r1.9 -r1.10 modules --- CVSROOT/modules 2000/06/13 13:42:13 1.9 +++ CVSROOT/modules 2000/06/13 13:45:48 1.10 @@ -60,3 +60,4 @@ ossp-web ossp-web ossp-play ossp-play + --MDOHUSCL29E138Y91LHP-- From ossp-cvs-owner@ossp.org Tue Jun 13 16:33:19 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e5DEXIq06762; Tue, 13 Jun 2000 16:33:18 +0200 (CEST) Date: Tue, 13 Jun 2000 16:33:18 +0200 (CEST) Message-Id: <200006131433.e5DEXIq06762@ossp.org> From: "OSSP Project Master" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="UT8N48YME17NVBMI5T54" Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: CVSROOT modules Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list This is a multi-part message in MIME format. --UT8N48YME17NVBMI5T54 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: commit summary Content-Disposition: inline OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: OSSP Project Master Root: /e/ossp/cvs Email: ossp@ossp.org Module: CVSROOT Date: 13-Jun-2000 16:33:18 Branch: HEAD Handle: 2000061315331700 Modified files: CVSROOT modules Log: Null commit Summary: Revision Changes Path 1.11 CVSROOT/modules ____________________________________________________________________________ --UT8N48YME17NVBMI5T54 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to CVSROOT/modules Content-Disposition: attachment Index: CVSROOT/modules ============================================================ $ cvs diff -u -r1.10 -r1.11 modules --- CVSROOT/modules 2000/06/13 13:45:48 1.10 +++ CVSROOT/modules 2000/06/13 14:33:17 1.11 @@ -60,4 +60,3 @@ ossp-web ossp-web ossp-play ossp-play - --UT8N48YME17NVBMI5T54-- From ossp-cvs-owner@ossp.org Tue Jun 13 16:38:22 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e5DEcL207234; Tue, 13 Jun 2000 16:38:21 +0200 (CEST) Date: Tue, 13 Jun 2000 16:38:21 +0200 (CEST) Message-Id: <200006131438.e5DEcL207234@ossp.org> From: "OSSP Project Master" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="UI088GO4UN4VOW8FMA70" Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: CVSROOT modules Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list This is a multi-part message in MIME format. --UI088GO4UN4VOW8FMA70 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: commit summary Content-Disposition: inline OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: OSSP Project Master Root: /e/ossp/cvs Email: ossp@ossp.org Module: CVSROOT Date: 13-Jun-2000 16:38:20 Branch: HEAD Handle: 2000061315381900 Modified files: CVSROOT modules Log: Null commit Summary: Revision Changes Path 1.12 CVSROOT/modules ____________________________________________________________________________ --UI088GO4UN4VOW8FMA70 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to CVSROOT/modules Content-Disposition: attachment Index: CVSROOT/modules ============================================================ $ cvs diff -u -r1.11 -r1.12 modules --- CVSROOT/modules 2000/06/13 14:33:17 1.11 +++ CVSROOT/modules 2000/06/13 14:38:19 1.12 @@ -60,3 +60,4 @@ ossp-web ossp-web ossp-play ossp-play + --UI088GO4UN4VOW8FMA70-- From ossp-cvs-owner@ossp.org Tue Jun 13 16:38:30 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e5DEcTA07280; Tue, 13 Jun 2000 16:38:29 +0200 (CEST) Date: Tue, 13 Jun 2000 16:38:29 +0200 (CEST) Message-Id: <200006131438.e5DEcTA07280@ossp.org> From: "OSSP Project Master" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="5XYAG7N3KOW9G3XLFAU3" Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: CVSROOT modules Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list This is a multi-part message in MIME format. --5XYAG7N3KOW9G3XLFAU3 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: commit summary Content-Disposition: inline OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: OSSP Project Master Root: /e/ossp/cvs Email: ossp@ossp.org Module: CVSROOT Date: 13-Jun-2000 16:38:29 Branch: HEAD Handle: 2000061315382700 Modified files: CVSROOT modules Log: Null commit Summary: Revision Changes Path 1.13 CVSROOT/modules ____________________________________________________________________________ --5XYAG7N3KOW9G3XLFAU3 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to CVSROOT/modules Content-Disposition: attachment Index: CVSROOT/modules ============================================================ $ cvs diff -u -r1.12 -r1.13 modules --- CVSROOT/modules 2000/06/13 14:38:19 1.12 +++ CVSROOT/modules 2000/06/13 14:38:27 1.13 @@ -60,4 +60,3 @@ ossp-web ossp-web ossp-play ossp-play - --5XYAG7N3KOW9G3XLFAU3-- From ossp-cvs-owner@ossp.org Tue Jun 13 16:51:22 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e5DEpL408373; Tue, 13 Jun 2000 16:51:21 +0200 (CEST) Date: Tue, 13 Jun 2000 16:51:21 +0200 (CEST) Message-Id: <200006131451.e5DEpL408373@ossp.org> From: "OSSP Project Master" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="KD2LR2KRDD1UEMRM9723" Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: CVSROOT modules Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list This is a multi-part message in MIME format. --KD2LR2KRDD1UEMRM9723 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: commit summary Content-Disposition: inline OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: OSSP Project Master Root: /e/ossp/cvs Email: ossp@ossp.org Module: CVSROOT Date: 13-Jun-2000 16:51:16 Branch: HEAD Handle: 2000061315511500 Modified files: CVSROOT modules Log: *** empty log message *** Summary: Revision Changes Path 1.14 CVSROOT/modules ____________________________________________________________________________ --KD2LR2KRDD1UEMRM9723 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to CVSROOT/modules Content-Disposition: attachment Index: CVSROOT/modules ============================================================ $ cvs diff -u -r1.13 -r1.14 modules --- CVSROOT/modules 2000/06/13 14:38:27 1.13 +++ CVSROOT/modules 2000/06/13 14:51:15 1.14 @@ -60,3 +60,4 @@ ossp-web ossp-web ossp-play ossp-play + --KD2LR2KRDD1UEMRM9723-- From ossp-cvs-owner@ossp.org Sat Jun 17 18:29:14 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e5HGTDb36838; Sat, 17 Jun 2000 18:29:13 +0200 (CEST) Date: Sat, 17 Jun 2000 18:29:13 +0200 (CEST) Message-Id: <200006171629.e5HGTDb36838@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="6SPYY0C18M0OCL6002HD" Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: CVSROOT modules Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list This is a multi-part message in MIME format. --6SPYY0C18M0OCL6002HD Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: commit summary Content-Disposition: inline OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: CVSROOT Date: 17-Jun-2000 18:29:13 Branch: HEAD Handle: 2000061717291200 Modified files: CVSROOT modules Log: Add OSSP CVS module Summary: Revision Changes Path 1.15 CVSROOT/modules ____________________________________________________________________________ --6SPYY0C18M0OCL6002HD Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to CVSROOT/modules Content-Disposition: attachment Index: CVSROOT/modules ============================================================ $ cvs diff -u -r1.14 -r1.15 modules --- CVSROOT/modules 2000/06/13 14:51:15 1.14 +++ CVSROOT/modules 2000/06/17 16:29:12 1.15 @@ -52,7 +52,7 @@ taginfo CVSROOT taginfo verifymsg CVSROOT verifymsg -# the real modules +# the OSSP top-level modules ossp -a ossp-adm ossp-srv ossp-pkg ossp-web ossp-play ossp-adm ossp-adm ossp-srv ossp-srv @@ -60,4 +60,6 @@ ossp-web ossp-web ossp-play ossp-play +# the OSSP sub-modules +ossp-cvs ossp-pkg/ossp-cvs --6SPYY0C18M0OCL6002HD-- From ossp-cvs-owner@ossp.org Sat Jun 17 21:55:51 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e5HJtoG51379; Sat, 17 Jun 2000 21:55:50 +0200 (CEST) Date: Sat, 17 Jun 2000 21:55:50 +0200 (CEST) Message-Id: <200006171955.e5HJtoG51379@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="A0AJEBJWWMBI21ASWH6V" Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/ossp-cvs README.OSSP ossp-pkg/ossp-cvs/src cvsrc.... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list This is a multi-part message in MIME format. --A0AJEBJWWMBI21ASWH6V Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: commit summary Content-Disposition: inline OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 17-Jun-2000 21:55:50 Branch: HEAD Handle: 2000061720554901 Modified files: ossp-pkg/ossp-cvs README.OSSP ossp-pkg/ossp-cvs/src cvsrc.c Log: Add support for quoted strings by using an own strqtok() function instead of the standard strtok() function. Summary: Revision Changes Path 1.39 ossp-pkg/ossp-cvs/README.OSSP 1.6 ossp-pkg/ossp-cvs/src/cvsrc.c ____________________________________________________________________________ --A0AJEBJWWMBI21ASWH6V Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/ossp-cvs/README.OSSP Content-Disposition: attachment Index: ossp-pkg/ossp-cvs/README.OSSP ============================================================ $ cvs diff -u -r1.38 -r1.39 README.OSSP --- ossp-pkg/ossp-cvs/README.OSSP 2000/06/17 12:15:52 1.38 +++ ossp-pkg/ossp-cvs/README.OSSP 2000/06/17 19:55:49 1.39 @@ -38,6 +38,8 @@ control and not for bookkeeping changes or group communication - instead a plain manually edited ChangeLog exists) or `commit -d ' (for OSSP when working with a local repository copy). + Additionally this adds support for quoted strings inside .cvsrc + files. [Origin: Ralf S. Engelschall] OSSP_PATCH_GLOBALOPTION: --A0AJEBJWWMBI21ASWH6V Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/ossp-cvs/src/cvsrc.c Content-Disposition: attachment Index: ossp-pkg/ossp-cvs/src/cvsrc.c ============================================================ $ cvs diff -u -r1.5 -r1.6 cvsrc.c --- ossp-pkg/ossp-cvs/src/cvsrc.c 2000/04/16 14:52:53 1.5 +++ ossp-pkg/ossp-cvs/src/cvsrc.c 2000/06/17 19:55:50 1.6 @@ -12,6 +12,203 @@ #include "cvs.h" #include "getline.h" +#ifdef OSSP_PATCH_CVSRC + +#include +#include + +static char *strq_start = NULL; + +static char * +strqtok_cchar( + register char *s, + register char *c, + int *backslashed) +{ + register char ch; + + if ((*backslashed = (*s == '\\'))) { + switch (*++s) { + case 'a': + *c = '\a'; + break; + case 'b': + *c = '\b'; + break; + case 'f': + *c = '\f'; + break; + case 'n': + *c = '\n'; + break; + case 'r': + *c = '\r'; + break; + case 't': + *c = '\t'; + break; + case 'v': + *c = '\v'; + break; + case '\\': + *c = '\\'; + break; + case '^': + *c = '^'; + break; + case '\'': + *c = '\''; + break; + case '"': + *c = '"'; + break; + case '?': + *c = '?'; + break; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + ch = 0; + if (isdigit(*s) && *s != '8' && *s != '9') { + ch = *s++ - '0'; + if (isdigit(*s) && *s != '8' && *s != '9') { + ch <<= 3; + ch |= *s++ - '0'; + if (isdigit(*s) && *s != '8' && *s != '9') { + ch <<= 3; + ch |= *s++ - '0'; + } + } + } + s--; + *c = ch; + break; + case 'x': + s++; + for (ch = 0; isxdigit(*s); s++) { + ch <<= 4; + ch |= isdigit(*s) ? *s - '0' : + islower(*s) ? *s + 10 - 'a' : *s + 10 - 'A'; + } + s--; + *c = ch; + break; + default: + *c = *s; + break; + } + } else + *c = *s; + return (*s) ? s+1 : NULL; +} + +static char * +strqtok( + char *s, /* String to tokenize. NULL to continue same str */ + char *delim, /* Token delimiters. Can be changed w/ each call. */ + char *quotemarks, /* Quotation marks. Can be changed w/ each call. */ + char *commentchars, /* Comment characters. Can be changed w/ each call. */ + unsigned int flags) /* flags&01 -> strip quotes; + * flags&02 -> enable backslash escapes; + * flags&04 -> skip all delims before return; + */ +{ + register char *p, *q; + char c; + char leftquote = 0; + char *token; + int backslashed, inquote, intok; + + int stripquote = flags & 01; /* strip quotemarks from tokens */ + int backslash = flags & 02; /* backslash sequences */ + int skipdelim = flags & 04; /* skip seq of delims at end of token */ + + /* New string? */ + if (s) + strq_start = s; + if (!strq_start) + return NULL; + + /* Skip leading delimiters */ + for (p=strq_start; *p && strchr(delim, *p); p++) + ; + if (!(*p) || strchr(commentchars, *p)) + return NULL; + + /* Set `token' to point to returned string. + * Use p and q to walk through the user's string: + * p will follow input characters; + * q will overwrite w/ outputted characters, minus possibly-stripped + * quotes and including nulls after each token. + */ + token = q = p; + inquote = 0; + intok = 1; + if (backslash) { + while (intok && (p = strqtok_cchar(p, &c, &backslashed))) { + if (backslashed) { + *q++ = c; /* treat as plain character */ + } else if (!inquote && *delim && strchr(delim, c)) { + *q = '\0'; /* Reached end of token */ + intok = 0; + } else if (!inquote && *commentchars && strchr(commentchars, c)) { + *q = '\0'; /* Reached end of token */ + *p = '\0'; /* make it act like end of string */ + intok = 0; + } else if (!inquote && *quotemarks && strchr(quotemarks, c)) { + inquote = 1; /* Beginning a quoted segment */ + leftquote = c; /* Save quote char for matching with */ + if (!stripquote) *q++ = c; + } else if (inquote && leftquote == c) { + inquote = 0; /* Ending a quoted segment */ + if (!stripquote) *q++ = c; + } else { + *q++ = c; /* Ordinary character */ + } + } + strq_start = p; /* Where to start next search */ + *q = '\0'; + } else { + while (intok && *p) { + if (!inquote && *delim && strchr(delim, *p)) { + *q = '\0'; /* Reached end of token */ + p++; /* advance p for next token */ + intok = 0; + } else if (!inquote && *commentchars && strchr(commentchars, *p)) { + *q = '\0'; /* Reached end of token */ + *p = '\0'; /* make it act like end of string */ + intok = 0; + } else if (!inquote && *quotemarks && strchr(quotemarks, *p)) { + inquote = 1; /* Beginning a quoted segment */ + leftquote = *p++; /* Save quote char for matching with */ + if (!stripquote) *q++ = leftquote; + } else if (inquote && leftquote == *p) { + inquote = 0; /* Ending a quoted segment */ + p++; + if (!stripquote) *q++ = leftquote; + } else { + *q++ = *p++; + } + } + strq_start = p; /* Where to start next search */ + *q = '\0'; + } + + if (skipdelim && strq_start) { + /* Skip trailing delimiters */ + while (*strq_start && strchr(delim, *strq_start)) + strq_start++; + } + return token; +} + +#endif + /* this file is to be found in the user's home directory */ #ifndef CVSRC_FILENAME @@ -185,19 +382,17 @@ if (found) { /* skip over command in the options line */ +#ifdef OSSP_PATCH_CVSRC + for (optstart = strqtok (line + command_len, "\t \n", "\"'", "", 7); + optstart; + optstart = strqtok (NULL, "\t \n", "\"'", "", 7)) +#else for (optstart = strtok (line + command_len, "\t \n"); optstart; optstart = strtok (NULL, "\t \n")) +#endif { new_argv [new_argc++] = xstrdup (optstart); -#ifdef OSSP_PATCH_CVSRC - /* support empty arguments as in ``-m ""'' */ - if ( ( new_argv[new_argc-1][0] == '"' - && new_argv[new_argc-1][1] == '"') - || ( new_argv[new_argc-1][0] == '\'' - && new_argv[new_argc-1][1] == '\'')) - new_argv[new_argc-1][0] = '\0'; -#endif if (new_argc >= max_new_argv) { --A0AJEBJWWMBI21ASWH6V-- From ossp-cvs-owner@ossp.org Sat Jun 17 22:01:33 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e5HK1XX51829; Sat, 17 Jun 2000 22:01:33 +0200 (CEST) Date: Sat, 17 Jun 2000 22:01:33 +0200 (CEST) Message-Id: <200006172001.e5HK1XX51829@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="XX9EOBODRMHAYXN3A8XG" Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/ossp-cvs/src main.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list This is a multi-part message in MIME format. --XX9EOBODRMHAYXN3A8XG Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: commit summary Content-Disposition: inline OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 17-Jun-2000 22:01:33 Branch: HEAD Handle: 2000061721013200 Modified files: ossp-pkg/ossp-cvs/src main.c Log: Make sure the -C commands are stand-alone. Summary: Revision Changes Path 1.15 ossp-pkg/ossp-cvs/src/main.c ____________________________________________________________________________ --XX9EOBODRMHAYXN3A8XG Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/ossp-cvs/src/main.c Content-Disposition: attachment Index: ossp-pkg/ossp-cvs/src/main.c ============================================================ $ cvs diff -u -r1.14 -r1.15 main.c --- ossp-pkg/ossp-cvs/src/main.c 2000/06/12 16:42:38 1.14 +++ ossp-pkg/ossp-cvs/src/main.c 2000/06/17 20:01:32 1.15 @@ -427,6 +427,20 @@ ret |= CVS_CMD_MODIFIES_REPOSITORY; } +#ifdef OSSP_PATCH_CUSTOMCMD + { + int i; + for (i = 0; i < customcmd_num; i++) { + if (strcmp(customcmd_tab[i].name, cmd_name) == 0) { + ret |= CVS_CMD_IGNORE_ADMROOT; + ret &= ~(CVS_CMD_USES_WORK_DIR); + ret &= ~(CVS_CMD_MODIFIES_REPOSITORY); + break; + } + } + } +#endif + return ret; } --XX9EOBODRMHAYXN3A8XG-- From ossp-cvs-owner@ossp.org Sat Jun 17 22:03:18 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e5HK3I552014; Sat, 17 Jun 2000 22:03:18 +0200 (CEST) Date: Sat, 17 Jun 2000 22:03:18 +0200 (CEST) Message-Id: <200006172003.e5HK3I552014@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="JS5I4TMB6N01KBZHX86L" Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/ossp-cvs VERSION ossp-pkg/ossp-cvs/doc CVSvn.texi... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list This is a multi-part message in MIME format. --JS5I4TMB6N01KBZHX86L Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: commit summary Content-Disposition: inline OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 17-Jun-2000 22:03:18 Branch: HEAD Handle: 2000061721031502 Modified files: ossp-pkg/ossp-cvs VERSION ossp-pkg/ossp-cvs/doc CVSvn.texi ossp-pkg/ossp-cvs/src version.c Log: Switch to 1.10.8.5 Summary: Revision Changes Path 1.4 ossp-pkg/ossp-cvs/VERSION 1.3 ossp-pkg/ossp-cvs/doc/CVSvn.texi 1.6 ossp-pkg/ossp-cvs/src/version.c ____________________________________________________________________________ --JS5I4TMB6N01KBZHX86L Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/ossp-cvs/VERSION Content-Disposition: attachment Index: ossp-pkg/ossp-cvs/VERSION ============================================================ $ cvs diff -u -r1.3 -r1.4 VERSION --- ossp-pkg/ossp-cvs/VERSION 2000/06/12 19:07:20 1.3 +++ ossp-pkg/ossp-cvs/VERSION 2000/06/17 20:03:15 1.4 @@ -1 +1 @@ -1.10.8.4 +1.10.8.5 --JS5I4TMB6N01KBZHX86L Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/ossp-cvs/doc/CVSvn.texi Content-Disposition: attachment Index: ossp-pkg/ossp-cvs/doc/CVSvn.texi ============================================================ $ cvs diff -u -r1.2 -r1.3 CVSvn.texi --- ossp-pkg/ossp-cvs/doc/CVSvn.texi 2000/06/12 19:07:20 1.2 +++ ossp-pkg/ossp-cvs/doc/CVSvn.texi 2000/06/17 20:03:16 1.3 @@ -1 +1 @@ -@set CVSVN 1.10.8.4 +@set CVSVN 1.10.8.5 --JS5I4TMB6N01KBZHX86L Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/ossp-cvs/src/version.c Content-Disposition: attachment Index: ossp-pkg/ossp-cvs/src/version.c ============================================================ $ cvs diff -u -r1.5 -r1.6 version.c --- ossp-pkg/ossp-cvs/src/version.c 2000/06/12 19:07:20 1.5 +++ ossp-pkg/ossp-cvs/src/version.c 2000/06/17 20:03:17 1.6 @@ -18,7 +18,7 @@ #define NAME_PREFIX "" #endif -char *version_string = "\n" NAME_PREFIX "Concurrent Versions System (CVS) 1.10.8.4"; +char *version_string = "\n" NAME_PREFIX "Concurrent Versions System (CVS) 1.10.8.5"; #ifdef CLIENT_SUPPORT #ifdef SERVER_SUPPORT --JS5I4TMB6N01KBZHX86L-- From ossp-cvs-owner@ossp.org Sun Jun 18 15:05:51 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e5ID5oY89623; Sun, 18 Jun 2000 15:05:50 +0200 (CEST) Date: Sun, 18 Jun 2000 15:05:50 +0200 (CEST) Message-Id: <200006181305.e5ID5oY89623@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/ossp-cvs .cvsignore COPYING COPYING.LIB ChangeLog... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 18-Jun-2000 15:05:50 Branch: vendor Handle: 1970010101000000 Modified files: (Branch: vendor) ossp-pkg/ossp-cvs/diff diff3.c ossp-pkg/ossp-cvs/src fileattr.c ignore.c modules.c rcs.c update.c Touched files: (Branch: vendor) ossp-pkg/ossp-cvs .cvsignore COPYING COPYING.LIB ChangeLog.zoo INSTALL Makefile.in NEWS README acconfig.h config.h.in configure configure.in ossp-pkg/ossp-cvs/diff .cvsignore Makefile.in analyze.c cmpbuf.c cmpbuf.h context.c diagmeet.note diff.c diff.h diffrun.h dir.c ed.c ifdef.c io.c normal.c side.c system.h util.c version.c ossp-pkg/ossp-cvs/doc .cvsignore FAQ HACKING Makefile.in RCSFILES TESTS TODO cvs-paper.ms cvs.texinfo cvsclient.texi ossp-pkg/ossp-cvs/lib .cvsignore Makefile.in argmatch.c dup2.c fncase.c fnmatch.c fnmatch.h ftruncate.c getdate.c getdate.y getline.c getline.h getopt.c getopt.h getopt1.c hostname.c md5.c md5.h memmove.c mkdir.c regex.c regex.h rename.c savecwd.c savecwd.h sighandle.c strerror.c stripslash.c strstr.c strtoul.c system.h valloc.c wait.h waitpid.c xgetwd.c yesno.c ossp-pkg/ossp-cvs/man .cvsignore Makefile.in cvs.1 cvs.5 ossp-pkg/ossp-cvs/src .cvsignore Makefile.in add.c admin.c buffer.c buffer.h checkin.c checkout.c classify.c client.c client.h commit.c create_adm.c cvs.h cvsrc.c diff.c edit.c edit.h entries.c error.c error.h expand_path.c fileattr.h filesubr.c find_names.c hardlink.c hardlink.h hash.c hash.h history.c import.c lock.c log.c login.c logmsg.c main.c mkmodules.c myndbm.c myndbm.h no_diff.c options.h.in parseinfo.c patch.c rcs.h rcscmds.c recurse.c release.c remove.c repos.c root.c rtag.c run.c sanity.sh scramble.c server.c server.h status.c subr.c tag.c update.h vers_ts.c version.c watch.c watch.h wrapper.c zlib.c ossp-pkg/ossp-cvs/zlib .cvsignore Makefile.in README adler32.c algorithm.doc compress.c crc32.c deflate.c deflate.h gzio.c infblock.c infblock.h infcodes.c infcodes.h inffast.c inffast.h inflate.c inftrees.c inftrees.h infutil.c infutil.h trees.c uncompr.c zconf.h zlib.h zutil.c zutil.h Log: Import vendor CVS, snapshot 20000618 [Release Tags: CVS_20000618] Summary: Revision Changes Path vendor +0 -0 ossp-pkg/ossp-cvs/diff/diff3.c vendor +0 -0 ossp-pkg/ossp-cvs/src/fileattr.c vendor +0 -0 ossp-pkg/ossp-cvs/src/ignore.c vendor +0 -0 ossp-pkg/ossp-cvs/src/modules.c vendor +0 -0 ossp-pkg/ossp-cvs/src/rcs.c vendor +0 -0 ossp-pkg/ossp-cvs/src/update.c ____________________________________________________________________________ http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/diff/diff3.c?cvsroot=ossp&r1=vendor&r2=vendor http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/fileattr.c?cvsroot=ossp&r1=vendor&r2=vendor http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/ignore.c?cvsroot=ossp&r1=vendor&r2=vendor http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/modules.c?cvsroot=ossp&r1=vendor&r2=vendor http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/rcs.c?cvsroot=ossp&r1=vendor&r2=vendor http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/update.c?cvsroot=ossp&r1=vendor&r2=vendor From ossp-cvs-owner@ossp.org Sun Jun 18 15:50:38 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e5IDocd92803; Sun, 18 Jun 2000 15:50:38 +0200 (CEST) Date: Sun, 18 Jun 2000 15:50:38 +0200 (CEST) Message-Id: <200006181350.e5IDocd92803@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="5Y4P7FL4IEC3RHL327EP" Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/ossp-cvs/diff diff3.c ossp-pkg/ossp-cvs/src modul... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list This is a multi-part message in MIME format. --5Y4P7FL4IEC3RHL327EP Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: commit summary Content-Disposition: inline OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 18-Jun-2000 15:50:38 Branch: HEAD Handle: 2000061814503601 Modified files: ossp-pkg/ossp-cvs/diff diff3.c ossp-pkg/ossp-cvs/src modules.c rcs.c update.c Log: Merge in changes Summary: Revision Changes Path 1.3 ossp-pkg/ossp-cvs/diff/diff3.c 1.4 ossp-pkg/ossp-cvs/src/modules.c 1.10 ossp-pkg/ossp-cvs/src/rcs.c 1.6 ossp-pkg/ossp-cvs/src/update.c ____________________________________________________________________________ --5Y4P7FL4IEC3RHL327EP Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/ossp-cvs/diff/diff3.c Content-Disposition: attachment Index: ossp-pkg/ossp-cvs/diff/diff3.c ============================================================ $ cvs diff -u -r1.2 -r1.3 diff3.c --- ossp-pkg/ossp-cvs/diff/diff3.c 2000/04/27 16:44:30 1.2 +++ ossp-pkg/ossp-cvs/diff/diff3.c 2000/06/18 13:50:36 1.3 @@ -475,8 +475,6 @@ free(content0); free(content1); - free_diff_blocks(thread0); - free_diff_blocks(thread1); free_diff3_blocks(diff3); if (! callbacks || ! callbacks->write_output) @@ -765,6 +763,8 @@ tmpblock = using_to_diff3_block (using, last_using, base_water_thread, high_water_thread, last_diff3); + free_diff_blocks(using[0]); + free_diff_blocks(using[1]); if (!tmpblock) diff3_fatal ("internal error: screwup in format of diff blocks"); --5Y4P7FL4IEC3RHL327EP Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/ossp-cvs/src/modules.c Content-Disposition: attachment Index: ossp-pkg/ossp-cvs/src/modules.c ============================================================ $ cvs diff -u -r1.3 -r1.4 modules.c --- ossp-pkg/ossp-cvs/src/modules.c 2000/06/15 06:44:45 1.3 +++ ossp-pkg/ossp-cvs/src/modules.c 2000/06/18 13:50:37 1.4 @@ -123,7 +123,6 @@ char **xmodargv = NULL; /* Found entry from modules file, including options and such. */ char *value = NULL; - char *zvalue = NULL; char *mwhere = NULL; char *mfile = NULL; char *spec_opt = NULL; @@ -186,20 +185,21 @@ val.dptr = NULL; if (val.dptr != NULL) { - /* null terminate the value XXX - is this space ours? */ - val.dptr[val.dsize] = '\0'; + /* copy and null terminate the value */ + value = xmalloc (val.dsize + 1); + memcpy (value, val.dptr, val.dsize); + value[val.dsize] = '\0'; /* If the line ends in a comment, strip it off */ - if ((cp = strchr (val.dptr, '#')) != NULL) + if ((cp = strchr (value, '#')) != NULL) *cp = '\0'; else - cp = val.dptr + val.dsize; + cp = value + val.dsize; /* Always strip trailing spaces */ - while (cp > val.dptr && isspace ((unsigned char) *--cp)) + while (cp > value && isspace ((unsigned char) *--cp)) *cp = '\0'; - value = val.dptr; mwhere = xstrdup (mname); goto found; } @@ -327,21 +327,21 @@ { char *cp2; - /* null terminate the value XXX - is this space ours? */ - val.dptr[val.dsize] = '\0'; + /* copy and null terminate the value */ + value = xmalloc (val.dsize + 1); + memcpy (value, val.dptr, val.dsize); + value[val.dsize] = '\0'; /* If the line ends in a comment, strip it off */ - if ((cp2 = strchr (val.dptr, '#')) != NULL) + if ((cp2 = strchr (value, '#')) != NULL) *cp2 = '\0'; else - cp2 = val.dptr + val.dsize; + cp2 = value + val.dsize; /* Always strip trailing spaces */ - while (cp2 > val.dptr && isspace ((unsigned char) *--cp2)) + while (cp2 > value && isspace ((unsigned char) *--cp2)) *cp2 = '\0'; - value = val.dptr; - /* mwhere gets just the module name */ mwhere = xstrdup (mname); mfile = cp + 1; @@ -373,11 +373,7 @@ error_exit (); cwd_saved = 1; - /* copy value to our own string since if we go recursive we'll be - really screwed if we do another dbm lookup */ assert (value != NULL); - zvalue = xstrdup (value); - value = zvalue; /* search the value for the special delimiter and save for later */ if ((cp = strchr (value, CVSMODULE_SPEC)) != NULL) @@ -466,7 +462,7 @@ case '?': error (0, 0, "modules file has invalid option for key %s value %s", - key.dptr, val.dptr); + key.dptr, value); err++; goto do_module_return; } @@ -768,8 +764,8 @@ free (update_prog); if (cwd_saved) free_cwd (&cwd); - if (zvalue != NULL) - free (zvalue); + if (value != NULL) + free (value); if (xvalue != NULL) free (xvalue); --5Y4P7FL4IEC3RHL327EP Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/ossp-cvs/src/rcs.c Content-Disposition: attachment Index: ossp-pkg/ossp-cvs/src/rcs.c ============================================================ $ cvs diff -u -r1.9 -r1.10 rcs.c --- ossp-pkg/ossp-cvs/src/rcs.c 2000/06/14 07:18:45 1.9 +++ ossp-pkg/ossp-cvs/src/rcs.c 2000/06/18 13:50:37 1.10 @@ -2558,8 +2558,8 @@ return (magic); } free (magic); - free (version); } + free (version); return ((char *) NULL); } --5Y4P7FL4IEC3RHL327EP Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/ossp-cvs/src/update.c Content-Disposition: attachment Index: ossp-pkg/ossp-cvs/src/update.c ============================================================ $ cvs diff -u -r1.5 -r1.6 update.c --- ossp-pkg/ossp-cvs/src/update.c 2000/06/14 07:18:45 1.5 +++ ossp-pkg/ossp-cvs/src/update.c 2000/06/18 13:50:37 1.6 @@ -1058,6 +1058,10 @@ { FILE *fp; + /* Delete the ignore list if it hasn't already been done. */ + if (ignlist) + dellist (&ignlist); + /* If we set the tag or date for a new subdirectory in update_dirent_proc, and we're now done with that subdirectory, undo the tag/date setting. Note that we know that the tag and --5Y4P7FL4IEC3RHL327EP-- From ossp-cvs-owner@ossp.org Sun Jun 18 16:30:56 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e5IEUu595808; Sun, 18 Jun 2000 16:30:56 +0200 (CEST) Date: Sun, 18 Jun 2000 16:30:56 +0200 (CEST) Message-Id: <200006181430.e5IEUu595808@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/shiela .configure AUTHORS COPYING ChangeLog INSTA... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 18-Jun-2000 16:30:56 Branch: vendor Handle: 2000061815304606 Added files: (Branch: vendor) ossp-pkg/shiela .configure AUTHORS COPYING ChangeLog INSTALL Makefile.in README THANKS TODO VERSION configure configure.in shiela-install.pod shiela-install.sh shiela.pl shtool Log: Import of OSSP Shiela [Release Tags: SHIELA_0_9_0] Summary: Revision Changes Path 1.1.1.1 +4 -0 ossp-pkg/shiela/.configure 1.1.1.1 +18 -0 ossp-pkg/shiela/AUTHORS 1.1.1.1 +280 -0 ossp-pkg/shiela/COPYING 1.1.1.1 +16 -0 ossp-pkg/shiela/ChangeLog 1.1.1.1 +13 -0 ossp-pkg/shiela/INSTALL 1.1.1.1 +91 -0 ossp-pkg/shiela/Makefile.in 1.1.1.1 +44 -0 ossp-pkg/shiela/README 1.1.1.1 +18 -0 ossp-pkg/shiela/THANKS 1.1.1.1 +60 -0 ossp-pkg/shiela/TODO 1.1.1.1 +3 -0 ossp-pkg/shiela/VERSION 1.1.1.1 BLOB ossp-pkg/shiela/configure 1.1.1.1 +24 -0 ossp-pkg/shiela/configure.in 1.1.1.1 +151 -0 ossp-pkg/shiela/shiela-install.pod 1.1.1.1 +619 -0 ossp-pkg/shiela/shiela-install.sh 1.1.1.1 +2069 -0 ossp-pkg/shiela/shiela.pl 1.1.1.1 +1442 -0 ossp-pkg/shiela/shtool ____________________________________________________________________________ http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/shiela/.configure?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/shiela/AUTHORS?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/shiela/COPYING?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/shiela/ChangeLog?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/shiela/INSTALL?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/shiela/Makefile.in?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/shiela/README?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/shiela/THANKS?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/shiela/TODO?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/shiela/VERSION?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/shiela/configure?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/shiela/configure.in?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/shiela/shiela-install.pod?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/shiela/shiela-install.sh?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/shiela/shiela.pl?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/shiela/shtool?cvsroot=ossp&r1=NONE&r2=1.1.1.1 From ossp-cvs-owner@ossp.org Sun Jun 18 16:32:44 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e5IEWiH95959; Sun, 18 Jun 2000 16:32:44 +0200 (CEST) Date: Sun, 18 Jun 2000 16:32:44 +0200 (CEST) Message-Id: <200006181432.e5IEWiH95959@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="TF6XYA5UQXPFNVJ6S1DS" Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: CVSROOT modules Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list This is a multi-part message in MIME format. --TF6XYA5UQXPFNVJ6S1DS Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: commit summary Content-Disposition: inline OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: CVSROOT Date: 18-Jun-2000 16:32:44 Branch: HEAD Handle: 2000061815324300 Modified files: CVSROOT modules Log: Add Shiela module Summary: Revision Changes Path 1.16 CVSROOT/modules ____________________________________________________________________________ --TF6XYA5UQXPFNVJ6S1DS Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to CVSROOT/modules Content-Disposition: attachment Index: CVSROOT/modules ============================================================ $ cvs diff -u -r1.15 -r1.16 modules --- CVSROOT/modules 2000/06/17 16:29:12 1.15 +++ CVSROOT/modules 2000/06/18 14:32:43 1.16 @@ -62,4 +62,5 @@ # the OSSP sub-modules ossp-cvs ossp-pkg/ossp-cvs +shiela ossp-pkg/shiela --TF6XYA5UQXPFNVJ6S1DS-- From ossp-cvs-owner@ossp.org Tue Jun 20 16:09:41 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e5KE9eR96538; Tue, 20 Jun 2000 16:09:40 +0200 (CEST) Date: Tue, 20 Jun 2000 16:09:40 +0200 (CEST) Message-Id: <200006201409.e5KE9eR96538@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/ossp-cvs .cvsignore COPYING COPYING.LIB ChangeLog... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 20-Jun-2000 16:09:40 Branch: vendor Handle: 19700101010000961506342 Modified files: (Branch: vendor) ossp-pkg/ossp-cvs config.h.in configure configure.in ossp-pkg/ossp-cvs/lib regex.c regex.h ossp-pkg/ossp-cvs/src main.c root.c server.c Touched files: (Branch: vendor) ossp-pkg/ossp-cvs .cvsignore COPYING COPYING.LIB ChangeLog.zoo INSTALL Makefile.in NEWS README acconfig.h ossp-pkg/ossp-cvs/diff .cvsignore Makefile.in analyze.c cmpbuf.c cmpbuf.h context.c diagmeet.note diff.c diff.h diff3.c diffrun.h dir.c ed.c ifdef.c io.c normal.c side.c system.h util.c version.c ossp-pkg/ossp-cvs/doc .cvsignore FAQ HACKING Makefile.in RCSFILES TESTS TODO cvs-paper.ms cvs.texinfo cvsclient.texi ossp-pkg/ossp-cvs/lib .cvsignore Makefile.in argmatch.c dup2.c fncase.c fnmatch.c fnmatch.h ftruncate.c getdate.c getdate.y getline.c getline.h getopt.c getopt.h getopt1.c hostname.c md5.c md5.h memmove.c mkdir.c rename.c savecwd.c savecwd.h sighandle.c strerror.c stripslash.c strstr.c strtoul.c system.h valloc.c wait.h waitpid.c xgetwd.c yesno.c ossp-pkg/ossp-cvs/man .cvsignore Makefile.in cvs.1 cvs.5 ossp-pkg/ossp-cvs/src .cvsignore Makefile.in add.c admin.c buffer.c buffer.h checkin.c checkout.c classify.c client.c client.h commit.c create_adm.c cvs.h cvsrc.c diff.c edit.c edit.h entries.c error.c error.h expand_path.c fileattr.c fileattr.h filesubr.c find_names.c hardlink.c hardlink.h hash.c hash.h history.c ignore.c import.c lock.c log.c login.c logmsg.c mkmodules.c modules.c myndbm.c myndbm.h no_diff.c options.h.in parseinfo.c patch.c rcs.c rcs.h rcscmds.c recurse.c release.c remove.c repos.c rtag.c run.c sanity.sh scramble.c server.h status.c subr.c tag.c update.c update.h vers_ts.c version.c watch.c watch.h wrapper.c zlib.c ossp-pkg/ossp-cvs/zlib .cvsignore Makefile.in README adler32.c algorithm.doc compress.c crc32.c deflate.c deflate.h gzio.c infblock.c infblock.h infcodes.c infcodes.h inffast.c inffast.h inflate.c inftrees.c inftrees.h infutil.c infutil.h trees.c uncompr.c zconf.h zlib.h zutil.c zutil.h Log: Import vendor CVS, snapshot 20000620 [Release Tags: CVS_20000620] Summary: Revision Changes Path 1.1.1.2 +6 -0 ossp-pkg/ossp-cvs/config.h.in 1.1.1.3 BLOB ossp-pkg/ossp-cvs/configure 1.1.1.3 +6 -0 ossp-pkg/ossp-cvs/configure.in 1.1.1.2 +0 -0 ossp-pkg/ossp-cvs/lib/regex.c 1.1.1.2 +0 -0 ossp-pkg/ossp-cvs/lib/regex.h 1.1.1.5 +0 -0 ossp-pkg/ossp-cvs/src/main.c 1.1.1.2 +0 -0 ossp-pkg/ossp-cvs/src/root.c 1.1.1.8 +0 -0 ossp-pkg/ossp-cvs/src/server.c ____________________________________________________________________________ http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/config.h.in?cvsroot=ossp&r1=1.1.1.1&r2=1.1.1.2 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/configure?cvsroot=ossp&r1=1.1.1.2&r2=1.1.1.3 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/configure.in?cvsroot=ossp&r1=1.1.1.2&r2=1.1.1.3 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/lib/regex.c?cvsroot=ossp&r1=1.1.1.1&r2=1.1.1.2 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/lib/regex.h?cvsroot=ossp&r1=1.1.1.1&r2=1.1.1.2 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/main.c?cvsroot=ossp&r1=1.1.1.4&r2=1.1.1.5 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/root.c?cvsroot=ossp&r1=1.1.1.1&r2=1.1.1.2 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/server.c?cvsroot=ossp&r1=1.1.1.7&r2=1.1.1.8 From ossp-cvs-owner@ossp.org Tue Jun 20 16:25:17 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e5KEPDt97692; Tue, 20 Jun 2000 16:25:13 +0200 (CEST) Date: Tue, 20 Jun 2000 16:25:13 +0200 (CEST) Message-Id: <200006201425.e5KEPDt97692@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="LZKIROWV0YR1M5IXJ62Q" Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/ossp-cvs/lib regex.c ossp-pkg/ossp-cvs/src main.c... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list This is a multi-part message in MIME format. --LZKIROWV0YR1M5IXJ62Q Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: commit summary Content-Disposition: inline OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 20-Jun-2000 16:25:13 Branch: HEAD Handle: 2000062015250903 Modified files: ossp-pkg/ossp-cvs/lib regex.c ossp-pkg/ossp-cvs/src main.c root.c server.c Log: Merge in changes Summary: Revision Changes Path 1.3 +3806 -2424 ossp-pkg/ossp-cvs/lib/regex.c 1.16 +6 -1 ossp-pkg/ossp-cvs/src/main.c 1.3 +31 -13 ossp-pkg/ossp-cvs/src/root.c 1.20 +1 -9 ossp-pkg/ossp-cvs/src/server.c ____________________________________________________________________________ --LZKIROWV0YR1M5IXJ62Q Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/ossp-cvs/lib/regex.c Content-Disposition: attachment Index: ossp-pkg/ossp-cvs/lib/regex.c ============================================================ $ cvs diff -u -r1.2 -r1.3 regex.c --- ossp-pkg/ossp-cvs/lib/regex.c 2000/04/27 16:44:30 1.2 +++ ossp-pkg/ossp-cvs/lib/regex.c 2000/06/20 14:25:09 1.3 @@ -2,7 +2,7 @@ 0.12. (Implements POSIX draft P10003.2/D11.2, except for internationalization features.) - Copyright (C) 1993, 1994, 1995, 1996 Free Software Foundation, Inc. + Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc. 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 @@ -11,25 +11,50 @@ 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. */ + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. -/* Trying to define this in the makefile would get hairy, unless we can - more gracefully do it for NT, OS/2, unix, etc. */ -#define REGEX_MALLOC 1 + 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. */ /* AIX requires this to be the first thing in the file. */ #if defined (_AIX) && !defined (REGEX_MALLOC) #pragma alloca #endif +#undef _GNU_SOURCE #define _GNU_SOURCE -/* We need this for `regex.h', and perhaps for the Emacs include files. */ -#include +#ifdef emacs +/* Converts the pointer to the char to BEG-based offset from the start. */ +#define PTR_TO_OFFSET(d) \ + POS_AS_IN_BUFFER (MATCHING_IN_FIRST_STRING \ + ? (d) - string1 : (d) - (string2 - size1)) +#define POS_AS_IN_BUFFER(p) ((p) + (NILP (re_match_object) || BUFFERP (re_match_object))) +#else +#define PTR_TO_OFFSET(d) 0 +#endif #ifdef HAVE_CONFIG_H -#include "config.h" +#include +#endif + +/* We need this for `regex.h', and perhaps for the Emacs include files. */ +#include + +/* This is for other GNU distributions with internationalized messages. */ +#if HAVE_LIBINTL_H || defined (_LIBC) +# include +#else +# define gettext(msgid) (msgid) +#endif + +#ifndef gettext_noop +/* This define is so xgettext can find the internationalizable + strings. */ +#define gettext_noop(String) String #endif /* The `emacs' switch turns on certain matching commands @@ -47,13 +72,38 @@ #include "category.h" #define malloc xmalloc +#define realloc xrealloc #define free xfree #else /* not emacs */ + +/* If we are not linking with Emacs proper, + we can't use the relocating allocator + even if config.h says that we can. */ +#undef REL_ALLOC + +#if defined (STDC_HEADERS) || defined (_LIBC) +#include +#else +char *malloc (); +char *realloc (); +#endif + +/* When used in Emacs's lib-src, we need to get bzero and bcopy somehow. + If nothing else has been done, use the method below. */ +#ifdef INHIBIT_STRING_HEADER +#if !(defined (HAVE_BZERO) && defined (HAVE_BCOPY)) +#if !defined (bzero) && !defined (bcopy) +#undef INHIBIT_STRING_HEADER +#endif +#endif +#endif -/* We used to test for `BSTRING' here, but only GCC and Emacs define - `BSTRING', as far as I know, and neither of them use this code. */ -#if HAVE_STRING_H || STDC_HEADERS +/* This is the normal way of making sure we have a bcopy and a bzero. + This is used in most programs--a few other programs avoid this + by defining INHIBIT_STRING_HEADER. */ +#ifndef INHIBIT_STRING_HEADER +#if defined (HAVE_STRING_H) || defined (STDC_HEADERS) || defined (_LIBC) #include #ifndef bcmp #define bcmp(s1, s2, n) memcmp ((s1), (s2), (n)) @@ -67,15 +117,8 @@ #else #include #endif - -#ifdef STDC_HEADERS -#include -#else -char *malloc (); -char *realloc (); #endif - /* Define the syntax stuff for \<, \>, etc. */ /* This must be nonzero for the wordchar and notwordchar pattern @@ -84,6 +127,12 @@ #define Sword 1 #endif +#ifdef SWITCH_ENUM_BUG +#define SWITCH_ENUM_CAST(x) ((int)(x)) +#else +#define SWITCH_ENUM_CAST(x) (x) +#endif + #ifdef SYNTAX_TABLE extern char *re_syntax_table; @@ -124,6 +173,19 @@ #define SYNTAX(c) re_syntax_table[c] +/* Dummy macros for non-Emacs environments. */ +#define BASE_LEADING_CODE_P(c) (0) +#define WORD_BOUNDARY_P(c1, c2) (0) +#define CHAR_HEAD_P(p) (1) +#define SINGLE_BYTE_CHAR_P(c) (1) +#define SAME_CHARSET_P(c1, c2) (1) +#define MULTIBYTE_FORM_LENGTH(p, s) (1) +#define STRING_CHAR(p, s) (*(p)) +#define STRING_CHAR_AND_LENGTH(p, s, actual_len) ((actual_len) = 1, *(p)) +#define GET_CHAR_AFTER_2(c, p, str1, end1, str2, end2) \ + (c = ((p) == (end1) ? *(str2) : *(p))) +#define GET_CHAR_BEFORE_2(c, p, str1, end1, str2, end2) \ + (c = ((p) == (str2) ? *((end1) - 1) : *((p) - 1))) #endif /* not emacs */ /* Get the interface, including the syntax bits. */ @@ -132,34 +194,47 @@ /* isalpha etc. are used for the character classes. */ #include -#ifndef isascii -#define isascii(c) 1 +/* Jim Meyering writes: + + "... Some ctype macros are valid only for character codes that + isascii says are ASCII (SGI's IRIX-4.0.5 is one such system --when + using /bin/cc or gcc but without giving an ansi option). So, all + ctype uses should be through macros like ISPRINT... If + STDC_HEADERS is defined, then autoconf has verified that the ctype + macros don't need to be guarded with references to isascii. ... + Defining isascii to 1 should let any compiler worth its salt + eliminate the && through constant folding." */ + +#if defined (STDC_HEADERS) || (!defined (isascii) && !defined (HAVE_ISASCII)) +#define ISASCII(c) 1 +#else +#define ISASCII(c) isascii(c) #endif #ifdef isblank -#define ISBLANK(c) (isascii (c) && isblank (c)) +#define ISBLANK(c) (ISASCII (c) && isblank (c)) #else #define ISBLANK(c) ((c) == ' ' || (c) == '\t') #endif #ifdef isgraph -#define ISGRAPH(c) (isascii (c) && isgraph (c)) +#define ISGRAPH(c) (ISASCII (c) && isgraph (c)) #else -#define ISGRAPH(c) (isascii (c) && isprint (c) && !isspace (c)) +#define ISGRAPH(c) (ISASCII (c) && isprint (c) && !isspace (c)) #endif -#define ISPRINT(c) (isascii (c) && isprint (c)) -#define ISDIGIT(c) (isascii (c) && isdigit (c)) -#define ISALNUM(c) (isascii (c) && isalnum (c)) -#define ISALPHA(c) (isascii (c) && isalpha (c)) -#define ISCNTRL(c) (isascii (c) && iscntrl (c)) -#define ISLOWER(c) (isascii (c) && islower (c)) -#define ISPUNCT(c) (isascii (c) && ispunct (c)) -#define ISSPACE(c) (isascii (c) && isspace (c)) -#define ISUPPER(c) (isascii (c) && isupper (c)) -#define ISXDIGIT(c) (isascii (c) && isxdigit (c)) +#define ISPRINT(c) (ISASCII (c) && isprint (c)) +#define ISDIGIT(c) (ISASCII (c) && isdigit (c)) +#define ISALNUM(c) (ISASCII (c) && isalnum (c)) +#define ISALPHA(c) (ISASCII (c) && isalpha (c)) +#define ISCNTRL(c) (ISASCII (c) && iscntrl (c)) +#define ISLOWER(c) (ISASCII (c) && islower (c)) +#define ISPUNCT(c) (ISASCII (c) && ispunct (c)) +#define ISSPACE(c) (ISASCII (c) && isspace (c)) +#define ISUPPER(c) (ISASCII (c) && isupper (c)) +#define ISXDIGIT(c) (ISASCII (c) && isxdigit (c)) #ifndef NULL -#define NULL 0 +#define NULL (void *)0 #endif /* We remove any previous definition of `SIGN_EXTEND_CHAR', @@ -188,6 +263,7 @@ #define REGEX_ALLOCATE malloc #define REGEX_REALLOCATE(source, osize, nsize) realloc (source, nsize) +#define REGEX_FREE free #else /* not REGEX_MALLOC */ @@ -201,10 +277,12 @@ #if HAVE_ALLOCA_H #include #else /* not __GNUC__ or HAVE_ALLOCA_H */ -#ifndef _AIX /* Already did AIX, up at the top. */ +#if 0 /* It is a bad idea to declare alloca. We always cast the result. */ +#ifndef _AIX /* Already did AIX, up at the top. */ char *alloca (); #endif /* not _AIX */ -#endif /* not HAVE_ALLOCA_H */ +#endif +#endif /* not HAVE_ALLOCA_H */ #endif /* not __GNUC__ */ #endif /* not alloca */ @@ -217,21 +295,57 @@ bcopy (source, destination, osize), \ destination) +/* No need to do anything to free, after alloca. */ +#define REGEX_FREE(arg) ((void)0) /* Do nothing! But inhibit gcc warning. */ + +#endif /* not REGEX_MALLOC */ + +/* Define how to allocate the failure stack. */ + +#if defined (REL_ALLOC) && defined (REGEX_MALLOC) + +#define REGEX_ALLOCATE_STACK(size) \ + r_alloc (&failure_stack_ptr, (size)) +#define REGEX_REALLOCATE_STACK(source, osize, nsize) \ + r_re_alloc (&failure_stack_ptr, (nsize)) +#define REGEX_FREE_STACK(ptr) \ + r_alloc_free (&failure_stack_ptr) + +#else /* not using relocating allocator */ + +#ifdef REGEX_MALLOC + +#define REGEX_ALLOCATE_STACK malloc +#define REGEX_REALLOCATE_STACK(source, osize, nsize) realloc (source, nsize) +#define REGEX_FREE_STACK free + +#else /* not REGEX_MALLOC */ + +#define REGEX_ALLOCATE_STACK alloca + +#define REGEX_REALLOCATE_STACK(source, osize, nsize) \ + REGEX_REALLOCATE (source, osize, nsize) +/* No need to explicitly free anything. */ +#define REGEX_FREE_STACK(arg) + #endif /* not REGEX_MALLOC */ +#endif /* not using relocating allocator */ /* True if `size1' is non-NULL and PTR is pointing anywhere inside `string1' or just past its end. This works if PTR is NULL, which is a good thing. */ -#define FIRST_STRING_P(ptr) \ +#define FIRST_STRING_P(ptr) \ (size1 && string1 <= (ptr) && (ptr) <= string1 + size1) /* (Re)Allocate N items of type T using malloc, or fail. */ #define TALLOC(n, t) ((t *) malloc ((n) * sizeof (t))) #define RETALLOC(addr, n, t) ((addr) = (t *) realloc (addr, (n) * sizeof (t))) +#define RETALLOC_IF(addr, n, t) \ + if (addr) RETALLOC((addr), (n), t); else (addr) = TALLOC ((n), t) #define REGEX_TALLOC(n, t) ((t *) REGEX_ALLOCATE ((n) * sizeof (t))) -#define BYTEWIDTH 8 /* In bits. */ +#define BYTEWIDTH 8 /* In bits. */ #define STREQ(s1, s2) ((strcmp (s1, s2) == 0)) @@ -243,122 +357,123 @@ typedef char boolean; #define false 0 #define true 1 + +static int re_match_2_internal (); /* These are the command codes that appear in compiled regular - expressions. Some opcodes are followed by argument bytes. A + expressions. Some opcodes are followed by argument bytes. A command code can specify any interpretation whatsoever for its - arguments. Zero bytes may appear in the compiled regular expression. - - The value of `exactn' is needed in search.c (search_buffer) in Emacs. - So regex.h defines a symbol `RE_EXACTN_VALUE' to be 1; the value of - `exactn' we use here must also be 1. */ + arguments. Zero bytes may appear in the compiled regular expression. */ typedef enum { no_op = 0, - /* Followed by one byte giving n, then by n literal bytes. */ - exactn = 1, + /* Succeed right away--no more backtracking. */ + succeed, - /* Matches any (more or less) character. */ + /* Followed by one byte giving n, then by n literal bytes. */ + exactn, + + /* Matches any (more or less) character. */ anychar, - /* Matches any one char belonging to specified set. First - following byte is number of bitmap bytes. Then come bytes - for a bitmap saying which chars are in. Bits in each byte - are ordered low-bit-first. A character is in the set if its - bit is 1. A character too large to have a bit in the map is - automatically not in the set. */ + /* Matches any one char belonging to specified set. First + following byte is number of bitmap bytes. Then come bytes + for a bitmap saying which chars are in. Bits in each byte + are ordered low-bit-first. A character is in the set if its + bit is 1. A character too large to have a bit in the map is + automatically not in the set. */ charset, - /* Same parameters as charset, but match any character that is - not one of those specified. */ + /* Same parameters as charset, but match any character that is + not one of those specified. */ charset_not, - /* Start remembering the text that is matched, for storing in a - register. Followed by one byte with the register number, in - the range 0 to one less than the pattern buffer's re_nsub - field. Then followed by one byte with the number of groups - inner to this one. (This last has to be part of the - start_memory only because we need it in the on_failure_jump - of re_match_2.) */ + /* Start remembering the text that is matched, for storing in a + register. Followed by one byte with the register number, in + the range 0 to one less than the pattern buffer's re_nsub + field. Then followed by one byte with the number of groups + inner to this one. (This last has to be part of the + start_memory only because we need it in the on_failure_jump + of re_match_2.) */ start_memory, - /* Stop remembering the text that is matched and store it in a - memory register. Followed by one byte with the register - number, in the range 0 to one less than `re_nsub' in the - pattern buffer, and one byte with the number of inner groups, - just like `start_memory'. (We need the number of inner - groups here because we don't have any easy way of finding the - corresponding start_memory when we're at a stop_memory.) */ + /* Stop remembering the text that is matched and store it in a + memory register. Followed by one byte with the register + number, in the range 0 to one less than `re_nsub' in the + pattern buffer, and one byte with the number of inner groups, + just like `start_memory'. (We need the number of inner + groups here because we don't have any easy way of finding the + corresponding start_memory when we're at a stop_memory.) */ stop_memory, - /* Match a duplicate of something remembered. Followed by one - byte containing the register number. */ + /* Match a duplicate of something remembered. Followed by one + byte containing the register number. */ duplicate, - /* Fail unless at beginning of line. */ + /* Fail unless at beginning of line. */ begline, - /* Fail unless at end of line. */ + /* Fail unless at end of line. */ endline, - /* Succeeds if at beginning of buffer (if emacs) or at beginning - of string to be matched (if not). */ + /* Succeeds if at beginning of buffer (if emacs) or at beginning + of string to be matched (if not). */ begbuf, - /* Analogously, for end of buffer/string. */ + /* Analogously, for end of buffer/string. */ endbuf, - /* Followed by two byte relative address to which to jump. */ + /* Followed by two byte relative address to which to jump. */ jump, /* Same as jump, but marks the end of an alternative. */ jump_past_alt, - /* Followed by two-byte relative address of place to resume at - in case of failure. */ + /* Followed by two-byte relative address of place to resume at + in case of failure. */ on_failure_jump, - /* Like on_failure_jump, but pushes a placeholder instead of the - current string position when executed. */ + /* Like on_failure_jump, but pushes a placeholder instead of the + current string position when executed. */ on_failure_keep_string_jump, - /* Throw away latest failure point and then jump to following - two-byte relative address. */ + /* Throw away latest failure point and then jump to following + two-byte relative address. */ pop_failure_jump, - /* Change to pop_failure_jump if know won't have to backtrack to - match; otherwise change to jump. This is used to jump - back to the beginning of a repeat. If what follows this jump - clearly won't match what the repeat does, such that we can be - sure that there is no use backtracking out of repetitions - already matched, then we change it to a pop_failure_jump. - Followed by two-byte address. */ + /* Change to pop_failure_jump if know won't have to backtrack to + match; otherwise change to jump. This is used to jump + back to the beginning of a repeat. If what follows this jump + clearly won't match what the repeat does, such that we can be + sure that there is no use backtracking out of repetitions + already matched, then we change it to a pop_failure_jump. + Followed by two-byte address. */ maybe_pop_jump, - /* Jump to following two-byte address, and push a dummy failure - point. This failure point will be thrown away if an attempt - is made to use it for a failure. A `+' construct makes this - before the first repeat. Also used as an intermediary kind - of jump when compiling an alternative. */ + /* Jump to following two-byte address, and push a dummy failure + point. This failure point will be thrown away if an attempt + is made to use it for a failure. A `+' construct makes this + before the first repeat. Also used as an intermediary kind + of jump when compiling an alternative. */ dummy_failure_jump, /* Push a dummy failure point and continue. Used at the end of alternatives. */ push_dummy_failure, - /* Followed by two-byte relative address and two-byte number n. - After matching N times, jump to the address upon failure. */ + /* Followed by two-byte relative address and two-byte number n. + After matching N times, jump to the address upon failure. */ succeed_n, - /* Followed by two-byte relative address, and two-byte number n. - Jump to the address N times, then fail. */ + /* Followed by two-byte relative address, and two-byte number n. + Jump to the address N times, then fail. */ jump_n, - /* Set the following two-byte relative address to the - subsequent two-byte number. The address *includes* the two - bytes of number. */ + /* Set the following two-byte relative address to the + subsequent two-byte number. The address *includes* the two + bytes of number. */ set_number_at, wordchar, /* Matches any word-constituent character. */ @@ -368,7 +483,7 @@ wordend, /* Succeeds if at word end. */ wordbound, /* Succeeds if at a word boundary. */ - notwordbound /* Succeeds if not at a word boundary. */ + notwordbound /* Succeeds if not at a word boundary. */ #ifdef emacs ,before_dot, /* Succeeds if before point. */ @@ -376,11 +491,21 @@ after_dot, /* Succeeds if after point. */ /* Matches any character whose syntax is specified. Followed by - a byte which contains a syntax code, e.g., Sword. */ + a byte which contains a syntax code, e.g., Sword. */ syntaxspec, /* Matches any character whose syntax is not that specified. */ - notsyntaxspec + notsyntaxspec, + + /* Matches any character whose category-set contains the specified + category. The operator is followed by a byte which contains a + category code (mnemonic ASCII character). */ + categoryspec, + + /* Matches any character whose category-set does not contain the + specified category. The operator is followed by a byte which + contains the category code (mnemonic ASCII character). */ + notcategoryspec #endif /* emacs */ } re_opcode_t; @@ -424,7 +549,7 @@ *dest += temp << 8; } -#ifndef EXTRACT_MACROS /* To debug the macros. */ +#ifndef EXTRACT_MACROS /* To debug the macros. */ #undef EXTRACT_NUMBER #define EXTRACT_NUMBER(dest, src) extract_number (&dest, src) #endif /* not EXTRACT_MACROS */ @@ -437,7 +562,7 @@ #define EXTRACT_NUMBER_AND_INCR(destination, source) \ do { \ EXTRACT_NUMBER (destination, source); \ - (source) += 2; \ + (source) += 2; \ } while (0) #ifdef DEBUG @@ -458,11 +583,98 @@ #endif /* DEBUG */ +/* Store a multibyte character in three contiguous bytes starting + DESTINATION, and increment DESTINATION to the byte after where the + character is stored. Therefore, DESTINATION must be an lvalue. */ + +#define STORE_CHARACTER_AND_INCR(destination, character) \ + do { \ + (destination)[0] = (character) & 0377; \ + (destination)[1] = ((character) >> 8) & 0377; \ + (destination)[2] = (character) >> 16; \ + (destination) += 3; \ + } while (0) + +/* Put into DESTINATION a character stored in three contiguous bytes + starting at SOURCE. */ + +#define EXTRACT_CHARACTER(destination, source) \ + do { \ + (destination) = ((source)[0] \ + | ((source)[1] << 8) \ + | ((source)[2] << 16)); \ + } while (0) + + +/* Macros for charset. */ + +/* Size of bitmap of charset P in bytes. P is a start of charset, + i.e. *P is (re_opcode_t) charset or (re_opcode_t) charset_not. */ +#define CHARSET_BITMAP_SIZE(p) ((p)[1] & 0x7F) + +/* Nonzero if charset P has range table. */ +#define CHARSET_RANGE_TABLE_EXISTS_P(p) ((p)[1] & 0x80) + +/* Return the address of range table of charset P. But not the start + of table itself, but the before where the number of ranges is + stored. `2 +' means to skip re_opcode_t and size of bitmap. */ +#define CHARSET_RANGE_TABLE(p) (&(p)[2 + CHARSET_BITMAP_SIZE (p)]) + +/* Test if C is listed in the bitmap of charset P. */ +#define CHARSET_LOOKUP_BITMAP(p, c) \ + ((c) < CHARSET_BITMAP_SIZE (p) * BYTEWIDTH \ + && (p)[2 + (c) / BYTEWIDTH] & (1 << ((c) % BYTEWIDTH))) + +/* Return the address of end of RANGE_TABLE. COUNT is number of + ranges (which is a pair of (start, end)) in the RANGE_TABLE. `* 2' + is start of range and end of range. `* 3' is size of each start + and end. */ +#define CHARSET_RANGE_TABLE_END(range_table, count) \ + ((range_table) + (count) * 2 * 3) + +/* Test if C is in RANGE_TABLE. A flag NOT is negated if C is in. + COUNT is number of ranges in RANGE_TABLE. */ +#define CHARSET_LOOKUP_RANGE_TABLE_RAW(not, c, range_table, count) \ + do \ + { \ + int range_start, range_end; \ + unsigned char *p; \ + unsigned char *range_table_end \ + = CHARSET_RANGE_TABLE_END ((range_table), (count)); \ + \ + for (p = (range_table); p < range_table_end; p += 2 * 3) \ + { \ + EXTRACT_CHARACTER (range_start, p); \ + EXTRACT_CHARACTER (range_end, p + 3); \ + \ + if (range_start <= (c) && (c) <= range_end) \ + { \ + (not) = !(not); \ + break; \ + } \ + } \ + } \ + while (0) + +/* Test if C is in range table of CHARSET. The flag NOT is negated if + C is listed in it. */ +#define CHARSET_LOOKUP_RANGE_TABLE(not, c, charset) \ + do \ + { \ + /* Number of ranges in range table. */ \ + int count; \ + unsigned char *range_table = CHARSET_RANGE_TABLE (charset); \ + \ + EXTRACT_NUMBER_AND_INCR (count, range_table); \ + CHARSET_LOOKUP_RANGE_TABLE_RAW ((not), (c), range_table, count); \ + } \ + while (0) + /* If DEBUG is defined, Regex prints many voluminous messages about what it is doing (if the variable `debug' is nonzero). If linked with the main program in `iregex.c', you can enter patterns and strings interactively. And if linked with the main program in `main.c' and - the other test files, you can run the already-written tests. */ + the other test files, you can run the already-written tests. */ #ifdef DEBUG @@ -479,14 +691,12 @@ #define DEBUG_PRINT2(x1, x2) if (debug) printf (x1, x2) #define DEBUG_PRINT3(x1, x2, x3) if (debug) printf (x1, x2, x3) #define DEBUG_PRINT4(x1, x2, x3, x4) if (debug) printf (x1, x2, x3, x4) -#define DEBUG_PRINT_COMPILED_PATTERN(p, s, e) \ +#define DEBUG_PRINT_COMPILED_PATTERN(p, s, e) \ if (debug) print_partial_compiled_pattern (s, e) #define DEBUG_PRINT_DOUBLE_STRING(w, s1, sz1, s2, sz2) \ if (debug) print_double_string (w, s1, sz1, s2, sz2) -extern void printchar (); - /* Print the fastmap in human-readable form. */ void @@ -501,18 +711,18 @@ if (fastmap[i++]) { was_a_range = 0; - printchar (i - 1); - while (i < (1 << BYTEWIDTH) && fastmap[i]) - { - was_a_range = 1; - i++; - } + putchar (i - 1); + while (i < (1 << BYTEWIDTH) && fastmap[i]) + { + was_a_range = 1; + i++; + } if (was_a_range) - { - printf ("-"); - printchar (i - 1); - } - } + { + printf ("-"); + putchar (i - 1); + } + } } putchar ('\n'); } @@ -539,32 +749,34 @@ /* Loop over pattern commands. */ while (p < pend) { + printf ("%d:\t", p - start); + switch ((re_opcode_t) *p++) { - case no_op: - printf ("/no_op"); - break; + case no_op: + printf ("/no_op"); + break; case exactn: mcnt = *p++; - printf ("/exactn/%d", mcnt); - do + printf ("/exactn/%d", mcnt); + do { - putchar ('/'); - printchar (*p++); - } - while (--mcnt); - break; + putchar ('/'); + putchar (*p++); + } + while (--mcnt); + break; case start_memory: - mcnt = *p++; - printf ("/start_memory/%d/%d", mcnt, *p++); - break; + mcnt = *p++; + printf ("/start_memory/%d/%d", mcnt, *p++); + break; case stop_memory: - mcnt = *p++; + mcnt = *p++; printf ("/stop_memory/%d/%d", mcnt, *p++); - break; + break; case duplicate: printf ("/duplicate/%d", *p++); @@ -575,102 +787,120 @@ break; case charset: - case charset_not: - { - register int c; - - printf ("/charset%s", - (re_opcode_t) *(p - 1) == charset_not ? "_not" : ""); - - assert (p + *p < pend); - - for (c = 0; c < *p; c++) - { - unsigned bit; - unsigned char map_byte = p[1 + c]; - - putchar ('/'); - - for (bit = 0; bit < BYTEWIDTH; bit++) - if (map_byte & (1 << bit)) - printchar (c * BYTEWIDTH + bit); - } + case charset_not: + { + register int c, last = -100; + register int in_range = 0; + + printf ("/charset [%s", + (re_opcode_t) *(p - 1) == charset_not ? "^" : ""); + + assert (p + *p < pend); + + for (c = 0; c < 256; c++) + if (c / 8 < *p + && (p[1 + (c/8)] & (1 << (c % 8)))) + { + /* Are we starting a range? */ + if (last + 1 == c && ! in_range) + { + putchar ('-'); + in_range = 1; + } + /* Have we broken a range? */ + else if (last + 1 != c && in_range) + { + putchar (last); + in_range = 0; + } + + if (! in_range) + putchar (c); + + last = c; + } + + if (in_range) + putchar (last); + + putchar (']'); + p += 1 + *p; - break; } + break; case begline: printf ("/begline"); - break; + break; case endline: - printf ("/endline"); - break; + printf ("/endline"); + break; case on_failure_jump: - extract_number_and_incr (&mcnt, &p); - printf ("/on_failure_jump/0/%d", mcnt); - break; + extract_number_and_incr (&mcnt, &p); + printf ("/on_failure_jump to %d", p + mcnt - start); + break; case on_failure_keep_string_jump: - extract_number_and_incr (&mcnt, &p); - printf ("/on_failure_keep_string_jump/0/%d", mcnt); - break; + extract_number_and_incr (&mcnt, &p); + printf ("/on_failure_keep_string_jump to %d", p + mcnt - start); + break; case dummy_failure_jump: - extract_number_and_incr (&mcnt, &p); - printf ("/dummy_failure_jump/0/%d", mcnt); - break; + extract_number_and_incr (&mcnt, &p); + printf ("/dummy_failure_jump to %d", p + mcnt - start); + break; case push_dummy_failure: - printf ("/push_dummy_failure"); - break; - - case maybe_pop_jump: - extract_number_and_incr (&mcnt, &p); - printf ("/maybe_pop_jump/0/%d", mcnt); + printf ("/push_dummy_failure"); break; - case pop_failure_jump: + case maybe_pop_jump: extract_number_and_incr (&mcnt, &p); - printf ("/pop_failure_jump/0/%d", mcnt); - break; - - case jump_past_alt: + printf ("/maybe_pop_jump to %d", p + mcnt - start); + break; + + case pop_failure_jump: extract_number_and_incr (&mcnt, &p); - printf ("/jump_past_alt/0/%d", mcnt); - break; - - case jump: + printf ("/pop_failure_jump to %d", p + mcnt - start); + break; + + case jump_past_alt: extract_number_and_incr (&mcnt, &p); - printf ("/jump/0/%d", mcnt); + printf ("/jump_past_alt to %d", p + mcnt - start); break; - case succeed_n: - extract_number_and_incr (&mcnt, &p); - extract_number_and_incr (&mcnt2, &p); - printf ("/succeed_n/0/%d/0/%d", mcnt, mcnt2); - break; + case jump: + extract_number_and_incr (&mcnt, &p); + printf ("/jump to %d", p + mcnt - start); + break; - case jump_n: - extract_number_and_incr (&mcnt, &p); - extract_number_and_incr (&mcnt2, &p); - printf ("/jump_n/0/%d/0/%d", mcnt, mcnt2); - break; + case succeed_n: + extract_number_and_incr (&mcnt, &p); + extract_number_and_incr (&mcnt2, &p); + printf ("/succeed_n to %d, %d times", p + mcnt - start, mcnt2); + break; - case set_number_at: - extract_number_and_incr (&mcnt, &p); - extract_number_and_incr (&mcnt2, &p); - printf ("/set_number_at/0/%d/0/%d", mcnt, mcnt2); - break; + case jump_n: + extract_number_and_incr (&mcnt, &p); + extract_number_and_incr (&mcnt2, &p); + printf ("/jump_n to %d, %d times", p + mcnt - start, mcnt2); + break; + + case set_number_at: + extract_number_and_incr (&mcnt, &p); + extract_number_and_incr (&mcnt2, &p); + printf ("/set_number_at location %d to %d", p + mcnt - start, mcnt2); + break; - case wordbound: + case wordbound: printf ("/wordbound"); break; case notwordbound: printf ("/notwordbound"); - break; + break; case wordbeg: printf ("/wordbeg"); @@ -682,24 +912,24 @@ #ifdef emacs case before_dot: printf ("/before_dot"); - break; + break; case at_dot: printf ("/at_dot"); - break; + break; case after_dot: printf ("/after_dot"); - break; + break; case syntaxspec: - printf ("/syntaxspec"); + printf ("/syntaxspec"); mcnt = *p++; printf ("/%d", mcnt); - break; + break; case notsyntaxspec: - printf ("/notsyntaxspec"); + printf ("/notsyntaxspec"); mcnt = *p++; printf ("/%d", mcnt); break; @@ -707,25 +937,28 @@ case wordchar: printf ("/wordchar"); - break; + break; case notwordchar: printf ("/notwordchar"); - break; + break; case begbuf: printf ("/begbuf"); - break; + break; case endbuf: printf ("/endbuf"); - break; + break; - default: - printf ("?%d", *(p-1)); + default: + printf ("?%d", *(p-1)); } + + putchar ('\n'); } - printf ("/\n"); + + printf ("%d:\tend of pattern.\n", p - start); } @@ -771,15 +1004,15 @@ else { if (FIRST_STRING_P (where)) - { - for (this_char = where - string1; this_char < size1; this_char++) - printchar (string1[this_char]); + { + for (this_char = where - string1; this_char < size1; this_char++) + putchar (string1[this_char]); - where = string2; - } + where = string2; + } for (this_char = where - string2; this_char < size2; this_char++) - printchar (string2[this_char]); + putchar (string2[this_char]); } } @@ -801,7 +1034,9 @@ /* Set by `re_set_syntax' to the current regexp syntax to recognize. Can also be assigned to arbitrarily: each pattern buffer stores its own syntax, so it can be changed between regex compilations. */ -reg_syntax_t re_syntax_options = RE_SYNTAX_EMACS; +/* This has no initializer because initialized variables in Emacs + become read-only after dumping. */ +reg_syntax_t re_syntax_options; /* Specify the precise syntax of regexps for compilation. This provides @@ -809,7 +1044,7 @@ different, incompatible syntaxes. The argument SYNTAX is a bit mask comprised of the various bits - defined in regex.h. We return the old syntax. */ + defined in regex.h. We return the old syntax. */ reg_syntax_t re_set_syntax (syntax) @@ -822,95 +1057,550 @@ } /* This table gives an error message for each of the error codes listed - in regex.h. Obviously the order here has to be same as there. */ + in regex.h. Obviously the order here has to be same as there. + POSIX doesn't require that we do anything for REG_NOERROR, + but why not be nice? */ -static const char *re_error_msg[] = - { NULL, /* REG_NOERROR */ - "No match", /* REG_NOMATCH */ - "Invalid regular expression", /* REG_BADPAT */ - "Invalid collation character", /* REG_ECOLLATE */ - "Invalid character class name", /* REG_ECTYPE */ - "Trailing backslash", /* REG_EESCAPE */ - "Invalid back reference", /* REG_ESUBREG */ - "Unmatched [ or [^", /* REG_EBRACK */ - "Unmatched ( or \\(", /* REG_EPAREN */ - "Unmatched \\{", /* REG_EBRACE */ - "Invalid content of \\{\\}", /* REG_BADBR */ - "Invalid range end", /* REG_ERANGE */ - "Memory exhausted", /* REG_ESPACE */ - "Invalid preceding regular expression", /* REG_BADRPT */ - "Premature end of regular expression", /* REG_EEND */ - "Regular expression too big", /* REG_ESIZE */ - "Unmatched ) or \\)", /* REG_ERPAREN */ +static const char *re_error_msgid[] = + { + gettext_noop ("Success"), /* REG_NOERROR */ + gettext_noop ("No match"), /* REG_NOMATCH */ + gettext_noop ("Invalid regular expression"), /* REG_BADPAT */ + gettext_noop ("Invalid collation character"), /* REG_ECOLLATE */ + gettext_noop ("Invalid character class name"), /* REG_ECTYPE */ + gettext_noop ("Trailing backslash"), /* REG_EESCAPE */ + gettext_noop ("Invalid back reference"), /* REG_ESUBREG */ + gettext_noop ("Unmatched [ or [^"), /* REG_EBRACK */ + gettext_noop ("Unmatched ( or \\("), /* REG_EPAREN */ + gettext_noop ("Unmatched \\{"), /* REG_EBRACE */ + gettext_noop ("Invalid content of \\{\\}"), /* REG_BADBR */ + gettext_noop ("Invalid range end"), /* REG_ERANGE */ + gettext_noop ("Memory exhausted"), /* REG_ESPACE */ + gettext_noop ("Invalid preceding regular expression"), /* REG_BADRPT */ + gettext_noop ("Premature end of regular expression"), /* REG_EEND */ + gettext_noop ("Regular expression too big"), /* REG_ESIZE */ + gettext_noop ("Unmatched ) or \\)"), /* REG_ERPAREN */ }; -/* Subroutine declarations and macros for regex_compile. */ +/* Avoiding alloca during matching, to placate r_alloc. */ -static void store_op1 (), store_op2 (); -static void insert_op1 (), insert_op2 (); -static boolean at_begline_loc_p (), at_endline_loc_p (); -static boolean group_in_compile_stack (); -static reg_errcode_t compile_range (); +/* Define MATCH_MAY_ALLOCATE unless we need to make sure that the + searching and matching functions should not call alloca. On some + systems, alloca is implemented in terms of malloc, and if we're + using the relocating allocator routines, then malloc could cause a + relocation, which might (if the strings being searched are in the + ralloc heap) shift the data out from underneath the regexp + routines. + + Here's another reason to avoid allocation: Emacs + processes input from X in a signal handler; processing X input may + call malloc; if input arrives while a matching routine is calling + malloc, then we're scrod. But Emacs can't just block input while + calling matching routines; then we don't notice interrupts when + they come in. So, Emacs blocks input around all regexp calls + except the matching calls, which it leaves unprotected, in the + faith that they will not malloc. */ -/* Fetch the next character in the uncompiled pattern---translating it - if necessary. Also cast from a signed character in the constant - string passed to us by the user to an unsigned char that we can use - as an array index (in, e.g., `translate'). */ -#define PATFETCH(c) \ - do {if (p == pend) return REG_EEND; \ - c = (unsigned char) *p++; \ - if (translate) c = translate[c]; \ - } while (0) +/* Normally, this is fine. */ +#define MATCH_MAY_ALLOCATE -/* Fetch the next character in the uncompiled pattern, with no - translation. */ -#define PATFETCH_RAW(c) \ - do {if (p == pend) return REG_EEND; \ - c = (unsigned char) *p++; \ - } while (0) +/* When using GNU C, we are not REALLY using the C alloca, no matter + what config.h may say. So don't take precautions for it. */ +#ifdef __GNUC__ +#undef C_ALLOCA +#endif -/* Go backwards one character in the pattern. */ -#define PATUNFETCH p-- +/* The match routines may not allocate if (1) they would do it with malloc + and (2) it's not safe for them to use malloc. + Note that if REL_ALLOC is defined, matching would not use malloc for the + failure stack, but we would still use it for the register vectors; + so REL_ALLOC should not affect this. */ +#if (defined (C_ALLOCA) || defined (REGEX_MALLOC)) && defined (emacs) +#undef MATCH_MAY_ALLOCATE +#endif + +/* Failure stack declarations and macros; both re_compile_fastmap and + re_match_2 use a failure stack. These have to be macros because of + REGEX_ALLOCATE_STACK. */ -/* If `translate' is non-null, return translate[D], else just D. We - cast the subscript to translate because some data is declared as - `char *', to avoid warnings when a string constant is passed. But - when we use a character as a subscript we must make it unsigned. */ -#define TRANSLATE(d) (translate ? translate[(unsigned char) (d)] : (d)) +/* Approximate number of failure points for which to initially allocate space + when matching. If this number is exceeded, we allocate more + space, so it is not a hard limit. */ +#ifndef INIT_FAILURE_ALLOC +#define INIT_FAILURE_ALLOC 20 +#endif -/* Macros for outputting the compiled pattern into `buffer'. */ +/* Roughly the maximum number of failure points on the stack. Would be + exactly that if always used TYPICAL_FAILURE_SIZE items each time we failed. + This is a variable only so users of regex can assign to it; we never + change it ourselves. */ +#if defined (MATCH_MAY_ALLOCATE) +/* Note that 4400 is enough to cause a crash on Alpha OSF/1, + whose default stack limit is 2mb. In order for a larger + value to work reliably, you have to try to make it accord + with the process stack limit. */ +int re_max_failures = 40000; +#else +int re_max_failures = 4000; +#endif -/* If the buffer isn't allocated when it comes in, use this. */ -#define INIT_BUF_SIZE 32 +union fail_stack_elt +{ + unsigned char *pointer; + int integer; +}; -/* Make sure we have at least N more bytes of space in buffer. */ -#define GET_BUFFER_SPACE(n) \ - while (b - bufp->buffer + (n) > bufp->allocated) \ - EXTEND_BUFFER () +typedef union fail_stack_elt fail_stack_elt_t; -/* Make sure we have one more byte of buffer space and then add C to it. */ -#define BUF_PUSH(c) \ - do { \ - GET_BUFFER_SPACE (1); \ - *b++ = (unsigned char) (c); \ - } while (0) +typedef struct +{ + fail_stack_elt_t *stack; + unsigned size; + unsigned avail; /* Offset of next open position. */ +} fail_stack_type; +#define FAIL_STACK_EMPTY() (fail_stack.avail == 0) +#define FAIL_STACK_PTR_EMPTY() (fail_stack_ptr->avail == 0) +#define FAIL_STACK_FULL() (fail_stack.avail == fail_stack.size) -/* Ensure we have two more bytes of buffer space and then append C1 and C2. */ -#define BUF_PUSH_2(c1, c2) \ - do { \ - GET_BUFFER_SPACE (2); \ - *b++ = (unsigned char) (c1); \ - *b++ = (unsigned char) (c2); \ - } while (0) +/* Define macros to initialize and free the failure stack. + Do `return -2' if the alloc fails. */ -/* As with BUF_PUSH_2, except for three bytes. */ -#define BUF_PUSH_3(c1, c2, c3) \ +#ifdef MATCH_MAY_ALLOCATE +#define INIT_FAIL_STACK() \ do { \ - GET_BUFFER_SPACE (3); \ + fail_stack.stack = (fail_stack_elt_t *) \ + REGEX_ALLOCATE_STACK (INIT_FAILURE_ALLOC * TYPICAL_FAILURE_SIZE \ + * sizeof (fail_stack_elt_t)); \ + \ + if (fail_stack.stack == NULL) \ + return -2; \ + \ + fail_stack.size = INIT_FAILURE_ALLOC; \ + fail_stack.avail = 0; \ + } while (0) + +#define RESET_FAIL_STACK() REGEX_FREE_STACK (fail_stack.stack) +#else +#define INIT_FAIL_STACK() \ + do { \ + fail_stack.avail = 0; \ + } while (0) + +#define RESET_FAIL_STACK() +#endif + + +/* Double the size of FAIL_STACK, up to a limit + which allows approximately `re_max_failures' items. + + Return 1 if succeeds, and 0 if either ran out of memory + allocating space for it or it was already too large. + + REGEX_REALLOCATE_STACK requires `destination' be declared. */ + +/* Factor to increase the failure stack size by + when we increase it. + This used to be 2, but 2 was too wasteful + because the old discarded stacks added up to as much space + were as ultimate, maximum-size stack. */ +#define FAIL_STACK_GROWTH_FACTOR 4 + +#define GROW_FAIL_STACK(fail_stack) \ + (((fail_stack).size * sizeof (fail_stack_elt_t) \ + >= re_max_failures * TYPICAL_FAILURE_SIZE) \ + ? 0 \ + : ((fail_stack).stack \ + = (fail_stack_elt_t *) \ + REGEX_REALLOCATE_STACK ((fail_stack).stack, \ + (fail_stack).size * sizeof (fail_stack_elt_t), \ + MIN (re_max_failures * TYPICAL_FAILURE_SIZE, \ + ((fail_stack).size * sizeof (fail_stack_elt_t) \ + * FAIL_STACK_GROWTH_FACTOR))), \ + \ + (fail_stack).stack == NULL \ + ? 0 \ + : ((fail_stack).size \ + = (MIN (re_max_failures * TYPICAL_FAILURE_SIZE, \ + ((fail_stack).size * sizeof (fail_stack_elt_t) \ + * FAIL_STACK_GROWTH_FACTOR)) \ + / sizeof (fail_stack_elt_t)), \ + 1))) + + +/* Push pointer POINTER on FAIL_STACK. + Return 1 if was able to do so and 0 if ran out of memory allocating + space to do so. */ +#define PUSH_PATTERN_OP(POINTER, FAIL_STACK) \ + ((FAIL_STACK_FULL () \ + && !GROW_FAIL_STACK (FAIL_STACK)) \ + ? 0 \ + : ((FAIL_STACK).stack[(FAIL_STACK).avail++].pointer = POINTER, \ + 1)) + +/* Push a pointer value onto the failure stack. + Assumes the variable `fail_stack'. Probably should only + be called from within `PUSH_FAILURE_POINT'. */ +#define PUSH_FAILURE_POINTER(item) \ + fail_stack.stack[fail_stack.avail++].pointer = (unsigned char *) (item) + +/* This pushes an integer-valued item onto the failure stack. + Assumes the variable `fail_stack'. Probably should only + be called from within `PUSH_FAILURE_POINT'. */ +#define PUSH_FAILURE_INT(item) \ + fail_stack.stack[fail_stack.avail++].integer = (item) + +/* Push a fail_stack_elt_t value onto the failure stack. + Assumes the variable `fail_stack'. Probably should only + be called from within `PUSH_FAILURE_POINT'. */ +#define PUSH_FAILURE_ELT(item) \ + fail_stack.stack[fail_stack.avail++] = (item) + +/* These three POP... operations complement the three PUSH... operations. + All assume that `fail_stack' is nonempty. */ +#define POP_FAILURE_POINTER() fail_stack.stack[--fail_stack.avail].pointer +#define POP_FAILURE_INT() fail_stack.stack[--fail_stack.avail].integer +#define POP_FAILURE_ELT() fail_stack.stack[--fail_stack.avail] + +/* Used to omit pushing failure point id's when we're not debugging. */ +#ifdef DEBUG +#define DEBUG_PUSH PUSH_FAILURE_INT +#define DEBUG_POP(item_addr) *(item_addr) = POP_FAILURE_INT () +#else +#define DEBUG_PUSH(item) +#define DEBUG_POP(item_addr) +#endif + + +/* Push the information about the state we will need + if we ever fail back to it. + + Requires variables fail_stack, regstart, regend, reg_info, and + num_regs be declared. GROW_FAIL_STACK requires `destination' be + declared. + + Does `return FAILURE_CODE' if runs out of memory. */ + +#define PUSH_FAILURE_POINT(pattern_place, string_place, failure_code) \ + do { \ + char *destination; \ + /* Must be int, so when we don't save any registers, the arithmetic \ + of 0 + -1 isn't done as unsigned. */ \ + int this_reg; \ + \ + DEBUG_STATEMENT (failure_id++); \ + DEBUG_STATEMENT (nfailure_points_pushed++); \ + DEBUG_PRINT2 ("\nPUSH_FAILURE_POINT #%u:\n", failure_id); \ + DEBUG_PRINT2 (" Before push, next avail: %d\n", (fail_stack).avail);\ + DEBUG_PRINT2 (" size: %d\n", (fail_stack).size);\ + \ + DEBUG_PRINT2 (" slots needed: %d\n", NUM_FAILURE_ITEMS); \ + DEBUG_PRINT2 (" available: %d\n", REMAINING_AVAIL_SLOTS); \ + \ + /* Ensure we have enough space allocated for what we will push. */ \ + while (REMAINING_AVAIL_SLOTS < NUM_FAILURE_ITEMS) \ + { \ + if (!GROW_FAIL_STACK (fail_stack)) \ + return failure_code; \ + \ + DEBUG_PRINT2 ("\n Doubled stack; size now: %d\n", \ + (fail_stack).size); \ + DEBUG_PRINT2 (" slots available: %d\n", REMAINING_AVAIL_SLOTS);\ + } \ + \ + /* Push the info, starting with the registers. */ \ + DEBUG_PRINT1 ("\n"); \ + \ + if (1) \ + for (this_reg = lowest_active_reg; this_reg <= highest_active_reg; \ + this_reg++) \ + { \ + DEBUG_PRINT2 (" Pushing reg: %d\n", this_reg); \ + DEBUG_STATEMENT (num_regs_pushed++); \ + \ + DEBUG_PRINT2 (" start: 0x%x\n", regstart[this_reg]); \ + PUSH_FAILURE_POINTER (regstart[this_reg]); \ + \ + DEBUG_PRINT2 (" end: 0x%x\n", regend[this_reg]); \ + PUSH_FAILURE_POINTER (regend[this_reg]); \ + \ + DEBUG_PRINT2 (" info: 0x%x\n ", reg_info[this_reg]); \ + DEBUG_PRINT2 (" match_null=%d", \ + REG_MATCH_NULL_STRING_P (reg_info[this_reg])); \ + DEBUG_PRINT2 (" active=%d", IS_ACTIVE (reg_info[this_reg])); \ + DEBUG_PRINT2 (" matched_something=%d", \ + MATCHED_SOMETHING (reg_info[this_reg])); \ + DEBUG_PRINT2 (" ever_matched=%d", \ + EVER_MATCHED_SOMETHING (reg_info[this_reg])); \ + DEBUG_PRINT1 ("\n"); \ + PUSH_FAILURE_ELT (reg_info[this_reg].word); \ + } \ + \ + DEBUG_PRINT2 (" Pushing low active reg: %d\n", lowest_active_reg);\ + PUSH_FAILURE_INT (lowest_active_reg); \ + \ + DEBUG_PRINT2 (" Pushing high active reg: %d\n", highest_active_reg);\ + PUSH_FAILURE_INT (highest_active_reg); \ + \ + DEBUG_PRINT2 (" Pushing pattern 0x%x: ", pattern_place); \ + DEBUG_PRINT_COMPILED_PATTERN (bufp, pattern_place, pend); \ + PUSH_FAILURE_POINTER (pattern_place); \ + \ + DEBUG_PRINT2 (" Pushing string 0x%x: `", string_place); \ + DEBUG_PRINT_DOUBLE_STRING (string_place, string1, size1, string2, \ + size2); \ + DEBUG_PRINT1 ("'\n"); \ + PUSH_FAILURE_POINTER (string_place); \ + \ + DEBUG_PRINT2 (" Pushing failure id: %u\n", failure_id); \ + DEBUG_PUSH (failure_id); \ + } while (0) + +/* This is the number of items that are pushed and popped on the stack + for each register. */ +#define NUM_REG_ITEMS 3 + +/* Individual items aside from the registers. */ +#ifdef DEBUG +#define NUM_NONREG_ITEMS 5 /* Includes failure point id. */ +#else +#define NUM_NONREG_ITEMS 4 +#endif + +/* Estimate the size of data pushed by a typical failure stack entry. + An estimate is all we need, because all we use this for + is to choose a limit for how big to make the failure stack. */ + +#define TYPICAL_FAILURE_SIZE 20 + +/* This is how many items we actually use for a failure point. + It depends on the regexp. */ +#define NUM_FAILURE_ITEMS \ + (((0 \ + ? 0 : highest_active_reg - lowest_active_reg + 1) \ + * NUM_REG_ITEMS) \ + + NUM_NONREG_ITEMS) + +/* How many items can still be added to the stack without overflowing it. */ +#define REMAINING_AVAIL_SLOTS ((fail_stack).size - (fail_stack).avail) + + +/* Pops what PUSH_FAIL_STACK pushes. + + We restore into the parameters, all of which should be lvalues: + STR -- the saved data position. + PAT -- the saved pattern position. + LOW_REG, HIGH_REG -- the highest and lowest active registers. + REGSTART, REGEND -- arrays of string positions. + REG_INFO -- array of information about each subexpression. + + Also assumes the variables `fail_stack' and (if debugging), `bufp', + `pend', `string1', `size1', `string2', and `size2'. */ + +#define POP_FAILURE_POINT(str, pat, low_reg, high_reg, regstart, regend, reg_info)\ +{ \ + DEBUG_STATEMENT (fail_stack_elt_t failure_id;) \ + int this_reg; \ + const unsigned char *string_temp; \ + \ + assert (!FAIL_STACK_EMPTY ()); \ + \ + /* Remove failure points and point to how many regs pushed. */ \ + DEBUG_PRINT1 ("POP_FAILURE_POINT:\n"); \ + DEBUG_PRINT2 (" Before pop, next avail: %d\n", fail_stack.avail); \ + DEBUG_PRINT2 (" size: %d\n", fail_stack.size); \ + \ + assert (fail_stack.avail >= NUM_NONREG_ITEMS); \ + \ + DEBUG_POP (&failure_id); \ + DEBUG_PRINT2 (" Popping failure id: %u\n", failure_id); \ + \ + /* If the saved string location is NULL, it came from an \ + on_failure_keep_string_jump opcode, and we want to throw away the \ + saved NULL, thus retaining our current position in the string. */ \ + string_temp = POP_FAILURE_POINTER (); \ + if (string_temp != NULL) \ + str = (const char *) string_temp; \ + \ + DEBUG_PRINT2 (" Popping string 0x%x: `", str); \ + DEBUG_PRINT_DOUBLE_STRING (str, string1, size1, string2, size2); \ + DEBUG_PRINT1 ("'\n"); \ + \ + pat = (unsigned char *) POP_FAILURE_POINTER (); \ + DEBUG_PRINT2 (" Popping pattern 0x%x: ", pat); \ + DEBUG_PRINT_COMPILED_PATTERN (bufp, pat, pend); \ + \ + /* Restore register info. */ \ + high_reg = (unsigned) POP_FAILURE_INT (); \ + DEBUG_PRINT2 (" Popping high active reg: %d\n", high_reg); \ + \ + low_reg = (unsigned) POP_FAILURE_INT (); \ + DEBUG_PRINT2 (" Popping low active reg: %d\n", low_reg); \ + \ + if (1) \ + for (this_reg = high_reg; this_reg >= low_reg; this_reg--) \ + { \ + DEBUG_PRINT2 (" Popping reg: %d\n", this_reg); \ + \ + reg_info[this_reg].word = POP_FAILURE_ELT (); \ + DEBUG_PRINT2 (" info: 0x%x\n", reg_info[this_reg]); \ + \ + regend[this_reg] = (const char *) POP_FAILURE_POINTER (); \ + DEBUG_PRINT2 (" end: 0x%x\n", regend[this_reg]); \ + \ + regstart[this_reg] = (const char *) POP_FAILURE_POINTER (); \ + DEBUG_PRINT2 (" start: 0x%x\n", regstart[this_reg]); \ + } \ + else \ + { \ + for (this_reg = highest_active_reg; this_reg > high_reg; this_reg--) \ + { \ + reg_info[this_reg].word.integer = 0; \ + regend[this_reg] = 0; \ + regstart[this_reg] = 0; \ + } \ + highest_active_reg = high_reg; \ + } \ + \ + set_regs_matched_done = 0; \ + DEBUG_STATEMENT (nfailure_points_popped++); \ +} /* POP_FAILURE_POINT */ + + + +/* Structure for per-register (a.k.a. per-group) information. + Other register information, such as the + starting and ending positions (which are addresses), and the list of + inner groups (which is a bits list) are maintained in separate + variables. + + We are making a (strictly speaking) nonportable assumption here: that + the compiler will pack our bit fields into something that fits into + the type of `word', i.e., is something that fits into one item on the + failure stack. */ + +typedef union +{ + fail_stack_elt_t word; + struct + { + /* This field is one if this group can match the empty string, + zero if not. If not yet determined, `MATCH_NULL_UNSET_VALUE'. */ +#define MATCH_NULL_UNSET_VALUE 3 + unsigned match_null_string_p : 2; + unsigned is_active : 1; + unsigned matched_something : 1; + unsigned ever_matched_something : 1; + } bits; +} register_info_type; + +#define REG_MATCH_NULL_STRING_P(R) ((R).bits.match_null_string_p) +#define IS_ACTIVE(R) ((R).bits.is_active) +#define MATCHED_SOMETHING(R) ((R).bits.matched_something) +#define EVER_MATCHED_SOMETHING(R) ((R).bits.ever_matched_something) + + +/* Call this when have matched a real character; it sets `matched' flags + for the subexpressions which we are currently inside. Also records + that those subexprs have matched. */ +#define SET_REGS_MATCHED() \ + do \ + { \ + if (!set_regs_matched_done) \ + { \ + unsigned r; \ + set_regs_matched_done = 1; \ + for (r = lowest_active_reg; r <= highest_active_reg; r++) \ + { \ + MATCHED_SOMETHING (reg_info[r]) \ + = EVER_MATCHED_SOMETHING (reg_info[r]) \ + = 1; \ + } \ + } \ + } \ + while (0) + +/* Registers are set to a sentinel when they haven't yet matched. */ +static char reg_unset_dummy; +#define REG_UNSET_VALUE (®_unset_dummy) +#define REG_UNSET(e) ((e) == REG_UNSET_VALUE) + +/* Subroutine declarations and macros for regex_compile. */ + +static void store_op1 (), store_op2 (); +static void insert_op1 (), insert_op2 (); +static boolean at_begline_loc_p (), at_endline_loc_p (); +static boolean group_in_compile_stack (); +static reg_errcode_t compile_range (); + +/* Fetch the next character in the uncompiled pattern---translating it + if necessary. Also cast from a signed character in the constant + string passed to us by the user to an unsigned char that we can use + as an array index (in, e.g., `translate'). */ +#ifndef PATFETCH +#define PATFETCH(c) \ + do {if (p == pend) return REG_EEND; \ + c = (unsigned char) *p++; \ + if (RE_TRANSLATE_P (translate)) c = RE_TRANSLATE (translate, c); \ + } while (0) +#endif + +/* Fetch the next character in the uncompiled pattern, with no + translation. */ +#define PATFETCH_RAW(c) \ + do {if (p == pend) return REG_EEND; \ + c = (unsigned char) *p++; \ + } while (0) + +/* Go backwards one character in the pattern. */ +#define PATUNFETCH p-- + + +/* If `translate' is non-null, return translate[D], else just D. We + cast the subscript to translate because some data is declared as + `char *', to avoid warnings when a string constant is passed. But + when we use a character as a subscript we must make it unsigned. */ +#ifndef TRANSLATE +#define TRANSLATE(d) \ + (RE_TRANSLATE_P (translate) \ + ? (unsigned) RE_TRANSLATE (translate, (unsigned) (d)) : (d)) +#endif + + +/* Macros for outputting the compiled pattern into `buffer'. */ + +/* If the buffer isn't allocated when it comes in, use this. */ +#define INIT_BUF_SIZE 32 + +/* Make sure we have at least N more bytes of space in buffer. */ +#define GET_BUFFER_SPACE(n) \ + while (b - bufp->buffer + (n) > bufp->allocated) \ + EXTEND_BUFFER () + +/* Make sure we have one more byte of buffer space and then add C to it. */ +#define BUF_PUSH(c) \ + do { \ + GET_BUFFER_SPACE (1); \ + *b++ = (unsigned char) (c); \ + } while (0) + + +/* Ensure we have two more bytes of buffer space and then append C1 and C2. */ +#define BUF_PUSH_2(c1, c2) \ + do { \ + GET_BUFFER_SPACE (2); \ + *b++ = (unsigned char) (c1); \ + *b++ = (unsigned char) (c2); \ + } while (0) + + +/* As with BUF_PUSH_2, except for three bytes. */ +#define BUF_PUSH_3(c1, c2, c3) \ + do { \ + GET_BUFFER_SPACE (3); \ *b++ = (unsigned char) (c1); \ *b++ = (unsigned char) (c2); \ *b++ = (unsigned char) (c3); \ @@ -918,7 +1608,7 @@ /* Store a jump with opcode OP at LOC to location TO. We store a - relative address offset by the three bytes the jump itself occupies. */ + relative address offset by the three bytes the jump itself occupies. */ #define STORE_JUMP(op, loc, to) \ store_op1 (op, loc, (to) - (loc) - 3) @@ -926,7 +1616,7 @@ #define STORE_JUMP2(op, loc, to, arg) \ store_op2 (op, loc, (to) - (loc) - 3, arg) -/* Like `STORE_JUMP', but for inserting. Assume `b' is the buffer end. */ +/* Like `STORE_JUMP', but for inserting. Assume `b' is the buffer end. */ #define INSERT_JUMP(op, loc, to) \ insert_op1 (op, loc, (to) - (loc) - 3, b) @@ -936,7 +1626,7 @@ /* This is not an arbitrary limit: the arguments which represent offsets - into the pattern are two bytes long. So if 2^16 bytes turns out to + into the pattern are two bytes long. So if 2^16 bytes turns out to be too small, many things would have to change. */ #define MAX_BUF_SIZE (1L << 16) @@ -944,29 +1634,29 @@ /* Extend the buffer by twice its current size via realloc and reset the pointers that pointed into the old block to point to the correct places in the new one. If extending the buffer results in it - being larger than MAX_BUF_SIZE, then flag memory exhausted. */ + being larger than MAX_BUF_SIZE, then flag memory exhausted. */ #define EXTEND_BUFFER() \ - do { \ + do { \ unsigned char *old_buffer = bufp->buffer; \ - if (bufp->allocated == MAX_BUF_SIZE) \ + if (bufp->allocated == MAX_BUF_SIZE) \ return REG_ESIZE; \ bufp->allocated <<= 1; \ if (bufp->allocated > MAX_BUF_SIZE) \ - bufp->allocated = MAX_BUF_SIZE; \ + bufp->allocated = MAX_BUF_SIZE; \ bufp->buffer = (unsigned char *) realloc (bufp->buffer, bufp->allocated);\ if (bufp->buffer == NULL) \ return REG_ESPACE; \ /* If the buffer moved, move all the pointers into it. */ \ if (old_buffer != bufp->buffer) \ { \ - b = (b - old_buffer) + bufp->buffer; \ - begalt = (begalt - old_buffer) + bufp->buffer; \ - if (fixup_alt_jump) \ - fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer;\ - if (laststart) \ - laststart = (laststart - old_buffer) + bufp->buffer; \ - if (pending_exact) \ - pending_exact = (pending_exact - old_buffer) + bufp->buffer; \ + b = (b - old_buffer) + bufp->buffer; \ + begalt = (begalt - old_buffer) + bufp->buffer; \ + if (fixup_alt_jump) \ + fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer;\ + if (laststart) \ + laststart = (laststart - old_buffer) + bufp->buffer; \ + if (pending_exact) \ + pending_exact = (pending_exact - old_buffer) + bufp->buffer; \ } \ } while (0) @@ -984,7 +1674,7 @@ /* Macros for the compile stack. */ /* Since offsets can go either forwards or backwards, this type needs to - be able to hold values from -(MAX_BUF_SIZE - 1) to MAX_BUF_SIZE - 1. */ + be able to hold values from -(MAX_BUF_SIZE - 1) to MAX_BUF_SIZE - 1. */ typedef int pattern_offset_t; typedef struct @@ -1010,31 +1700,76 @@ #define COMPILE_STACK_EMPTY (compile_stack.avail == 0) #define COMPILE_STACK_FULL (compile_stack.avail == compile_stack.size) -/* The next available element. */ +/* The next available element. */ #define COMPILE_STACK_TOP (compile_stack.stack[compile_stack.avail]) +/* Structure to manage work area for range table. */ +struct range_table_work_area +{ + int *table; /* actual work area. */ + int allocated; /* allocated size for work area in bytes. */ + int used; /* actually used size in words. */ +}; + +/* Make sure that WORK_AREA can hold more N multibyte characters. */ +#define EXTEND_RANGE_TABLE_WORK_AREA(work_area, n) \ + do { \ + if (((work_area).used + (n)) * sizeof (int) > (work_area).allocated) \ + { \ + (work_area).allocated += 16 * sizeof (int); \ + if ((work_area).table) \ + (work_area).table \ + = (int *) realloc ((work_area).table, (work_area).allocated); \ + else \ + (work_area).table \ + = (int *) malloc ((work_area).allocated); \ + if ((work_area).table == 0) \ + FREE_STACK_RETURN (REG_ESPACE); \ + } \ + } while (0) + +/* Set a range (RANGE_START, RANGE_END) to WORK_AREA. */ +#define SET_RANGE_TABLE_WORK_AREA(work_area, range_start, range_end) \ + do { \ + EXTEND_RANGE_TABLE_WORK_AREA ((work_area), 2); \ + (work_area).table[(work_area).used++] = (range_start); \ + (work_area).table[(work_area).used++] = (range_end); \ + } while (0) + +/* Free allocated memory for WORK_AREA. */ +#define FREE_RANGE_TABLE_WORK_AREA(work_area) \ + do { \ + if ((work_area).table) \ + free ((work_area).table); \ + } while (0) + +#define CLEAR_RANGE_TABLE_WORK_USED(work_area) ((work_area).used = 0) +#define RANGE_TABLE_WORK_USED(work_area) ((work_area).used) +#define RANGE_TABLE_WORK_ELT(work_area, i) ((work_area).table[i]) + + /* Set the bit for character C in a list. */ -#define SET_LIST_BIT(c) \ - (b[((unsigned char) (c)) / BYTEWIDTH] \ +#define SET_LIST_BIT(c) \ + (b[((unsigned char) (c)) / BYTEWIDTH] \ |= 1 << (((unsigned char) c) % BYTEWIDTH)) /* Get the next unsigned number in the uncompiled pattern. */ -#define GET_UNSIGNED_NUMBER(num) \ +#define GET_UNSIGNED_NUMBER(num) \ { if (p != pend) \ { \ - PATFETCH (c); \ - while (ISDIGIT (c)) \ - { \ - if (num < 0) \ - num = 0; \ - num = num * 10 + c - '0'; \ - if (p == pend) \ - break; \ - PATFETCH (c); \ - } \ - } \ + PATFETCH (c); \ + while (ISDIGIT (c)) \ + { \ + if (num < 0) \ + num = 0; \ + num = num * 10 + c - '0'; \ + if (p == pend) \ + break; \ + PATFETCH (c); \ + } \ + } \ } #define CHAR_CLASS_MAX_LENGTH 6 /* Namely, `xdigit'. */ @@ -1047,6 +1782,54 @@ || STREQ (string, "punct") || STREQ (string, "graph") \ || STREQ (string, "cntrl") || STREQ (string, "blank")) +#ifndef MATCH_MAY_ALLOCATE + +/* If we cannot allocate large objects within re_match_2_internal, + we make the fail stack and register vectors global. + The fail stack, we grow to the maximum size when a regexp + is compiled. + The register vectors, we adjust in size each time we + compile a regexp, according to the number of registers it needs. */ + +static fail_stack_type fail_stack; + +/* Size with which the following vectors are currently allocated. + That is so we can make them bigger as needed, + but never make them smaller. */ +static int regs_allocated_size; + +static const char ** regstart, ** regend; +static const char ** old_regstart, ** old_regend; +static const char **best_regstart, **best_regend; +static register_info_type *reg_info; +static const char **reg_dummy; +static register_info_type *reg_info_dummy; + +/* Make the register vectors big enough for NUM_REGS registers, + but don't make them smaller. */ + +static +regex_grow_registers (num_regs) + int num_regs; +{ + if (num_regs > regs_allocated_size) + { + RETALLOC_IF (regstart, num_regs, const char *); + RETALLOC_IF (regend, num_regs, const char *); + RETALLOC_IF (old_regstart, num_regs, const char *); + RETALLOC_IF (old_regend, num_regs, const char *); + RETALLOC_IF (best_regstart, num_regs, const char *); + RETALLOC_IF (best_regend, num_regs, const char *); + RETALLOC_IF (reg_info, num_regs, register_info_type); + RETALLOC_IF (reg_dummy, num_regs, const char *); + RETALLOC_IF (reg_info_dummy, num_regs, register_info_type); + + regs_allocated_size = num_regs; + } +} + +#endif /* not MATCH_MAY_ALLOCATE */ + /* `regex_compile' compiles PATTERN (of length SIZE) according to SYNTAX. Returns one of error codes defined in `regex.h', or zero for success. @@ -1065,6 +1848,14 @@ The `fastmap' and `newline_anchor' fields are neither examined nor set. */ +/* Return, freeing storage we allocated. */ +#define FREE_STACK_RETURN(value) \ + do { \ + FREE_RANGE_TABLE_WORK_AREA (range_table_work); \ + free (compile_stack.stack); \ + return value; \ + } while (0) + static reg_errcode_t regex_compile (pattern, size, syntax, bufp) const char *pattern; @@ -1075,7 +1866,7 @@ /* We fetch characters from PATTERN here. Even though PATTERN is `char *' (i.e., signed), we declare these variables as unsigned, so they can be reliably used as array indices. */ - register unsigned char c, c1; + register unsigned int c, c1; /* A random temporary spot in PATTERN. */ const char *p1; @@ -1087,11 +1878,16 @@ compile_stack_type compile_stack; /* Points to the current (ending) position in the pattern. */ +#ifdef AIX + /* `const' makes AIX compiler fail. */ + char *p = pattern; +#else const char *p = pattern; +#endif const char *pend = pattern + size; /* How to translate the characters in the pattern. */ - char *translate = bufp->translate; + RE_TRANSLATE_TYPE translate = bufp->translate; /* Address of the count-byte of the most recently inserted `exactn' command. This makes it possible to tell if a new exact-match @@ -1112,7 +1908,7 @@ const char *beg_interval; /* Address of the place where a forward jump should go to the end of - the containing expression. Each alternative of an `or' -- except the + the containing expression. Each alternative of an `or' -- except the last -- ends with a forward jump of this sort. */ unsigned char *fixup_alt_jump = 0; @@ -1121,6 +1917,9 @@ number is put in the stop_memory as the start_memory. */ regnum_t regnum = 0; + /* Work area for range table of charset. */ + struct range_table_work_area range_table_work; + #ifdef DEBUG DEBUG_PRINT1 ("\nCompiling pattern: "); if (debug) @@ -1128,7 +1927,7 @@ unsigned debug_count; for (debug_count = 0; debug_count < size; debug_count++) - printchar (pattern[debug_count]); + putchar (pattern[debug_count]); putchar ('\n'); } #endif /* DEBUG */ @@ -1141,6 +1940,9 @@ compile_stack.size = INIT_COMPILE_STACK_SIZE; compile_stack.avail = 0; + range_table_work.table = 0; + range_table_work.allocated = 0; + /* Initialize the pattern buffer. */ bufp->syntax = syntax; bufp->fastmap_accurate = 0; @@ -1154,6 +1956,14 @@ /* Always count groups, whether or not bufp->no_sub is set. */ bufp->re_nsub = 0; +#ifdef emacs + /* bufp->multibyte is set before regex_compile is called, so don't alter + it. */ +#else /* not emacs */ + /* Nothing is recognized as a multibyte character. */ + bufp->multibyte = 0; +#endif + #if !defined (emacs) && !defined (SYNTAX_TABLE) /* Initialize the syntax table. */ init_syntax_once (); @@ -1163,15 +1973,15 @@ { if (bufp->buffer) { /* If zero allocated, but buffer is non-null, try to realloc - enough space. This loses if buffer's address is bogus, but - that is the user's responsibility. */ - RETALLOC (bufp->buffer, INIT_BUF_SIZE, unsigned char); - } + enough space. This loses if buffer's address is bogus, but + that is the user's responsibility. */ + RETALLOC (bufp->buffer, INIT_BUF_SIZE, unsigned char); + } else - { /* Caller did not allocate a buffer. Do it for them. */ - bufp->buffer = TALLOC (INIT_BUF_SIZE, unsigned char); - } - if (!bufp->buffer) return REG_ESPACE; + { /* Caller did not allocate a buffer. Do it for them. */ + bufp->buffer = TALLOC (INIT_BUF_SIZE, unsigned char); + } + if (!bufp->buffer) FREE_STACK_RETURN (REG_ESPACE); bufp->allocated = INIT_BUF_SIZE; } @@ -1184,1377 +1994,1167 @@ PATFETCH (c); switch (c) - { - case '^': - { - if ( /* If at start of pattern, it's an operator. */ - p == pattern + 1 - /* If context independent, it's an operator. */ - || syntax & RE_CONTEXT_INDEP_ANCHORS - /* Otherwise, depends on what's come before. */ - || at_begline_loc_p (pattern, p, syntax)) - BUF_PUSH (begline); - else - goto normal_char; - } - break; + { + case '^': + { + if ( /* If at start of pattern, it's an operator. */ + p == pattern + 1 + /* If context independent, it's an operator. */ + || syntax & RE_CONTEXT_INDEP_ANCHORS + /* Otherwise, depends on what's come before. */ + || at_begline_loc_p (pattern, p, syntax)) + BUF_PUSH (begline); + else + goto normal_char; + } + break; - case '$': - { - if ( /* If at end of pattern, it's an operator. */ - p == pend - /* If context independent, it's an operator. */ - || syntax & RE_CONTEXT_INDEP_ANCHORS - /* Otherwise, depends on what's next. */ - || at_endline_loc_p (p, pend, syntax)) - BUF_PUSH (endline); - else - goto normal_char; - } - break; + case '$': + { + if ( /* If at end of pattern, it's an operator. */ + p == pend + /* If context independent, it's an operator. */ + || syntax & RE_CONTEXT_INDEP_ANCHORS + /* Otherwise, depends on what's next. */ + || at_endline_loc_p (p, pend, syntax)) + BUF_PUSH (endline); + else + goto normal_char; + } + break; case '+': - case '?': - if ((syntax & RE_BK_PLUS_QM) - || (syntax & RE_LIMITED_OPS)) - goto normal_char; - handle_plus: - case '*': - /* If there is no previous pattern... */ - if (!laststart) - { - if (syntax & RE_CONTEXT_INVALID_OPS) - return REG_BADRPT; - else if (!(syntax & RE_CONTEXT_INDEP_OPS)) - goto normal_char; - } + case '?': + if ((syntax & RE_BK_PLUS_QM) + || (syntax & RE_LIMITED_OPS)) + goto normal_char; + handle_plus: + case '*': + /* If there is no previous pattern... */ + if (!laststart) + { + if (syntax & RE_CONTEXT_INVALID_OPS) + FREE_STACK_RETURN (REG_BADRPT); + else if (!(syntax & RE_CONTEXT_INDEP_OPS)) + goto normal_char; + } - { - /* Are we optimizing this jump? */ - boolean keep_string_p = false; - - /* 1 means zero (many) matches is allowed. */ - char zero_times_ok = 0, many_times_ok = 0; - - /* If there is a sequence of repetition chars, collapse it - down to just one (the right one). We can't combine - interval operators with these because of, e.g., `a{2}*', - which should only match an even number of `a's. */ - - for (;;) - { - zero_times_ok |= c != '+'; - many_times_ok |= c != '?'; + { + /* Are we optimizing this jump? */ + boolean keep_string_p = false; - if (p == pend) - break; + /* 1 means zero (many) matches is allowed. */ + char zero_times_ok = 0, many_times_ok = 0; - PATFETCH (c); + /* If there is a sequence of repetition chars, collapse it + down to just one (the right one). We can't combine + interval operators with these because of, e.g., `a{2}*', + which should only match an even number of `a's. */ - if (c == '*' - || (!(syntax & RE_BK_PLUS_QM) && (c == '+' || c == '?'))) - ; - - else if (syntax & RE_BK_PLUS_QM && c == '\\') - { - if (p == pend) return REG_EESCAPE; - - PATFETCH (c1); - if (!(c1 == '+' || c1 == '?')) - { - PATUNFETCH; - PATUNFETCH; - break; - } - - c = c1; - } - else - { - PATUNFETCH; - break; - } + for (;;) + { + zero_times_ok |= c != '+'; + many_times_ok |= c != '?'; + + if (p == pend) + break; + + PATFETCH (c); - /* If we get here, we found another repeat character. */ - } + if (c == '*' + || (!(syntax & RE_BK_PLUS_QM) && (c == '+' || c == '?'))) + ; - /* Star, etc. applied to an empty pattern is equivalent - to an empty pattern. */ - if (!laststart) - break; - - /* Now we know whether or not zero matches is allowed - and also whether or not two or more matches is allowed. */ - if (many_times_ok) - { /* More than one repetition is allowed, so put in at the - end a backward relative jump from `b' to before the next - jump we're going to put in below (which jumps from - laststart to after this jump). - - But if we are at the `*' in the exact sequence `.*\n', - insert an unconditional jump backwards to the ., - instead of the beginning of the loop. This way we only - push a failure point once, instead of every time - through the loop. */ - assert (p - 1 > pattern); - - /* Allocate the space for the jump. */ - GET_BUFFER_SPACE (3); - - /* We know we are not at the first character of the pattern, - because laststart was nonzero. And we've already - incremented `p', by the way, to be the character after - the `*'. Do we have to do something analogous here - for null bytes, because of RE_DOT_NOT_NULL? */ - if (TRANSLATE (*(p - 2)) == TRANSLATE ('.') + else if (syntax & RE_BK_PLUS_QM && c == '\\') + { + if (p == pend) FREE_STACK_RETURN (REG_EESCAPE); + + PATFETCH (c1); + if (!(c1 == '+' || c1 == '?')) + { + PATUNFETCH; + PATUNFETCH; + break; + } + + c = c1; + } + else + { + PATUNFETCH; + break; + } + + /* If we get here, we found another repeat character. */ + } + + /* Star, etc. applied to an empty pattern is equivalent + to an empty pattern. */ + if (!laststart) + break; + + /* Now we know whether or not zero matches is allowed + and also whether or not two or more matches is allowed. */ + if (many_times_ok) + { /* More than one repetition is allowed, so put in at the + end a backward relative jump from `b' to before the next + jump we're going to put in below (which jumps from + laststart to after this jump). + + But if we are at the `*' in the exact sequence `.*\n', + insert an unconditional jump backwards to the ., + instead of the beginning of the loop. This way we only + push a failure point once, instead of every time + through the loop. */ + assert (p - 1 > pattern); + + /* Allocate the space for the jump. */ + GET_BUFFER_SPACE (3); + + /* We know we are not at the first character of the pattern, + because laststart was nonzero. And we've already + incremented `p', by the way, to be the character after + the `*'. Do we have to do something analogous here + for null bytes, because of RE_DOT_NOT_NULL? */ + if (TRANSLATE ((unsigned char)*(p - 2)) == TRANSLATE ('.') && zero_times_ok - && p < pend && TRANSLATE (*p) == TRANSLATE ('\n') - && !(syntax & RE_DOT_NEWLINE)) - { /* We have .*\n. */ - STORE_JUMP (jump, b, laststart); - keep_string_p = true; - } - else - /* Anything else. */ - STORE_JUMP (maybe_pop_jump, b, laststart - 3); - - /* We've added more stuff to the buffer. */ - b += 3; - } - - /* On failure, jump from laststart to b + 3, which will be the - end of the buffer after this jump is inserted. */ - GET_BUFFER_SPACE (3); - INSERT_JUMP (keep_string_p ? on_failure_keep_string_jump - : on_failure_jump, - laststart, b + 3); - pending_exact = 0; - b += 3; - - if (!zero_times_ok) - { - /* At least one repetition is required, so insert a - `dummy_failure_jump' before the initial - `on_failure_jump' instruction of the loop. This - effects a skip over that instruction the first time - we hit that loop. */ - GET_BUFFER_SPACE (3); - INSERT_JUMP (dummy_failure_jump, laststart, laststart + 6); - b += 3; - } - } + && p < pend + && TRANSLATE ((unsigned char)*p) == TRANSLATE ('\n') + && !(syntax & RE_DOT_NEWLINE)) + { /* We have .*\n. */ + STORE_JUMP (jump, b, laststart); + keep_string_p = true; + } + else + /* Anything else. */ + STORE_JUMP (maybe_pop_jump, b, laststart - 3); + + /* We've added more stuff to the buffer. */ + b += 3; + } + + /* On failure, jump from laststart to b + 3, which will be the + end of the buffer after this jump is inserted. */ + GET_BUFFER_SPACE (3); + INSERT_JUMP (keep_string_p ? on_failure_keep_string_jump + : on_failure_jump, + laststart, b + 3); + pending_exact = 0; + b += 3; + + if (!zero_times_ok) + { + /* At least one repetition is required, so insert a + `dummy_failure_jump' before the initial + `on_failure_jump' instruction of the loop. This + effects a skip over that instruction the first time + we hit that loop. */ + GET_BUFFER_SPACE (3); + INSERT_JUMP (dummy_failure_jump, laststart, laststart + 6); + b += 3; + } + } break; case '.': - laststart = b; - BUF_PUSH (anychar); - break; + laststart = b; + BUF_PUSH (anychar); + break; - case '[': - { - boolean had_char_class = false; + case '[': + { + CLEAR_RANGE_TABLE_WORK_USED (range_table_work); - if (p == pend) return REG_EBRACK; + if (p == pend) FREE_STACK_RETURN (REG_EBRACK); - /* Ensure that we have enough space to push a charset: the - opcode, the length count, and the bitset; 34 bytes in all. */ + /* Ensure that we have enough space to push a charset: the + opcode, the length count, and the bitset; 34 bytes in all. */ GET_BUFFER_SPACE (34); - laststart = b; + laststart = b; - /* We test `*p == '^' twice, instead of using an if - statement, so we only need one BUF_PUSH. */ - BUF_PUSH (*p == '^' ? charset_not : charset); - if (*p == '^') - p++; - - /* Remember the first position in the bracket expression. */ - p1 = p; - - /* Push the number of bytes in the bitmap. */ - BUF_PUSH ((1 << BYTEWIDTH) / BYTEWIDTH); - - /* Clear the whole map. */ - bzero (b, (1 << BYTEWIDTH) / BYTEWIDTH); - - /* charset_not matches newline according to a syntax bit. */ - if ((re_opcode_t) b[-2] == charset_not - && (syntax & RE_HAT_LISTS_NOT_NEWLINE)) - SET_LIST_BIT ('\n'); - - /* Read in characters and ranges, setting map bits. */ - for (;;) - { - if (p == pend) return REG_EBRACK; - - PATFETCH (c); - - /* \ might escape characters inside [...] and [^...]. */ - if ((syntax & RE_BACKSLASH_ESCAPE_IN_LISTS) && c == '\\') - { - if (p == pend) return REG_EESCAPE; - - PATFETCH (c1); - SET_LIST_BIT (c1); - continue; - } - - /* Could be the end of the bracket expression. If it's - not (i.e., when the bracket expression is `[]' so - far), the ']' character bit gets set way below. */ - if (c == ']' && p != p1 + 1) - break; + /* We test `*p == '^' twice, instead of using an if + statement, so we only need one BUF_PUSH. */ + BUF_PUSH (*p == '^' ? charset_not : charset); + if (*p == '^') + p++; - /* Look ahead to see if it's a range when the last thing - was a character class. */ - if (had_char_class && c == '-' && *p != ']') - return REG_ERANGE; - - /* Look ahead to see if it's a range when the last thing - was a character: if this is a hyphen not at the - beginning or the end of a list, then it's the range - operator. */ - if (c == '-' - && !(p - 2 >= pattern && p[-2] == '[') - && !(p - 3 >= pattern && p[-3] == '[' && p[-2] == '^') - && *p != ']') - { - reg_errcode_t ret - = compile_range (&p, pend, translate, syntax, b); - if (ret != REG_NOERROR) return ret; - } - - else if (p[0] == '-' && p[1] != ']') - { /* This handles ranges made up of characters only. */ - reg_errcode_t ret; - - /* Move past the `-'. */ - PATFETCH (c1); - - ret = compile_range (&p, pend, translate, syntax, b); - if (ret != REG_NOERROR) return ret; - } - - /* See if we're at the beginning of a possible character - class. */ - - else if (syntax & RE_CHAR_CLASSES && c == '[' && *p == ':') - { /* Leave room for the null. */ - char str[CHAR_CLASS_MAX_LENGTH + 1]; - - PATFETCH (c); - c1 = 0; - - /* If pattern is `[[:'. */ - if (p == pend) return REG_EBRACK; - - for (;;) - { - PATFETCH (c); - if (c == ':' || c == ']' || p == pend - || c1 == CHAR_CLASS_MAX_LENGTH) - break; - str[c1++] = c; - } - str[c1] = '\0'; - - /* If isn't a word bracketed by `[:' and:`]': - undo the ending character, the letters, and leave - the leading `:' and `[' (but set bits for them). */ - if (c == ':' && *p == ']') - { - int ch; - boolean is_alnum = STREQ (str, "alnum"); - boolean is_alpha = STREQ (str, "alpha"); - boolean is_blank = STREQ (str, "blank"); - boolean is_cntrl = STREQ (str, "cntrl"); - boolean is_digit = STREQ (str, "digit"); - boolean is_graph = STREQ (str, "graph"); - boolean is_lower = STREQ (str, "lower"); - boolean is_print = STREQ (str, "print"); - boolean is_punct = STREQ (str, "punct"); - boolean is_space = STREQ (str, "space"); - boolean is_upper = STREQ (str, "upper"); - boolean is_xdigit = STREQ (str, "xdigit"); - - if (!IS_CHAR_CLASS (str)) return REG_ECTYPE; - - /* Throw away the ] at the end of the character - class. */ - PATFETCH (c); - - if (p == pend) return REG_EBRACK; - - for (ch = 0; ch < 1 << BYTEWIDTH; ch++) - { - if ( (is_alnum && ISALNUM (ch)) - || (is_alpha && ISALPHA (ch)) - || (is_blank && ISBLANK (ch)) - || (is_cntrl && ISCNTRL (ch)) - || (is_digit && ISDIGIT (ch)) - || (is_graph && ISGRAPH (ch)) - || (is_lower && ISLOWER (ch)) - || (is_print && ISPRINT (ch)) - || (is_punct && ISPUNCT (ch)) - || (is_space && ISSPACE (ch)) - || (is_upper && ISUPPER (ch)) - || (is_xdigit && ISXDIGIT (ch))) - SET_LIST_BIT (ch); - } - had_char_class = true; - } - else - { - c1++; - while (c1--) - PATUNFETCH; - SET_LIST_BIT ('['); - SET_LIST_BIT (':'); - had_char_class = false; - } - } - else - { - had_char_class = false; - SET_LIST_BIT (c); - } - } - - /* Discard any (non)matching list bytes that are all 0 at the - end of the map. Decrease the map-length byte too. */ - while ((int) b[-1] > 0 && b[b[-1] - 1] == 0) - b[-1]--; - b += b[-1]; - } - break; + /* Remember the first position in the bracket expression. */ + p1 = p; + /* Push the number of bytes in the bitmap. */ + BUF_PUSH ((1 << BYTEWIDTH) / BYTEWIDTH); - case '(': - if (syntax & RE_NO_BK_PARENS) - goto handle_open; - else - goto normal_char; - - - case ')': - if (syntax & RE_NO_BK_PARENS) - goto handle_close; - else - goto normal_char; - - - case '\n': - if (syntax & RE_NEWLINE_ALT) - goto handle_alt; - else - goto normal_char; + /* Clear the whole map. */ + bzero (b, (1 << BYTEWIDTH) / BYTEWIDTH); + /* charset_not matches newline according to a syntax bit. */ + if ((re_opcode_t) b[-2] == charset_not + && (syntax & RE_HAT_LISTS_NOT_NEWLINE)) + SET_LIST_BIT ('\n'); - case '|': - if (syntax & RE_NO_BK_VBAR) - goto handle_alt; - else - goto normal_char; + /* Read in characters and ranges, setting map bits. */ + for (;;) + { + int len; + boolean escaped_char = false; + if (p == pend) FREE_STACK_RETURN (REG_EBRACK); - case '{': - if (syntax & RE_INTERVALS && syntax & RE_NO_BK_BRACES) - goto handle_interval; - else - goto normal_char; + PATFETCH (c); + /* \ might escape characters inside [...] and [^...]. */ + if ((syntax & RE_BACKSLASH_ESCAPE_IN_LISTS) && c == '\\') + { + if (p == pend) FREE_STACK_RETURN (REG_EESCAPE); - case '\\': - if (p == pend) return REG_EESCAPE; + PATFETCH (c); + escaped_char = true; + } + else + { + /* Could be the end of the bracket expression. If it's + not (i.e., when the bracket expression is `[]' so + far), the ']' character bit gets set way below. */ + if (c == ']' && p != p1 + 1) + break; + } - /* Do not translate the character after the \, so that we can - distinguish, e.g., \B from \b, even if we normally would - translate, e.g., B to b. */ - PATFETCH_RAW (c); + /* If C indicates start of multibyte char, get the + actual character code in C, and set the pattern + pointer P to the next character boundary. */ + if (bufp->multibyte && BASE_LEADING_CODE_P (c)) + { + PATUNFETCH; + c = STRING_CHAR_AND_LENGTH (p, pend - p, len); + p += len; + } + /* What should we do for the character which is + greater than 0x7F, but not BASE_LEADING_CODE_P? + XXX */ - switch (c) - { - case '(': - if (syntax & RE_NO_BK_PARENS) - goto normal_backslash; - - handle_open: - bufp->re_nsub++; - regnum++; + /* See if we're at the beginning of a possible character + class. */ - if (COMPILE_STACK_FULL) - { - RETALLOC (compile_stack.stack, compile_stack.size << 1, - compile_stack_elt_t); - if (compile_stack.stack == NULL) return REG_ESPACE; + else if (!escaped_char && + syntax & RE_CHAR_CLASSES && c == '[' && *p == ':') + { + /* Leave room for the null. */ + char str[CHAR_CLASS_MAX_LENGTH + 1]; - compile_stack.size <<= 1; - } + PATFETCH (c); + c1 = 0; - /* These are the values to restore when we hit end of this - group. They are all relative offsets, so that if the - whole pattern moves because of realloc, they will still - be valid. */ - COMPILE_STACK_TOP.begalt_offset = begalt - bufp->buffer; - COMPILE_STACK_TOP.fixup_alt_jump - = fixup_alt_jump ? fixup_alt_jump - bufp->buffer + 1 : 0; - COMPILE_STACK_TOP.laststart_offset = b - bufp->buffer; - COMPILE_STACK_TOP.regnum = regnum; - - /* We will eventually replace the 0 with the number of - groups inner to this one. But do not push a - start_memory for groups beyond the last one we can - represent in the compiled pattern. */ - if (regnum <= MAX_REGNUM) - { - COMPILE_STACK_TOP.inner_group_offset = b - bufp->buffer + 2; - BUF_PUSH_3 (start_memory, regnum, 0); - } + /* If pattern is `[[:'. */ + if (p == pend) FREE_STACK_RETURN (REG_EBRACK); - compile_stack.avail++; + for (;;) + { + PATFETCH (c); + if (c == ':' || c == ']' || p == pend + || c1 == CHAR_CLASS_MAX_LENGTH) + break; + str[c1++] = c; + } + str[c1] = '\0'; + + /* If isn't a word bracketed by `[:' and `:]': + undo the ending character, the letters, and + leave the leading `:' and `[' (but set bits for + them). */ + if (c == ':' && *p == ']') + { + int ch; + boolean is_alnum = STREQ (str, "alnum"); + boolean is_alpha = STREQ (str, "alpha"); + boolean is_blank = STREQ (str, "blank"); + boolean is_cntrl = STREQ (str, "cntrl"); + boolean is_digit = STREQ (str, "digit"); + boolean is_graph = STREQ (str, "graph"); + boolean is_lower = STREQ (str, "lower"); + boolean is_print = STREQ (str, "print"); + boolean is_punct = STREQ (str, "punct"); + boolean is_space = STREQ (str, "space"); + boolean is_upper = STREQ (str, "upper"); + boolean is_xdigit = STREQ (str, "xdigit"); + + if (!IS_CHAR_CLASS (str)) + FREE_STACK_RETURN (REG_ECTYPE); + + /* Throw away the ] at the end of the character + class. */ + PATFETCH (c); + + if (p == pend) FREE_STACK_RETURN (REG_EBRACK); + + for (ch = 0; ch < 1 << BYTEWIDTH; ch++) + { + int translated = TRANSLATE (ch); + /* This was split into 3 if's to + avoid an arbitrary limit in some compiler. */ + if ( (is_alnum && ISALNUM (ch)) + || (is_alpha && ISALPHA (ch)) + || (is_blank && ISBLANK (ch)) + || (is_cntrl && ISCNTRL (ch))) + SET_LIST_BIT (translated); + if ( (is_digit && ISDIGIT (ch)) + || (is_graph && ISGRAPH (ch)) + || (is_lower && ISLOWER (ch)) + || (is_print && ISPRINT (ch))) + SET_LIST_BIT (translated); + if ( (is_punct && ISPUNCT (ch)) + || (is_space && ISSPACE (ch)) + || (is_upper && ISUPPER (ch)) + || (is_xdigit && ISXDIGIT (ch))) + SET_LIST_BIT (translated); + } + + /* Repeat the loop. */ + continue; + } + else + { + c1++; + while (c1--) + PATUNFETCH; + SET_LIST_BIT ('['); + + /* Because the `:' may starts the range, we + can't simply set bit and repeat the loop. + Instead, just set it to C and handle below. */ + c = ':'; + } + } - fixup_alt_jump = 0; - laststart = 0; - begalt = b; - /* If we've reached MAX_REGNUM groups, then this open - won't actually generate any code, so we'll have to - clear pending_exact explicitly. */ - pending_exact = 0; - break; + if (p < pend && p[0] == '-' && p[1] != ']') + { + /* Discard the `-'. */ + PATFETCH (c1); - case ')': - if (syntax & RE_NO_BK_PARENS) goto normal_backslash; + /* Fetch the character which ends the range. */ + PATFETCH (c1); + if (bufp->multibyte && BASE_LEADING_CODE_P (c1)) + { + PATUNFETCH; + c1 = STRING_CHAR_AND_LENGTH (p, pend - p, len); + p += len; + } + + if (SINGLE_BYTE_CHAR_P (c) + && ! SINGLE_BYTE_CHAR_P (c1)) + { + /* Handle a range such as \177-\377 in multibyte mode. + Split that into two ranges,, + the low one ending at 0237, and the high one + starting at ...040. */ + int c1_base = (c1 & ~0177) | 040; + SET_RANGE_TABLE_WORK_AREA (range_table_work, c, c1); + c1 = 0237; + } + else if (!SAME_CHARSET_P (c, c1)) + FREE_STACK_RETURN (REG_ERANGE); + } + else + /* Range from C to C. */ + c1 = c; + + /* Set the range ... */ + if (SINGLE_BYTE_CHAR_P (c)) + /* ... into bitmap. */ + { + unsigned this_char; + int range_start = c, range_end = c1; - if (COMPILE_STACK_EMPTY) { - if (syntax & RE_UNMATCHED_RIGHT_PAREN_ORD) - goto normal_backslash; - else - return REG_ERPAREN; - } - - handle_close: - if (fixup_alt_jump) - { /* Push a dummy failure point at the end of the - alternative for a possible future - `pop_failure_jump' to pop. See comments at - `push_dummy_failure' in `re_match_2'. */ - BUF_PUSH (push_dummy_failure); - - /* We allocated space for this jump when we assigned - to `fixup_alt_jump', in the `handle_alt' case below. */ - STORE_JUMP (jump_past_alt, fixup_alt_jump, b - 1); - } + /* If the start is after the end, the range is empty. */ + if (range_start > range_end) + { + if (syntax & RE_NO_EMPTY_RANGES) + FREE_STACK_RETURN (REG_ERANGE); + /* Else, repeat the loop. */ + } + else + { + for (this_char = range_start; this_char <= range_end; + this_char++) + SET_LIST_BIT (TRANSLATE (this_char)); + } + } + else + /* ... into range table. */ + SET_RANGE_TABLE_WORK_AREA (range_table_work, c, c1); + } - /* See similar code for backslashed left paren above. */ - if (COMPILE_STACK_EMPTY) { - if (syntax & RE_UNMATCHED_RIGHT_PAREN_ORD) - goto normal_char; - else - return REG_ERPAREN; - } - - /* Since we just checked for an empty stack above, this - ``can't happen''. */ - assert (compile_stack.avail != 0); - { - /* We don't just want to restore into `regnum', because - later groups should continue to be numbered higher, - as in `(ab)c(de)' -- the second group is #2. */ - regnum_t this_group_regnum; - - compile_stack.avail--; - begalt = bufp->buffer + COMPILE_STACK_TOP.begalt_offset; - fixup_alt_jump - = COMPILE_STACK_TOP.fixup_alt_jump - ? bufp->buffer + COMPILE_STACK_TOP.fixup_alt_jump - 1 - : 0; - laststart = bufp->buffer + COMPILE_STACK_TOP.laststart_offset; - this_group_regnum = COMPILE_STACK_TOP.regnum; - /* If we've reached MAX_REGNUM groups, then this open - won't actually generate any code, so we'll have to - clear pending_exact explicitly. */ - pending_exact = 0; + /* Discard any (non)matching list bytes that are all 0 at the + end of the map. Decrease the map-length byte too. */ + while ((int) b[-1] > 0 && b[b[-1] - 1] == 0) + b[-1]--; + b += b[-1]; - /* We're at the end of the group, so now we know how many - groups were inside this one. */ - if (this_group_regnum <= MAX_REGNUM) - { - unsigned char *inner_group_loc - = bufp->buffer + COMPILE_STACK_TOP.inner_group_offset; - - *inner_group_loc = regnum - this_group_regnum; - BUF_PUSH_3 (stop_memory, this_group_regnum, - regnum - this_group_regnum); - } - } - break; - - - case '|': /* `\|'. */ - if (syntax & RE_LIMITED_OPS || syntax & RE_NO_BK_VBAR) - goto normal_backslash; - handle_alt: - if (syntax & RE_LIMITED_OPS) - goto normal_char; - - /* Insert before the previous alternative a jump which - jumps to this alternative if the former fails. */ - GET_BUFFER_SPACE (3); - INSERT_JUMP (on_failure_jump, begalt, b + 6); - pending_exact = 0; - b += 3; - - /* The alternative before this one has a jump after it - which gets executed if it gets matched. Adjust that - jump so it will jump to this alternative's analogous - jump (put in below, which in turn will jump to the next - (if any) alternative's such jump, etc.). The last such - jump jumps to the correct final destination. A picture: - _____ _____ - | | | | - | v | v - a | b | c - - If we are at `b', then fixup_alt_jump right now points to a - three-byte space after `a'. We'll put in the jump, set - fixup_alt_jump to right after `b', and leave behind three - bytes which we'll fill in when we get to after `c'. */ - - if (fixup_alt_jump) - STORE_JUMP (jump_past_alt, fixup_alt_jump, b); - - /* Mark and leave space for a jump after this alternative, - to be filled in later either by next alternative or - when know we're at the end of a series of alternatives. */ - fixup_alt_jump = b; - GET_BUFFER_SPACE (3); - b += 3; - - laststart = 0; - begalt = b; - break; - - - case '{': - /* If \{ is a literal. */ - if (!(syntax & RE_INTERVALS) - /* If we're at `\{' and it's not the open-interval - operator. */ - || ((syntax & RE_INTERVALS) && (syntax & RE_NO_BK_BRACES)) - || (p - 2 == pattern && p == pend)) - goto normal_backslash; - - handle_interval: - { - /* If got here, then the syntax allows intervals. */ - - /* At least (most) this many matches must be made. */ - int lower_bound = -1, upper_bound = -1; - - beg_interval = p - 1; - - if (p == pend) - { - if (syntax & RE_NO_BK_BRACES) - goto unfetch_interval; - else - return REG_EBRACE; - } - - GET_UNSIGNED_NUMBER (lower_bound); - - if (c == ',') - { - GET_UNSIGNED_NUMBER (upper_bound); - if (upper_bound < 0) upper_bound = RE_DUP_MAX; - } - else - /* Interval such as `{1}' => match exactly once. */ - upper_bound = lower_bound; - - if (lower_bound < 0 || upper_bound > RE_DUP_MAX - || lower_bound > upper_bound) - { - if (syntax & RE_NO_BK_BRACES) - goto unfetch_interval; - else - return REG_BADBR; - } - - if (!(syntax & RE_NO_BK_BRACES)) - { - if (c != '\\') return REG_EBRACE; - - PATFETCH (c); - } - - if (c != '}') - { - if (syntax & RE_NO_BK_BRACES) - goto unfetch_interval; - else - return REG_BADBR; - } - - /* We just parsed a valid interval. */ - - /* If it's invalid to have no preceding re. */ - if (!laststart) - { - if (syntax & RE_CONTEXT_INVALID_OPS) - return REG_BADRPT; - else if (syntax & RE_CONTEXT_INDEP_OPS) - laststart = b; - else - goto unfetch_interval; - } - - /* If the upper bound is zero, don't want to succeed at - all; jump from `laststart' to `b + 3', which will be - the end of the buffer after we insert the jump. */ - if (upper_bound == 0) - { - GET_BUFFER_SPACE (3); - INSERT_JUMP (jump, laststart, b + 3); - b += 3; - } - - /* Otherwise, we have a nontrivial interval. When - we're all done, the pattern will look like: - set_number_at - set_number_at - succeed_n - - jump_n - (The upper bound and `jump_n' are omitted if - `upper_bound' is 1, though.) */ - else - { /* If the upper bound is > 1, we need to insert - more at the end of the loop. */ - unsigned nbytes = 10 + (upper_bound > 1) * 10; - - GET_BUFFER_SPACE (nbytes); - - /* Initialize lower bound of the `succeed_n', even - though it will be set during matching by its - attendant `set_number_at' (inserted next), - because `re_compile_fastmap' needs to know. - Jump to the `jump_n' we might insert below. */ - INSERT_JUMP2 (succeed_n, laststart, - b + 5 + (upper_bound > 1) * 5, - lower_bound); - b += 5; - - /* Code to initialize the lower bound. Insert - before the `succeed_n'. The `5' is the last two - bytes of this `set_number_at', plus 3 bytes of - the following `succeed_n'. */ - insert_op2 (set_number_at, laststart, 5, lower_bound, b); - b += 5; - - if (upper_bound > 1) - { /* More than one repetition is allowed, so - append a backward jump to the `succeed_n' - that starts this interval. - - When we've reached this during matching, - we'll have matched the interval once, so - jump back only `upper_bound - 1' times. */ - STORE_JUMP2 (jump_n, b, laststart + 5, - upper_bound - 1); - b += 5; - - /* The location we want to set is the second - parameter of the `jump_n'; that is `b-2' as - an absolute address. `laststart' will be - the `set_number_at' we're about to insert; - `laststart+3' the number to set, the source - for the relative address. But we are - inserting into the middle of the pattern -- - so everything is getting moved up by 5. - Conclusion: (b - 2) - (laststart + 3) + 5, - i.e., b - laststart. - - We insert this at the beginning of the loop - so that if we fail during matching, we'll - reinitialize the bounds. */ - insert_op2 (set_number_at, laststart, b - laststart, - upper_bound - 1, b); - b += 5; - } - } - pending_exact = 0; - beg_interval = NULL; - } - break; - - unfetch_interval: - /* If an invalid interval, match the characters as literals. */ - assert (beg_interval); - p = beg_interval; - beg_interval = NULL; - - /* normal_char and normal_backslash need `c'. */ - PATFETCH (c); - - if (!(syntax & RE_NO_BK_BRACES)) - { - if (p > pattern && p[-1] == '\\') - goto normal_backslash; - } - goto normal_char; + /* Build real range table from work area. */ + if (RANGE_TABLE_WORK_USED (range_table_work)) + { + int i; + int used = RANGE_TABLE_WORK_USED (range_table_work); -#ifdef emacs - /* There is no way to specify the before_dot and after_dot - operators. rms says this is ok. --karl */ - case '=': - BUF_PUSH (at_dot); - break; - - case 's': - laststart = b; - PATFETCH (c); - BUF_PUSH_2 (syntaxspec, syntax_spec_code[c]); - break; - - case 'S': - laststart = b; - PATFETCH (c); - BUF_PUSH_2 (notsyntaxspec, syntax_spec_code[c]); - break; -#endif /* emacs */ + /* Allocate space for COUNT + RANGE_TABLE. Needs two + bytes for COUNT and three bytes for each character. */ + GET_BUFFER_SPACE (2 + used * 3); + + /* Indicate the existence of range table. */ + laststart[1] |= 0x80; + + STORE_NUMBER_AND_INCR (b, used / 2); + for (i = 0; i < used; i++) + STORE_CHARACTER_AND_INCR + (b, RANGE_TABLE_WORK_ELT (range_table_work, i)); + } + } + break; - case 'w': - laststart = b; - BUF_PUSH (wordchar); - break; - - - case 'W': - laststart = b; - BUF_PUSH (notwordchar); - break; - - - case '<': - BUF_PUSH (wordbeg); - break; - - case '>': - BUF_PUSH (wordend); - break; - - case 'b': - BUF_PUSH (wordbound); - break; - - case 'B': - BUF_PUSH (notwordbound); - break; - - case '`': - BUF_PUSH (begbuf); - break; - - case '\'': - BUF_PUSH (endbuf); - break; - - case '1': case '2': case '3': case '4': case '5': - case '6': case '7': case '8': case '9': - if (syntax & RE_NO_BK_REFS) - goto normal_char; - - c1 = c - '0'; - - if (c1 > regnum) - return REG_ESUBREG; - - /* Can't back reference to a subexpression if inside of it. */ - if (group_in_compile_stack (compile_stack, c1)) - goto normal_char; - - laststart = b; - BUF_PUSH_2 (duplicate, c1); - break; - - - case '+': - case '?': - if (syntax & RE_BK_PLUS_QM) - goto handle_plus; - else - goto normal_backslash; - - default: - normal_backslash: - /* You might think it would be useful for \ to mean - not to translate; but if we don't translate it - it will never match anything. */ - c = TRANSLATE (c); - goto normal_char; - } - break; + case '(': + if (syntax & RE_NO_BK_PARENS) + goto handle_open; + else + goto normal_char; - default: - /* Expects the character in `c'. */ - normal_char: - /* If no exactn currently being built. */ - if (!pending_exact + case ')': + if (syntax & RE_NO_BK_PARENS) + goto handle_close; + else + goto normal_char; + - /* If last exactn not at current position. */ - || pending_exact + *pending_exact + 1 != b + case '\n': + if (syntax & RE_NEWLINE_ALT) + goto handle_alt; + else + goto normal_char; - /* We have only one byte following the exactn for the count. */ - || *pending_exact == (1 << BYTEWIDTH) - 1 - /* If followed by a repetition operator. */ - || *p == '*' || *p == '^' - || ((syntax & RE_BK_PLUS_QM) - ? *p == '\\' && (p[1] == '+' || p[1] == '?') - : (*p == '+' || *p == '?')) - || ((syntax & RE_INTERVALS) - && ((syntax & RE_NO_BK_BRACES) - ? *p == '{' - : (p[0] == '\\' && p[1] == '{')))) + case '|': + if (syntax & RE_NO_BK_VBAR) + goto handle_alt; + else + goto normal_char; + + + case '{': + if (syntax & RE_INTERVALS && syntax & RE_NO_BK_BRACES) + goto handle_interval; + else + goto normal_char; + + + case '\\': + if (p == pend) FREE_STACK_RETURN (REG_EESCAPE); + + /* Do not translate the character after the \, so that we can + distinguish, e.g., \B from \b, even if we normally would + translate, e.g., B to b. */ + PATFETCH_RAW (c); + + switch (c) { - /* Start building a new exactn. */ + case '(': + if (syntax & RE_NO_BK_PARENS) + goto normal_backslash; + + handle_open: + bufp->re_nsub++; + regnum++; - laststart = b; + if (COMPILE_STACK_FULL) + { + RETALLOC (compile_stack.stack, compile_stack.size << 1, + compile_stack_elt_t); + if (compile_stack.stack == NULL) return REG_ESPACE; - BUF_PUSH_2 (exactn, 0); - pending_exact = b - 1; - } + compile_stack.size <<= 1; + } - BUF_PUSH (c); - (*pending_exact)++; - break; - } /* switch (c) */ - } /* while p != pend */ + /* These are the values to restore when we hit end of this + group. They are all relative offsets, so that if the + whole pattern moves because of realloc, they will still + be valid. */ + COMPILE_STACK_TOP.begalt_offset = begalt - bufp->buffer; + COMPILE_STACK_TOP.fixup_alt_jump + = fixup_alt_jump ? fixup_alt_jump - bufp->buffer + 1 : 0; + COMPILE_STACK_TOP.laststart_offset = b - bufp->buffer; + COMPILE_STACK_TOP.regnum = regnum; + + /* We will eventually replace the 0 with the number of + groups inner to this one. But do not push a + start_memory for groups beyond the last one we can + represent in the compiled pattern. */ + if (regnum <= MAX_REGNUM) + { + COMPILE_STACK_TOP.inner_group_offset = b - bufp->buffer + 2; + BUF_PUSH_3 (start_memory, regnum, 0); + } + compile_stack.avail++; - /* Through the pattern now. */ + fixup_alt_jump = 0; + laststart = 0; + begalt = b; + /* If we've reached MAX_REGNUM groups, then this open + won't actually generate any code, so we'll have to + clear pending_exact explicitly. */ + pending_exact = 0; + break; - if (fixup_alt_jump) - STORE_JUMP (jump_past_alt, fixup_alt_jump, b); - if (!COMPILE_STACK_EMPTY) - return REG_EPAREN; + case ')': + if (syntax & RE_NO_BK_PARENS) goto normal_backslash; - free (compile_stack.stack); + if (COMPILE_STACK_EMPTY) + if (syntax & RE_UNMATCHED_RIGHT_PAREN_ORD) + goto normal_backslash; + else + FREE_STACK_RETURN (REG_ERPAREN); + + handle_close: + if (fixup_alt_jump) + { /* Push a dummy failure point at the end of the + alternative for a possible future + `pop_failure_jump' to pop. See comments at + `push_dummy_failure' in `re_match_2'. */ + BUF_PUSH (push_dummy_failure); + + /* We allocated space for this jump when we assigned + to `fixup_alt_jump', in the `handle_alt' case below. */ + STORE_JUMP (jump_past_alt, fixup_alt_jump, b - 1); + } - /* We have succeeded; set the length of the buffer. */ - bufp->used = b - bufp->buffer; + /* See similar code for backslashed left paren above. */ + if (COMPILE_STACK_EMPTY) + if (syntax & RE_UNMATCHED_RIGHT_PAREN_ORD) + goto normal_char; + else + FREE_STACK_RETURN (REG_ERPAREN); + + /* Since we just checked for an empty stack above, this + ``can't happen''. */ + assert (compile_stack.avail != 0); + { + /* We don't just want to restore into `regnum', because + later groups should continue to be numbered higher, + as in `(ab)c(de)' -- the second group is #2. */ + regnum_t this_group_regnum; + + compile_stack.avail--; + begalt = bufp->buffer + COMPILE_STACK_TOP.begalt_offset; + fixup_alt_jump + = COMPILE_STACK_TOP.fixup_alt_jump + ? bufp->buffer + COMPILE_STACK_TOP.fixup_alt_jump - 1 + : 0; + laststart = bufp->buffer + COMPILE_STACK_TOP.laststart_offset; + this_group_regnum = COMPILE_STACK_TOP.regnum; + /* If we've reached MAX_REGNUM groups, then this open + won't actually generate any code, so we'll have to + clear pending_exact explicitly. */ + pending_exact = 0; -#ifdef DEBUG - if (debug) - { - DEBUG_PRINT1 ("\nCompiled pattern: "); - print_compiled_pattern (bufp); - } -#endif /* DEBUG */ + /* We're at the end of the group, so now we know how many + groups were inside this one. */ + if (this_group_regnum <= MAX_REGNUM) + { + unsigned char *inner_group_loc + = bufp->buffer + COMPILE_STACK_TOP.inner_group_offset; - return REG_NOERROR; -} /* regex_compile */ - -/* Subroutines for `regex_compile'. */ + *inner_group_loc = regnum - this_group_regnum; + BUF_PUSH_3 (stop_memory, this_group_regnum, + regnum - this_group_regnum); + } + } + break; -/* Store OP at LOC followed by two-byte integer parameter ARG. */ -static void -store_op1 (op, loc, arg) - re_opcode_t op; - unsigned char *loc; - int arg; -{ - *loc = (unsigned char) op; - STORE_NUMBER (loc + 1, arg); -} + case '|': /* `\|'. */ + if (syntax & RE_LIMITED_OPS || syntax & RE_NO_BK_VBAR) + goto normal_backslash; + handle_alt: + if (syntax & RE_LIMITED_OPS) + goto normal_char; + + /* Insert before the previous alternative a jump which + jumps to this alternative if the former fails. */ + GET_BUFFER_SPACE (3); + INSERT_JUMP (on_failure_jump, begalt, b + 6); + pending_exact = 0; + b += 3; + /* The alternative before this one has a jump after it + which gets executed if it gets matched. Adjust that + jump so it will jump to this alternative's analogous + jump (put in below, which in turn will jump to the next + (if any) alternative's such jump, etc.). The last such + jump jumps to the correct final destination. A picture: + _____ _____ + | | | | + | v | v + a | b | c + + If we are at `b', then fixup_alt_jump right now points to a + three-byte space after `a'. We'll put in the jump, set + fixup_alt_jump to right after `b', and leave behind three + bytes which we'll fill in when we get to after `c'. */ + + if (fixup_alt_jump) + STORE_JUMP (jump_past_alt, fixup_alt_jump, b); + + /* Mark and leave space for a jump after this alternative, + to be filled in later either by next alternative or + when know we're at the end of a series of alternatives. */ + fixup_alt_jump = b; + GET_BUFFER_SPACE (3); + b += 3; + + laststart = 0; + begalt = b; + break; + + + case '{': + /* If \{ is a literal. */ + if (!(syntax & RE_INTERVALS) + /* If we're at `\{' and it's not the open-interval + operator. */ + || ((syntax & RE_INTERVALS) && (syntax & RE_NO_BK_BRACES)) + || (p - 2 == pattern && p == pend)) + goto normal_backslash; -/* Like `store_op1', but for two two-byte parameters ARG1 and ARG2. */ + handle_interval: + { + /* If got here, then the syntax allows intervals. */ -static void -store_op2 (op, loc, arg1, arg2) - re_opcode_t op; - unsigned char *loc; - int arg1, arg2; -{ - *loc = (unsigned char) op; - STORE_NUMBER (loc + 1, arg1); - STORE_NUMBER (loc + 3, arg2); -} + /* At least (most) this many matches must be made. */ + int lower_bound = -1, upper_bound = -1; + beg_interval = p - 1; -/* Copy the bytes from LOC to END to open up three bytes of space at LOC - for OP followed by two-byte integer parameter ARG. */ + if (p == pend) + { + if (syntax & RE_NO_BK_BRACES) + goto unfetch_interval; + else + FREE_STACK_RETURN (REG_EBRACE); + } -static void -insert_op1 (op, loc, arg, end) - re_opcode_t op; - unsigned char *loc; - int arg; - unsigned char *end; -{ - register unsigned char *pfrom = end; - register unsigned char *pto = end + 3; + GET_UNSIGNED_NUMBER (lower_bound); - while (pfrom != loc) - *--pto = *--pfrom; + if (c == ',') + { + GET_UNSIGNED_NUMBER (upper_bound); + if (upper_bound < 0) upper_bound = RE_DUP_MAX; + } + else + /* Interval such as `{1}' => match exactly once. */ + upper_bound = lower_bound; - store_op1 (op, loc, arg); -} + if (lower_bound < 0 || upper_bound > RE_DUP_MAX + || lower_bound > upper_bound) + { + if (syntax & RE_NO_BK_BRACES) + goto unfetch_interval; + else + FREE_STACK_RETURN (REG_BADBR); + } + if (!(syntax & RE_NO_BK_BRACES)) + { + if (c != '\\') FREE_STACK_RETURN (REG_EBRACE); -/* Like `insert_op1', but for two two-byte parameters ARG1 and ARG2. */ + PATFETCH (c); + } -static void -insert_op2 (op, loc, arg1, arg2, end) - re_opcode_t op; - unsigned char *loc; - int arg1, arg2; - unsigned char *end; -{ - register unsigned char *pfrom = end; - register unsigned char *pto = end + 5; + if (c != '}') + { + if (syntax & RE_NO_BK_BRACES) + goto unfetch_interval; + else + FREE_STACK_RETURN (REG_BADBR); + } - while (pfrom != loc) - *--pto = *--pfrom; + /* We just parsed a valid interval. */ - store_op2 (op, loc, arg1, arg2); -} + /* If it's invalid to have no preceding re. */ + if (!laststart) + { + if (syntax & RE_CONTEXT_INVALID_OPS) + FREE_STACK_RETURN (REG_BADRPT); + else if (syntax & RE_CONTEXT_INDEP_OPS) + laststart = b; + else + goto unfetch_interval; + } + + /* If the upper bound is zero, don't want to succeed at + all; jump from `laststart' to `b + 3', which will be + the end of the buffer after we insert the jump. */ + if (upper_bound == 0) + { + GET_BUFFER_SPACE (3); + INSERT_JUMP (jump, laststart, b + 3); + b += 3; + } + + /* Otherwise, we have a nontrivial interval. When + we're all done, the pattern will look like: + set_number_at + set_number_at + succeed_n + + jump_n + (The upper bound and `jump_n' are omitted if + `upper_bound' is 1, though.) */ + else + { /* If the upper bound is > 1, we need to insert + more at the end of the loop. */ + unsigned nbytes = 10 + (upper_bound > 1) * 10; + + GET_BUFFER_SPACE (nbytes); + + /* Initialize lower bound of the `succeed_n', even + though it will be set during matching by its + attendant `set_number_at' (inserted next), + because `re_compile_fastmap' needs to know. + Jump to the `jump_n' we might insert below. */ + INSERT_JUMP2 (succeed_n, laststart, + b + 5 + (upper_bound > 1) * 5, + lower_bound); + b += 5; + + /* Code to initialize the lower bound. Insert + before the `succeed_n'. The `5' is the last two + bytes of this `set_number_at', plus 3 bytes of + the following `succeed_n'. */ + insert_op2 (set_number_at, laststart, 5, lower_bound, b); + b += 5; + + if (upper_bound > 1) + { /* More than one repetition is allowed, so + append a backward jump to the `succeed_n' + that starts this interval. + + When we've reached this during matching, + we'll have matched the interval once, so + jump back only `upper_bound - 1' times. */ + STORE_JUMP2 (jump_n, b, laststart + 5, + upper_bound - 1); + b += 5; + + /* The location we want to set is the second + parameter of the `jump_n'; that is `b-2' as + an absolute address. `laststart' will be + the `set_number_at' we're about to insert; + `laststart+3' the number to set, the source + for the relative address. But we are + inserting into the middle of the pattern -- + so everything is getting moved up by 5. + Conclusion: (b - 2) - (laststart + 3) + 5, + i.e., b - laststart. + + We insert this at the beginning of the loop + so that if we fail during matching, we'll + reinitialize the bounds. */ + insert_op2 (set_number_at, laststart, b - laststart, + upper_bound - 1, b); + b += 5; + } + } + pending_exact = 0; + beg_interval = NULL; + } + break; + + unfetch_interval: + /* If an invalid interval, match the characters as literals. */ + assert (beg_interval); + p = beg_interval; + beg_interval = NULL; + + /* normal_char and normal_backslash need `c'. */ + PATFETCH (c); + + if (!(syntax & RE_NO_BK_BRACES)) + { + if (p > pattern && p[-1] == '\\') + goto normal_backslash; + } + goto normal_char; + +#ifdef emacs + /* There is no way to specify the before_dot and after_dot + operators. rms says this is ok. --karl */ + case '=': + BUF_PUSH (at_dot); + break; + + case 's': + laststart = b; + PATFETCH (c); + BUF_PUSH_2 (syntaxspec, syntax_spec_code[c]); + break; + + case 'S': + laststart = b; + PATFETCH (c); + BUF_PUSH_2 (notsyntaxspec, syntax_spec_code[c]); + break; + + case 'c': + laststart = b; + PATFETCH_RAW (c); + BUF_PUSH_2 (categoryspec, c); + break; + + case 'C': + laststart = b; + PATFETCH_RAW (c); + BUF_PUSH_2 (notcategoryspec, c); + break; +#endif /* emacs */ + + + case 'w': + laststart = b; + BUF_PUSH (wordchar); + break; + + case 'W': + laststart = b; + BUF_PUSH (notwordchar); + break; -/* P points to just after a ^ in PATTERN. Return true if that ^ comes - after an alternative or a begin-subexpression. We assume there is at - least one character before the ^. */ -static boolean -at_begline_loc_p (pattern, p, syntax) - const char *pattern, *p; - reg_syntax_t syntax; -{ - const char *prev = p - 2; - boolean prev_prev_backslash = prev > pattern && prev[-1] == '\\'; + case '<': + BUF_PUSH (wordbeg); + break; - return - /* After a subexpression? */ - (*prev == '(' && (syntax & RE_NO_BK_PARENS || prev_prev_backslash)) - /* After an alternative? */ - || (*prev == '|' && (syntax & RE_NO_BK_VBAR || prev_prev_backslash)); -} + case '>': + BUF_PUSH (wordend); + break; + case 'b': + BUF_PUSH (wordbound); + break; -/* The dual of at_begline_loc_p. This one is for $. We assume there is - at least one character after the $, i.e., `P < PEND'. */ + case 'B': + BUF_PUSH (notwordbound); + break; -static boolean -at_endline_loc_p (p, pend, syntax) - const char *p, *pend; - int syntax; -{ - const char *next = p; - boolean next_backslash = *next == '\\'; - const char *next_next = p + 1 < pend ? p + 1 : NULL; - - return - /* Before a subexpression? */ - (syntax & RE_NO_BK_PARENS ? *next == ')' - : next_backslash && next_next && *next_next == ')') - /* Before an alternative? */ - || (syntax & RE_NO_BK_VBAR ? *next == '|' - : next_backslash && next_next && *next_next == '|'); -} + case '`': + BUF_PUSH (begbuf); + break; + case '\'': + BUF_PUSH (endbuf); + break; -/* Returns true if REGNUM is in one of COMPILE_STACK's elements and - false if it's not. */ + case '1': case '2': case '3': case '4': case '5': + case '6': case '7': case '8': case '9': + if (syntax & RE_NO_BK_REFS) + goto normal_char; -static boolean -group_in_compile_stack (compile_stack, regnum) - compile_stack_type compile_stack; - regnum_t regnum; -{ - int this_element; + c1 = c - '0'; - for (this_element = compile_stack.avail - 1; - this_element >= 0; - this_element--) - if (compile_stack.stack[this_element].regnum == regnum) - return true; + if (c1 > regnum) + FREE_STACK_RETURN (REG_ESUBREG); - return false; -} + /* Can't back reference to a subexpression if inside of it. */ + if (group_in_compile_stack (compile_stack, c1)) + goto normal_char; + laststart = b; + BUF_PUSH_2 (duplicate, c1); + break; -/* Read the ending character of a range (in a bracket expression) from the - uncompiled pattern *P_PTR (which ends at PEND). We assume the - starting character is in `P[-2]'. (`P[-1]' is the character `-'.) - Then we set the translation of all bits between the starting and - ending characters (inclusive) in the compiled pattern B. - - Return an error code. - - We use these short variable names so we can use the same macros as - `regex_compile' itself. */ -static reg_errcode_t -compile_range (p_ptr, pend, translate, syntax, b) - const char **p_ptr, *pend; - char *translate; - reg_syntax_t syntax; - unsigned char *b; -{ - unsigned this_char; + case '+': + case '?': + if (syntax & RE_BK_PLUS_QM) + goto handle_plus; + else + goto normal_backslash; - const char *p = *p_ptr; - int range_start, range_end; - - if (p == pend) - return REG_ERANGE; - - /* Even though the pattern is a signed `char *', we need to fetch - with unsigned char *'s; if the high bit of the pattern character - is set, the range endpoints will be negative if we fetch using a - signed char *. - - We also want to fetch the endpoints without translating them; the - appropriate translation is done in the bit-setting loop below. */ - range_start = ((unsigned char *) p)[-2]; - range_end = ((unsigned char *) p)[0]; - - /* Have to increment the pointer into the pattern string, so the - caller isn't still at the ending character. */ - (*p_ptr)++; - - /* If the start is after the end, the range is empty. */ - if (range_start > range_end) - return syntax & RE_NO_EMPTY_RANGES ? REG_ERANGE : REG_NOERROR; - - /* Here we see why `this_char' has to be larger than an `unsigned - char' -- the range is inclusive, so if `range_end' == 0xff - (assuming 8-bit characters), we would otherwise go into an infinite - loop, since all characters <= 0xff. */ - for (this_char = range_start; this_char <= range_end; this_char++) - { - SET_LIST_BIT (TRANSLATE (this_char)); - } - - return REG_NOERROR; -} - -/* Failure stack declarations and macros; both re_compile_fastmap and - re_match_2 use a failure stack. These have to be macros because of - REGEX_ALLOCATE. */ - + default: + normal_backslash: + /* You might think it would be useful for \ to mean + not to translate; but if we don't translate it + it will never match anything. */ + c = TRANSLATE (c); + goto normal_char; + } + break; -/* Number of failure points for which to initially allocate space - when matching. If this number is exceeded, we allocate more - space, so it is not a hard limit. */ -#ifndef INIT_FAILURE_ALLOC -#define INIT_FAILURE_ALLOC 5 -#endif -/* Roughly the maximum number of failure points on the stack. Would be - exactly that if always used MAX_FAILURE_SPACE each time we failed. - This is a variable only so users of regex can assign to it; we never - change it ourselves. */ -int re_max_failures = 2000; + default: + /* Expects the character in `c'. */ + normal_char: + p1 = p - 1; /* P1 points the head of C. */ +#ifdef emacs + if (bufp->multibyte) + { + c = STRING_CHAR (p1, pend - p1); + c = TRANSLATE (c); + /* Set P to the next character boundary. */ + p += MULTIBYTE_FORM_LENGTH (p1, pend - p1) - 1; + } +#endif + /* If no exactn currently being built. */ + if (!pending_exact -union fail_stack_elt -{ - unsigned char *pointer; - int integer; -}; + /* If last exactn not at current position. */ + || pending_exact + *pending_exact + 1 != b -typedef union fail_stack_elt fail_stack_elt_t; + /* We have only one byte following the exactn for the count. */ + || *pending_exact >= (1 << BYTEWIDTH) - (p - p1) -typedef struct -{ - fail_stack_elt_t *stack; - unsigned size; - unsigned avail; /* Offset of next open position. */ -} fail_stack_type; + /* If followed by a repetition operator. */ + || (p != pend && (*p == '*' || *p == '^')) + || ((syntax & RE_BK_PLUS_QM) + ? p + 1 < pend && *p == '\\' && (p[1] == '+' || p[1] == '?') + : p != pend && (*p == '+' || *p == '?')) + || ((syntax & RE_INTERVALS) + && ((syntax & RE_NO_BK_BRACES) + ? p != pend && *p == '{' + : p + 1 < pend && p[0] == '\\' && p[1] == '{'))) + { + /* Start building a new exactn. */ -#define FAIL_STACK_EMPTY() (fail_stack.avail == 0) -#define FAIL_STACK_PTR_EMPTY() (fail_stack_ptr->avail == 0) -#define FAIL_STACK_FULL() (fail_stack.avail == fail_stack.size) -#define FAIL_STACK_TOP() (fail_stack.stack[fail_stack.avail]) + laststart = b; + BUF_PUSH_2 (exactn, 0); + pending_exact = b - 1; + } -/* Initialize `fail_stack'. Do `return -2' if the alloc fails. */ +#ifdef emacs + if (! SINGLE_BYTE_CHAR_P (c)) + { + unsigned char work[4], *str; + int i = CHAR_STRING (c, work, str); + int j; + for (j = 0; j < i; j++) + { + BUF_PUSH (str[j]); + (*pending_exact)++; + } + } + else +#endif + { + BUF_PUSH (c); + (*pending_exact)++; + } + break; + } /* switch (c) */ + } /* while p != pend */ -#define INIT_FAIL_STACK() \ - do { \ - fail_stack.stack = (fail_stack_elt_t *) \ - REGEX_ALLOCATE (INIT_FAILURE_ALLOC * sizeof (fail_stack_elt_t)); \ - \ - if (fail_stack.stack == NULL) \ - return -2; \ - \ - fail_stack.size = INIT_FAILURE_ALLOC; \ - fail_stack.avail = 0; \ - } while (0) + /* Through the pattern now. */ -/* Double the size of FAIL_STACK, up to approximately `re_max_failures' items. + if (fixup_alt_jump) + STORE_JUMP (jump_past_alt, fixup_alt_jump, b); - Return 1 if succeeds, and 0 if either ran out of memory - allocating space for it or it was already too large. - - REGEX_REALLOCATE requires `destination' be declared. */ + if (!COMPILE_STACK_EMPTY) + FREE_STACK_RETURN (REG_EPAREN); -#define DOUBLE_FAIL_STACK(fail_stack) \ - ((fail_stack).size > re_max_failures * MAX_FAILURE_ITEMS \ - ? 0 \ - : ((fail_stack).stack = (fail_stack_elt_t *) \ - REGEX_REALLOCATE ((fail_stack).stack, \ - (fail_stack).size * sizeof (fail_stack_elt_t), \ - ((fail_stack).size << 1) * sizeof (fail_stack_elt_t)), \ - \ - (fail_stack).stack == NULL \ - ? 0 \ - : ((fail_stack).size <<= 1, \ - 1))) + /* If we don't want backtracking, force success + the first time we reach the end of the compiled pattern. */ + if (syntax & RE_NO_POSIX_BACKTRACKING) + BUF_PUSH (succeed); + free (compile_stack.stack); -/* Push PATTERN_OP on FAIL_STACK. + /* We have succeeded; set the length of the buffer. */ + bufp->used = b - bufp->buffer; - Return 1 if was able to do so and 0 if ran out of memory allocating - space to do so. */ -#define PUSH_PATTERN_OP(POINTER, FAIL_STACK) \ - ((FAIL_STACK_FULL () \ - && !DOUBLE_FAIL_STACK (FAIL_STACK)) \ - ? 0 \ - : ((FAIL_STACK).stack[(FAIL_STACK).avail++].pointer = POINTER, \ - 1)) +#ifdef DEBUG + if (debug) + { + DEBUG_PRINT1 ("\nCompiled pattern: \n"); + print_compiled_pattern (bufp); + } +#endif /* DEBUG */ -/* Push a pointer value onto the failure stack. - Assumes the variable `fail_stack'. Probably should only - be called from within `PUSH_FAILURE_POINT'. */ -#define PUSH_FAILURE_POINTER(item) \ - fail_stack.stack[fail_stack.avail++].pointer = (unsigned char *) (item) +#ifndef MATCH_MAY_ALLOCATE + /* Initialize the failure stack to the largest possible stack. This + isn't necessary unless we're trying to avoid calling alloca in + the search and match routines. */ + { + int num_regs = bufp->re_nsub + 1; -/* This pushes an integer-valued item onto the failure stack. - Assumes the variable `fail_stack'. Probably should only - be called from within `PUSH_FAILURE_POINT'. */ -#define PUSH_FAILURE_INT(item) \ - fail_stack.stack[fail_stack.avail++].integer = (item) + if (fail_stack.size < re_max_failures * TYPICAL_FAILURE_SIZE) + { + fail_stack.size = re_max_failures * TYPICAL_FAILURE_SIZE; -/* Push a fail_stack_elt_t value onto the failure stack. - Assumes the variable `fail_stack'. Probably should only - be called from within `PUSH_FAILURE_POINT'. */ -#define PUSH_FAILURE_ELT(item) \ - fail_stack.stack[fail_stack.avail++] = (item) +#ifdef emacs + if (! fail_stack.stack) + fail_stack.stack + = (fail_stack_elt_t *) xmalloc (fail_stack.size + * sizeof (fail_stack_elt_t)); + else + fail_stack.stack + = (fail_stack_elt_t *) xrealloc (fail_stack.stack, + (fail_stack.size + * sizeof (fail_stack_elt_t))); +#else /* not emacs */ + if (! fail_stack.stack) + fail_stack.stack + = (fail_stack_elt_t *) malloc (fail_stack.size + * sizeof (fail_stack_elt_t)); + else + fail_stack.stack + = (fail_stack_elt_t *) realloc (fail_stack.stack, + (fail_stack.size + * sizeof (fail_stack_elt_t))); +#endif /* not emacs */ + } -/* These three POP... operations complement the three PUSH... operations. - All assume that `fail_stack' is nonempty. */ -#define POP_FAILURE_POINTER() fail_stack.stack[--fail_stack.avail].pointer -#define POP_FAILURE_INT() fail_stack.stack[--fail_stack.avail].integer -#define POP_FAILURE_ELT() fail_stack.stack[--fail_stack.avail] + regex_grow_registers (num_regs); + } +#endif /* not MATCH_MAY_ALLOCATE */ -/* Used to omit pushing failure point id's when we're not debugging. */ -#ifdef DEBUG -#define DEBUG_PUSH PUSH_FAILURE_INT -#define DEBUG_POP(item_addr) *(item_addr) = POP_FAILURE_INT () -#else -#define DEBUG_PUSH(item) -#define DEBUG_POP(item_addr) -#endif + return REG_NOERROR; +} /* regex_compile */ + +/* Subroutines for `regex_compile'. */ +/* Store OP at LOC followed by two-byte integer parameter ARG. */ -/* Push the information about the state we will need - if we ever fail back to it. +static void +store_op1 (op, loc, arg) + re_opcode_t op; + unsigned char *loc; + int arg; +{ + *loc = (unsigned char) op; + STORE_NUMBER (loc + 1, arg); +} - Requires variables fail_stack, regstart, regend, reg_info, and - num_regs be declared. DOUBLE_FAIL_STACK requires `destination' be - declared. - Does `return FAILURE_CODE' if runs out of memory. */ +/* Like `store_op1', but for two two-byte parameters ARG1 and ARG2. */ -#define PUSH_FAILURE_POINT(pattern_place, string_place, failure_code) \ - do { \ - /* Must be int, so when we don't save any registers, the arithmetic \ - of 0 + -1 isn't done as unsigned. */ \ - int this_reg; \ - \ - DEBUG_STATEMENT (failure_id++); \ - DEBUG_STATEMENT (nfailure_points_pushed++); \ - DEBUG_PRINT2 ("\nPUSH_FAILURE_POINT #%u:\n", failure_id); \ - DEBUG_PRINT2 (" Before push, next avail: %d\n", (fail_stack).avail);\ - DEBUG_PRINT2 (" size: %d\n", (fail_stack).size);\ - \ - DEBUG_PRINT2 (" slots needed: %d\n", NUM_FAILURE_ITEMS); \ - DEBUG_PRINT2 (" available: %d\n", REMAINING_AVAIL_SLOTS); \ - \ - /* Ensure we have enough space allocated for what we will push. */ \ - while (REMAINING_AVAIL_SLOTS < NUM_FAILURE_ITEMS) \ - { \ - if (!DOUBLE_FAIL_STACK (fail_stack)) \ - return failure_code; \ - \ - DEBUG_PRINT2 ("\n Doubled stack; size now: %d\n", \ - (fail_stack).size); \ - DEBUG_PRINT2 (" slots available: %d\n", REMAINING_AVAIL_SLOTS);\ - } \ - \ - /* Push the info, starting with the registers. */ \ - DEBUG_PRINT1 ("\n"); \ - \ - if (1) \ - for (this_reg = lowest_active_reg; this_reg <= highest_active_reg; \ - this_reg++) \ - { \ - DEBUG_PRINT2 (" Pushing reg: %d\n", this_reg); \ - DEBUG_STATEMENT (num_regs_pushed++); \ - \ - DEBUG_PRINT2 (" start: 0x%x\n", regstart[this_reg]); \ - PUSH_FAILURE_POINTER (regstart[this_reg]); \ - \ - DEBUG_PRINT2 (" end: 0x%x\n", regend[this_reg]); \ - PUSH_FAILURE_POINTER (regend[this_reg]); \ - \ - DEBUG_PRINT2 (" info: 0x%x\n ", reg_info[this_reg]); \ - DEBUG_PRINT2 (" match_null=%d", \ - REG_MATCH_NULL_STRING_P (reg_info[this_reg])); \ - DEBUG_PRINT2 (" active=%d", IS_ACTIVE (reg_info[this_reg])); \ - DEBUG_PRINT2 (" matched_something=%d", \ - MATCHED_SOMETHING (reg_info[this_reg])); \ - DEBUG_PRINT2 (" ever_matched=%d", \ - EVER_MATCHED_SOMETHING (reg_info[this_reg])); \ - DEBUG_PRINT1 ("\n"); \ - PUSH_FAILURE_ELT (reg_info[this_reg].word); \ - } \ - \ - DEBUG_PRINT2 (" Pushing low active reg: %d\n", lowest_active_reg);\ - PUSH_FAILURE_INT (lowest_active_reg); \ - \ - DEBUG_PRINT2 (" Pushing high active reg: %d\n", highest_active_reg);\ - PUSH_FAILURE_INT (highest_active_reg); \ - \ - DEBUG_PRINT2 (" Pushing pattern 0x%x: ", pattern_place); \ - DEBUG_PRINT_COMPILED_PATTERN (bufp, pattern_place, pend); \ - PUSH_FAILURE_POINTER (pattern_place); \ - \ - DEBUG_PRINT2 (" Pushing string 0x%x: `", string_place); \ - DEBUG_PRINT_DOUBLE_STRING (string_place, string1, size1, string2, \ - size2); \ - DEBUG_PRINT1 ("'\n"); \ - PUSH_FAILURE_POINTER (string_place); \ - \ - DEBUG_PRINT2 (" Pushing failure id: %u\n", failure_id); \ - DEBUG_PUSH (failure_id); \ - } while (0) +static void +store_op2 (op, loc, arg1, arg2) + re_opcode_t op; + unsigned char *loc; + int arg1, arg2; +{ + *loc = (unsigned char) op; + STORE_NUMBER (loc + 1, arg1); + STORE_NUMBER (loc + 3, arg2); +} -/* This is the number of items that are pushed and popped on the stack - for each register. */ -#define NUM_REG_ITEMS 3 -/* Individual items aside from the registers. */ -#ifdef DEBUG -#define NUM_NONREG_ITEMS 5 /* Includes failure point id. */ -#else -#define NUM_NONREG_ITEMS 4 -#endif +/* Copy the bytes from LOC to END to open up three bytes of space at LOC + for OP followed by two-byte integer parameter ARG. */ -/* We push at most this many items on the stack. */ -#define MAX_FAILURE_ITEMS ((num_regs - 1) * NUM_REG_ITEMS + NUM_NONREG_ITEMS) +static void +insert_op1 (op, loc, arg, end) + re_opcode_t op; + unsigned char *loc; + int arg; + unsigned char *end; +{ + register unsigned char *pfrom = end; + register unsigned char *pto = end + 3; -/* We actually push this many items. */ -#define NUM_FAILURE_ITEMS \ - ((highest_active_reg - lowest_active_reg + 1) * NUM_REG_ITEMS \ - + NUM_NONREG_ITEMS) + while (pfrom != loc) + *--pto = *--pfrom; -/* How many items can still be added to the stack without overflowing it. */ -#define REMAINING_AVAIL_SLOTS ((fail_stack).size - (fail_stack).avail) + store_op1 (op, loc, arg); +} -/* Pops what PUSH_FAIL_STACK pushes. +/* Like `insert_op1', but for two two-byte parameters ARG1 and ARG2. */ - We restore into the parameters, all of which should be lvalues: - STR -- the saved data position. - PAT -- the saved pattern position. - LOW_REG, HIGH_REG -- the highest and lowest active registers. - REGSTART, REGEND -- arrays of string positions. - REG_INFO -- array of information about each subexpression. +static void +insert_op2 (op, loc, arg1, arg2, end) + re_opcode_t op; + unsigned char *loc; + int arg1, arg2; + unsigned char *end; +{ + register unsigned char *pfrom = end; + register unsigned char *pto = end + 5; - Also assumes the variables `fail_stack' and (if debugging), `bufp', - `pend', `string1', `size1', `string2', and `size2'. */ + while (pfrom != loc) + *--pto = *--pfrom; -#define POP_FAILURE_POINT(str, pat, low_reg, high_reg, regstart, regend, reg_info)\ -{ \ - DEBUG_STATEMENT (fail_stack_elt_t failure_id;) \ - int this_reg; \ - const unsigned char *string_temp; \ - \ - assert (!FAIL_STACK_EMPTY ()); \ - \ - /* Remove failure points and point to how many regs pushed. */ \ - DEBUG_PRINT1 ("POP_FAILURE_POINT:\n"); \ - DEBUG_PRINT2 (" Before pop, next avail: %d\n", fail_stack.avail); \ - DEBUG_PRINT2 (" size: %d\n", fail_stack.size); \ - \ - assert (fail_stack.avail >= NUM_NONREG_ITEMS); \ - \ - DEBUG_POP (&failure_id); \ - DEBUG_PRINT2 (" Popping failure id: %u\n", failure_id); \ - \ - /* If the saved string location is NULL, it came from an \ - on_failure_keep_string_jump opcode, and we want to throw away the \ - saved NULL, thus retaining our current position in the string. */ \ - string_temp = POP_FAILURE_POINTER (); \ - if (string_temp != NULL) \ - str = (const char *) string_temp; \ - \ - DEBUG_PRINT2 (" Popping string 0x%x: `", str); \ - DEBUG_PRINT_DOUBLE_STRING (str, string1, size1, string2, size2); \ - DEBUG_PRINT1 ("'\n"); \ - \ - pat = (unsigned char *) POP_FAILURE_POINTER (); \ - DEBUG_PRINT2 (" Popping pattern 0x%x: ", pat); \ - DEBUG_PRINT_COMPILED_PATTERN (bufp, pat, pend); \ - \ - /* Restore register info. */ \ - high_reg = (unsigned) POP_FAILURE_INT (); \ - DEBUG_PRINT2 (" Popping high active reg: %d\n", high_reg); \ - \ - low_reg = (unsigned) POP_FAILURE_INT (); \ - DEBUG_PRINT2 (" Popping low active reg: %d\n", low_reg); \ - \ - if (1) \ - for (this_reg = high_reg; this_reg >= low_reg; this_reg--) \ - { \ - DEBUG_PRINT2 (" Popping reg: %d\n", this_reg); \ - \ - reg_info[this_reg].word = POP_FAILURE_ELT (); \ - DEBUG_PRINT2 (" info: 0x%x\n", reg_info[this_reg]); \ - \ - regend[this_reg] = (const char *) POP_FAILURE_POINTER (); \ - DEBUG_PRINT2 (" end: 0x%x\n", regend[this_reg]); \ - \ - regstart[this_reg] = (const char *) POP_FAILURE_POINTER (); \ - DEBUG_PRINT2 (" start: 0x%x\n", regstart[this_reg]); \ - } \ - else \ - { \ - for (this_reg = highest_active_reg; this_reg > high_reg; this_reg--) \ - { \ - reg_info[this_reg].word.integer = 0; \ - regend[this_reg] = 0; \ - regstart[this_reg] = 0; \ - } \ - highest_active_reg = high_reg; \ - } \ - \ - DEBUG_STATEMENT (nfailure_points_popped++); \ -} /* POP_FAILURE_POINT */ + store_op2 (op, loc, arg1, arg2); +} + + +/* P points to just after a ^ in PATTERN. Return true if that ^ comes + after an alternative or a begin-subexpression. We assume there is at + least one character before the ^. */ + +static boolean +at_begline_loc_p (pattern, p, syntax) + const char *pattern, *p; + reg_syntax_t syntax; +{ + const char *prev = p - 2; + boolean prev_prev_backslash = prev > pattern && prev[-1] == '\\'; + + return + /* After a subexpression? */ + (*prev == '(' && (syntax & RE_NO_BK_PARENS || prev_prev_backslash)) + /* After an alternative? */ + || (*prev == '|' && (syntax & RE_NO_BK_VBAR || prev_prev_backslash)); +} + + +/* The dual of at_begline_loc_p. This one is for $. We assume there is + at least one character after the $, i.e., `P < PEND'. */ + +static boolean +at_endline_loc_p (p, pend, syntax) + const char *p, *pend; + int syntax; +{ + const char *next = p; + boolean next_backslash = *next == '\\'; + const char *next_next = p + 1 < pend ? p + 1 : 0; + + return + /* Before a subexpression? */ + (syntax & RE_NO_BK_PARENS ? *next == ')' + : next_backslash && next_next && *next_next == ')') + /* Before an alternative? */ + || (syntax & RE_NO_BK_VBAR ? *next == '|' + : next_backslash && next_next && *next_next == '|'); +} + + +/* Returns true if REGNUM is in one of COMPILE_STACK's elements and + false if it's not. */ + +static boolean +group_in_compile_stack (compile_stack, regnum) + compile_stack_type compile_stack; + regnum_t regnum; +{ + int this_element; + + for (this_element = compile_stack.avail - 1; + this_element >= 0; + this_element--) + if (compile_stack.stack[this_element].regnum == regnum) + return true; + + return false; +} /* re_compile_fastmap computes a ``fastmap'' for the compiled pattern in BUFP. A fastmap records which of the (1 << BYTEWIDTH) possible @@ -2573,8 +3173,10 @@ re_compile_fastmap (bufp) struct re_pattern_buffer *bufp; { - int j, k; + int i, j, k; +#ifdef MATCH_MAY_ALLOCATE fail_stack_type fail_stack; +#endif #ifndef REGEX_MALLOC char *destination; #endif @@ -2587,8 +3189,12 @@ unsigned char *p = pattern; register unsigned char *pend = pattern + size; + /* This holds the pointer to the failure stack, when + it is allocated relocatably. */ + fail_stack_elt_t *failure_stack_ptr; + /* Assume that each path through the pattern can be null until - proven otherwise. We set this false at the bottom of switch + proven otherwise. We set this false at the bottom of switch statement, to which we get only if a particular path doesn't match the empty string. */ boolean path_can_be_null = true; @@ -2596,69 +3202,81 @@ /* We aren't doing a `succeed_n' to begin with. */ boolean succeed_n_p = false; + /* If all elements for base leading-codes in fastmap is set, this + flag is set true. */ + boolean match_any_multibyte_characters = false; + + /* Maximum code of simple (single byte) character. */ + int simple_char_max; + assert (fastmap != NULL && p != NULL); INIT_FAIL_STACK (); - bzero (fastmap, 1 << BYTEWIDTH); /* Assume nothing's valid. */ + bzero (fastmap, 1 << BYTEWIDTH); /* Assume nothing's valid. */ bufp->fastmap_accurate = 1; /* It will be when we're done. */ bufp->can_be_null = 0; - while (p != pend || !FAIL_STACK_EMPTY ()) + while (1) { - if (p == pend) - { - bufp->can_be_null |= path_can_be_null; - - /* Reset for next path. */ - path_can_be_null = true; - - p = fail_stack.stack[--fail_stack.avail].pointer; + if (p == pend || *p == succeed) + { + /* We have reached the (effective) end of pattern. */ + if (!FAIL_STACK_EMPTY ()) + { + bufp->can_be_null |= path_can_be_null; + + /* Reset for next path. */ + path_can_be_null = true; + + p = fail_stack.stack[--fail_stack.avail].pointer; + + continue; + } + else + break; } - /* We should never be about to go beyond the end of the pattern. */ + /* We should never be about to go beyond the end of the pattern. */ assert (p < pend); - -#ifdef SWITCH_ENUM_BUG - switch ((int) ((re_opcode_t) *p++)) -#else - switch ((re_opcode_t) *p++) -#endif + + switch (SWITCH_ENUM_CAST ((re_opcode_t) *p++)) { - /* I guess the idea here is to simply not bother with a fastmap - if a backreference is used, since it's too hard to figure out - the fastmap for the corresponding group. Setting - `can_be_null' stops `re_search_2' from using the fastmap, so - that is all we do. */ + /* I guess the idea here is to simply not bother with a fastmap + if a backreference is used, since it's too hard to figure out + the fastmap for the corresponding group. Setting + `can_be_null' stops `re_search_2' from using the fastmap, so + that is all we do. */ case duplicate: bufp->can_be_null = 1; - return 0; + goto done; /* Following are the cases which match a character. These end - with `break'. */ + with `break'. */ case exactn: - fastmap[p[1]] = 1; + fastmap[p[1]] = 1; break; - case charset: - for (j = *p++ * BYTEWIDTH - 1; j >= 0; j--) +#ifndef emacs + case charset: + for (j = *p++ * BYTEWIDTH - 1; j >= 0; j--) if (p[j / BYTEWIDTH] & (1 << (j % BYTEWIDTH))) - fastmap[j] = 1; + fastmap[j] = 1; break; case charset_not: /* Chars beyond end of map must be allowed. */ for (j = *p * BYTEWIDTH; j < (1 << BYTEWIDTH); j++) - fastmap[j] = 1; + fastmap[j] = 1; for (j = *p++ * BYTEWIDTH - 1; j >= 0; j--) if (!(p[j / BYTEWIDTH] & (1 << (j % BYTEWIDTH)))) - fastmap[j] = 1; - break; + fastmap[j] = 1; + break; case wordchar: @@ -2673,171 +3291,327 @@ if (SYNTAX (j) != Sword) fastmap[j] = 1; break; +#else /* emacs */ + case charset: + for (j = CHARSET_BITMAP_SIZE (&p[-1]) * BYTEWIDTH - 1, p++; + j >= 0; j--) + if (p[j / BYTEWIDTH] & (1 << (j % BYTEWIDTH))) + fastmap[j] = 1; + + if (CHARSET_RANGE_TABLE_EXISTS_P (&p[-2]) + && match_any_multibyte_characters == false) + { + /* Set fastmap[I] 1 where I is a base leading code of each + multibyte character in the range table. */ + int c, count; + + /* Make P points the range table. */ + p += CHARSET_BITMAP_SIZE (&p[-2]); + + /* Extract the number of ranges in range table into + COUNT. */ + EXTRACT_NUMBER_AND_INCR (count, p); + for (; count > 0; count--, p += 2 * 3) /* XXX */ + { + /* Extract the start of each range. */ + EXTRACT_CHARACTER (c, p); + j = CHAR_CHARSET (c); + fastmap[CHARSET_LEADING_CODE_BASE (j)] = 1; + } + } + break; - case anychar: - /* `.' matches anything ... */ - for (j = 0; j < (1 << BYTEWIDTH); j++) - fastmap[j] = 1; + case charset_not: + /* Chars beyond end of bitmap are possible matches. + All the single-byte codes can occur in multibyte buffers. + So any that are not listed in the charset + are possible matches, even in multibyte buffers. */ + simple_char_max = (1 << BYTEWIDTH); + for (j = CHARSET_BITMAP_SIZE (&p[-1]) * BYTEWIDTH; + j < simple_char_max; j++) + fastmap[j] = 1; + + for (j = CHARSET_BITMAP_SIZE (&p[-1]) * BYTEWIDTH - 1, p++; + j >= 0; j--) + if (!(p[j / BYTEWIDTH] & (1 << (j % BYTEWIDTH)))) + fastmap[j] = 1; + + if (bufp->multibyte) + /* Any character set can possibly contain a character + which doesn't match the specified set of characters. */ + { + set_fastmap_for_multibyte_characters: + if (match_any_multibyte_characters == false) + { + for (j = 0x80; j < 0xA0; j++) /* XXX */ + if (BASE_LEADING_CODE_P (j)) + fastmap[j] = 1; + match_any_multibyte_characters = true; + } + } + break; + + + case wordchar: + /* All the single-byte codes can occur in multibyte buffers, + and they may have word syntax. So do consider them. */ + simple_char_max = (1 << BYTEWIDTH); + for (j = 0; j < simple_char_max; j++) + if (SYNTAX (j) == Sword) + fastmap[j] = 1; + + if (bufp->multibyte) + /* Any character set can possibly contain a character + whose syntax is `Sword'. */ + goto set_fastmap_for_multibyte_characters; + break; + - /* ... except perhaps newline. */ - if (!(bufp->syntax & RE_DOT_NEWLINE)) - fastmap['\n'] = 0; - - /* Return if we have already set `can_be_null'; if we have, - then the fastmap is irrelevant. Something's wrong here. */ - else if (bufp->can_be_null) - return 0; + case notwordchar: + /* All the single-byte codes can occur in multibyte buffers, + and they may not have word syntax. So do consider them. */ + simple_char_max = (1 << BYTEWIDTH); + for (j = 0; j < simple_char_max; j++) + if (SYNTAX (j) != Sword) + fastmap[j] = 1; + + if (bufp->multibyte) + /* Any character set can possibly contain a character + whose syntax is not `Sword'. */ + goto set_fastmap_for_multibyte_characters; + break; +#endif + + case anychar: + { + int fastmap_newline = fastmap['\n']; + + /* `.' matches anything, except perhaps newline. + Even in a multibyte buffer, it should match any + conceivable byte value for the fastmap. */ + if (bufp->multibyte) + match_any_multibyte_characters = true; + + simple_char_max = (1 << BYTEWIDTH); + for (j = 0; j < simple_char_max; j++) + fastmap[j] = 1; + + /* ... except perhaps newline. */ + if (!(bufp->syntax & RE_DOT_NEWLINE)) + fastmap['\n'] = fastmap_newline; + + /* Return if we have already set `can_be_null'; if we have, + then the fastmap is irrelevant. Something's wrong here. */ + else if (bufp->can_be_null) + goto done; + + /* Otherwise, have to check alternative paths. */ + break; + } + +#ifdef emacs + case wordbound: + case notwordbound: + case wordbeg: + case wordend: + case notsyntaxspec: + case syntaxspec: + /* This match depends on text properties. These end with + aborting optimizations. */ + bufp->can_be_null = 1; + goto done; +#if 0 + k = *p++; + simple_char_max = bufp->multibyte ? 0x80 : (1 << BYTEWIDTH); + for (j = 0; j < simple_char_max; j++) + if (SYNTAX (j) == (enum syntaxcode) k) + fastmap[j] = 1; + + if (bufp->multibyte) + /* Any character set can possibly contain a character + whose syntax is K. */ + goto set_fastmap_for_multibyte_characters; + break; + + case notsyntaxspec: + k = *p++; + simple_char_max = bufp->multibyte ? 0x80 : (1 << BYTEWIDTH); + for (j = 0; j < simple_char_max; j++) + if (SYNTAX (j) != (enum syntaxcode) k) + fastmap[j] = 1; - /* Otherwise, have to check alternative paths. */ + if (bufp->multibyte) + /* Any character set can possibly contain a character + whose syntax is not K. */ + goto set_fastmap_for_multibyte_characters; break; +#endif -#ifdef emacs - case syntaxspec: + case categoryspec: k = *p++; - for (j = 0; j < (1 << BYTEWIDTH); j++) - if (SYNTAX (j) == (enum syntaxcode) k) + simple_char_max = (1 << BYTEWIDTH); + for (j = 0; j < simple_char_max; j++) + if (CHAR_HAS_CATEGORY (j, k)) fastmap[j] = 1; + + if (bufp->multibyte) + /* Any character set can possibly contain a character + whose category is K. */ + goto set_fastmap_for_multibyte_characters; break; - case notsyntaxspec: + case notcategoryspec: k = *p++; - for (j = 0; j < (1 << BYTEWIDTH); j++) - if (SYNTAX (j) != (enum syntaxcode) k) + simple_char_max = (1 << BYTEWIDTH); + for (j = 0; j < simple_char_max; j++) + if (!CHAR_HAS_CATEGORY (j, k)) fastmap[j] = 1; - break; + if (bufp->multibyte) + /* Any character set can possibly contain a character + whose category is not K. */ + goto set_fastmap_for_multibyte_characters; + break; /* All cases after this match the empty string. These end with - `continue'. */ + `continue'. */ case before_dot: case at_dot: case after_dot: - continue; -#endif /* not emacs */ + continue; +#endif /* emacs */ - case no_op: - case begline: - case endline: + case no_op: + case begline: + case endline: case begbuf: case endbuf: +#ifndef emacs case wordbound: case notwordbound: case wordbeg: case wordend: - case push_dummy_failure: - continue; +#endif + case push_dummy_failure: + continue; case jump_n: - case pop_failure_jump: + case pop_failure_jump: case maybe_pop_jump: case jump: - case jump_past_alt: + case jump_past_alt: case dummy_failure_jump: - EXTRACT_NUMBER_AND_INCR (j, p); + EXTRACT_NUMBER_AND_INCR (j, p); p += j; if (j > 0) continue; - /* Jump backward implies we just went through the body of a - loop and matched nothing. Opcode jumped to should be - `on_failure_jump' or `succeed_n'. Just treat it like an - ordinary jump. For a * loop, it has pushed its failure - point already; if so, discard that as redundant. */ - if ((re_opcode_t) *p != on_failure_jump + /* Jump backward implies we just went through the body of a + loop and matched nothing. Opcode jumped to should be + `on_failure_jump' or `succeed_n'. Just treat it like an + ordinary jump. For a * loop, it has pushed its failure + point already; if so, discard that as redundant. */ + if ((re_opcode_t) *p != on_failure_jump && (re_opcode_t) *p != succeed_n) continue; - p++; - EXTRACT_NUMBER_AND_INCR (j, p); - p += j; + p++; + EXTRACT_NUMBER_AND_INCR (j, p); + p += j; - /* If what's on the stack is where we are now, pop it. */ - if (!FAIL_STACK_EMPTY () + /* If what's on the stack is where we are now, pop it. */ + if (!FAIL_STACK_EMPTY () && fail_stack.stack[fail_stack.avail - 1].pointer == p) - fail_stack.avail--; + fail_stack.avail--; - continue; + continue; - case on_failure_jump: - case on_failure_keep_string_jump: + case on_failure_jump: + case on_failure_keep_string_jump: handle_on_failure_jump: - EXTRACT_NUMBER_AND_INCR (j, p); + EXTRACT_NUMBER_AND_INCR (j, p); - /* For some patterns, e.g., `(a?)?', `p+j' here points to the - end of the pattern. We don't want to push such a point, - since when we restore it above, entering the switch will - increment `p' past the end of the pattern. We don't need - to push such a point since we obviously won't find any more - fastmap entries beyond `pend'. Such a pattern can match - the null string, though. */ - if (p + j < pend) - { - if (!PUSH_PATTERN_OP (p + j, fail_stack)) - return -2; - } - else - bufp->can_be_null = 1; + /* For some patterns, e.g., `(a?)?', `p+j' here points to the + end of the pattern. We don't want to push such a point, + since when we restore it above, entering the switch will + increment `p' past the end of the pattern. We don't need + to push such a point since we obviously won't find any more + fastmap entries beyond `pend'. Such a pattern can match + the null string, though. */ + if (p + j < pend) + { + if (!PUSH_PATTERN_OP (p + j, fail_stack)) + { + RESET_FAIL_STACK (); + return -2; + } + } + else + bufp->can_be_null = 1; - if (succeed_n_p) - { - EXTRACT_NUMBER_AND_INCR (k, p); /* Skip the n. */ - succeed_n_p = false; + if (succeed_n_p) + { + EXTRACT_NUMBER_AND_INCR (k, p); /* Skip the n. */ + succeed_n_p = false; } - continue; + continue; case succeed_n: - /* Get to the number of times to succeed. */ - p += 2; + /* Get to the number of times to succeed. */ + p += 2; - /* Increment p past the n for when k != 0. */ - EXTRACT_NUMBER_AND_INCR (k, p); - if (k == 0) + /* Increment p past the n for when k != 0. */ + EXTRACT_NUMBER_AND_INCR (k, p); + if (k == 0) { - p -= 4; - succeed_n_p = true; /* Spaghetti code alert. */ - goto handle_on_failure_jump; - } - continue; + p -= 4; + succeed_n_p = true; /* Spaghetti code alert. */ + goto handle_on_failure_jump; + } + continue; case set_number_at: - p += 4; - continue; + p += 4; + continue; case start_memory: - case stop_memory: + case stop_memory: p += 2; continue; default: - abort (); /* We have listed all the cases. */ - } /* switch *p++ */ + abort (); /* We have listed all the cases. */ + } /* switch *p++ */ /* Getting here means we have found the possible starting - characters for one path of the pattern -- and that the empty - string does not match. We need not follow this path further. - Instead, look at the next alternative (remembered on the - stack), or quit if no more. The test at the top of the loop - does these things. */ + characters for one path of the pattern -- and that the empty + string does not match. We need not follow this path further. + Instead, look at the next alternative (remembered on the + stack), or quit if no more. The test at the top of the loop + does these things. */ path_can_be_null = false; p = pend; } /* while p */ /* Set `can_be_null' for the last path (also the first path, if the - pattern is empty). */ + pattern is empty). */ bufp->can_be_null |= path_can_be_null; + + done: + RESET_FAIL_STACK (); return 0; } /* re_compile_fastmap */ @@ -2876,7 +3650,7 @@ } } -/* Searching routines. */ +/* Searching routines. */ /* Like re_search_2, below, but only one string is specified, and doesn't let you say where to stop matching. */ @@ -2892,6 +3666,13 @@ regs, size); } +/* End address of virtual concatenation of string. */ +#define STOP_ADDR_VSTRING(P) \ + (((P) >= size1 ? string2 + size2 : string1 + size1)) + +/* Address of POS in the concatenation of virtual string. */ +#define POS_ADDR_VSTRING(POS) \ + (((POS) >= size1 ? string2 - size1 : string1) + (POS)) /* Using the compiled pattern in BUFP->buffer, first tries to match the virtual concatenation of STRING1 and STRING2, starting first at index @@ -2926,29 +3707,34 @@ { int val; register char *fastmap = bufp->fastmap; - register char *translate = bufp->translate; + register RE_TRANSLATE_TYPE translate = bufp->translate; int total_size = size1 + size2; int endpos = startpos + range; + int anchored_start = 0; + + /* Nonzero if we have to concern multibyte character. */ + int multibyte = bufp->multibyte; /* Check for out-of-range STARTPOS. */ if (startpos < 0 || startpos > total_size) return -1; /* Fix up RANGE if it might eventually take us outside - the virtual concatenation of STRING1 and STRING2. */ - if (endpos < -1) - range = -1 - startpos; + the virtual concatenation of STRING1 and STRING2. + Make sure we won't move STARTPOS below 0 or above TOTAL_SIZE. */ + if (endpos < 0) + range = 0 - startpos; else if (endpos > total_size) range = total_size - startpos; /* If the search isn't to be a backwards one, don't waste time in a - search for a pattern that must be anchored. */ + search for a pattern anchored at beginning of buffer. */ if (bufp->used > 0 && (re_opcode_t) bufp->buffer[0] == begbuf && range > 0) { if (startpos > 0) return -1; else - range = 1; + range = 0; } #ifdef emacs @@ -2956,8 +3742,8 @@ don't keep searching past point. */ if (bufp->used > 0 && (re_opcode_t) bufp->buffer[0] == at_dot && range > 0) { - range = PT - startpos; - if (range <= 0) + range = PT_BYTE - BEGV_BYTE - startpos; + if (range < 0) return -1; } #endif /* emacs */ @@ -2967,57 +3753,122 @@ if (re_compile_fastmap (bufp) == -2) return -2; + /* See whether the pattern is anchored. */ + if (bufp->buffer[0] == begline) + anchored_start = 1; + +#ifdef emacs + gl_state.object = re_match_object; + { + int adjpos = NILP (re_match_object) || BUFFERP (re_match_object); + int charpos = SYNTAX_TABLE_BYTE_TO_CHAR (startpos + adjpos); + + SETUP_SYNTAX_TABLE_FOR_OBJECT (re_match_object, charpos, 1); + } +#endif + /* Loop through the string, looking for a place to start matching. */ for (;;) { + /* If the pattern is anchored, + skip quickly past places we cannot match. + We don't bother to treat startpos == 0 specially + because that case doesn't repeat. */ + if (anchored_start && startpos > 0) + { + if (! (bufp->newline_anchor + && ((startpos <= size1 ? string1[startpos - 1] + : string2[startpos - size1 - 1]) + == '\n'))) + goto advance; + } + /* If a fastmap is supplied, skip quickly over characters that - cannot be the start of a match. If the pattern can match the - null string, however, we don't need to skip characters; we want - the first null string. */ + cannot be the start of a match. If the pattern can match the + null string, however, we don't need to skip characters; we want + the first null string. */ if (fastmap && startpos < total_size && !bufp->can_be_null) { - if (range > 0) /* Searching forwards. */ + register const char *d; + register unsigned int buf_ch; + + d = POS_ADDR_VSTRING (startpos); + + if (range > 0) /* Searching forwards. */ { - register const char *d; register int lim = 0; int irange = range; - if (startpos < size1 && startpos + range >= size1) - lim = range - (size1 - startpos); + if (startpos < size1 && startpos + range >= size1) + lim = range - (size1 - startpos); - d = (startpos >= size1 ? string2 - size1 : string1) + startpos; - - /* Written out as an if-else to avoid testing `translate' - inside the loop. */ - if (translate) - while (range > lim - && !fastmap[(unsigned char) - translate[(unsigned char) *d++]]) - range--; + /* Written out as an if-else to avoid testing `translate' + inside the loop. */ + if (RE_TRANSLATE_P (translate)) + { + if (multibyte) + while (range > lim) + { + int buf_charlen; + + buf_ch = STRING_CHAR_AND_LENGTH (d, range - lim, + buf_charlen); + + buf_ch = RE_TRANSLATE (translate, buf_ch); + if (buf_ch >= 0400 + || fastmap[buf_ch]) + break; + + range -= buf_charlen; + d += buf_charlen; + } + else + while (range > lim + && !fastmap[(unsigned char) + RE_TRANSLATE (translate, (unsigned char) *d)]) + { + d++; + range--; + } + } else - while (range > lim && !fastmap[(unsigned char) *d++]) - range--; + while (range > lim && !fastmap[(unsigned char) *d]) + { + d++; + range--; + } startpos += irange - range; } - else /* Searching backwards. */ + else /* Searching backwards. */ { - register char c = (size1 == 0 || startpos >= size1 - ? string2[startpos - size1] - : string1[startpos]); + int room = (size1 == 0 || startpos >= size1 + ? size2 + size1 - startpos + : size1 - startpos); + + buf_ch = STRING_CHAR (d, room); + if (RE_TRANSLATE_P (translate)) + buf_ch = RE_TRANSLATE (translate, buf_ch); - if (!fastmap[(unsigned char) TRANSLATE (c)]) + if (! (buf_ch >= 0400 + || fastmap[buf_ch])) goto advance; } } /* If can't match the null string, and that's all we have left, fail. */ if (range >= 0 && startpos == total_size && fastmap - && !bufp->can_be_null) + && !bufp->can_be_null) return -1; + + val = re_match_2_internal (bufp, string1, size1, string2, size2, + startpos, regs, stop); +#ifndef REGEX_MALLOC +#ifdef C_ALLOCA + alloca (0); +#endif +#endif - val = re_match_2 (bufp, string1, size1, string2, size2, - startpos, regs, stop); if (val >= 0) return startpos; @@ -3026,17 +3877,60 @@ advance: if (!range) - break; + break; else if (range > 0) - { - range--; - startpos++; - } + { + /* Update STARTPOS to the next character boundary. */ + if (multibyte) + { + const unsigned char *p + = (const unsigned char *) POS_ADDR_VSTRING (startpos); + const unsigned char *pend + = (const unsigned char *) STOP_ADDR_VSTRING (startpos); + int len = MULTIBYTE_FORM_LENGTH (p, pend - p); + + range -= len; + if (range < 0) + break; + startpos += len; + } + else + { + range--; + startpos++; + } + } else - { - range++; - startpos--; - } + { + range++; + startpos--; + + /* Update STARTPOS to the previous character boundary. */ + if (multibyte) + { + const unsigned char *p + = (const unsigned char *) POS_ADDR_VSTRING (startpos); + int len = 0; + + /* Find the head of multibyte form. */ + while (!CHAR_HEAD_P (*p)) + p--, len++; + + /* Adjust it. */ +#if 0 /* XXX */ + if (MULTIBYTE_FORM_LENGTH (p, len + 1) != (len + 1)) + ; + else +#endif + { + range += len; + if (range > 0) + break; + + startpos -= len; + } + } + } } return -1; } /* re_search_2 */ @@ -3045,68 +3939,16 @@ static int bcmp_translate (); static boolean alt_match_null_string_p (), - common_op_match_null_string_p (), - group_match_null_string_p (); - -/* Structure for per-register (a.k.a. per-group) information. - Other register information, such as the - starting and ending positions (which are addresses), and the list of - inner groups (which is a bits list) are maintained in separate - variables. - - We are making a (strictly speaking) nonportable assumption here: that - the compiler will pack our bit fields into something that fits into - the type of `word', i.e., is something that fits into one item on the - failure stack. */ - -typedef union -{ - fail_stack_elt_t word; - struct - { - /* This field is one if this group can match the empty string, - zero if not. If not yet determined, `MATCH_NULL_UNSET_VALUE'. */ -#define MATCH_NULL_UNSET_VALUE 3 - unsigned match_null_string_p : 2; - unsigned is_active : 1; - unsigned matched_something : 1; - unsigned ever_matched_something : 1; - } bits; -} register_info_type; - -#define REG_MATCH_NULL_STRING_P(R) ((R).bits.match_null_string_p) -#define IS_ACTIVE(R) ((R).bits.is_active) -#define MATCHED_SOMETHING(R) ((R).bits.matched_something) -#define EVER_MATCHED_SOMETHING(R) ((R).bits.ever_matched_something) - - -/* Call this when have matched a real character; it sets `matched' flags - for the subexpressions which we are currently inside. Also records - that those subexprs have matched. */ -#define SET_REGS_MATCHED() \ - do \ - { \ - unsigned r; \ - for (r = lowest_active_reg; r <= highest_active_reg; r++) \ - { \ - MATCHED_SOMETHING (reg_info[r]) \ - = EVER_MATCHED_SOMETHING (reg_info[r]) \ - = 1; \ - } \ - } \ - while (0) + common_op_match_null_string_p (), + group_match_null_string_p (); - /* This converts PTR, a pointer into one of the search strings `string1' and `string2' into an offset from the beginning of that string. */ -#define POINTER_TO_OFFSET(ptr) \ - (FIRST_STRING_P (ptr) ? (ptr) - string1 : (ptr) - string2 + size1) - -/* Registers are set to a sentinel when they haven't yet matched. */ -#define REG_UNSET_VALUE ((char *) -1) -#define REG_UNSET(e) ((e) == REG_UNSET_VALUE) +#define POINTER_TO_OFFSET(ptr) \ + (FIRST_STRING_P (ptr) \ + ? ((regoff_t) ((ptr) - string1)) \ + : ((regoff_t) ((ptr) - string2 + size1))) - /* Macros for dealing with the split strings in re_match_2. */ #define MATCHING_IN_FIRST_STRING (dend == end_match_1) @@ -3114,19 +3956,19 @@ /* Call before fetching a character with *d. This switches over to string2 if necessary. */ #define PREFETCH() \ - while (d == dend) \ + while (d == dend) \ { \ /* End of string2 => fail. */ \ - if (dend == end_match_2) \ - goto fail; \ - /* End of string1 => advance to string2. */ \ - d = string2; \ + if (dend == end_match_2) \ + goto fail; \ + /* End of string1 => advance to string2. */ \ + d = string2; \ dend = end_match_2; \ } /* Test if at very beginning or at very end of the virtual concatenation - of `string1' and `string2'. If only one string, it's `string2'. */ + of `string1' and `string2'. If only one string, it's `string2'. */ #define AT_STRINGS_BEG(d) ((d) == (size1 ? string1 : string2) || !size2) #define AT_STRINGS_END(d) ((d) == end2) @@ -3137,22 +3979,33 @@ string2, look at the last character in string1. */ #define WORDCHAR_P(d) \ (SYNTAX ((d) == end1 ? *string2 \ - : (d) == string2 - 1 ? *(end1 - 1) : *(d)) \ + : (d) == string2 - 1 ? *(end1 - 1) : *(d)) \ == Sword) +/* Disabled due to a compiler bug -- see comment at case wordbound */ + +/* The comment at case wordbound is following one, but we don't use + AT_WORD_BOUNDARY anymore to support multibyte form. + + The DEC Alpha C compiler 3.x generates incorrect code for the + test WORDCHAR_P (d - 1) != WORDCHAR_P (d) in the expansion of + AT_WORD_BOUNDARY, so this code is disabled. Expanding the + macro and introducing temporary variables works around the bug. */ + +#if 0 /* Test if the character before D and the one at D differ with respect to being word-constituent. */ #define AT_WORD_BOUNDARY(d) \ (AT_STRINGS_BEG (d) || AT_STRINGS_END (d) \ || WORDCHAR_P (d - 1) != WORDCHAR_P (d)) - +#endif /* Free everything we malloc. */ -#ifdef REGEX_MALLOC -#define FREE_VAR(var) if (var) free (var); var = NULL +#ifdef MATCH_MAY_ALLOCATE +#define FREE_VAR(var) if (var) { REGEX_FREE (var); var = NULL; } else #define FREE_VARIABLES() \ do { \ - FREE_VAR (fail_stack.stack); \ + REGEX_FREE_STACK (fail_stack.stack); \ FREE_VAR (regstart); \ FREE_VAR (regend); \ FREE_VAR (old_regstart); \ @@ -3163,25 +4016,23 @@ FREE_VAR (reg_dummy); \ FREE_VAR (reg_info_dummy); \ } while (0) -#else /* not REGEX_MALLOC */ -/* Some MIPS systems (at least) want this to free alloca'd storage. */ -#define FREE_VARIABLES() alloca (0) -#endif /* not REGEX_MALLOC */ - +#else +#define FREE_VARIABLES() ((void)0) /* Do nothing! But inhibit gcc warning. */ +#endif /* not MATCH_MAY_ALLOCATE */ -/* These values must meet several constraints. They must not be valid +/* These values must meet several constraints. They must not be valid register values; since we have a limit of 255 registers (because we use only one byte in the pattern for the register number), we can - use numbers larger than 255. They must differ by 1, because of + use numbers larger than 255. They must differ by 1, because of NUM_FAILURE_ITEMS above. And the value for the lowest register must be larger than the value for the highest register, so we do not try - to actually save any registers when none are active. */ + to actually save any registers when none are active. */ #define NO_HIGHEST_ACTIVE_REG (1 << BYTEWIDTH) #define NO_LOWEST_ACTIVE_REG (NO_HIGHEST_ACTIVE_REG + 1) /* Matching routines. */ -#ifndef emacs /* Emacs never uses this. */ +#ifndef emacs /* Emacs never uses this. */ /* re_match is like re_match_2 except it takes only a single string. */ int @@ -3190,11 +4041,23 @@ const char *string; int size, pos; struct re_registers *regs; - { - return re_match_2 (bufp, NULL, 0, string, size, pos, regs, size); +{ + int result = re_match_2_internal (bufp, NULL, 0, string, size, + pos, regs, size); +#ifndef REGEX_MALLOC /* CVS */ +#ifdef C_ALLOCA /* CVS */ + alloca (0); +#endif /* CVS */ +#endif /* CVS */ + return result; } #endif /* not emacs */ +#ifdef emacs +/* In Emacs, this is the string or buffer in which we + are matching. It is used for looking up syntax properties. */ +Lisp_Object re_match_object; +#endif /* re_match_2 matches the compiled pattern in BUFP against the the (virtual) concatenation of STRING1 and STRING2 (of length SIZE1 @@ -3202,11 +4065,11 @@ matching at STOP. If REGS is non-null and the `no_sub' field of BUFP is nonzero, we - store offsets for the substring each group matched in REGS. See the + store offsets for the substring each group matched in REGS. See the documentation for exactly how many groups we fill. We return -1 if no match, -2 if an internal error (such as the - failure stack overflowing). Otherwise, we return the length of the + failure stack overflowing). Otherwise, we return the length of the matched substring. */ int @@ -3218,6 +4081,37 @@ struct re_registers *regs; int stop; { + int result; + +#ifdef emacs + int charpos; + int adjpos = NILP (re_match_object) || BUFFERP (re_match_object); + gl_state.object = re_match_object; + charpos = SYNTAX_TABLE_BYTE_TO_CHAR (pos + adjpos); + SETUP_SYNTAX_TABLE_FOR_OBJECT (re_match_object, charpos, 1); +#endif + + result = re_match_2_internal (bufp, string1, size1, string2, size2, + pos, regs, stop); +#ifndef REGEX_MALLOC /* CVS */ +#ifdef C_ALLOCA /* CVS */ + alloca (0); +#endif /* CVS */ +#endif /* CVS */ + return result; +} + +/* This is a separate function so that we can force an alloca cleanup + afterwards. */ +static int +re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop) + struct re_pattern_buffer *bufp; + const char *string1, *string2; + int size1, size2; + int pos; + struct re_registers *regs; + int stop; +{ /* General temporaries. */ int mcnt; unsigned char *p1; @@ -3226,7 +4120,7 @@ const char *end1, *end2; /* Pointers into string1 and string2, just past the last characters in - each to consider matching. */ + each to consider matching. */ const char *end_match_1, *end_match_2; /* Where we are in the data, and the end of the current string. */ @@ -3236,9 +4130,16 @@ unsigned char *p = bufp->buffer; register unsigned char *pend = p + bufp->used; - /* We use this to map every character in the string. */ - char *translate = bufp->translate; + /* Mark the opcode just after a start_memory, so we can test for an + empty subpattern when we get to the stop_memory. */ + unsigned char *just_past_start_mem = 0; + /* We use this to map every character in the string. */ + RE_TRANSLATE_TYPE translate = bufp->translate; + + /* Nonzero if we have to concern multibyte character. */ + int multibyte = bufp->multibyte; + /* Failure point stack. Each place that can handle a failure further down the line pushes a failure point on this stack. It consists of restart, regend, and reg_info for all registers corresponding to @@ -3247,15 +4148,21 @@ to resume scanning the pattern; the second one is where to resume scanning the strings. If the latter is zero, the failure point is a ``dummy''; if a failure happens and the failure point is a dummy, - it gets discarded and the next next one is tried. */ + it gets discarded and the next next one is tried. */ +#ifdef MATCH_MAY_ALLOCATE /* otherwise, this is global. */ fail_stack_type fail_stack; +#endif #ifdef DEBUG static unsigned failure_id = 0; unsigned nfailure_points_pushed = 0, nfailure_points_popped = 0; #endif + /* This holds the pointer to the failure stack, when + it is allocated relocatably. */ + fail_stack_elt_t *failure_stack_ptr; + /* We fill all the registers internally, independent of what we - return, for use in backreferences. The number here includes + return, for use in backreferences. The number here includes an element for register zero. */ unsigned num_regs = bufp->re_nsub + 1; @@ -3270,33 +4177,41 @@ matching and the regnum-th regend points to right after where we stopped matching the regnum-th subexpression. (The zeroth register keeps track of what the whole pattern matches.) */ +#ifdef MATCH_MAY_ALLOCATE /* otherwise, these are global. */ const char **regstart, **regend; +#endif /* If a group that's operated upon by a repetition operator fails to match anything, then the register for its start will need to be restored because it will have been set to wherever in the string we are when we last see its open-group operator. Similarly for a register's end. */ +#ifdef MATCH_MAY_ALLOCATE /* otherwise, these are global. */ const char **old_regstart, **old_regend; +#endif /* The is_active field of reg_info helps us keep track of which (possibly nested) subexpressions we are currently in. The matched_something field of reg_info[reg_num] helps us tell whether or not we have matched any of the pattern so far this time through the reg_num-th subexpression. These two fields get reset each time through any - loop their register is in. */ + loop their register is in. */ +#ifdef MATCH_MAY_ALLOCATE /* otherwise, this is global. */ register_info_type *reg_info; +#endif /* The following record the register info as found in the above variables when we find a match better than any we've seen before. This happens as we backtrack through the failure points, which in turn happens only if we have not yet matched the entire string. */ unsigned best_regs_set = false; +#ifdef MATCH_MAY_ALLOCATE /* otherwise, these are global. */ const char **best_regstart, **best_regend; - +#endif + /* Logically, this is `best_regend[0]'. But we don't want to have to allocate space for that if we're not allocating space for anything - else (see below). Also, we never need info about register 0 for + else (see below). Also, we never need info about register 0 for any of the other register vectors, and it seems rather a kludge to treat `best_regend' differently than the rest. So we keep track of the end of the best match so far in a separate variable. We @@ -3304,9 +4219,14 @@ and need to test it, it's not garbage. */ const char *match_end = NULL; + /* This helps SET_REGS_MATCHED avoid doing redundant work. */ + int set_regs_matched_done = 0; + /* Used when we pop values we don't care about. */ +#ifdef MATCH_MAY_ALLOCATE /* otherwise, these are global. */ const char **reg_dummy; register_info_type *reg_info_dummy; +#endif #ifdef DEBUG /* Counts the total number of registers pushed. */ @@ -3317,6 +4237,7 @@ INIT_FAIL_STACK (); +#ifdef MATCH_MAY_ALLOCATE /* Do not bother to initialize all the register variables if there are no groups in the pattern, as it takes a fair amount of time. If there are groups, we include space for register 0 (the whole @@ -3335,22 +4256,21 @@ reg_info_dummy = REGEX_TALLOC (num_regs, register_info_type); if (!(regstart && regend && old_regstart && old_regend && reg_info - && best_regstart && best_regend && reg_dummy && reg_info_dummy)) - { - FREE_VARIABLES (); - return -2; - } + && best_regstart && best_regend && reg_dummy && reg_info_dummy)) + { + FREE_VARIABLES (); + return -2; + } } -#ifdef REGEX_MALLOC else { /* We must initialize all our variables to NULL, so that - `FREE_VARIABLES' doesn't try to free them. */ + `FREE_VARIABLES' doesn't try to free them. */ regstart = regend = old_regstart = old_regend = best_regstart - = best_regend = reg_dummy = NULL; + = best_regend = reg_dummy = NULL; reg_info = reg_info_dummy = (register_info_type *) NULL; } -#endif /* REGEX_MALLOC */ +#endif /* MATCH_MAY_ALLOCATE */ /* The starting position is bogus. */ if (pos < 0 || pos > size1 + size2) @@ -3365,7 +4285,7 @@ for (mcnt = 1; mcnt < num_regs; mcnt++) { regstart[mcnt] = regend[mcnt] - = old_regstart[mcnt] = old_regend[mcnt] = REG_UNSET_VALUE; + = old_regstart[mcnt] = old_regend[mcnt] = REG_UNSET_VALUE; REG_MATCH_NULL_STRING_P (reg_info[mcnt]) = MATCH_NULL_UNSET_VALUE; IS_ACTIVE (reg_info[mcnt]) = 0; @@ -3374,7 +4294,7 @@ } /* We move `string1' into `string2' if the latter's empty -- but not if - `string1' is null. */ + `string1' is null. */ if (size2 == 0 && string1 != NULL) { string2 = string1; @@ -3420,7 +4340,7 @@ DEBUG_PRINT_DOUBLE_STRING (d, string1, size1, string2, size2); DEBUG_PRINT1 ("'\n"); - /* This loops over pattern commands. It exits by returning from the + /* This loops over pattern commands. It exits by returning from the function if the match is complete, or it drops through if the match fails at this starting point in the input data. */ for (;;) @@ -3429,177 +4349,222 @@ if (p == pend) { /* End of pattern means we might have succeeded. */ - DEBUG_PRINT1 ("end of pattern ... "); + DEBUG_PRINT1 ("end of pattern ... "); /* If we haven't matched the entire string, and we want the - longest match, try backtracking. */ - if (d != end_match_2) + longest match, try backtracking. */ + if (d != end_match_2) { - DEBUG_PRINT1 ("backtracking.\n"); + /* 1 if this match ends in the same string (string1 or string2) + as the best previous match. */ + boolean same_str_p = (FIRST_STRING_P (match_end) + == MATCHING_IN_FIRST_STRING); + /* 1 if this match is the best seen so far. */ + boolean best_match_p; + + /* AIX compiler got confused when this was combined + with the previous declaration. */ + if (same_str_p) + best_match_p = d > match_end; + else + best_match_p = !MATCHING_IN_FIRST_STRING; - if (!FAIL_STACK_EMPTY ()) - { /* More failure points to try. */ - boolean same_str_p = (FIRST_STRING_P (match_end) - == MATCHING_IN_FIRST_STRING); - - /* If exceeds best match so far, save it. */ - if (!best_regs_set - || (same_str_p && d > match_end) - || (!same_str_p && !MATCHING_IN_FIRST_STRING)) - { - best_regs_set = true; - match_end = d; + DEBUG_PRINT1 ("backtracking.\n"); - DEBUG_PRINT1 ("\nSAVING match as best so far.\n"); + if (!FAIL_STACK_EMPTY ()) + { /* More failure points to try. */ - for (mcnt = 1; mcnt < num_regs; mcnt++) - { - best_regstart[mcnt] = regstart[mcnt]; - best_regend[mcnt] = regend[mcnt]; - } - } - goto fail; - } + /* If exceeds best match so far, save it. */ + if (!best_regs_set || best_match_p) + { + best_regs_set = true; + match_end = d; - /* If no failure points, don't restore garbage. */ - else if (best_regs_set) - { - restore_best_regs: - /* Restore best match. It may happen that `dend == - end_match_1' while the restored d is in string2. - For example, the pattern `x.*y.*z' against the - strings `x-' and `y-z-', if the two strings are - not consecutive in memory. */ - DEBUG_PRINT1 ("Restoring best registers.\n"); - - d = match_end; - dend = ((d >= string1 && d <= end1) - ? end_match_1 : end_match_2); + DEBUG_PRINT1 ("\nSAVING match as best so far.\n"); + + for (mcnt = 1; mcnt < num_regs; mcnt++) + { + best_regstart[mcnt] = regstart[mcnt]; + best_regend[mcnt] = regend[mcnt]; + } + } + goto fail; + } + /* If no failure points, don't restore garbage. And if + last match is real best match, don't restore second + best one. */ + else if (best_regs_set && !best_match_p) + { + restore_best_regs: + /* Restore best match. It may happen that `dend == + end_match_1' while the restored d is in string2. + For example, the pattern `x.*y.*z' against the + strings `x-' and `y-z-', if the two strings are + not consecutive in memory. */ + DEBUG_PRINT1 ("Restoring best registers.\n"); + + d = match_end; + dend = ((d >= string1 && d <= end1) + ? end_match_1 : end_match_2); + for (mcnt = 1; mcnt < num_regs; mcnt++) { regstart[mcnt] = best_regstart[mcnt]; regend[mcnt] = best_regend[mcnt]; } - } - } /* d != end_match_2 */ + } + } /* d != end_match_2 */ - DEBUG_PRINT1 ("Accepting match.\n"); + succeed_label: + DEBUG_PRINT1 ("Accepting match.\n"); - /* If caller wants register contents data back, do it. */ - if (regs && !bufp->no_sub) + /* If caller wants register contents data back, do it. */ + if (regs && !bufp->no_sub) { - /* Have the register data arrays been allocated? */ - if (bufp->regs_allocated == REGS_UNALLOCATED) - { /* No. So allocate them with malloc. We need one - extra element beyond `num_regs' for the `-1' marker - GNU code uses. */ - regs->num_regs = MAX (RE_NREGS, num_regs + 1); - regs->start = TALLOC (regs->num_regs, regoff_t); - regs->end = TALLOC (regs->num_regs, regoff_t); - if (regs->start == NULL || regs->end == NULL) - return -2; - bufp->regs_allocated = REGS_REALLOCATE; - } - else if (bufp->regs_allocated == REGS_REALLOCATE) - { /* Yes. If we need more elements than were already - allocated, reallocate them. If we need fewer, just - leave it alone. */ - if (regs->num_regs < num_regs + 1) - { - regs->num_regs = num_regs + 1; - RETALLOC (regs->start, regs->num_regs, regoff_t); - RETALLOC (regs->end, regs->num_regs, regoff_t); - if (regs->start == NULL || regs->end == NULL) - return -2; - } - } - else + /* Have the register data arrays been allocated? */ + if (bufp->regs_allocated == REGS_UNALLOCATED) + { /* No. So allocate them with malloc. We need one + extra element beyond `num_regs' for the `-1' marker + GNU code uses. */ + regs->num_regs = MAX (RE_NREGS, num_regs + 1); + regs->start = TALLOC (regs->num_regs, regoff_t); + regs->end = TALLOC (regs->num_regs, regoff_t); + if (regs->start == NULL || regs->end == NULL) + { + FREE_VARIABLES (); + return -2; + } + bufp->regs_allocated = REGS_REALLOCATE; + } + else if (bufp->regs_allocated == REGS_REALLOCATE) + { /* Yes. If we need more elements than were already + allocated, reallocate them. If we need fewer, just + leave it alone. */ + if (regs->num_regs < num_regs + 1) + { + regs->num_regs = num_regs + 1; + RETALLOC (regs->start, regs->num_regs, regoff_t); + RETALLOC (regs->end, regs->num_regs, regoff_t); + if (regs->start == NULL || regs->end == NULL) + { + FREE_VARIABLES (); + return -2; + } + } + } + else { /* These braces fend off a "empty body in an else-statement" - warning under GCC when assert expands to nothing. */ + warning under GCC when assert expands to nothing. */ assert (bufp->regs_allocated == REGS_FIXED); } - /* Convert the pointer data in `regstart' and `regend' to - indices. Register zero has to be set differently, - since we haven't kept track of any info for it. */ - if (regs->num_regs > 0) - { - regs->start[0] = pos; - regs->end[0] = (MATCHING_IN_FIRST_STRING ? d - string1 - : d - string2 + size1); - } + /* Convert the pointer data in `regstart' and `regend' to + indices. Register zero has to be set differently, + since we haven't kept track of any info for it. */ + if (regs->num_regs > 0) + { + regs->start[0] = pos; + regs->end[0] = (MATCHING_IN_FIRST_STRING + ? ((regoff_t) (d - string1)) + : ((regoff_t) (d - string2 + size1))); + } - /* Go through the first `min (num_regs, regs->num_regs)' - registers, since that is all we initialized. */ + /* Go through the first `min (num_regs, regs->num_regs)' + registers, since that is all we initialized. */ for (mcnt = 1; mcnt < MIN (num_regs, regs->num_regs); mcnt++) { - if (REG_UNSET (regstart[mcnt]) || REG_UNSET (regend[mcnt])) - regs->start[mcnt] = regs->end[mcnt] = -1; - else - { - regs->start[mcnt] = POINTER_TO_OFFSET (regstart[mcnt]); - regs->end[mcnt] = POINTER_TO_OFFSET (regend[mcnt]); - } + if (REG_UNSET (regstart[mcnt]) || REG_UNSET (regend[mcnt])) + regs->start[mcnt] = regs->end[mcnt] = -1; + else + { + regs->start[mcnt] + = (regoff_t) POINTER_TO_OFFSET (regstart[mcnt]); + regs->end[mcnt] + = (regoff_t) POINTER_TO_OFFSET (regend[mcnt]); + } } - /* If the regs structure we return has more elements than - were in the pattern, set the extra elements to -1. If - we (re)allocated the registers, this is the case, - because we always allocate enough to have at least one - -1 at the end. */ - for (mcnt = num_regs; mcnt < regs->num_regs; mcnt++) - regs->start[mcnt] = regs->end[mcnt] = -1; + /* If the regs structure we return has more elements than + were in the pattern, set the extra elements to -1. If + we (re)allocated the registers, this is the case, + because we always allocate enough to have at least one + -1 at the end. */ + for (mcnt = num_regs; mcnt < regs->num_regs; mcnt++) + regs->start[mcnt] = regs->end[mcnt] = -1; } /* regs && !bufp->no_sub */ - FREE_VARIABLES (); - DEBUG_PRINT4 ("%u failure points pushed, %u popped (%u remain).\n", - nfailure_points_pushed, nfailure_points_popped, - nfailure_points_pushed - nfailure_points_popped); - DEBUG_PRINT2 ("%u registers pushed.\n", num_regs_pushed); + DEBUG_PRINT4 ("%u failure points pushed, %u popped (%u remain).\n", + nfailure_points_pushed, nfailure_points_popped, + nfailure_points_pushed - nfailure_points_popped); + DEBUG_PRINT2 ("%u registers pushed.\n", num_regs_pushed); - mcnt = d - pos - (MATCHING_IN_FIRST_STRING + mcnt = d - pos - (MATCHING_IN_FIRST_STRING ? string1 : string2 - size1); - DEBUG_PRINT2 ("Returning %d from re_match_2.\n", mcnt); + DEBUG_PRINT2 ("Returning %d from re_match_2.\n", mcnt); - return mcnt; - } + FREE_VARIABLES (); + return mcnt; + } - /* Otherwise match next pattern command. */ -#ifdef SWITCH_ENUM_BUG - switch ((int) ((re_opcode_t) *p++)) -#else - switch ((re_opcode_t) *p++) -#endif + /* Otherwise match next pattern command. */ + switch (SWITCH_ENUM_CAST ((re_opcode_t) *p++)) { - /* Ignore these. Used to ignore the n of succeed_n's which - currently have n == 0. */ - case no_op: - DEBUG_PRINT1 ("EXECUTING no_op.\n"); - break; - + /* Ignore these. Used to ignore the n of succeed_n's which + currently have n == 0. */ + case no_op: + DEBUG_PRINT1 ("EXECUTING no_op.\n"); + break; - /* Match the next n pattern characters exactly. The following - byte in the pattern defines n, and the n bytes after that - are the characters to match. */ + case succeed: + DEBUG_PRINT1 ("EXECUTING succeed.\n"); + goto succeed_label; + + /* Match the next n pattern characters exactly. The following + byte in the pattern defines n, and the n bytes after that + are the characters to match. */ case exactn: mcnt = *p++; - DEBUG_PRINT2 ("EXECUTING exactn %d.\n", mcnt); + DEBUG_PRINT2 ("EXECUTING exactn %d.\n", mcnt); - /* This is written out as an if-else so we don't waste time - testing `translate' inside the loop. */ - if (translate) + /* This is written out as an if-else so we don't waste time + testing `translate' inside the loop. */ + if (RE_TRANSLATE_P (translate)) { - do - { - PREFETCH (); - if (translate[(unsigned char) *d++] != (char) *p++) - goto fail; - } - while (--mcnt); +#ifdef emacs + if (multibyte) + do + { + int pat_charlen, buf_charlen; + unsigned int pat_ch, buf_ch; + + PREFETCH (); + pat_ch = STRING_CHAR_AND_LENGTH (p, pend - p, pat_charlen); + buf_ch = STRING_CHAR_AND_LENGTH (d, dend - d, buf_charlen); + + if (RE_TRANSLATE (translate, buf_ch) + != pat_ch) + goto fail; + + p += pat_charlen; + d += buf_charlen; + mcnt -= pat_charlen; + } + while (mcnt > 0); + else +#endif /* not emacs */ + do + { + PREFETCH (); + if ((unsigned char) RE_TRANSLATE (translate, (unsigned char) *d) + != (unsigned char) *p++) + goto fail; + d++; + } + while (--mcnt); } else { @@ -3611,206 +4576,262 @@ while (--mcnt); } SET_REGS_MATCHED (); - break; + break; - /* Match any character except possibly a newline or a null. */ + /* Match any character except possibly a newline or a null. */ case anychar: - DEBUG_PRINT1 ("EXECUTING anychar.\n"); + { + int buf_charlen; + unsigned int buf_ch; - PREFETCH (); + DEBUG_PRINT1 ("EXECUTING anychar.\n"); - if ((!(bufp->syntax & RE_DOT_NEWLINE) && TRANSLATE (*d) == '\n') - || (bufp->syntax & RE_DOT_NOT_NULL && TRANSLATE (*d) == '\000')) - goto fail; + PREFETCH (); - SET_REGS_MATCHED (); - DEBUG_PRINT2 (" Matched `%d'.\n", *d); - d++; +#ifdef emacs + if (multibyte) + buf_ch = STRING_CHAR_AND_LENGTH (d, dend - d, buf_charlen); + else +#endif /* not emacs */ + { + buf_ch = (unsigned char) *d; + buf_charlen = 1; + } + + buf_ch = TRANSLATE (buf_ch); + + if ((!(bufp->syntax & RE_DOT_NEWLINE) + && buf_ch == '\n') + || ((bufp->syntax & RE_DOT_NOT_NULL) + && buf_ch == '\000')) + goto fail; + + SET_REGS_MATCHED (); + DEBUG_PRINT2 (" Matched `%d'.\n", *d); + d += buf_charlen; + } break; case charset: case charset_not: { - register unsigned char c; + register unsigned int c; boolean not = (re_opcode_t) *(p - 1) == charset_not; + int len; - DEBUG_PRINT2 ("EXECUTING charset%s.\n", not ? "_not" : ""); + /* Start of actual range_table, or end of bitmap if there is no + range table. */ + unsigned char *range_table; + /* Nonzero if there is range table. */ + int range_table_exists; + + /* Number of ranges of range table. Not in bytes. */ + int count; + + DEBUG_PRINT2 ("EXECUTING charset%s.\n", not ? "_not" : ""); + PREFETCH (); - c = TRANSLATE (*d); /* The character to match. */ + c = (unsigned char) *d; - /* Cast to `unsigned' instead of `unsigned char' in case the - bit list is a full 32 bytes long. */ - if (c < (unsigned) (*p * BYTEWIDTH) + range_table = CHARSET_RANGE_TABLE (&p[-1]); /* Past the bitmap. */ + range_table_exists = CHARSET_RANGE_TABLE_EXISTS_P (&p[-1]); + if (range_table_exists) + EXTRACT_NUMBER_AND_INCR (count, range_table); + else + count = 0; + + if (multibyte && BASE_LEADING_CODE_P (c)) + c = STRING_CHAR_AND_LENGTH (d, dend - d, len); + + if (SINGLE_BYTE_CHAR_P (c)) + { /* Lookup bitmap. */ + c = TRANSLATE (c); /* The character to match. */ + len = 1; + + /* Cast to `unsigned' instead of `unsigned char' in + case the bit list is a full 32 bytes long. */ + if (c < (unsigned) (CHARSET_BITMAP_SIZE (&p[-1]) * BYTEWIDTH) && p[1 + c / BYTEWIDTH] & (1 << (c % BYTEWIDTH))) not = !not; + } + else if (range_table_exists) + CHARSET_LOOKUP_RANGE_TABLE_RAW (not, c, range_table, count); - p += 1 + *p; + p = CHARSET_RANGE_TABLE_END (range_table, count); if (!not) goto fail; SET_REGS_MATCHED (); - d++; + d += len; break; } - /* The beginning of a group is represented by start_memory. - The arguments are the register number in the next byte, and the - number of groups inner to this one in the next. The text - matched within the group is recorded (in the internal - registers data structure) under the register number. */ - case start_memory: + /* The beginning of a group is represented by start_memory. + The arguments are the register number in the next byte, and the + number of groups inner to this one in the next. The text + matched within the group is recorded (in the internal + registers data structure) under the register number. */ + case start_memory: DEBUG_PRINT3 ("EXECUTING start_memory %d (%d):\n", *p, p[1]); - /* Find out if this group can match the empty string. */ + /* Find out if this group can match the empty string. */ p1 = p; /* To send to group_match_null_string_p. */ - if (REG_MATCH_NULL_STRING_P (reg_info[*p]) == MATCH_NULL_UNSET_VALUE) - REG_MATCH_NULL_STRING_P (reg_info[*p]) - = group_match_null_string_p (&p1, pend, reg_info); - - /* Save the position in the string where we were the last time - we were at this open-group operator in case the group is - operated upon by a repetition operator, e.g., with `(a*)*b' - against `ab'; then we want to ignore where we are now in - the string in case this attempt to match fails. */ - old_regstart[*p] = REG_MATCH_NULL_STRING_P (reg_info[*p]) - ? REG_UNSET (regstart[*p]) ? d : regstart[*p] - : regstart[*p]; + if (REG_MATCH_NULL_STRING_P (reg_info[*p]) == MATCH_NULL_UNSET_VALUE) + REG_MATCH_NULL_STRING_P (reg_info[*p]) + = group_match_null_string_p (&p1, pend, reg_info); + + /* Save the position in the string where we were the last time + we were at this open-group operator in case the group is + operated upon by a repetition operator, e.g., with `(a*)*b' + against `ab'; then we want to ignore where we are now in + the string in case this attempt to match fails. */ + old_regstart[*p] = REG_MATCH_NULL_STRING_P (reg_info[*p]) + ? REG_UNSET (regstart[*p]) ? d : regstart[*p] + : regstart[*p]; DEBUG_PRINT2 (" old_regstart: %d\n", POINTER_TO_OFFSET (old_regstart[*p])); - regstart[*p] = d; + regstart[*p] = d; DEBUG_PRINT2 (" regstart: %d\n", POINTER_TO_OFFSET (regstart[*p])); - IS_ACTIVE (reg_info[*p]) = 1; - MATCHED_SOMETHING (reg_info[*p]) = 0; + IS_ACTIVE (reg_info[*p]) = 1; + MATCHED_SOMETHING (reg_info[*p]) = 0; - /* This is the new highest active register. */ - highest_active_reg = *p; + /* Clear this whenever we change the register activity status. */ + set_regs_matched_done = 0; - /* If nothing was active before, this is the new lowest active - register. */ - if (lowest_active_reg == NO_LOWEST_ACTIVE_REG) - lowest_active_reg = *p; + /* This is the new highest active register. */ + highest_active_reg = *p; - /* Move past the register number and inner group count. */ - p += 2; - break; + /* If nothing was active before, this is the new lowest active + register. */ + if (lowest_active_reg == NO_LOWEST_ACTIVE_REG) + lowest_active_reg = *p; + + /* Move past the register number and inner group count. */ + p += 2; + just_past_start_mem = p; + + break; - /* The stop_memory opcode represents the end of a group. Its - arguments are the same as start_memory's: the register - number, and the number of inner groups. */ + /* The stop_memory opcode represents the end of a group. Its + arguments are the same as start_memory's: the register + number, and the number of inner groups. */ case stop_memory: DEBUG_PRINT3 ("EXECUTING stop_memory %d (%d):\n", *p, p[1]); - /* We need to save the string position the last time we were at - this close-group operator in case the group is operated - upon by a repetition operator, e.g., with `((a*)*(b*)*)*' - against `aba'; then we want to ignore where we are now in - the string in case this attempt to match fails. */ - old_regend[*p] = REG_MATCH_NULL_STRING_P (reg_info[*p]) - ? REG_UNSET (regend[*p]) ? d : regend[*p] + /* We need to save the string position the last time we were at + this close-group operator in case the group is operated + upon by a repetition operator, e.g., with `((a*)*(b*)*)*' + against `aba'; then we want to ignore where we are now in + the string in case this attempt to match fails. */ + old_regend[*p] = REG_MATCH_NULL_STRING_P (reg_info[*p]) + ? REG_UNSET (regend[*p]) ? d : regend[*p] : regend[*p]; DEBUG_PRINT2 (" old_regend: %d\n", POINTER_TO_OFFSET (old_regend[*p])); - regend[*p] = d; + regend[*p] = d; DEBUG_PRINT2 (" regend: %d\n", POINTER_TO_OFFSET (regend[*p])); - /* This register isn't active anymore. */ - IS_ACTIVE (reg_info[*p]) = 0; + /* This register isn't active anymore. */ + IS_ACTIVE (reg_info[*p]) = 0; - /* If this was the only register active, nothing is active - anymore. */ - if (lowest_active_reg == highest_active_reg) - { - lowest_active_reg = NO_LOWEST_ACTIVE_REG; - highest_active_reg = NO_HIGHEST_ACTIVE_REG; - } - else - { /* We must scan for the new highest active register, since - it isn't necessarily one less than now: consider - (a(b)c(d(e)f)g). When group 3 ends, after the f), the - new highest active register is 1. */ - unsigned char r = *p - 1; - while (r > 0 && !IS_ACTIVE (reg_info[r])) - r--; - - /* If we end up at register zero, that means that we saved - the registers as the result of an `on_failure_jump', not - a `start_memory', and we jumped to past the innermost - `stop_memory'. For example, in ((.)*) we save - registers 1 and 2 as a result of the *, but when we pop - back to the second ), we are at the stop_memory 1. - Thus, nothing is active. */ + /* Clear this whenever we change the register activity status. */ + set_regs_matched_done = 0; + + /* If this was the only register active, nothing is active + anymore. */ + if (lowest_active_reg == highest_active_reg) + { + lowest_active_reg = NO_LOWEST_ACTIVE_REG; + highest_active_reg = NO_HIGHEST_ACTIVE_REG; + } + else + { /* We must scan for the new highest active register, since + it isn't necessarily one less than now: consider + (a(b)c(d(e)f)g). When group 3 ends, after the f), the + new highest active register is 1. */ + unsigned char r = *p - 1; + while (r > 0 && !IS_ACTIVE (reg_info[r])) + r--; + + /* If we end up at register zero, that means that we saved + the registers as the result of an `on_failure_jump', not + a `start_memory', and we jumped to past the innermost + `stop_memory'. For example, in ((.)*) we save + registers 1 and 2 as a result of the *, but when we pop + back to the second ), we are at the stop_memory 1. + Thus, nothing is active. */ if (r == 0) - { - lowest_active_reg = NO_LOWEST_ACTIVE_REG; - highest_active_reg = NO_HIGHEST_ACTIVE_REG; - } - else - highest_active_reg = r; - } + { + lowest_active_reg = NO_LOWEST_ACTIVE_REG; + highest_active_reg = NO_HIGHEST_ACTIVE_REG; + } + else + highest_active_reg = r; + } - /* If just failed to match something this time around with a - group that's operated on by a repetition operator, try to - force exit from the ``loop'', and restore the register - information for this group that we had before trying this - last match. */ - if ((!MATCHED_SOMETHING (reg_info[*p]) - || (re_opcode_t) p[-3] == start_memory) - && (p + 2) < pend) - { - boolean is_a_jump_n = false; + /* If just failed to match something this time around with a + group that's operated on by a repetition operator, try to + force exit from the ``loop'', and restore the register + information for this group that we had before trying this + last match. */ + if ((!MATCHED_SOMETHING (reg_info[*p]) + || just_past_start_mem == p - 1) + && (p + 2) < pend) + { + boolean is_a_jump_n = false; - p1 = p + 2; - mcnt = 0; - switch ((re_opcode_t) *p1++) - { - case jump_n: + p1 = p + 2; + mcnt = 0; + switch ((re_opcode_t) *p1++) + { + case jump_n: is_a_jump_n = true; - case pop_failure_jump: + case pop_failure_jump: case maybe_pop_jump: case jump: case dummy_failure_jump: - EXTRACT_NUMBER_AND_INCR (mcnt, p1); + EXTRACT_NUMBER_AND_INCR (mcnt, p1); if (is_a_jump_n) p1 += 2; - break; + break; - default: - /* do nothing */ ; - } + default: + /* do nothing */ ; + } p1 += mcnt; - /* If the next operation is a jump backwards in the pattern - to an on_failure_jump right before the start_memory - corresponding to this stop_memory, exit from the loop - by forcing a failure after pushing on the stack the - on_failure_jump's jump in the pattern, and d. */ - if (mcnt < 0 && (re_opcode_t) *p1 == on_failure_jump - && (re_opcode_t) p1[3] == start_memory && p1[4] == *p) + /* If the next operation is a jump backwards in the pattern + to an on_failure_jump right before the start_memory + corresponding to this stop_memory, exit from the loop + by forcing a failure after pushing on the stack the + on_failure_jump's jump in the pattern, and d. */ + if (mcnt < 0 && (re_opcode_t) *p1 == on_failure_jump + && (re_opcode_t) p1[3] == start_memory && p1[4] == *p) { - /* If this group ever matched anything, then restore - what its registers were before trying this last - failed match, e.g., with `(a*)*b' against `ab' for - regstart[1], and, e.g., with `((a*)*(b*)*)*' - against `aba' for regend[3]. - - Also restore the registers for inner groups for, - e.g., `((a*)(b*))*' against `aba' (register 3 would - otherwise get trashed). */ + /* If this group ever matched anything, then restore + what its registers were before trying this last + failed match, e.g., with `(a*)*b' against `ab' for + regstart[1], and, e.g., with `((a*)*(b*)*)*' + against `aba' for regend[3]. + + Also restore the registers for inner groups for, + e.g., `((a*)(b*))*' against `aba' (register 3 would + otherwise get trashed). */ - if (EVER_MATCHED_SOMETHING (reg_info[*p])) + if (EVER_MATCHED_SOMETHING (reg_info[*p])) { unsigned r; - EVER_MATCHED_SOMETHING (reg_info[*p]) = 0; + EVER_MATCHED_SOMETHING (reg_info[*p]) = 0; /* Restore this and inner groups' (if any) registers. */ for (r = *p; r < *p + *(p + 1); r++) @@ -3823,53 +4844,53 @@ } } p1++; - EXTRACT_NUMBER_AND_INCR (mcnt, p1); - PUSH_FAILURE_POINT (p1 + mcnt, d, -2); + EXTRACT_NUMBER_AND_INCR (mcnt, p1); + PUSH_FAILURE_POINT (p1 + mcnt, d, -2); - goto fail; - } - } + goto fail; + } + } - /* Move past the register number and the inner group count. */ - p += 2; - break; + /* Move past the register number and the inner group count. */ + p += 2; + break; /* \ has been turned into a `duplicate' command which is - followed by the numeric value of as the register number. */ - case duplicate: + followed by the numeric value of as the register number. */ + case duplicate: { register const char *d2, *dend2; - int regno = *p++; /* Get which register to match against. */ + int regno = *p++; /* Get which register to match against. */ DEBUG_PRINT2 ("EXECUTING duplicate %d.\n", regno); - /* Can't back reference a group which we've never matched. */ - if (REG_UNSET (regstart[regno]) || REG_UNSET (regend[regno])) - goto fail; - - /* Where in input to try to start matching. */ - d2 = regstart[regno]; - - /* Where to stop matching; if both the place to start and - the place to stop matching are in the same string, then - set to the place to stop, otherwise, for now have to use - the end of the first string. */ + /* Can't back reference a group which we've never matched. */ + if (REG_UNSET (regstart[regno]) || REG_UNSET (regend[regno])) + goto fail; + + /* Where in input to try to start matching. */ + d2 = regstart[regno]; + + /* Where to stop matching; if both the place to start and + the place to stop matching are in the same string, then + set to the place to stop, otherwise, for now have to use + the end of the first string. */ - dend2 = ((FIRST_STRING_P (regstart[regno]) + dend2 = ((FIRST_STRING_P (regstart[regno]) == FIRST_STRING_P (regend[regno])) ? regend[regno] : end_match_1); for (;;) { /* If necessary, advance to next segment in register - contents. */ + contents. */ while (d2 == dend2) { if (dend2 == end_match_2) break; if (dend2 == regend[regno]) break; - /* End of string1 => advance to string2. */ - d2 = string2; - dend2 = regend[regno]; + /* End of string1 => advance to string2. */ + d2 = string2; + dend2 = regend[regno]; } /* At end of register contents => success */ if (d2 == dend2) break; @@ -3881,433 +4902,761 @@ mcnt = dend - d; /* Want how many consecutive characters we can match in - one shot, so, if necessary, adjust the count. */ - if (mcnt > dend2 - d2) + one shot, so, if necessary, adjust the count. */ + if (mcnt > dend2 - d2) mcnt = dend2 - d2; /* Compare that many; failure if mismatch, else move - past them. */ - if (translate - ? bcmp_translate (d, d2, mcnt, translate) - : bcmp (d, d2, mcnt)) + past them. */ + if (RE_TRANSLATE_P (translate) + ? bcmp_translate (d, d2, mcnt, translate) + : bcmp (d, d2, mcnt)) goto fail; d += mcnt, d2 += mcnt; + + /* Do this because we've match some characters. */ + SET_REGS_MATCHED (); } } break; - /* begline matches the empty string at the beginning of the string - (unless `not_bol' is set in `bufp'), and, if - `newline_anchor' is set, after newlines. */ + /* begline matches the empty string at the beginning of the string + (unless `not_bol' is set in `bufp'), and, if + `newline_anchor' is set, after newlines. */ case begline: - DEBUG_PRINT1 ("EXECUTING begline.\n"); + DEBUG_PRINT1 ("EXECUTING begline.\n"); - if (AT_STRINGS_BEG (d)) - { - if (!bufp->not_bol) break; - } - else if (d[-1] == '\n' && bufp->newline_anchor) - { - break; - } - /* In all other cases, we fail. */ - goto fail; + if (AT_STRINGS_BEG (d)) + { + if (!bufp->not_bol) break; + } + else if (d[-1] == '\n' && bufp->newline_anchor) + { + break; + } + /* In all other cases, we fail. */ + goto fail; - /* endline is the dual of begline. */ + /* endline is the dual of begline. */ case endline: - DEBUG_PRINT1 ("EXECUTING endline.\n"); + DEBUG_PRINT1 ("EXECUTING endline.\n"); - if (AT_STRINGS_END (d)) - { - if (!bufp->not_eol) break; - } + if (AT_STRINGS_END (d)) + { + if (!bufp->not_eol) break; + } - /* We have to ``prefetch'' the next character. */ - else if ((d == end1 ? *string2 : *d) == '\n' - && bufp->newline_anchor) - { - break; - } - goto fail; + /* We have to ``prefetch'' the next character. */ + else if ((d == end1 ? *string2 : *d) == '\n' + && bufp->newline_anchor) + { + break; + } + goto fail; /* Match at the very beginning of the data. */ - case begbuf: - DEBUG_PRINT1 ("EXECUTING begbuf.\n"); - if (AT_STRINGS_BEG (d)) - break; - goto fail; + case begbuf: + DEBUG_PRINT1 ("EXECUTING begbuf.\n"); + if (AT_STRINGS_BEG (d)) + break; + goto fail; /* Match at the very end of the data. */ - case endbuf: - DEBUG_PRINT1 ("EXECUTING endbuf.\n"); + case endbuf: + DEBUG_PRINT1 ("EXECUTING endbuf.\n"); if (AT_STRINGS_END (d)) break; - goto fail; + goto fail; - /* on_failure_keep_string_jump is used to optimize `.*\n'. It - pushes NULL as the value for the string on the stack. Then - `pop_failure_point' will keep the current value for the - string, instead of restoring it. To see why, consider - matching `foo\nbar' against `.*\n'. The .* matches the foo; - then the . fails against the \n. But the next thing we want - to do is match the \n against the \n; if we restored the - string value, we would be back at the foo. - - Because this is used only in specific cases, we don't need to - check all the things that `on_failure_jump' does, to make - sure the right things get saved on the stack. Hence we don't - share its code. The only reason to push anything on the - stack at all is that otherwise we would have to change - `anychar's code to do something besides goto fail in this - case; that seems worse than this. */ - case on_failure_keep_string_jump: - DEBUG_PRINT1 ("EXECUTING on_failure_keep_string_jump"); + /* on_failure_keep_string_jump is used to optimize `.*\n'. It + pushes NULL as the value for the string on the stack. Then + `pop_failure_point' will keep the current value for the + string, instead of restoring it. To see why, consider + matching `foo\nbar' against `.*\n'. The .* matches the foo; + then the . fails against the \n. But the next thing we want + to do is match the \n against the \n; if we restored the + string value, we would be back at the foo. + + Because this is used only in specific cases, we don't need to + check all the things that `on_failure_jump' does, to make + sure the right things get saved on the stack. Hence we don't + share its code. The only reason to push anything on the + stack at all is that otherwise we would have to change + `anychar's code to do something besides goto fail in this + case; that seems worse than this. */ + case on_failure_keep_string_jump: + DEBUG_PRINT1 ("EXECUTING on_failure_keep_string_jump"); - EXTRACT_NUMBER_AND_INCR (mcnt, p); - DEBUG_PRINT3 (" %d (to 0x%x):\n", mcnt, p + mcnt); + EXTRACT_NUMBER_AND_INCR (mcnt, p); + DEBUG_PRINT3 (" %d (to 0x%x):\n", mcnt, p + mcnt); - PUSH_FAILURE_POINT (p + mcnt, NULL, -2); - break; + PUSH_FAILURE_POINT (p + mcnt, NULL, -2); + break; /* Uses of on_failure_jump: - Each alternative starts with an on_failure_jump that points - to the beginning of the next alternative. Each alternative - except the last ends with a jump that in effect jumps past - the rest of the alternatives. (They really jump to the - ending jump of the following alternative, because tensioning - these jumps is a hassle.) - - Repeats start with an on_failure_jump that points past both - the repetition text and either the following jump or - pop_failure_jump back to this on_failure_jump. */ + Each alternative starts with an on_failure_jump that points + to the beginning of the next alternative. Each alternative + except the last ends with a jump that in effect jumps past + the rest of the alternatives. (They really jump to the + ending jump of the following alternative, because tensioning + these jumps is a hassle.) + + Repeats start with an on_failure_jump that points past both + the repetition text and either the following jump or + pop_failure_jump back to this on_failure_jump. */ case on_failure_jump: - on_failure: - DEBUG_PRINT1 ("EXECUTING on_failure_jump"); + on_failure: + DEBUG_PRINT1 ("EXECUTING on_failure_jump"); - EXTRACT_NUMBER_AND_INCR (mcnt, p); - DEBUG_PRINT3 (" %d (to 0x%x)", mcnt, p + mcnt); +#if defined (WINDOWSNT) && defined (emacs) + QUIT; +#endif - /* If this on_failure_jump comes right before a group (i.e., - the original * applied to a group), save the information - for that group and all inner ones, so that if we fail back - to this point, the group's information will be correct. - For example, in \(a*\)*\1, we need the preceding group, - and in \(\(a*\)b*\)\2, we need the inner group. */ - - /* We can't use `p' to check ahead because we push - a failure point to `p + mcnt' after we do this. */ - p1 = p; - - /* We need to skip no_op's before we look for the - start_memory in case this on_failure_jump is happening as - the result of a completed succeed_n, as in \(a\)\{1,3\}b\1 - against aba. */ - while (p1 < pend && (re_opcode_t) *p1 == no_op) - p1++; + EXTRACT_NUMBER_AND_INCR (mcnt, p); + DEBUG_PRINT3 (" %d (to 0x%x)", mcnt, p + mcnt); - if (p1 < pend && (re_opcode_t) *p1 == start_memory) - { - /* We have a new highest active register now. This will - get reset at the start_memory we are about to get to, - but we will have saved all the registers relevant to - this repetition op, as described above. */ - highest_active_reg = *(p1 + 1) + *(p1 + 2); - if (lowest_active_reg == NO_LOWEST_ACTIVE_REG) - lowest_active_reg = *(p1 + 1); - } + /* If this on_failure_jump comes right before a group (i.e., + the original * applied to a group), save the information + for that group and all inner ones, so that if we fail back + to this point, the group's information will be correct. + For example, in \(a*\)*\1, we need the preceding group, + and in \(zz\(a*\)b*\)\2, we need the inner group. */ + + /* We can't use `p' to check ahead because we push + a failure point to `p + mcnt' after we do this. */ + p1 = p; + + /* We need to skip no_op's before we look for the + start_memory in case this on_failure_jump is happening as + the result of a completed succeed_n, as in \(a\)\{1,3\}b\1 + against aba. */ + while (p1 < pend && (re_opcode_t) *p1 == no_op) + p1++; - DEBUG_PRINT1 (":\n"); - PUSH_FAILURE_POINT (p + mcnt, d, -2); - break; + if (p1 < pend && (re_opcode_t) *p1 == start_memory) + { + /* We have a new highest active register now. This will + get reset at the start_memory we are about to get to, + but we will have saved all the registers relevant to + this repetition op, as described above. */ + highest_active_reg = *(p1 + 1) + *(p1 + 2); + if (lowest_active_reg == NO_LOWEST_ACTIVE_REG) + lowest_active_reg = *(p1 + 1); + } + DEBUG_PRINT1 (":\n"); + PUSH_FAILURE_POINT (p + mcnt, d, -2); + break; + - /* A smart repeat ends with `maybe_pop_jump'. - We change it to either `pop_failure_jump' or `jump'. */ - case maybe_pop_jump: - EXTRACT_NUMBER_AND_INCR (mcnt, p); - DEBUG_PRINT2 ("EXECUTING maybe_pop_jump %d.\n", mcnt); - { + /* A smart repeat ends with `maybe_pop_jump'. + We change it to either `pop_failure_jump' or `jump'. */ + case maybe_pop_jump: +#if defined (WINDOWSNT) && defined (emacs) + QUIT; +#endif + EXTRACT_NUMBER_AND_INCR (mcnt, p); + DEBUG_PRINT2 ("EXECUTING maybe_pop_jump %d.\n", mcnt); + { register unsigned char *p2 = p; + + /* Compare the beginning of the repeat with what in the + pattern follows its end. If we can establish that there + is nothing that they would both match, i.e., that we + would have to backtrack because of (as in, e.g., `a*a') + then we can change to pop_failure_jump, because we'll + never have to backtrack. + + This is not true in the case of alternatives: in + `(a|ab)*' we do need to backtrack to the `ab' alternative + (e.g., if the string was `ab'). But instead of trying to + detect that here, the alternative has put on a dummy + failure point which is what we will end up popping. */ + + /* Skip over open/close-group commands. + If what follows this loop is a ...+ construct, + look at what begins its body, since we will have to + match at least one of that. */ + while (1) + { + if (p2 + 2 < pend + && ((re_opcode_t) *p2 == stop_memory + || (re_opcode_t) *p2 == start_memory)) + p2 += 3; + else if (p2 + 6 < pend + && (re_opcode_t) *p2 == dummy_failure_jump) + p2 += 6; + else + break; + } - /* Compare the beginning of the repeat with what in the - pattern follows its end. If we can establish that there - is nothing that they would both match, i.e., that we - would have to backtrack because of (as in, e.g., `a*a') - then we can change to pop_failure_jump, because we'll - never have to backtrack. - - This is not true in the case of alternatives: in - `(a|ab)*' we do need to backtrack to the `ab' alternative - (e.g., if the string was `ab'). But instead of trying to - detect that here, the alternative has put on a dummy - failure point which is what we will end up popping. */ - - /* Skip over open/close-group commands. */ - while (p2 + 2 < pend - && ((re_opcode_t) *p2 == stop_memory - || (re_opcode_t) *p2 == start_memory)) - p2 += 3; /* Skip over args, too. */ + p1 = p + mcnt; + /* p1[0] ... p1[2] are the `on_failure_jump' corresponding + to the `maybe_finalize_jump' of this case. Examine what + follows. */ - /* If we're at the end of the pattern, we can change. */ - if (p2 == pend) + /* If we're at the end of the pattern, we can change. */ + if (p2 == pend) { /* Consider what happens when matching ":\(.*\)" against ":/". I don't really understand this code - yet. */ - p[-3] = (unsigned char) pop_failure_jump; - DEBUG_PRINT1 - (" End of pattern: change to `pop_failure_jump'.\n"); - } + yet. */ + p[-3] = (unsigned char) pop_failure_jump; + DEBUG_PRINT1 + (" End of pattern: change to `pop_failure_jump'.\n"); + } - else if ((re_opcode_t) *p2 == exactn + else if ((re_opcode_t) *p2 == exactn || (bufp->newline_anchor && (re_opcode_t) *p2 == endline)) { - register unsigned char c - = *p2 == (unsigned char) endline ? '\n' : p2[2]; - p1 = p + mcnt; - - /* p1[0] ... p1[2] are the `on_failure_jump' corresponding - to the `maybe_finalize_jump' of this case. Examine what - follows. */ - if ((re_opcode_t) p1[3] == exactn && p1[5] != c) - { - p[-3] = (unsigned char) pop_failure_jump; - DEBUG_PRINT3 (" %c != %c => pop_failure_jump.\n", - c, p1[5]); - } + register unsigned int c + = *p2 == (unsigned char) endline ? '\n' : p2[2]; + + if ((re_opcode_t) p1[3] == exactn) + { + if (!(multibyte /* && (c != '\n') */ + && BASE_LEADING_CODE_P (c)) + ? c != p1[5] + : (STRING_CHAR (&p2[2], pend - &p2[2]) + != STRING_CHAR (&p1[5], pend - &p1[5]))) + { + p[-3] = (unsigned char) pop_failure_jump; + DEBUG_PRINT3 (" %c != %c => pop_failure_jump.\n", + c, p1[5]); + } + } else if ((re_opcode_t) p1[3] == charset || (re_opcode_t) p1[3] == charset_not) { int not = (re_opcode_t) p1[3] == charset_not; - if (c < (unsigned char) (p1[4] * BYTEWIDTH) + if (multibyte /* && (c != '\n') */ + && BASE_LEADING_CODE_P (c)) + c = STRING_CHAR (&p2[2], pend - &p2[2]); + + /* Test if C is listed in charset (or charset_not) + at `&p1[3]'. */ + if (SINGLE_BYTE_CHAR_P (c)) + { + if (c < CHARSET_BITMAP_SIZE (&p1[3]) * BYTEWIDTH && p1[5 + c / BYTEWIDTH] & (1 << (c % BYTEWIDTH))) not = !not; + } + else if (CHARSET_RANGE_TABLE_EXISTS_P (&p1[3])) + CHARSET_LOOKUP_RANGE_TABLE (not, c, &p1[3]); + + /* `not' is equal to 1 if c would match, which means + that we can't change to pop_failure_jump. */ + if (!not) + { + p[-3] = (unsigned char) pop_failure_jump; + DEBUG_PRINT1 (" No match => pop_failure_jump.\n"); + } + } + } + else if ((re_opcode_t) *p2 == charset) + { + if ((re_opcode_t) p1[3] == exactn) + { + register unsigned int c = p1[5]; + int not = 0; - /* `not' is equal to 1 if c would match, which means - that we can't change to pop_failure_jump. */ + if (multibyte && BASE_LEADING_CODE_P (c)) + c = STRING_CHAR (&p1[5], pend - &p1[5]); + + /* Test if C is listed in charset at `p2'. */ + if (SINGLE_BYTE_CHAR_P (c)) + { + if (c < CHARSET_BITMAP_SIZE (p2) * BYTEWIDTH + && (p2[2 + c / BYTEWIDTH] + & (1 << (c % BYTEWIDTH)))) + not = !not; + } + else if (CHARSET_RANGE_TABLE_EXISTS_P (p2)) + CHARSET_LOOKUP_RANGE_TABLE (not, c, p2); + if (!not) - { - p[-3] = (unsigned char) pop_failure_jump; - DEBUG_PRINT1 (" No match => pop_failure_jump.\n"); - } + { + p[-3] = (unsigned char) pop_failure_jump; + DEBUG_PRINT1 (" No match => pop_failure_jump.\n"); + } + } + + /* It is hard to list up all the character in charset + P2 if it includes multibyte character. Give up in + such case. */ + else if (!multibyte || !CHARSET_RANGE_TABLE_EXISTS_P (p2)) + { + /* Now, we are sure that P2 has no range table. + So, for the size of bitmap in P2, `p2[1]' is + enough. But P1 may have range table, so the + size of bitmap table of P1 is extracted by + using macro `CHARSET_BITMAP_SIZE'. + + Since we know that all the character listed in + P2 is ASCII, it is enough to test only bitmap + table of P1. */ + + if ((re_opcode_t) p1[3] == charset_not) + { + int idx; + /* We win if the charset_not inside the loop lists + every character listed in the charset after. */ + for (idx = 0; idx < (int) p2[1]; idx++) + if (! (p2[2 + idx] == 0 + || (idx < CHARSET_BITMAP_SIZE (&p1[3]) + && ((p2[2 + idx] & ~ p1[5 + idx]) == 0)))) + break; + + if (idx == p2[1]) + { + p[-3] = (unsigned char) pop_failure_jump; + DEBUG_PRINT1 (" No match => pop_failure_jump.\n"); + } } + else if ((re_opcode_t) p1[3] == charset) + { + int idx; + /* We win if the charset inside the loop + has no overlap with the one after the loop. */ + for (idx = 0; + (idx < (int) p2[1] + && idx < CHARSET_BITMAP_SIZE (&p1[3])); + idx++) + if ((p2[2 + idx] & p1[5 + idx]) != 0) + break; + + if (idx == p2[1] + || idx == CHARSET_BITMAP_SIZE (&p1[3])) + { + p[-3] = (unsigned char) pop_failure_jump; + DEBUG_PRINT1 (" No match => pop_failure_jump.\n"); + } + } } } + } p -= 2; /* Point at relative address again. */ if ((re_opcode_t) p[-1] != pop_failure_jump) { p[-1] = (unsigned char) jump; - DEBUG_PRINT1 (" Match => jump.\n"); + DEBUG_PRINT1 (" Match => jump.\n"); goto unconditional_jump; } - /* Note fall through. */ + /* Note fall through. */ /* The end of a simple repeat has a pop_failure_jump back to - its matching on_failure_jump, where the latter will push a - failure point. The pop_failure_jump takes off failure - points put on by this pop_failure_jump's matching - on_failure_jump; we got through the pattern to here from the - matching on_failure_jump, so didn't fail. */ - case pop_failure_jump: - { - /* We need to pass separate storage for the lowest and - highest registers, even though we don't care about the - actual values. Otherwise, we will restore only one - register from the stack, since lowest will == highest in - `pop_failure_point'. */ - unsigned dummy_low_reg, dummy_high_reg; - unsigned char *pdummy; - const char *sdummy; - - DEBUG_PRINT1 ("EXECUTING pop_failure_jump.\n"); - POP_FAILURE_POINT (sdummy, pdummy, - dummy_low_reg, dummy_high_reg, - reg_dummy, reg_dummy, reg_info_dummy); - } - /* Note fall through. */ + its matching on_failure_jump, where the latter will push a + failure point. The pop_failure_jump takes off failure + points put on by this pop_failure_jump's matching + on_failure_jump; we got through the pattern to here from the + matching on_failure_jump, so didn't fail. */ + case pop_failure_jump: + { + /* We need to pass separate storage for the lowest and + highest registers, even though we don't care about the + actual values. Otherwise, we will restore only one + register from the stack, since lowest will == highest in + `pop_failure_point'. */ + unsigned dummy_low_reg, dummy_high_reg; + unsigned char *pdummy; + const char *sdummy; + + DEBUG_PRINT1 ("EXECUTING pop_failure_jump.\n"); + POP_FAILURE_POINT (sdummy, pdummy, + dummy_low_reg, dummy_high_reg, + reg_dummy, reg_dummy, reg_info_dummy); + } + /* Note fall through. */ - /* Unconditionally jump (without popping any failure points). */ - case jump: + /* Unconditionally jump (without popping any failure points). */ + case jump: unconditional_jump: +#if defined (WINDOWSNT) && defined (emacs) + QUIT; +#endif EXTRACT_NUMBER_AND_INCR (mcnt, p); /* Get the amount to jump. */ - DEBUG_PRINT2 ("EXECUTING jump %d ", mcnt); - p += mcnt; /* Do the jump. */ - DEBUG_PRINT2 ("(to 0x%x).\n", p); + DEBUG_PRINT2 ("EXECUTING jump %d ", mcnt); + p += mcnt; /* Do the jump. */ + DEBUG_PRINT2 ("(to 0x%x).\n", p); break; - /* We need this opcode so we can detect where alternatives end - in `group_match_null_string_p' et al. */ - case jump_past_alt: - DEBUG_PRINT1 ("EXECUTING jump_past_alt.\n"); - goto unconditional_jump; - - - /* Normally, the on_failure_jump pushes a failure point, which - then gets popped at pop_failure_jump. We will end up at - pop_failure_jump, also, and with a pattern of, say, `a+', we - are skipping over the on_failure_jump, so we have to push - something meaningless for pop_failure_jump to pop. */ - case dummy_failure_jump: - DEBUG_PRINT1 ("EXECUTING dummy_failure_jump.\n"); - /* It doesn't matter what we push for the string here. What - the code at `fail' tests is the value for the pattern. */ - PUSH_FAILURE_POINT (0, 0, -2); - goto unconditional_jump; - - - /* At the end of an alternative, we need to push a dummy failure - point in case we are followed by a `pop_failure_jump', because - we don't want the failure point for the alternative to be - popped. For example, matching `(a|ab)*' against `aab' - requires that we match the `ab' alternative. */ - case push_dummy_failure: - DEBUG_PRINT1 ("EXECUTING push_dummy_failure.\n"); - /* See comments just above at `dummy_failure_jump' about the - two zeroes. */ - PUSH_FAILURE_POINT (0, 0, -2); - break; + /* We need this opcode so we can detect where alternatives end + in `group_match_null_string_p' et al. */ + case jump_past_alt: + DEBUG_PRINT1 ("EXECUTING jump_past_alt.\n"); + goto unconditional_jump; - /* Have to succeed matching what follows at least n times. - After that, handle like `on_failure_jump'. */ - case succeed_n: - EXTRACT_NUMBER (mcnt, p + 2); - DEBUG_PRINT2 ("EXECUTING succeed_n %d.\n", mcnt); - - assert (mcnt >= 0); - /* Originally, this is how many times we HAVE to succeed. */ - if (mcnt > 0) - { - mcnt--; + + /* Normally, the on_failure_jump pushes a failure point, which + then gets popped at pop_failure_jump. We will end up at + pop_failure_jump, also, and with a pattern of, say, `a+', we + are skipping over the on_failure_jump, so we have to push + something meaningless for pop_failure_jump to pop. */ + case dummy_failure_jump: + DEBUG_PRINT1 ("EXECUTING dummy_failure_jump.\n"); + /* It doesn't matter what we push for the string here. What + the code at `fail' tests is the value for the pattern. */ + PUSH_FAILURE_POINT (0, 0, -2); + goto unconditional_jump; + + + /* At the end of an alternative, we need to push a dummy failure + point in case we are followed by a `pop_failure_jump', because + we don't want the failure point for the alternative to be + popped. For example, matching `(a|ab)*' against `aab' + requires that we match the `ab' alternative. */ + case push_dummy_failure: + DEBUG_PRINT1 ("EXECUTING push_dummy_failure.\n"); + /* See comments just above at `dummy_failure_jump' about the + two zeroes. */ + PUSH_FAILURE_POINT (0, 0, -2); + break; + + /* Have to succeed matching what follows at least n times. + After that, handle like `on_failure_jump'. */ + case succeed_n: + EXTRACT_NUMBER (mcnt, p + 2); + DEBUG_PRINT2 ("EXECUTING succeed_n %d.\n", mcnt); + + assert (mcnt >= 0); + /* Originally, this is how many times we HAVE to succeed. */ + if (mcnt > 0) + { + mcnt--; p += 2; - STORE_NUMBER_AND_INCR (p, mcnt); - DEBUG_PRINT3 (" Setting 0x%x to %d.\n", p, mcnt); - } + STORE_NUMBER_AND_INCR (p, mcnt); + DEBUG_PRINT3 (" Setting 0x%x to %d.\n", p, mcnt); + } else if (mcnt == 0) - { - DEBUG_PRINT2 (" Setting two bytes from 0x%x to no_op.\n", p+2); + { + DEBUG_PRINT2 (" Setting two bytes from 0x%x to no_op.\n", p+2); p[2] = (unsigned char) no_op; - p[3] = (unsigned char) no_op; - goto on_failure; - } - break; + p[3] = (unsigned char) no_op; + goto on_failure; + } + break; - case jump_n: - EXTRACT_NUMBER (mcnt, p + 2); - DEBUG_PRINT2 ("EXECUTING jump_n %d.\n", mcnt); + case jump_n: + EXTRACT_NUMBER (mcnt, p + 2); + DEBUG_PRINT2 ("EXECUTING jump_n %d.\n", mcnt); - /* Originally, this is how many times we CAN jump. */ - if (mcnt) - { - mcnt--; - STORE_NUMBER (p + 2, mcnt); + /* Originally, this is how many times we CAN jump. */ + if (mcnt) + { + mcnt--; + STORE_NUMBER (p + 2, mcnt); goto unconditional_jump; - } - /* If don't have to jump any more, skip over the rest of command. */ + } + /* If don't have to jump any more, skip over the rest of command. */ else p += 4; - break; + break; case set_number_at: { - DEBUG_PRINT1 ("EXECUTING set_number_at.\n"); + DEBUG_PRINT1 ("EXECUTING set_number_at.\n"); - EXTRACT_NUMBER_AND_INCR (mcnt, p); - p1 = p + mcnt; - EXTRACT_NUMBER_AND_INCR (mcnt, p); - DEBUG_PRINT3 (" Setting 0x%x to %d.\n", p1, mcnt); + EXTRACT_NUMBER_AND_INCR (mcnt, p); + p1 = p + mcnt; + EXTRACT_NUMBER_AND_INCR (mcnt, p); + DEBUG_PRINT3 (" Setting 0x%x to %d.\n", p1, mcnt); STORE_NUMBER (p1, mcnt); - break; - } + break; + } - case wordbound: - DEBUG_PRINT1 ("EXECUTING wordbound.\n"); - if (AT_WORD_BOUNDARY (d)) + case wordbound: + DEBUG_PRINT1 ("EXECUTING wordbound.\n"); + + /* We SUCCEED in one of the following cases: */ + + /* Case 1: D is at the beginning or the end of string. */ + if (AT_STRINGS_BEG (d) || AT_STRINGS_END (d)) break; - goto fail; + else + { + /* C1 is the character before D, S1 is the syntax of C1, C2 + is the character at D, and S2 is the syntax of C2. */ + int c1, c2, s1, s2; + int pos1 = PTR_TO_OFFSET (d - 1); + int charpos; - case notwordbound: - DEBUG_PRINT1 ("EXECUTING notwordbound.\n"); - if (AT_WORD_BOUNDARY (d)) + GET_CHAR_BEFORE_2 (c1, d, string1, end1, string2, end2); + GET_CHAR_AFTER_2 (c2, d, string1, end1, string2, end2); +#ifdef emacs + charpos = SYNTAX_TABLE_BYTE_TO_CHAR (pos1); + UPDATE_SYNTAX_TABLE (charpos); +#endif + s1 = SYNTAX (c1); +#ifdef emacs + UPDATE_SYNTAX_TABLE_FORWARD (charpos + 1); +#endif + s2 = SYNTAX (c2); + + if (/* Case 2: Only one of S1 and S2 is Sword. */ + ((s1 == Sword) != (s2 == Sword)) + /* Case 3: Both of S1 and S2 are Sword, and macro + WORD_BOUNDARY_P (C1, C2) returns nonzero. */ + || ((s1 == Sword) && WORD_BOUNDARY_P (c1, c2))) + break; + } + goto fail; + + case notwordbound: + DEBUG_PRINT1 ("EXECUTING notwordbound.\n"); + + /* We FAIL in one of the following cases: */ + + /* Case 1: D is at the beginning or the end of string. */ + if (AT_STRINGS_BEG (d) || AT_STRINGS_END (d)) goto fail; - break; + else + { + /* C1 is the character before D, S1 is the syntax of C1, C2 + is the character at D, and S2 is the syntax of C2. */ + int c1, c2, s1, s2; + int pos1 = PTR_TO_OFFSET (d - 1); + int charpos; + + GET_CHAR_BEFORE_2 (c1, d, string1, end1, string2, end2); + GET_CHAR_AFTER_2 (c2, d, string1, end1, string2, end2); +#ifdef emacs + charpos = SYNTAX_TABLE_BYTE_TO_CHAR (pos1); + UPDATE_SYNTAX_TABLE (charpos); +#endif + s1 = SYNTAX (c1); +#ifdef emacs + UPDATE_SYNTAX_TABLE_FORWARD (charpos + 1); +#endif + s2 = SYNTAX (c2); + + if (/* Case 2: Only one of S1 and S2 is Sword. */ + ((s1 == Sword) != (s2 == Sword)) + /* Case 3: Both of S1 and S2 are Sword, and macro + WORD_BOUNDARY_P (C1, C2) returns nonzero. */ + || ((s1 == Sword) && WORD_BOUNDARY_P (c1, c2))) + goto fail; + } + break; case wordbeg: - DEBUG_PRINT1 ("EXECUTING wordbeg.\n"); - if (WORDCHAR_P (d) && (AT_STRINGS_BEG (d) || !WORDCHAR_P (d - 1))) - break; - goto fail; + DEBUG_PRINT1 ("EXECUTING wordbeg.\n"); + + /* We FAIL in one of the following cases: */ + + /* Case 1: D is at the end of string. */ + if (AT_STRINGS_END (d)) + goto fail; + else + { + /* C1 is the character before D, S1 is the syntax of C1, C2 + is the character at D, and S2 is the syntax of C2. */ + int c1, c2, s1, s2; + int pos1 = PTR_TO_OFFSET (d); + int charpos; + + GET_CHAR_AFTER_2 (c2, d, string1, end1, string2, end2); +#ifdef emacs + charpos = SYNTAX_TABLE_BYTE_TO_CHAR (pos1); + UPDATE_SYNTAX_TABLE (charpos); +#endif + s2 = SYNTAX (c2); + + /* Case 2: S2 is not Sword. */ + if (s2 != Sword) + goto fail; + + /* Case 3: D is not at the beginning of string ... */ + if (!AT_STRINGS_BEG (d)) + { + GET_CHAR_BEFORE_2 (c1, d, string1, end1, string2, end2); +#ifdef emacs + UPDATE_SYNTAX_TABLE_BACKWARD (charpos - 1); +#endif + s1 = SYNTAX (c1); + + /* ... and S1 is Sword, and WORD_BOUNDARY_P (C1, C2) + returns 0. */ + if ((s1 == Sword) && !WORD_BOUNDARY_P (c1, c2)) + goto fail; + } + } + break; case wordend: - DEBUG_PRINT1 ("EXECUTING wordend.\n"); - if (!AT_STRINGS_BEG (d) && WORDCHAR_P (d - 1) - && (!WORDCHAR_P (d) || AT_STRINGS_END (d))) - break; - goto fail; + DEBUG_PRINT1 ("EXECUTING wordend.\n"); + + /* We FAIL in one of the following cases: */ + + /* Case 1: D is at the beginning of string. */ + if (AT_STRINGS_BEG (d)) + goto fail; + else + { + /* C1 is the character before D, S1 is the syntax of C1, C2 + is the character at D, and S2 is the syntax of C2. */ + int c1, c2, s1, s2; + int pos1 = PTR_TO_OFFSET (d); + int charpos; + + GET_CHAR_BEFORE_2 (c1, d, string1, end1, string2, end2); +#ifdef emacs + charpos = SYNTAX_TABLE_BYTE_TO_CHAR (pos1 - 1); + UPDATE_SYNTAX_TABLE (charpos); +#endif + s1 = SYNTAX (c1); + + /* Case 2: S1 is not Sword. */ + if (s1 != Sword) + goto fail; + + /* Case 3: D is not at the end of string ... */ + if (!AT_STRINGS_END (d)) + { + GET_CHAR_AFTER_2 (c2, d, string1, end1, string2, end2); +#ifdef emacs + UPDATE_SYNTAX_TABLE_FORWARD (charpos); +#endif + s2 = SYNTAX (c2); + + /* ... and S2 is Sword, and WORD_BOUNDARY_P (C1, C2) + returns 0. */ + if ((s2 == Sword) && !WORD_BOUNDARY_P (c1, c2)) + goto fail; + } + } + break; #ifdef emacs - case before_dot: - DEBUG_PRINT1 ("EXECUTING before_dot.\n"); - if (PTR_CHAR_POS ((unsigned char *) d) >= point) - goto fail; - break; - - case at_dot: - DEBUG_PRINT1 ("EXECUTING at_dot.\n"); - if (PTR_CHAR_POS ((unsigned char *) d) != point) - goto fail; - break; - - case after_dot: - DEBUG_PRINT1 ("EXECUTING after_dot.\n"); - if (PTR_CHAR_POS ((unsigned char *) d) <= point) - goto fail; - break; + case before_dot: + DEBUG_PRINT1 ("EXECUTING before_dot.\n"); + if (PTR_BYTE_POS ((unsigned char *) d) >= PT_BYTE) + goto fail; + break; + + case at_dot: + DEBUG_PRINT1 ("EXECUTING at_dot.\n"); + if (PTR_BYTE_POS ((unsigned char *) d) != PT_BYTE) + goto fail; + break; + + case after_dot: + DEBUG_PRINT1 ("EXECUTING after_dot.\n"); + if (PTR_BYTE_POS ((unsigned char *) d) <= PT_BYTE) + goto fail; + break; case syntaxspec: - DEBUG_PRINT2 ("EXECUTING syntaxspec %d.\n", mcnt); + DEBUG_PRINT2 ("EXECUTING syntaxspec %d.\n", mcnt); mcnt = *p++; goto matchsyntax; - case wordchar: - DEBUG_PRINT1 ("EXECUTING Emacs wordchar.\n"); + case wordchar: + DEBUG_PRINT1 ("EXECUTING Emacs wordchar.\n"); mcnt = (int) Sword; - matchsyntax: + matchsyntax: PREFETCH (); - if (SYNTAX (*d++) != (enum syntaxcode) mcnt) - goto fail; - /* Can't use *d++ here; SYNTAX may be an unsafe macro. */ - d++; - if (SYNTAX (d[-1]) != (enum syntaxcode) mcnt) +#ifdef emacs + { + int pos1 = SYNTAX_TABLE_BYTE_TO_CHAR (PTR_TO_OFFSET (d)); + UPDATE_SYNTAX_TABLE (pos1); + } +#endif + { + int c, len; + + if (multibyte) + /* we must concern about multibyte form, ... */ + c = STRING_CHAR_AND_LENGTH (d, dend - d, len); + else + /* everything should be handled as ASCII, even though it + looks like multibyte form. */ + c = *d, len = 1; + + if (SYNTAX (c) != (enum syntaxcode) mcnt) goto fail; - SET_REGS_MATCHED (); + d += len; + } + SET_REGS_MATCHED (); break; case notsyntaxspec: - DEBUG_PRINT2 ("EXECUTING notsyntaxspec %d.\n", mcnt); + DEBUG_PRINT2 ("EXECUTING notsyntaxspec %d.\n", mcnt); mcnt = *p++; goto matchnotsyntax; - case notwordchar: - DEBUG_PRINT1 ("EXECUTING Emacs notwordchar.\n"); + case notwordchar: + DEBUG_PRINT1 ("EXECUTING Emacs notwordchar.\n"); mcnt = (int) Sword; - matchnotsyntax: + matchnotsyntax: PREFETCH (); - /* Can't use *d++ here; SYNTAX may be an unsafe macro. */ - d++; - if (SYNTAX (d[-1]) == (enum syntaxcode) mcnt) +#ifdef emacs + { + int pos1 = SYNTAX_TABLE_BYTE_TO_CHAR (PTR_TO_OFFSET (d)); + UPDATE_SYNTAX_TABLE (pos1); + } +#endif + { + int c, len; + + if (multibyte) + c = STRING_CHAR_AND_LENGTH (d, dend - d, len); + else + c = *d, len = 1; + + if (SYNTAX (c) == (enum syntaxcode) mcnt) goto fail; + d += len; + } + SET_REGS_MATCHED (); + break; + + case categoryspec: + DEBUG_PRINT2 ("EXECUTING categoryspec %d.\n", *p); + mcnt = *p++; + PREFETCH (); + { + int c, len; + + if (multibyte) + c = STRING_CHAR_AND_LENGTH (d, dend - d, len); + else + c = *d, len = 1; + + if (!CHAR_HAS_CATEGORY (c, mcnt)) + goto fail; + d += len; + } + SET_REGS_MATCHED (); + break; + + case notcategoryspec: + DEBUG_PRINT2 ("EXECUTING notcategoryspec %d.\n", *p); + mcnt = *p++; + PREFETCH (); + { + int c, len; + + if (multibyte) + c = STRING_CHAR_AND_LENGTH (d, dend - d, len); + else + c = *d, len = 1; + + if (CHAR_HAS_CATEGORY (c, mcnt)) + goto fail; + d += len; + } SET_REGS_MATCHED (); break; @@ -4339,6 +5688,9 @@ /* We goto here if a matching operation fails. */ fail: +#if defined (WINDOWSNT) && defined (emacs) + QUIT; +#endif if (!FAIL_STACK_EMPTY ()) { /* A restart point is known. Restore to that state. */ DEBUG_PRINT1 ("\nFAIL:\n"); @@ -4645,14 +5997,30 @@ bcmp_translate (s1, s2, len, translate) unsigned char *s1, *s2; register int len; - char *translate; + RE_TRANSLATE_TYPE translate; { register unsigned char *p1 = s1, *p2 = s2; - while (len) + unsigned char *p1_end = s1 + len; + unsigned char *p2_end = s2 + len; + + while (p1 != p1_end && p2 != p2_end) { - if (translate[*p1++] != translate[*p2++]) return 1; - len--; + int p1_charlen, p2_charlen; + int p1_ch, p2_ch; + + p1_ch = STRING_CHAR_AND_LENGTH (p1, p1_end - p1, p1_charlen); + p2_ch = STRING_CHAR_AND_LENGTH (p2, p2_end - p2, p2_charlen); + + if (RE_TRANSLATE (translate, p1_ch) + != RE_TRANSLATE (translate, p2_ch)) + return 1; + + p1 += p1_charlen, p2 += p2_charlen; } + + if (p1 != p1_end || p2 != p2_end) + return 1; + return 0; } @@ -4689,18 +6057,26 @@ ret = regex_compile (pattern, length, re_syntax_options, bufp); - return re_error_msg[(int) ret]; -} + if (!ret) + return NULL; + return gettext (re_error_msgid[(int) ret]); +} /* Entry points compatible with 4.2 BSD regex library. We don't define - them if this is an Emacs or POSIX compilation. */ + them unless specifically requested. */ -#if !defined (emacs) +#if defined (_REGEX_RE_COMP) || defined (_LIBC) /* BSD has one and only one pattern buffer. */ static struct re_pattern_buffer re_comp_buf; char * +#ifdef _LIBC +/* Make these definitions weak in libc, so POSIX programs can redefine + these names if they don't use our functions, and still use + regcomp/regexec below without link errors. */ +weak_function +#endif re_comp (s) const char *s; { @@ -4709,7 +6085,7 @@ if (!s) { if (!re_comp_buf.buffer) - return "No previous regular expression"; + return gettext ("No previous regular expression"); return 0; } @@ -4717,12 +6093,14 @@ { re_comp_buf.buffer = (unsigned char *) malloc (200); if (re_comp_buf.buffer == NULL) - return "Memory exhausted"; + /* CVS: Yes, we're discarding `const' here if !HAVE_LIBINTL. */ + return (char *) gettext (re_error_msgid[(int) REG_ESPACE]); re_comp_buf.allocated = 200; re_comp_buf.fastmap = (char *) malloc (1 << BYTEWIDTH); if (re_comp_buf.fastmap == NULL) - return "Memory exhausted"; + /* CVS: Yes, we're discarding `const' here if !HAVE_LIBINTL. */ + return (char *) gettext (re_error_msgid[(int) REG_ESPACE]); } /* Since `re_exec' always passes NULL for the `regs' argument, we @@ -4732,13 +6110,19 @@ re_comp_buf.newline_anchor = 1; ret = regex_compile (s, strlen (s), re_syntax_options, &re_comp_buf); - - /* Yes, we're discarding `const' here. */ - return (char *) re_error_msg[(int) ret]; + + if (!ret) + return NULL; + + /* Yes, we're discarding `const' here if !HAVE_LIBINTL. */ + return (char *) gettext (re_error_msgid[(int) ret]); } int +#ifdef _LIBC +weak_function +#endif re_exec (s) const char *s; { @@ -4746,7 +6130,7 @@ return 0 <= re_search (&re_comp_buf, s, len, 0, len, (struct re_registers *) 0); } -#endif /* not emacs and not _POSIX_SOURCE */ +#endif /* _REGEX_RE_COMP */ /* POSIX.2 functions. Don't define these for Emacs. */ @@ -4800,6 +6184,7 @@ /* regex_compile will allocate the space for the compiled pattern. */ preg->buffer = 0; preg->allocated = 0; + preg->used = 0; /* Don't bother to use a fastmap when searching. This simplifies the REG_NEWLINE case: if we used a fastmap, we'd have to put all the @@ -4811,7 +6196,9 @@ { unsigned i; - preg->translate = (char *) malloc (CHAR_SET_SIZE); + preg->translate + = (RE_TRANSLATE_TYPE) malloc (CHAR_SET_SIZE + * sizeof (*(RE_TRANSLATE_TYPE)0)); if (preg->translate == NULL) return (int) REG_ESPACE; @@ -4937,19 +6324,14 @@ size_t msg_size; if (errcode < 0 - || errcode >= (sizeof (re_error_msg) / sizeof (re_error_msg[0]))) + || errcode >= (sizeof (re_error_msgid) / sizeof (re_error_msgid[0]))) /* Only error codes returned by the rest of the code should be passed to this routine. If we are given anything else, or if other regex code generates an invalid error code, then the program has a bug. Dump core so we can fix it. */ abort (); - - msg = re_error_msg[errcode]; - /* POSIX doesn't require that we do anything in this case, but why - not be nice. */ - if (! msg) - msg = "Success"; + msg = gettext (re_error_msgid[errcode]); msg_size = strlen (msg) + 1; /* Includes the null. */ --LZKIROWV0YR1M5IXJ62Q Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/ossp-cvs/src/main.c Content-Disposition: attachment Index: ossp-pkg/ossp-cvs/src/main.c ============================================================ $ cvs diff -u -r1.15 -r1.16 main.c --- ossp-pkg/ossp-cvs/src/main.c 2000/06/17 20:01:32 1.15 +++ ossp-pkg/ossp-cvs/src/main.c 2000/06/20 14:25:12 1.16 @@ -1266,12 +1266,17 @@ /* FIXME (njc): should we always set this with the CVSROOT from the command line? */ if (cvs_update_env) { + static char *prev; char *env; env = xmalloc (strlen (CVSROOT_ENV) + strlen (CVSroot) + 1 + 1); (void) sprintf (env, "%s=%s", CVSROOT_ENV, CVSroot); (void) putenv (env); - /* do not free env, as putenv has control of it */ + /* do not free env yet, as putenv has control of it */ + /* but do free the previous value, if any */ + if (prev != NULL) + free (prev); + prev = env; } #endif } --LZKIROWV0YR1M5IXJ62Q Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/ossp-cvs/src/root.c Content-Disposition: attachment Index: ossp-pkg/ossp-cvs/src/root.c ============================================================ $ cvs diff -u -r1.2 -r1.3 root.c --- ossp-pkg/ossp-cvs/src/root.c 2000/06/12 16:42:39 1.2 +++ ossp-pkg/ossp-cvs/src/root.c 2000/06/20 14:25:12 1.3 @@ -379,7 +379,7 @@ char *CVSroot; { static int cvsroot_parsed = 0; - char *cvsroot_copy, *p; + char *cvsroot_copy, *cvsroot_save, *p; int check_hostname; /* Don't go through the trouble twice. */ @@ -389,10 +389,19 @@ return 0; } + if (CVSroot_original != NULL) + free (CVSroot_original); + if (CVSroot_directory != NULL) + free (CVSroot_directory); + if (CVSroot_username != NULL) + free (CVSroot_username); + if (CVSroot_hostname != NULL) + free (CVSroot_hostname); + CVSroot_original = xstrdup (CVSroot); - cvsroot_copy = xstrdup (CVSroot); + cvsroot_save = cvsroot_copy = xstrdup (CVSroot); - if ((*cvsroot_copy == ':')) + if (*cvsroot_copy == ':') { char *method = ++cvsroot_copy; @@ -408,6 +417,7 @@ if (! (p = strchr (method, ':'))) { error (0, 0, "bad CVSroot: %s", CVSroot); + free (cvsroot_save); return 1; } *p = '\0'; @@ -432,6 +442,7 @@ else { error (0, 0, "unknown method in CVSroot: %s", CVSroot); + free (cvsroot_save); return 1; } } @@ -462,18 +473,18 @@ { /* Check to see if there is a username in the string. */ - if ((p = strchr (cvsroot_copy, '@'))) + if ((p = strchr (cvsroot_copy, '@')) != NULL) { - CVSroot_username = cvsroot_copy; + CVSroot_username = xstrdup (cvsroot_copy); *p = '\0'; cvsroot_copy = ++p; if (*CVSroot_username == '\0') CVSroot_username = NULL; } - if ((p = strchr (cvsroot_copy, ':'))) + if ((p = strchr (cvsroot_copy, ':')) != NULL) { - CVSroot_hostname = cvsroot_copy; + CVSroot_hostname = xstrdup (cvsroot_copy); *p = '\0'; cvsroot_copy = ++p; @@ -482,7 +493,8 @@ } } - CVSroot_directory = cvsroot_copy; + CVSroot_directory = xstrdup(cvsroot_copy); + free (cvsroot_save); #if ! defined (CLIENT_SUPPORT) && ! defined (DEBUG) if (CVSroot_method != local_method) @@ -572,18 +584,24 @@ /* Set up the global CVSroot* variables as if we're using the local - repository DIR. DIR must point to storage which will last for the - rest of the CVS invocation (for example, the caller might malloc it - and never free it, or free it just before exiting CVS). */ + repository DIR. */ void set_local_cvsroot (dir) char *dir; { - CVSroot_original = dir; + if (CVSroot_original != NULL) + free (CVSroot_original); + CVSroot_original = xstrdup(dir); CVSroot_method = local_method; - CVSroot_directory = CVSroot_original; + if (CVSroot_directory != NULL) + free (CVSroot_directory); + CVSroot_directory = xstrdup(dir); + if (CVSroot_username != NULL) + free (CVSroot_username); CVSroot_username = NULL; + if (CVSroot_hostname != NULL) + free (CVSroot_hostname); CVSroot_hostname = NULL; client_active = 0; } --LZKIROWV0YR1M5IXJ62Q Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/ossp-cvs/src/server.c Content-Disposition: attachment Index: ossp-pkg/ossp-cvs/src/server.c ============================================================ $ cvs diff -u -r1.19 -r1.20 server.c --- ossp-pkg/ossp-cvs/src/server.c 2000/06/17 12:42:25 1.19 +++ ossp-pkg/ossp-cvs/src/server.c 2000/06/20 14:25:12 1.20 @@ -745,7 +745,6 @@ { char *env; char *path; - char *arg_dup; if (error_pending()) return; @@ -794,14 +793,7 @@ } } #endif - arg_dup = malloc (strlen (arg) + 1); - if (arg_dup == NULL) - { - pending_error = ENOMEM; - return; - } - strcpy (arg_dup, arg); - set_local_cvsroot (arg_dup); + set_local_cvsroot (arg); /* For pserver, this will already have happened, and the call will do nothing. But for rsh, we need to do it now. */ --LZKIROWV0YR1M5IXJ62Q-- From ossp-cvs-owner@ossp.org Tue Jun 20 16:26:05 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e5KEQ4797784; Tue, 20 Jun 2000 16:26:04 +0200 (CEST) Date: Tue, 20 Jun 2000 16:26:04 +0200 (CEST) Message-Id: <200006201426.e5KEQ4797784@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="XGEPC3MF2IEA0R8GASLX" Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/ossp-cvs configure configure.in Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list This is a multi-part message in MIME format. --XGEPC3MF2IEA0R8GASLX Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: commit summary Content-Disposition: inline OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 20-Jun-2000 16:26:04 Branch: HEAD Handle: 2000062015260300 Modified files: ossp-pkg/ossp-cvs configure configure.in Log: *** empty log message *** Summary: Revision Changes Path 1.12 BLOB ossp-pkg/ossp-cvs/configure 1.12 +6 -0 ossp-pkg/ossp-cvs/configure.in ____________________________________________________________________________ --XGEPC3MF2IEA0R8GASLX Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/ossp-cvs/configure Content-Disposition: attachment Index: ossp-pkg/ossp-cvs/configure ============================================================ $ cvs update -p -r1.11 configure >configure.old $ cvs update -p -r1.12 configure >configure.new $ diff -u configure.old configure.new --XGEPC3MF2IEA0R8GASLX Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/ossp-cvs/configure.in Content-Disposition: attachment Index: ossp-pkg/ossp-cvs/configure.in ============================================================ $ cvs diff -u -r1.11 -r1.12 configure.in --- ossp-pkg/ossp-cvs/configure.in 2000/06/16 20:51:48 1.11 +++ ossp-pkg/ossp-cvs/configure.in 2000/06/20 14:26:03 1.12 @@ -77,6 +77,12 @@ AC_DEFINE(HAVE_MEMCHR) dnl +dnl Force lib/regex.c to use malloc instead of messing around with alloca +dnl and define the old re_comp routines that we use. +dnl +AC_DEFINE(REGEX_MALLOC) +AC_DEFINE(_REGEX_RE_COMP) +dnl dnl AC_FUNC_VFORK is rather baroque. It seems to be rather more picky dnl than, say, the Single Unix Specification (version 2), which simplifies dnl a lot of cases by saying that the child process can't set any variables --XGEPC3MF2IEA0R8GASLX-- From ossp-cvs-owner@ossp.org Tue Jun 20 16:38:51 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e5KEco998697; Tue, 20 Jun 2000 16:38:50 +0200 (CEST) Date: Tue, 20 Jun 2000 16:38:50 +0200 (CEST) Message-Id: <200006201438.e5KEco998697@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="LBT26W69VOAOSQ8OXYAT" Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/ossp-cvs/lib regex.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list This is a multi-part message in MIME format. --LBT26W69VOAOSQ8OXYAT Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: commit summary Content-Disposition: inline OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 20-Jun-2000 16:38:50 Branch: HEAD Handle: 2000062015385000 Modified files: ossp-pkg/ossp-cvs/lib regex.c Log: Get rid of Emacs related warnings Summary: Revision Changes Path 1.4 +5 -31 ossp-pkg/ossp-cvs/lib/regex.c ____________________________________________________________________________ --LBT26W69VOAOSQ8OXYAT Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/ossp-cvs/lib/regex.c Content-Disposition: attachment Index: ossp-pkg/ossp-cvs/lib/regex.c ============================================================ $ cvs diff -u -r1.3 -r1.4 regex.c --- ossp-pkg/ossp-cvs/lib/regex.c 2000/06/20 14:25:09 1.3 +++ ossp-pkg/ossp-cvs/lib/regex.c 2000/06/20 14:38:50 1.4 @@ -1534,7 +1534,6 @@ static void insert_op1 (), insert_op2 (); static boolean at_begline_loc_p (), at_endline_loc_p (); static boolean group_in_compile_stack (); -static reg_errcode_t compile_range (); /* Fetch the next character in the uncompiled pattern---translating it if necessary. Also cast from a signed character in the constant @@ -2352,7 +2351,6 @@ Split that into two ranges,, the low one ending at 0237, and the high one starting at ...040. */ - int c1_base = (c1 & ~0177) | 040; SET_RANGE_TABLE_WORK_AREA (range_table_work, c, c1); c1 = 0237; } @@ -2514,11 +2512,12 @@ case ')': if (syntax & RE_NO_BK_PARENS) goto normal_backslash; - if (COMPILE_STACK_EMPTY) + if (COMPILE_STACK_EMPTY) { if (syntax & RE_UNMATCHED_RIGHT_PAREN_ORD) goto normal_backslash; else FREE_STACK_RETURN (REG_ERPAREN); + } handle_close: if (fixup_alt_jump) @@ -2534,11 +2533,12 @@ } /* See similar code for backslashed left paren above. */ - if (COMPILE_STACK_EMPTY) + if (COMPILE_STACK_EMPTY) { if (syntax & RE_UNMATCHED_RIGHT_PAREN_ORD) goto normal_char; else FREE_STACK_RETURN (REG_ERPAREN); + } /* Since we just checked for an empty stack above, this ``can't happen''. */ @@ -3173,15 +3173,13 @@ re_compile_fastmap (bufp) struct re_pattern_buffer *bufp; { - int i, j, k; + int j, k; #ifdef MATCH_MAY_ALLOCATE fail_stack_type fail_stack; #endif #ifndef REGEX_MALLOC char *destination; #endif - /* We don't push any register information onto the failure stack. */ - unsigned num_regs = 0; register char *fastmap = bufp->fastmap; unsigned char *pattern = bufp->buffer; @@ -3189,10 +3187,6 @@ unsigned char *p = pattern; register unsigned char *pend = pattern + size; - /* This holds the pointer to the failure stack, when - it is allocated relocatably. */ - fail_stack_elt_t *failure_stack_ptr; - /* Assume that each path through the pattern can be null until proven otherwise. We set this false at the bottom of switch statement, to which we get only if a particular path doesn't @@ -3842,10 +3836,6 @@ } else /* Searching backwards. */ { - int room = (size1 == 0 || startpos >= size1 - ? size2 + size1 - startpos - : size1 - startpos); - buf_ch = STRING_CHAR (d, room); if (RE_TRANSLATE_P (translate)) buf_ch = RE_TRANSLATE (translate, buf_ch); @@ -3883,10 +3873,6 @@ /* Update STARTPOS to the next character boundary. */ if (multibyte) { - const unsigned char *p - = (const unsigned char *) POS_ADDR_VSTRING (startpos); - const unsigned char *pend - = (const unsigned char *) STOP_ADDR_VSTRING (startpos); int len = MULTIBYTE_FORM_LENGTH (p, pend - p); range -= len; @@ -4157,10 +4143,6 @@ unsigned nfailure_points_pushed = 0, nfailure_points_popped = 0; #endif - /* This holds the pointer to the failure stack, when - it is allocated relocatably. */ - fail_stack_elt_t *failure_stack_ptr; - /* We fill all the registers internally, independent of what we return, for use in backreferences. The number here includes an element for register zero. */ @@ -5389,8 +5371,6 @@ /* C1 is the character before D, S1 is the syntax of C1, C2 is the character at D, and S2 is the syntax of C2. */ int c1, c2, s1, s2; - int pos1 = PTR_TO_OFFSET (d - 1); - int charpos; GET_CHAR_BEFORE_2 (c1, d, string1, end1, string2, end2); GET_CHAR_AFTER_2 (c2, d, string1, end1, string2, end2); @@ -5426,8 +5406,6 @@ /* C1 is the character before D, S1 is the syntax of C1, C2 is the character at D, and S2 is the syntax of C2. */ int c1, c2, s1, s2; - int pos1 = PTR_TO_OFFSET (d - 1); - int charpos; GET_CHAR_BEFORE_2 (c1, d, string1, end1, string2, end2); GET_CHAR_AFTER_2 (c2, d, string1, end1, string2, end2); @@ -5463,8 +5441,6 @@ /* C1 is the character before D, S1 is the syntax of C1, C2 is the character at D, and S2 is the syntax of C2. */ int c1, c2, s1, s2; - int pos1 = PTR_TO_OFFSET (d); - int charpos; GET_CHAR_AFTER_2 (c2, d, string1, end1, string2, end2); #ifdef emacs @@ -5507,8 +5483,6 @@ /* C1 is the character before D, S1 is the syntax of C1, C2 is the character at D, and S2 is the syntax of C2. */ int c1, c2, s1, s2; - int pos1 = PTR_TO_OFFSET (d); - int charpos; GET_CHAR_BEFORE_2 (c1, d, string1, end1, string2, end2); #ifdef emacs --LBT26W69VOAOSQ8OXYAT-- From ossp-cvs-owner@ossp.org Wed Jun 21 09:52:17 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e5L7qGH78272; Wed, 21 Jun 2000 09:52:16 +0200 (CEST) Date: Wed, 21 Jun 2000 09:52:16 +0200 (CEST) Message-Id: <200006210752.e5L7qGH78272@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="AT9DHHFXIIB9T7P9TI51" Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: CVSROOT modules Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list This is a multi-part message in MIME format. --AT9DHHFXIIB9T7P9TI51 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: commit summary Content-Disposition: inline OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: CVSROOT Date: 21-Jun-2000 09:52:16 Branch: HEAD Handle: 2000062108521500 Modified files: CVSROOT modules Log: Remove duplicate key Summary: Revision Changes Path 1.17 +0 -1 CVSROOT/modules ____________________________________________________________________________ --AT9DHHFXIIB9T7P9TI51 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to CVSROOT/modules Content-Disposition: attachment Index: CVSROOT/modules ============================================================ $ cvs diff -u -r1.16 -r1.17 modules --- CVSROOT/modules 2000/06/18 14:32:43 1.16 +++ CVSROOT/modules 2000/06/21 07:52:15 1.17 @@ -46,7 +46,6 @@ modules CVSROOT modules notify CVSROOT notify rcsinfo CVSROOT rcsinfo -shiela CVSROOT shiela shiela.cfg CVSROOT shiela.cfg shiela.msg CVSROOT shiela.msg taginfo CVSROOT taginfo --AT9DHHFXIIB9T7P9TI51-- From ossp-cvs-owner@ossp.org Wed Jun 21 11:14:59 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e5L9EwJ84609; Wed, 21 Jun 2000 11:14:58 +0200 (CEST) Date: Wed, 21 Jun 2000 11:14:58 +0200 (CEST) Message-Id: <200006210914.e5L9EwJ84609@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/ossp-cvs .cvsignore COPYING COPYING.LIB ChangeLog... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 21-Jun-2000 11:14:58 Branch: vendor Handle: 1970010101000000 Modified files: (Branch: vendor) ossp-pkg/ossp-cvs/src root.c Touched files: (Branch: vendor) ossp-pkg/ossp-cvs .cvsignore COPYING COPYING.LIB ChangeLog.zoo INSTALL Makefile.in NEWS README acconfig.h config.h.in configure configure.in ossp-pkg/ossp-cvs/diff .cvsignore Makefile.in analyze.c cmpbuf.c cmpbuf.h context.c diagmeet.note diff.c diff.h diff3.c diffrun.h dir.c ed.c ifdef.c io.c normal.c side.c system.h util.c version.c ossp-pkg/ossp-cvs/doc .cvsignore FAQ HACKING Makefile.in RCSFILES TESTS TODO cvs-paper.ms cvs.texinfo cvsclient.texi ossp-pkg/ossp-cvs/lib .cvsignore Makefile.in argmatch.c dup2.c fncase.c fnmatch.c fnmatch.h ftruncate.c getdate.c getdate.y getline.c getline.h getopt.c getopt.h getopt1.c hostname.c md5.c md5.h memmove.c mkdir.c regex.c regex.h rename.c savecwd.c savecwd.h sighandle.c strerror.c stripslash.c strstr.c strtoul.c system.h valloc.c wait.h waitpid.c xgetwd.c yesno.c ossp-pkg/ossp-cvs/man .cvsignore Makefile.in cvs.1 cvs.5 ossp-pkg/ossp-cvs/src .cvsignore Makefile.in add.c admin.c buffer.c buffer.h checkin.c checkout.c classify.c client.c client.h commit.c create_adm.c cvs.h cvsrc.c diff.c edit.c edit.h entries.c error.c error.h expand_path.c fileattr.c fileattr.h filesubr.c find_names.c hardlink.c hardlink.h hash.c hash.h history.c ignore.c import.c lock.c log.c login.c logmsg.c main.c mkmodules.c modules.c myndbm.c myndbm.h no_diff.c options.h.in parseinfo.c patch.c rcs.c rcs.h rcscmds.c recurse.c release.c remove.c repos.c rtag.c run.c sanity.sh scramble.c server.c server.h status.c subr.c tag.c update.c update.h vers_ts.c version.c watch.c watch.h wrapper.c zlib.c ossp-pkg/ossp-cvs/zlib .cvsignore Makefile.in README adler32.c algorithm.doc compress.c crc32.c deflate.c deflate.h gzio.c infblock.c infblock.h infcodes.c infcodes.h inffast.c inffast.h inflate.c inftrees.c inftrees.h infutil.c infutil.h trees.c uncompr.c zconf.h zlib.h zutil.c zutil.h Log: Import vendor CVS, snapshot 20000621 [Release Tags: CVS_20000621] Summary: Revision Changes Path 1.1.1.3 +0 -0 ossp-pkg/ossp-cvs/src/root.c ____________________________________________________________________________ http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/root.c?cvsroot=ossp&r1=1.1.1.2&r2=1.1.1.3 From ossp-cvs-owner@ossp.org Wed Jun 21 11:27:01 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e5L9R0g85480; Wed, 21 Jun 2000 11:27:00 +0200 (CEST) Date: Wed, 21 Jun 2000 11:27:00 +0200 (CEST) Message-Id: <200006210927.e5L9R0g85480@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="G4CTXS1XK745R7T7UUBF" Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/ossp-cvs/src root.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list This is a multi-part message in MIME format. --G4CTXS1XK745R7T7UUBF Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: commit summary Content-Disposition: inline OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 21-Jun-2000 11:27:00 Branch: HEAD Handle: 2000062110270000 Modified files: ossp-pkg/ossp-cvs/src root.c Log: Merge in conflicts Summary: Revision Changes Path 1.4 +2 -2 ossp-pkg/ossp-cvs/src/root.c ____________________________________________________________________________ --G4CTXS1XK745R7T7UUBF Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/ossp-cvs/src/root.c Content-Disposition: attachment Index: ossp-pkg/ossp-cvs/src/root.c ============================================================ $ cvs diff -u -r1.3 -r1.4 root.c --- ossp-pkg/ossp-cvs/src/root.c 2000/06/20 14:25:12 1.3 +++ ossp-pkg/ossp-cvs/src/root.c 2000/06/21 09:27:00 1.4 @@ -475,8 +475,8 @@ if ((p = strchr (cvsroot_copy, '@')) != NULL) { - CVSroot_username = xstrdup (cvsroot_copy); *p = '\0'; + CVSroot_username = xstrdup (cvsroot_copy); cvsroot_copy = ++p; if (*CVSroot_username == '\0') CVSroot_username = NULL; @@ -484,8 +484,8 @@ if ((p = strchr (cvsroot_copy, ':')) != NULL) { - CVSroot_hostname = xstrdup (cvsroot_copy); *p = '\0'; + CVSroot_hostname = xstrdup (cvsroot_copy); cvsroot_copy = ++p; if (*CVSroot_hostname == '\0') --G4CTXS1XK745R7T7UUBF-- From ossp-cvs-owner@ossp.org Wed Jun 21 11:46:05 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e5L9k4G86854; Wed, 21 Jun 2000 11:46:04 +0200 (CEST) Date: Wed, 21 Jun 2000 11:46:04 +0200 (CEST) Message-Id: <200006210946.e5L9k4G86854@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="X5CBXCXSUAEDYLJIG629" Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/ossp-cvs/lib regex.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list This is a multi-part message in MIME format. --X5CBXCXSUAEDYLJIG629 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: commit summary Content-Disposition: inline OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 21-Jun-2000 11:46:04 Branch: HEAD Handle: 2000062110460300 Modified files: ossp-pkg/ossp-cvs/lib regex.c Log: Fix warning Summary: Revision Changes Path 1.5 +0 -1 ossp-pkg/ossp-cvs/lib/regex.c ____________________________________________________________________________ --X5CBXCXSUAEDYLJIG629 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/ossp-cvs/lib/regex.c Content-Disposition: attachment Index: ossp-pkg/ossp-cvs/lib/regex.c ============================================================ $ cvs diff -u -r1.4 -r1.5 regex.c --- ossp-pkg/ossp-cvs/lib/regex.c 2000/06/20 14:38:50 1.4 +++ ossp-pkg/ossp-cvs/lib/regex.c 2000/06/21 09:46:03 1.5 @@ -1286,7 +1286,6 @@ #define PUSH_FAILURE_POINT(pattern_place, string_place, failure_code) \ do { \ - char *destination; \ /* Must be int, so when we don't save any registers, the arithmetic \ of 0 + -1 isn't done as unsigned. */ \ int this_reg; \ --X5CBXCXSUAEDYLJIG629-- From ossp-cvs-owner@ossp.org Thu Jun 22 15:13:16 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e5MDDEi50071; Thu, 22 Jun 2000 15:13:14 +0200 (CEST) Date: Thu, 22 Jun 2000 15:13:14 +0200 (CEST) Message-Id: <200006221313.e5MDDEi50071@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="NH3NU9BGT6CUC21LP7GX" Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/ossp-cvs/src cvs.h main.c options.h.in root.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list This is a multi-part message in MIME format. --NH3NU9BGT6CUC21LP7GX Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: commit summary Content-Disposition: inline OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 22-Jun-2000 15:13:14 Branch: HEAD Handle: 2000062214131200 Modified files: ossp-pkg/ossp-cvs/src cvs.h main.c options.h.in root.c Log: Add new "cvs root" stuff. Summary: Revision Changes Path 1.15 +18 -0 ossp-pkg/ossp-cvs/src/cvs.h 1.17 +99 -2 ossp-pkg/ossp-cvs/src/main.c 1.26 +1 -0 ossp-pkg/ossp-cvs/src/options.h.in 1.5 +452 -0 ossp-pkg/ossp-cvs/src/root.c ____________________________________________________________________________ --NH3NU9BGT6CUC21LP7GX Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/ossp-cvs/src/cvs.h Content-Disposition: attachment Index: ossp-pkg/ossp-cvs/src/cvs.h ============================================================ $ cvs diff -u -r1.14 -r1.15 cvs.h --- ossp-pkg/ossp-cvs/src/cvs.h 2000/06/15 06:44:45 1.14 +++ ossp-pkg/ossp-cvs/src/cvs.h 2000/06/22 13:13:12 1.15 @@ -500,6 +500,21 @@ int root_map_it PROTO ((char *, char **, int)); #endif +#ifdef OSSP_PATCH_CVSROOT +typedef struct { + char *nickname; + char *masterpath; + char *slavepath; + char *syncprog; +} cvsroot_t; +char *cvsroot_filename(void); +void cvsroot_free(cvsroot_t *); +cvsroot_t *cvsroot_entry_read(FILE *); +void cvsroot_entry_write(FILE *, cvsroot_t *); +cvsroot_t *cvsroot_lookup(char *, char *, char *); +void cvsroot_synchronize(cvsroot_t *, int); +#endif + char *gca PROTO((const char *rev1, const char *rev2)); extern void check_numeric PROTO ((const char *, int, char **)); char *getcaller PROTO((void)); @@ -891,6 +906,9 @@ int unedit PROTO ((int argc, char **argv)); int editors PROTO ((int argc, char **argv)); int watchers PROTO ((int argc, char **argv)); +#ifdef OSSP_PATCH_CVSROOT +int root PROTO ((int argc, char **argv)); +#endif #ifdef OSSP_PATCH_PSERVERD int pserverd PROTO ((int argc, char **argv)); int pserver_daemon PROTO ((int argc, char **argv)); --NH3NU9BGT6CUC21LP7GX Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/ossp-cvs/src/main.c Content-Disposition: attachment Index: ossp-pkg/ossp-cvs/src/main.c ============================================================ $ cvs diff -u -r1.16 -r1.17 main.c --- ossp-pkg/ossp-cvs/src/main.c 2000/06/20 14:25:12 1.16 +++ ossp-pkg/ossp-cvs/src/main.c 2000/06/22 13:13:12 1.17 @@ -150,6 +150,9 @@ { "update", "up", "upd", update }, { "watch", NULL, NULL, watch }, { "watchers", NULL, NULL, watchers }, +#ifdef OSSP_PATCH_CVSROOT + { "root", "ro", "repo", root }, +#endif { NULL, NULL, NULL, NULL }, }; @@ -286,6 +289,9 @@ " update Bring work tree in sync with repository\n", " watch Set watches\n", " watchers See who is watching a file\n", +#ifdef OSSP_PATCH_CVSROOT + " root Maintain repository root locations\n", +#endif "(Specify the --help option for a list of other help options)\n", NULL, }; @@ -441,6 +447,14 @@ } #endif +#ifdef OSSP_PATCH_CVSROOT + if (strcmp (cmd_name, "root") == 0) { + ret |= CVS_CMD_IGNORE_ADMROOT; + ret &= ~(CVS_CMD_USES_WORK_DIR); + ret &= ~(CVS_CMD_MODIFIES_REPOSITORY); + } +#endif + return ret; } @@ -507,6 +521,9 @@ int free_CVSroot = 0; int free_Editor = 0; int free_Tmpdir = 0; +#ifdef OSSP_PATCH_CVSROOT + cvsroot_t *cvsroot_sync = NULL; +#endif int help = 0; /* Has the user asked for help? This lets us support the `cvs -H cmd' @@ -775,6 +792,8 @@ free_Editor = 1; break; case 'd': + if (CVSroot_cmdline != NULL) + free (CVSroot_cmdline); #ifdef OSSP_PATCH_MAPROOT { char *newarg; @@ -782,10 +801,24 @@ optarg = newarg; } #endif - if (CVSroot_cmdline != NULL) - free (CVSroot_cmdline); +#ifdef OSSP_PATCH_CVSROOT + { + cvsroot_t *e; + if ((e = cvsroot_lookup(optarg, NULL, NULL)) != NULL) { + if (!quiet) + fprintf(stderr, "%s: using repository `%s'\n", program_name, e->masterpath); + CVSroot_cmdline = xstrdup(e->masterpath); + CVSroot = xstrdup(e->masterpath); + cvsroot_free(e); + } + else { +#endif CVSroot_cmdline = xstrdup (optarg); CVSroot = xstrdup (optarg); +#ifdef OSSP_PATCH_CVSROOT + } + } +#endif free_CVSroot = 1; cvs_update_env = 1; /* need to update environment */ break; @@ -1046,6 +1079,12 @@ server_active = strcmp (command_name, "server") == 0; #endif +#ifdef OSSP_PATCH_CVSROOT + if (strcmp(command_name, "root") == 0) { + server_active = 1; + } +#endif + /* This is only used for writing into the history file. For remote connections, it might be nice to have hostname and/or remote path, on the other hand I'm not sure whether @@ -1176,6 +1215,54 @@ error (1, 0, "CVS/Root file (if any)."); } + +#ifdef OSSP_PATCH_CVSROOT + if (CVSroot_cmdline == NULL) { + cvsroot_t *e; + if (lookup_command_attribute(command_name) & CVS_CMD_MODIFIES_REPOSITORY) { + if ((e = cvsroot_lookup(NULL, NULL, CVSroot)) != NULL) { + /* command modifies repository and we still operare on + the slave repository, so switch to the master repository, + because we can only perform modifications there. */ + if (!quiet) { + fprintf(stderr, "%s: switching to MASTER location of repository `%s'\n", program_name, e->nickname); + fprintf(stderr, "%s: %s <-- %s\n", program_name, e->masterpath, e->slavepath); + } + if (free_CVSroot) + free(CVSroot); + CVSroot = xstrdup(e->masterpath); + if (CVSroot_cmdline != NULL) + free(CVSroot_cmdline); + CVSroot_cmdline = xstrdup(e->masterpath); + cvsroot_sync = e; + free_CVSroot = 1; + cvs_update_env = 1; + } + } + else { + if ((e = cvsroot_lookup(NULL, CVSroot, NULL)) != NULL) { + if (e->slavepath[0] != '\0') { + /* command does not modify repository and we still operare on + the master repository, so switch to the slave repository, + because it is faster per definition. */ + if (!quiet) { + fprintf(stderr, "%s: switching to SLAVE location of repository `%s'\n", program_name, e->nickname); + fprintf(stderr, "%s: %s --> %s\n", program_name, e->masterpath, e->slavepath); + } + if (free_CVSroot) + free(CVSroot); + CVSroot = xstrdup(e->slavepath); + if (CVSroot_cmdline != NULL) + free(CVSroot_cmdline); + CVSroot_cmdline = xstrdup(e->slavepath); + cvsroot_free(e); + free_CVSroot = 1; + cvs_update_env = 1; + } + } + } + } +#endif /* OSSP_PATCH_CVSROOT */ } /* Here begins the big loop over unique cvsroot values. We @@ -1253,7 +1340,12 @@ { save_errno = errno; /* If this is "cvs init", the root need not exist yet. */ +#ifdef OSSP_PATCH_CVSROOT + if (strcmp (command_name, "init") != 0 && + strcmp (command_name, "root") != 0) +#else if (strcmp (command_name, "init") != 0) +#endif { error (1, save_errno, "%s", path); } @@ -1381,6 +1473,11 @@ break; #endif } /* end of loop for cvsroot values */ + +#ifdef OSSP_PATCH_CVSROOT + if (cvsroot_sync != NULL) + cvsroot_synchronize(cvsroot_sync, 0); +#endif } /* end of stuff that gets done if the user DOESN'T ask for help */ --NH3NU9BGT6CUC21LP7GX Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/ossp-cvs/src/options.h.in Content-Disposition: attachment Index: ossp-pkg/ossp-cvs/src/options.h.in ============================================================ $ cvs diff -u -r1.25 -r1.26 options.h.in --- ossp-pkg/ossp-cvs/src/options.h.in 2000/06/12 16:42:38 1.25 +++ ossp-pkg/ossp-cvs/src/options.h.in 2000/06/22 13:13:12 1.26 @@ -204,6 +204,7 @@ */ #ifdef OSSP_PATCHES #define OSSP_PATCH_CVSRC +#define OSSP_PATCH_CVSROOT #define OSSP_PATCH_GLOBALOPTION #define OSSP_PATCH_GLOBALOPTION_PARTLY #define OSSP_PATCH_CUSTOMCMD --NH3NU9BGT6CUC21LP7GX Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/ossp-cvs/src/root.c Content-Disposition: attachment Index: ossp-pkg/ossp-cvs/src/root.c ============================================================ $ cvs diff -u -r1.4 -r1.5 root.c --- ossp-pkg/ossp-cvs/src/root.c 2000/06/21 09:27:00 1.4 +++ ossp-pkg/ossp-cvs/src/root.c 2000/06/22 13:13:12 1.5 @@ -674,3 +674,455 @@ /* NOTREACHED */ } #endif + +#ifdef OSSP_PATCH_CVSROOT + +#include + +#ifndef CVS_ROOT_FILE +#define CVS_ROOT_FILE ".cvsroot" +#endif + +char * +cvsroot_filename( + void) +{ + char *homedir; + char *rootfile; + + /* Environment should override file. */ + if ((rootfile = getenv("CVS_ROOTFILE")) != NULL) + return xstrdup(rootfile); + + /* Construct absolute pathname to user's password file. */ + if ((homedir = get_homedir()) == NULL) { + error(1, 0, "could not find out home directory"); + return NULL; + } + rootfile = (char *)xmalloc(strlen(homedir)+strlen(CVS_ROOT_FILE)+3); + strcpy(rootfile, homedir); + strcat(rootfile, "/"); + strcat(rootfile, CVS_ROOT_FILE); + return rootfile; +} + +void cvsroot_free( + cvsroot_t *e) +{ + if (e != NULL) { + if (e->nickname != NULL) + free(e->nickname); + if (e->masterpath != NULL) + free(e->masterpath); + if (e->slavepath != NULL) + free(e->slavepath); + if (e->syncprog != NULL) + free(e->syncprog); + free(e); + } + return; +} + +cvsroot_t * +cvsroot_entry_read( + FILE *fp) +{ + cvsroot_t *e; + char *nickname; + char *masterpath; + char *slavepath; + char *syncprog; + char *line; + int line_length; + size_t line_chars_allocated; + size_t n; + + e = NULL; + line = NULL; + line_chars_allocated = 0; + while ((line_length = getline(&line, &line_chars_allocated, fp)) >= 0) { + /* parse line */ + line += strspn(line, " \t\n"); + if (line[0] == '#') + continue; + nickname = line; + if ((n = strcspn(line, " \t\n")) == 0) + return NULL; + line += n; + *line++ = '\0'; + line += strspn(line, " \t"); + masterpath = line; + if ((n = strcspn(line, " \t\n")) == 0) + return NULL; + line += n; + *line++ = '\0'; + line += strspn(line, " \t\n"); + slavepath = ""; + syncprog = ""; + if (line[0] != '\0') { + slavepath = line; + n = strcspn(line, " \t\n"); + line += n; + *line++ = '\0'; + if (line[0] != '\0') { + syncprog = line; + n = strcspn(line, " \t\n"); + line += n; + *line++ = '\0'; + } + } + e = (cvsroot_t *)xmalloc(sizeof(cvsroot_t)); + e->nickname = xstrdup(nickname); + e->masterpath = xstrdup(masterpath); + e->slavepath = xstrdup(slavepath); + e->syncprog = xstrdup(syncprog); + break; + } + return e; +} + +void +cvsroot_entry_write( + FILE *fp, + cvsroot_t *e) +{ + if (fp != NULL && e != NULL) { + fprintf(fp, "%s %s", + e->nickname, e->masterpath); + if (e->slavepath[0] != '\0') + fprintf(fp, " %s", e->slavepath); + if (e->syncprog[0] != '\0') + fprintf(fp, " %s", e->syncprog); + fprintf(fp, "\n"); + } + return; +} + +cvsroot_t * +cvsroot_lookup( + char *by_nickname, + char *by_masterpath, + char *by_slavepath) +{ + char *rootfile; + cvsroot_t *e = NULL; + FILE *fp; + + if ((rootfile = cvsroot_filename()) == NULL) + return NULL; + if ((fp = fopen(rootfile, "r")) == NULL) { + free(rootfile); + return NULL; + } + while ((e = cvsroot_entry_read(fp)) != NULL) { + if ( (by_nickname != NULL && strcmp(e->nickname, by_nickname) == 0) + || (by_masterpath != NULL && strcmp(e->masterpath, by_masterpath) == 0) + || (by_slavepath != NULL && strcmp(e->slavepath, by_slavepath) == 0)) + break; + cvsroot_free(e); + } + fclose(fp); + free(rootfile); + return e; +} + +void +cvsroot_synchronize( + cvsroot_t *e, + int force) +{ + char *cmd; + char *arg; + char *rsh; + int smart; + char *syncprog; + + smart = 0; + syncprog = e->syncprog; + if (syncprog[0] == '-') { + smart++; + syncprog++; + } + if (smart && !force) { + if (strcasecmp(syncprog, "manual") == 0) { + fprintf(stderr, "%s: synchronize SLAVE with MASTER of repository `%s', please!\n", program_name, e->nickname); + } + else { + fprintf(stderr, "%s: synchronize SLAVE with MASTER of repository `%s'\n", program_name, e->nickname); + fprintf(stderr, "%s: by running the command `%s root -s %s', please.\n", program_name, program_name, e->nickname); + } + return; + } + + if (strcasecmp(syncprog, "manual") == 0) { + if (!really_quiet) { + fprintf(stderr, "%s: synchronizing SLAVE with MASTER of repository `%s'\n", program_name, e->nickname); + fprintf(stderr, "%s: has to be performed manually by you!\n", program_name); + } + } + else if (strcasecmp(syncprog, "rsync") == 0 || + strncasecmp(syncprog, "rsync:", 6) == 0) { + if (!really_quiet) { + fprintf(stderr, "%s: synchronizing SLAVE with MASTER of repository `%s':\n", program_name, e->nickname); + fprintf(stderr, "%s: %s --> %s (rsync)\n", program_name, e->masterpath, e->slavepath); + } + run_setup("rsync"); + if (!quiet) + run_arg("-v"); + if ((rsh = getenv("CVS_RSH")) != NULL) { + arg = xmalloc(strlen(rsh)+7); + strcpy(arg, "--rsh="); + strcat(arg, rsh); + run_arg(arg); + free(arg); + } + run_arg("-rlpt"); + run_arg("--delete"); + if (strncasecmp(syncprog, "rsync:", 6) == 0) { + char *list = xstrdup(syncprog+6); + for (arg = strtok(list, ","); arg != NULL; arg = strtok(NULL, ",")) { + if (arg[0] == '!') { + run_arg("--exclude"); + run_arg(arg+1); + } + else { + run_arg("--include"); + run_arg(arg); + } + } + free(list); + } + arg = xmalloc(strlen(e->masterpath)+2); + strcpy(arg, e->masterpath); + strcat(arg, "/"); + run_arg(arg); + free(arg); + arg = xmalloc(strlen(e->slavepath)+2); + strcpy(arg, e->slavepath); + strcat(arg, "/"); + run_arg(arg); + free(arg); + if (trace) { + cvs_output(program_name, 0); + cvs_output(" ", 1); + cvs_output(command_name, 0); + cvs_output(": Executing ", 0); + run_print(stdout); + cvs_output("\n", 0); + } + if (run_exec(RUN_TTY, RUN_TTY, RUN_TTY, RUN_NORMAL) != 0) + error(1, 0, "synchronization program `rsync' returned non-zero"); + } + else { + if (!really_quiet) { + fprintf(stderr, "%s: synchronizing SLAVE with MASTER of repository `%s':\n", program_name, e->nickname); + fprintf(stderr, "%s: %s --> %s (%s)\n", program_name, e->masterpath, e->slavepath, e->syncprog); + } + cmd = expand_path(syncprog, "sync", 0); + run_setup(cmd); + run_arg(e->nickname); + run_arg(e->masterpath); + run_arg(e->slavepath); + if (trace) { + cvs_output(program_name, 0); + cvs_output(" ", 1); + cvs_output(command_name, 0); + cvs_output(": Executing ", 0); + run_print(stdout); + cvs_output("\n", 0); + } + if (run_exec(RUN_TTY, RUN_TTY, RUN_TTY, RUN_NORMAL) != 0) + error(1, 0, "synchronization program `%s' returned non-zero", cmd); + free(cmd); + } +} + +static const char *const root_usage[] = { + "Usage: %s %s [-v] -e|-E|-l|s [arg ...]\n", + "Options:\n", + " -v Verbose mode.\n", + " -e Edit entry from ~/.cvsroot in batch mode.\n", + " -E Edit entry from ~/.cvsroot in visual mode.\n", + " -l List entries from ~/.cvsroot.\n", + " -s Synchronize entries from ~/.cvsroot.\n", + "Synopsis:\n", + " Add/Modify an entry:\n", + " cvs root -e nickname masterpath [slavepath [syncprog]]\n", + " Delete an entry:\n", + " cvs root -e nickname\n", + " List all or some particular entries:\n", + " cvs [-Q] [-q] root [-v] -l [nickname ...]\n", + " Synchronize all or some particular entries:\n", + " cvs [-Q] [-q] root -s [nickname ...]\n", + "(Specify the --help global option for a list of other help options)\n", + NULL +}; + +int +root( + int argc, + char **argv) +{ + enum { + ROOT_MODE_UNKNOWN, + ROOT_MODE_EDIT_CMDLINE, + ROOT_MODE_EDIT_VISUAL, + ROOT_MODE_LIST, + ROOT_MODE_SYNC + }; + int mode = ROOT_MODE_UNKNOWN; + char *rootfile; + char *rootfilebak; + FILE *fp; + FILE *fpbak; + int option; + cvsroot_t *e; + cvsroot_t E; + int doit; + int i; + int rc; + int verbose = 0; + int found; + + if (argc == -1) + usage(root_usage); + optind = 0; + while ((option = getopt(argc, argv, "veEsl")) != EOF) { + switch ((char)option) { + case 'v': + verbose = 1; + break; + case 'e': + mode = ROOT_MODE_EDIT_CMDLINE; + break; + case 'E': + mode = ROOT_MODE_EDIT_VISUAL; + break; + case 'l': + mode = ROOT_MODE_LIST; + break; + case 's': + mode = ROOT_MODE_SYNC; + break; + case '?': + default: + usage(root_usage); + break; + } + } + argc -= optind; + argv += optind; + if (mode == ROOT_MODE_UNKNOWN) + error(1, 0, "exactly one of the -e, -E, -l or -s options have to given"); + + if (mode == ROOT_MODE_EDIT_CMDLINE) { + if (argc < 1 || argc > 4) + error(1, 0, "option -e requires 1-4 arguments"); + E.nickname = argv[0]; + if (argc >= 2) + E.masterpath = argv[1]; + else + E.masterpath = ""; + if (argc >= 3) + E.slavepath = argv[2]; + else + E.slavepath = ""; + if (argc == 4) + E.syncprog = argv[3]; + else + E.syncprog = ""; + if ((rootfile = cvsroot_filename()) == NULL) + return 0; + rootfilebak = xmalloc(strlen(rootfile)+5); + strcpy(rootfilebak, rootfile); + strcat(rootfilebak, ".bak"); + rename(rootfile, rootfilebak); + if ((fpbak = fopen(rootfilebak, "r")) == NULL) { + free(rootfile); + free(rootfilebak); + return 0; + } + if ((fp = fopen(rootfile, "w")) == NULL) { + fclose(fpbak); + free(rootfile); + free(rootfilebak); + return 0; + } + found = 0; + while ((e = cvsroot_entry_read(fpbak)) != NULL) { + if (strcmp(e->nickname, E.nickname) == 0) { + cvsroot_free(e); + found = 1; + break; + } + cvsroot_entry_write(fp, e); + cvsroot_free(e); + } + if (argc > 1) + cvsroot_entry_write(fp, &E); + if (found) { + while ((e = cvsroot_entry_read(fpbak)) != NULL) { + cvsroot_entry_write(fp, e); + cvsroot_free(e); + } + } + fclose(fpbak); + fclose(fp); + } + else if (mode == ROOT_MODE_EDIT_VISUAL) { + if (argc != 0) + error(1, 0, "option -E requires no arguments"); + if ((rootfile = cvsroot_filename()) == NULL) + return 0; + run_setup(Editor); + run_arg(rootfile); + if ((rc = run_exec(RUN_TTY, RUN_TTY, RUN_TTY, RUN_NORMAL|RUN_SIGIGNORE)) != 0) + error (1, rc == -1 ? errno : 0, "warning: editor session failed"); + } + else if (mode == ROOT_MODE_LIST || mode == ROOT_MODE_SYNC) { + if ((rootfile = cvsroot_filename()) == NULL) + return 0; + if ((fp = fopen(rootfile, "r")) == NULL) { + free(rootfile); + return 0; + } + while ((e = cvsroot_entry_read(fp)) != NULL) { + doit = 0; + if (argc == 0) + doit = 1; + else { + for (i = 0; argv[i] != NULL; i++) { + if (strcmp(argv[i], e->nickname) == 0) { + doit = 1; + break; + } + } + } + if (doit) { + if (mode == ROOT_MODE_LIST) { + if (verbose) + fprintf(stdout, "Repository `%s':\n" + " Master Path: %s\n" + " Slave Path: %s\n" + " Synchronize: %s\n", + e->nickname, e->masterpath, + e->slavepath, e->syncprog); + else + fprintf(stdout, "%s %s %s %s\n", + e->nickname, e->masterpath, + e->slavepath, e->syncprog); + } + else { + cvsroot_synchronize(e, 1); + } + } + cvsroot_free(e); + } + fclose(fp); + free(rootfile); + } + return 0; +} + +#endif /* OSSP_PATCH_CVSROOT */ + --NH3NU9BGT6CUC21LP7GX-- From ossp-cvs-owner@ossp.org Thu Jun 22 15:13:56 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e5MDDtL50146; Thu, 22 Jun 2000 15:13:55 +0200 (CEST) Date: Thu, 22 Jun 2000 15:13:55 +0200 (CEST) Message-Id: <200006221313.e5MDDtL50146@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="HKEJ8284HXBXCAQ8S29G" Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/ossp-cvs README.OSSP Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list This is a multi-part message in MIME format. --HKEJ8284HXBXCAQ8S29G Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: commit summary Content-Disposition: inline OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 22-Jun-2000 15:13:54 Branch: HEAD Handle: 2000062214135400 Modified files: ossp-pkg/ossp-cvs README.OSSP Log: *** empty log message *** Summary: Revision Changes Path 1.40 +25 -0 ossp-pkg/ossp-cvs/README.OSSP ____________________________________________________________________________ --HKEJ8284HXBXCAQ8S29G Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/ossp-cvs/README.OSSP Content-Disposition: attachment Index: ossp-pkg/ossp-cvs/README.OSSP ============================================================ $ cvs diff -u -r1.39 -r1.40 README.OSSP --- ossp-pkg/ossp-cvs/README.OSSP 2000/06/17 19:55:49 1.39 +++ ossp-pkg/ossp-cvs/README.OSSP 2000/06/22 13:13:54 1.40 @@ -42,6 +42,31 @@ files. [Origin: Ralf S. Engelschall] + OSSP_PATCH_CVSROOT: + This adds support for a new dot-file ~/.cvsroot which is used + optionally by CVS. It can be used by the user to configure a + nickname for a CVS repository root (the master location) plus a + possibly existing local repository copy (the slave location). An + entry in ~/.cvsroot is of the format `` + [ []]''. Those entries can be either created + manually in ~/.cvsroot or with the `cvs root -e' command. + + The idea is this: if a global `-d' option is used with it is + automatically expanded to . If no global `-d' option is used, + the CVS command is checked. If it is one of the commands which are known + to CVS to modify the repository, and the $CVSROOT or CVS/Root specify a + slave location, the repository is switched to the corresponding master + location (because modifications have to be performed there). If the + command is one of the commands which are known to CVS to NOT modify the + repository, and the $CVSROOT or CVS/Root specify a master location, the + repository is switched to the corresponding slave location (because the + slave location is faster than the master location per definition). + + After a modifying operation, CVS can either run a synchronization job + automatically to bring slave in sync with master again or the user can run + `cvs root -s ' manually to perform this task. + [Origin: Ralf S. Engelschall] + OSSP_PATCH_GLOBALOPTION: OSSP_PATCH_GLOBALOPTION_PARTLY: By default, global options in `.cvsrc' files are specified with a --HKEJ8284HXBXCAQ8S29G-- From ossp-cvs-owner@ossp.org Thu Jun 22 15:29:28 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e5MDTRw51811; Thu, 22 Jun 2000 15:29:27 +0200 (CEST) Date: Thu, 22 Jun 2000 15:29:27 +0200 (CEST) Message-Id: <200006221329.e5MDTRw51811@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/ossp-cvs .cvsignore COPYING COPYING.LIB ChangeLog... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 22-Jun-2000 15:29:27 Branch: vendor Handle: 1970010101000000 Modified files: (Branch: vendor) ossp-pkg/ossp-cvs/src client.c commit.c import.c log.c recurse.c remove.c server.c Touched files: (Branch: vendor) ossp-pkg/ossp-cvs .cvsignore COPYING COPYING.LIB ChangeLog.zoo INSTALL Makefile.in NEWS README acconfig.h config.h.in configure configure.in ossp-pkg/ossp-cvs/diff .cvsignore Makefile.in analyze.c cmpbuf.c cmpbuf.h context.c diagmeet.note diff.c diff.h diff3.c diffrun.h dir.c ed.c ifdef.c io.c normal.c side.c system.h util.c version.c ossp-pkg/ossp-cvs/doc .cvsignore FAQ HACKING Makefile.in RCSFILES TESTS TODO cvs-paper.ms cvs.texinfo cvsclient.texi ossp-pkg/ossp-cvs/lib .cvsignore Makefile.in argmatch.c dup2.c fncase.c fnmatch.c fnmatch.h ftruncate.c getdate.c getdate.y getline.c getline.h getopt.c getopt.h getopt1.c hostname.c md5.c md5.h memmove.c mkdir.c regex.c regex.h rename.c savecwd.c savecwd.h sighandle.c strerror.c stripslash.c strstr.c strtoul.c system.h valloc.c wait.h waitpid.c xgetwd.c yesno.c ossp-pkg/ossp-cvs/man .cvsignore Makefile.in cvs.1 cvs.5 ossp-pkg/ossp-cvs/src .cvsignore Makefile.in add.c admin.c buffer.c buffer.h checkin.c checkout.c classify.c client.h create_adm.c cvs.h cvsrc.c diff.c edit.c edit.h entries.c error.c error.h expand_path.c fileattr.c fileattr.h filesubr.c find_names.c hardlink.c hardlink.h hash.c hash.h history.c ignore.c lock.c login.c logmsg.c main.c mkmodules.c modules.c myndbm.c myndbm.h no_diff.c options.h.in parseinfo.c patch.c rcs.c rcs.h rcscmds.c release.c repos.c root.c rtag.c run.c sanity.sh scramble.c server.h status.c subr.c tag.c update.c update.h vers_ts.c version.c watch.c watch.h wrapper.c zlib.c ossp-pkg/ossp-cvs/zlib .cvsignore Makefile.in README adler32.c algorithm.doc compress.c crc32.c deflate.c deflate.h gzio.c infblock.c infblock.h infcodes.c infcodes.h inffast.c inffast.h inflate.c inftrees.c inftrees.h infutil.c infutil.h trees.c uncompr.c zconf.h zlib.h zutil.c zutil.h Log: Import vendor CVS, snapshot 20000622 [Release Tags: CVS_20000622] Summary: Revision Changes Path 1.1.1.5 +0 -0 ossp-pkg/ossp-cvs/src/client.c 1.1.1.5 +0 -0 ossp-pkg/ossp-cvs/src/commit.c 1.1.1.4 +0 -0 ossp-pkg/ossp-cvs/src/import.c 1.1.1.4 +0 -0 ossp-pkg/ossp-cvs/src/log.c 1.1.1.3 +0 -0 ossp-pkg/ossp-cvs/src/recurse.c 1.1.1.2 +0 -0 ossp-pkg/ossp-cvs/src/remove.c 1.1.1.9 +0 -0 ossp-pkg/ossp-cvs/src/server.c ____________________________________________________________________________ http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/client.c?cvsroot=ossp&r1=1.1.1.4&r2=1.1.1.5 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/commit.c?cvsroot=ossp&r1=1.1.1.4&r2=1.1.1.5 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/import.c?cvsroot=ossp&r1=1.1.1.3&r2=1.1.1.4 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/log.c?cvsroot=ossp&r1=1.1.1.3&r2=1.1.1.4 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/recurse.c?cvsroot=ossp&r1=1.1.1.2&r2=1.1.1.3 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/remove.c?cvsroot=ossp&r1=1.1.1.1&r2=1.1.1.2 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/server.c?cvsroot=ossp&r1=1.1.1.8&r2=1.1.1.9 From ossp-cvs-owner@ossp.org Thu Jun 22 15:31:40 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e5MDVdL52038; Thu, 22 Jun 2000 15:31:39 +0200 (CEST) Date: Thu, 22 Jun 2000 15:31:39 +0200 (CEST) Message-Id: <200006221331.e5MDVdL52038@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="TVWJYDVYMCATFQQVOD23" Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/ossp-cvs/src client.c commit.c import.c recurse.c... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list This is a multi-part message in MIME format. --TVWJYDVYMCATFQQVOD23 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: commit summary Content-Disposition: inline OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 22-Jun-2000 15:31:39 Branch: HEAD Handle: 2000062214313800 Modified files: ossp-pkg/ossp-cvs/src client.c commit.c import.c recurse.c server.c Log: Merge in conflicts Summary: Revision Changes Path 1.6 +6 -1 ossp-pkg/ossp-cvs/src/client.c 1.9 +7 -0 ossp-pkg/ossp-cvs/src/commit.c 1.11 +5 -0 ossp-pkg/ossp-cvs/src/import.c 1.4 +1 -0 ossp-pkg/ossp-cvs/src/recurse.c 1.21 +31 -2 ossp-pkg/ossp-cvs/src/server.c ____________________________________________________________________________ --TVWJYDVYMCATFQQVOD23 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/ossp-cvs/src/client.c Content-Disposition: attachment Index: ossp-pkg/ossp-cvs/src/client.c ============================================================ $ cvs diff -u -r1.5 -r1.6 client.c --- ossp-pkg/ossp-cvs/src/client.c 2000/06/15 06:44:45 1.5 +++ ossp-pkg/ossp-cvs/src/client.c 2000/06/22 13:31:38 1.6 @@ -1757,6 +1757,7 @@ } free (mode_string); + free (scratch_entries); free (entries_line); /* The Mode, Mod-time, and Checksum responses should not carry @@ -2023,6 +2024,8 @@ free (mode_string); free (buf); + free (scratch_entries); + free (entries_line); return; } @@ -2121,8 +2124,8 @@ if (file_timestamp) free (file_timestamp); - free (scratch_entries); } + free (scratch_entries); free (entries_line); } @@ -3592,6 +3595,8 @@ && waitpid (rsh_pid, (int *) 0, 0) == -1) error (1, errno, "waiting for process %d", rsh_pid); + buf_free (to_server); + buf_free (from_server); server_started = 0; /* see if we need to sleep before returning to avoid time-stamp races */ --TVWJYDVYMCATFQQVOD23 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/ossp-cvs/src/commit.c Content-Disposition: attachment Index: ossp-pkg/ossp-cvs/src/commit.c ============================================================ $ cvs diff -u -r1.8 -r1.9 commit.c --- ossp-pkg/ossp-cvs/src/commit.c 2000/06/14 07:18:45 1.8 +++ ossp-pkg/ossp-cvs/src/commit.c 2000/06/22 13:31:38 1.9 @@ -263,6 +263,7 @@ else error (0, 0, "use `%s add' to create an entry for %s", program_name, finfo->fullname); + freevers_ts (&vers); return 1; } else if (vers->ts_user != NULL @@ -284,6 +285,7 @@ cases. FIXME: we probably should be printing a message and returning 1 for many of those cases (but I'm not sure exactly which ones). */ + freevers_ts (&vers); return 0; } @@ -460,11 +462,14 @@ error (1, 0, "correct above errors first!"); if (find_args.argc == 0) + { /* Nothing to commit. Exit now without contacting the server (note that this means that we won't print "? foo" for files which merit it, because we don't know what is in the CVSROOT/cvsignore file). */ + dellist (&find_args.ulist); return 0; + } /* Now we keep track of which files we actually are going to operate on, and only work with those files in the future. @@ -574,6 +579,8 @@ previous versions of client/server CVS, but it probably is a Good Thing, or at least Not Such A Bad Thing. */ send_file_names (find_args.argc, find_args.argv, 0); + free (find_args.argv); + dellist (&find_args.ulist); send_to_server ("ci\012", 0); err = get_responses_and_close (); --TVWJYDVYMCATFQQVOD23 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/ossp-cvs/src/import.c Content-Disposition: attachment Index: ossp-pkg/ossp-cvs/src/import.c ============================================================ $ cvs diff -u -r1.10 -r1.11 import.c --- ossp-pkg/ossp-cvs/src/import.c 2000/05/18 14:37:27 1.10 +++ ossp-pkg/ossp-cvs/src/import.c 2000/06/22 13:31:38 1.11 @@ -404,6 +404,11 @@ client_import_setup (repository); err = import_descend (message, argv[1], argc - 2, argv + 2); client_import_done (); + if (message) + free (message); + free (repository); + free (vbranch); + free (vhead); send_to_server ("import\012", 0); err += get_responses_and_close (); return err; --TVWJYDVYMCATFQQVOD23 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/ossp-cvs/src/recurse.c Content-Disposition: attachment Index: ossp-pkg/ossp-cvs/src/recurse.c ============================================================ $ cvs diff -u -r1.3 -r1.4 recurse.c --- ossp-pkg/ossp-cvs/src/recurse.c 2000/06/04 08:51:58 1.3 +++ ossp-pkg/ossp-cvs/src/recurse.c 2000/06/22 13:31:38 1.4 @@ -173,6 +173,7 @@ seems to be handled somewhere (else) but why should it be a separate case? Needs investigation... */ just_subdirs = 1; + free (root); } #endif --TVWJYDVYMCATFQQVOD23 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/ossp-cvs/src/server.c Content-Disposition: attachment Index: ossp-pkg/ossp-cvs/src/server.c ============================================================ $ cvs diff -u -r1.20 -r1.21 server.c --- ossp-pkg/ossp-cvs/src/server.c 2000/06/20 14:25:12 1.20 +++ ossp-pkg/ossp-cvs/src/server.c 2000/06/22 13:31:38 1.21 @@ -190,6 +190,7 @@ static int fd_buffer_output PROTO((void *, const char *, int, int *)); static int fd_buffer_flush PROTO((void *)); static int fd_buffer_block PROTO((void *, int)); +static int fd_buffer_shutdown PROTO((void *)); /* Initialize a buffer built on a file descriptor. FD is the file descriptor. INPUT is nonzero if this is for input, zero if this is @@ -211,7 +212,7 @@ input ? NULL : fd_buffer_output, input ? NULL : fd_buffer_flush, fd_buffer_block, - (int (*) PROTO((void *))) NULL, + fd_buffer_shutdown, memory, n); } @@ -348,6 +349,16 @@ return 0; } +/* The buffer shutdown function for a buffer built on a file descriptor. */ + +static int +fd_buffer_shutdown (closure) + void *closure; +{ + free (closure); + return 0; +} + /* Populate all of the directories between BASE_DIR and its relative subdirectory DIR with CVSADM directories. Return 0 for success or errno value. */ @@ -1543,6 +1554,7 @@ } } } + free (mode_text); return; } if (size_text[0] == 'z') @@ -1567,16 +1579,24 @@ return; size -= nread; } + free (mode_text); return; } if (outside_dir (arg)) + { + free (mode_text); return; + } if (size >= 0) { receive_file (size, arg, gzipped); - if (error_pending ()) return; + if (error_pending ()) + { + free (mode_text); + return; + } } if (checkin_time_valid) @@ -1591,6 +1611,7 @@ if (alloc_pending (80 + strlen (arg))) sprintf (pending_error_text, "E cannot utime %s", arg); pending_error = save_errno; + free (mode_text); return; } checkin_time_valid = 0; @@ -2086,6 +2107,7 @@ buf_append_char (buf_to_net, '/'); buf_output0 (buf_to_net, notify_list->filename); buf_append_char (buf_to_net, '\n'); + free (repos); p = notify_list->next; free (notify_list->filename); @@ -2808,6 +2830,7 @@ * When we exit, that will close the pipes, giving an EOF to * the parent. */ + buf_free (protocol); exit (exitstatus); } @@ -3161,6 +3184,12 @@ */ set_block (buf_to_net); buf_flush (buf_to_net, 1); + buf_shutdown (protocol_inbuf); + buf_free (protocol_inbuf); + buf_shutdown (stderrbuf); + buf_free (stderrbuf); + buf_shutdown (stdoutbuf); + buf_free (stdoutbuf); } if (errs) --TVWJYDVYMCATFQQVOD23-- From ossp-cvs-owner@ossp.org Thu Jun 22 15:53:37 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e5MDrbn53581; Thu, 22 Jun 2000 15:53:37 +0200 (CEST) Date: Thu, 22 Jun 2000 15:53:37 +0200 (CEST) Message-Id: <200006221353.e5MDrbn53581@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="GZJ1C79W4O0W26ZIMD6X" Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/ossp-cvs/src main.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list This is a multi-part message in MIME format. --GZJ1C79W4O0W26ZIMD6X Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: commit summary Content-Disposition: inline OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 22-Jun-2000 15:53:37 Branch: HEAD Handle: 2000062214533600 Modified files: ossp-pkg/ossp-cvs/src main.c Log: *** empty log message *** Summary: Revision Changes Path 1.18 +27 -4 ossp-pkg/ossp-cvs/src/main.c ____________________________________________________________________________ --GZJ1C79W4O0W26ZIMD6X Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/ossp-cvs/src/main.c Content-Disposition: attachment Index: ossp-pkg/ossp-cvs/src/main.c ============================================================ $ cvs diff -u -r1.17 -r1.18 main.c --- ossp-pkg/ossp-cvs/src/main.c 2000/06/22 13:13:12 1.17 +++ ossp-pkg/ossp-cvs/src/main.c 2000/06/22 13:53:36 1.18 @@ -523,7 +523,11 @@ int free_Tmpdir = 0; #ifdef OSSP_PATCH_CVSROOT cvsroot_t *cvsroot_sync = NULL; + int cvsroot_cmdline_isreal = 0; #endif +#if defined(OSSP_PATCH_CVSROOT) || defined(OSSP_PATCH_CUSTOMCMD) + int standalone_command = 0; +#endif int help = 0; /* Has the user asked for help? This lets us support the `cvs -H cmd' @@ -812,6 +816,7 @@ cvsroot_free(e); } else { + cvsroot_cmdline_isreal = 1; #endif CVSroot_cmdline = xstrdup (optarg); CVSroot = xstrdup (optarg); @@ -909,6 +914,7 @@ ccm->fullname = customcmd_tab[i].name; argv[0] = customcmd_tab[i].command; cm = (const struct cmd *)ccm; + standalone_command = 1; } } } @@ -1080,9 +1086,8 @@ #endif #ifdef OSSP_PATCH_CVSROOT - if (strcmp(command_name, "root") == 0) { - server_active = 1; - } + if (strcmp(command_name, "root") == 0) + standalone_command = 1; #endif /* This is only used for writing into the history file. For @@ -1157,8 +1162,12 @@ in server mode, since the client will send the repository directory after the connection is made. */ +#if defined(OSSP_PATCH_CVSROOT) || defined(OSSP_PATCH_CUSTOMCMD) + if (!server_active && !standalone_command) +#else if (!server_active) #endif +#endif { char *CVSADM_Root; @@ -1217,7 +1226,7 @@ } #ifdef OSSP_PATCH_CVSROOT - if (CVSroot_cmdline == NULL) { + if (CVSroot_cmdline == NULL || !cvsroot_cmdline_isreal) { cvsroot_t *e; if (lookup_command_attribute(command_name) & CVS_CMD_MODIFIES_REPOSITORY) { if ((e = cvsroot_lookup(NULL, NULL, CVSroot)) != NULL) { @@ -1295,6 +1304,9 @@ end of things. */ while ( +#if defined(OSSP_PATCH_CVSROOT) || defined(OSSP_PATCH_CUSTOMCMD) + standalone_command || +#endif #ifdef SERVER_SUPPORT server_active || #endif @@ -1306,8 +1318,12 @@ in server mode, since the client will send the repository directory after the connection is made. */ +#if defined(OSSP_PATCH_CVSROOT) || defined(OSSP_PATCH_CUSTOMCMD) + if (!server_active && !standalone_command) +#else if (!server_active) #endif +#endif { /* Now we're 100% sure that we have a valid CVSROOT variable. Parse it to see if we're supposed to do @@ -1381,6 +1397,9 @@ read_cvsrc and other such places or vice versa. That sort of thing probably needs more thought. */ if (1 +#if defined(OSSP_PATCH_CVSROOT) || defined(OSSP_PATCH_CUSTOMCMD) + && !standalone_command +#endif #ifdef SERVER_SUPPORT && !server_active #endif @@ -1468,6 +1487,10 @@ dellist (&root_directories); #endif +#if defined(OSSP_PATCH_CVSROOT) || defined(OSSP_PATCH_CUSTOMCMD) + if (standalone_command) + break; +#endif #ifdef SERVER_SUPPORT if (server_active) break; --GZJ1C79W4O0W26ZIMD6X-- From ossp-cvs-owner@ossp.org Thu Jun 22 17:09:35 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e5MF9X558909; Thu, 22 Jun 2000 17:09:33 +0200 (CEST) Date: Thu, 22 Jun 2000 17:09:33 +0200 (CEST) Message-Id: <200006221509.e5MF9X558909@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="5QP9CKWMCI0CUR67I85D" Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/ossp-cvs/src sanity.sh Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list This is a multi-part message in MIME format. --5QP9CKWMCI0CUR67I85D Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: commit summary Content-Disposition: inline OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 22-Jun-2000 17:09:33 Branch: HEAD Handle: 2000062216092600 Modified files: ossp-pkg/ossp-cvs/src sanity.sh Log: *** empty log message *** Summary: Revision Changes Path 1.2 +382 -201 ossp-pkg/ossp-cvs/src/sanity.sh ____________________________________________________________________________ --5QP9CKWMCI0CUR67I85D Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/ossp-cvs/src/sanity.sh Content-Disposition: attachment Index: ossp-pkg/ossp-cvs/src/sanity.sh ============================================================ $ cvs diff -u -r1.1.1.8 -r1.2 sanity.sh --- ossp-pkg/ossp-cvs/src/sanity.sh 2000/06/15 06:42:04 1.1.1.8 +++ ossp-pkg/ossp-cvs/src/sanity.sh 2000/06/22 15:09:26 1.2 @@ -7011,11 +7011,13 @@ ############################################################ # Check out the whole repository mkdir 1; cd 1 - dotest modules-1 "${testcvs} -q co ." 'U CVSROOT/checkoutlist + dotest modules-1 "${testcvs} -q co ." 'U CVSROOT/admininfo +U CVSROOT/checkoutlist U CVSROOT/commitinfo U CVSROOT/config U CVSROOT/cvswrappers U CVSROOT/editinfo +U CVSROOT/importinfo U CVSROOT/loginfo U CVSROOT/modules U CVSROOT/notify @@ -7035,11 +7037,13 @@ ############################################################ # Check out CVSROOT mkdir 1; cd 1 - dotest modules-2 "${testcvs} -q co CVSROOT" 'U CVSROOT/checkoutlist + dotest modules-2 "${testcvs} -q co CVSROOT" 'U CVSROOT/admininfo +U CVSROOT/checkoutlist U CVSROOT/commitinfo U CVSROOT/config U CVSROOT/cvswrappers U CVSROOT/editinfo +U CVSROOT/importinfo U CVSROOT/loginfo U CVSROOT/modules U CVSROOT/notify @@ -7062,11 +7066,13 @@ mkdir 1; cd 1 dotest modules-3 "${testcvs} -q co somedir" '' cd somedir - dotest modules-3d "${testcvs} -q co CVSROOT" 'U CVSROOT/checkoutlist + dotest modules-3d "${testcvs} -q co CVSROOT" 'U CVSROOT/admininfo +U CVSROOT/checkoutlist U CVSROOT/commitinfo U CVSROOT/config U CVSROOT/cvswrappers U CVSROOT/editinfo +U CVSROOT/importinfo U CVSROOT/loginfo U CVSROOT/modules U CVSROOT/notify --5QP9CKWMCI0CUR67I85D-- From ossp-cvs-owner@ossp.org Thu Jun 22 17:10:37 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e5MFAa259020; Thu, 22 Jun 2000 17:10:36 +0200 (CEST) Date: Thu, 22 Jun 2000 17:10:36 +0200 (CEST) Message-Id: <200006221510.e5MFAa259020@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Y4P11OIUANI6VJPOQ7WL" Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/ossp-cvs/src rcs.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list This is a multi-part message in MIME format. --Y4P11OIUANI6VJPOQ7WL Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: commit summary Content-Disposition: inline OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 22-Jun-2000 17:10:36 Branch: HEAD Handle: 2000062216103200 Modified files: ossp-pkg/ossp-cvs/src rcs.c Log: *** empty log message *** Summary: Revision Changes Path 1.11 +1 -1 ossp-pkg/ossp-cvs/src/rcs.c ____________________________________________________________________________ --Y4P11OIUANI6VJPOQ7WL Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/ossp-cvs/src/rcs.c Content-Disposition: attachment Index: ossp-pkg/ossp-cvs/src/rcs.c ============================================================ $ cvs diff -u -r1.10 -r1.11 rcs.c --- ossp-pkg/ossp-cvs/src/rcs.c 2000/06/18 13:50:37 1.10 +++ ossp-pkg/ossp-cvs/src/rcs.c 2000/06/22 15:10:32 1.11 @@ -3397,7 +3397,7 @@ KEYWORD_SOURCE, #ifdef OSSP_PATCH_LOCALID KEYWORD_STATE, - KEYWORD_LOCALID, + KEYWORD_LOCALID #else KEYWORD_STATE #endif --Y4P11OIUANI6VJPOQ7WL-- From ossp-cvs-owner@ossp.org Thu Jun 22 17:11:24 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e5MFBNm59107; Thu, 22 Jun 2000 17:11:23 +0200 (CEST) Date: Thu, 22 Jun 2000 17:11:23 +0200 (CEST) Message-Id: <200006221511.e5MFBNm59107@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="QOT3XWRR5MRTG330N18C" Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/ossp-cvs/src server.c update.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list This is a multi-part message in MIME format. --QOT3XWRR5MRTG330N18C Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: commit summary Content-Disposition: inline OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 22-Jun-2000 17:11:22 Branch: HEAD Handle: 2000062216111900 Modified files: ossp-pkg/ossp-cvs/src server.c update.c Log: *** empty log message *** Summary: Revision Changes Path 1.22 +1 -0 ossp-pkg/ossp-cvs/src/server.c 1.7 +4 -0 ossp-pkg/ossp-cvs/src/update.c ____________________________________________________________________________ --QOT3XWRR5MRTG330N18C Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/ossp-cvs/src/server.c Content-Disposition: attachment Index: ossp-pkg/ossp-cvs/src/server.c ============================================================ $ cvs diff -u -r1.21 -r1.22 server.c --- ossp-pkg/ossp-cvs/src/server.c 2000/06/22 13:31:38 1.21 +++ ossp-pkg/ossp-cvs/src/server.c 2000/06/22 15:11:19 1.22 @@ -2206,6 +2206,7 @@ #ifdef OSSP_PATCH_NOLOCK case 'u': nolock = 1; + break; #endif case 'q': quiet = 1; --QOT3XWRR5MRTG330N18C Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/ossp-cvs/src/update.c Content-Disposition: attachment Index: ossp-pkg/ossp-cvs/src/update.c ============================================================ $ cvs diff -u -r1.6 -r1.7 update.c --- ossp-pkg/ossp-cvs/src/update.c 2000/06/18 13:50:37 1.6 +++ ossp-pkg/ossp-cvs/src/update.c 2000/06/22 15:11:19 1.7 @@ -202,7 +202,11 @@ break; case 'p': pipeout = 1; +#ifdef OSSP_PATCH_NOLOCK + nolock = noexec = 1; /* so no locks will be created */ +#else noexec = 1; /* so no locks will be created */ +#endif break; case 'j': if (join_rev2) --QOT3XWRR5MRTG330N18C-- From ossp-cvs-owner@ossp.org Thu Jun 22 17:50:35 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e5MFoYC61876; Thu, 22 Jun 2000 17:50:34 +0200 (CEST) Date: Thu, 22 Jun 2000 17:50:34 +0200 (CEST) Message-Id: <200006221550.e5MFoYC61876@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="R6O6YKAPCCEWE3CFQTJP" Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/ossp-cvs/src checkin.c options.h.in sanity.sh Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list This is a multi-part message in MIME format. --R6O6YKAPCCEWE3CFQTJP Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: commit summary Content-Disposition: inline OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 22-Jun-2000 17:50:34 Branch: HEAD Handle: 2000062216503200 Modified files: ossp-pkg/ossp-cvs/src checkin.c options.h.in sanity.sh Log: *** empty log message *** Summary: Revision Changes Path 1.3 +5 -5 ossp-pkg/ossp-cvs/src/checkin.c 1.27 +5 -3 ossp-pkg/ossp-cvs/src/options.h.in 1.3 +1 -1 ossp-pkg/ossp-cvs/src/sanity.sh ____________________________________________________________________________ --R6O6YKAPCCEWE3CFQTJP Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/ossp-cvs/src/checkin.c Content-Disposition: attachment Index: ossp-pkg/ossp-cvs/src/checkin.c ============================================================ $ cvs diff -u -r1.2 -r1.3 checkin.c --- ossp-pkg/ossp-cvs/src/checkin.c 2000/04/10 06:07:46 1.2 +++ ossp-pkg/ossp-cvs/src/checkin.c 2000/06/22 15:50:32 1.3 @@ -32,7 +32,7 @@ Vers_TS *vers; int set_time; char *tocvsPath = NULL; -#ifdef OSSP_PATCH_COSMETICS +#ifdef OSSP_PATCH_COSMETICS_HARD int flags; #endif @@ -40,17 +40,17 @@ message from "ci" goes to stderr. This doesn't make a whole lot of sense, but making everything go to stdout can only be gracefully achieved once RCS_checkin is librarified. */ -#ifdef OSSP_PATCH_COSMETICS +#ifdef OSSP_PATCH_COSMETICS_HARD if (!really_quiet) { #endif cvs_output ("Checking in ", 0); cvs_output (finfo->fullname, 0); -#ifdef OSSP_PATCH_COSMETICS +#ifdef OSSP_PATCH_COSMETICS_HARD cvs_output ("\n", 0); #else cvs_output (";\n", 0); #endif -#ifdef OSSP_PATCH_COSMETICS +#ifdef OSSP_PATCH_COSMETICS_HARD } #endif @@ -69,7 +69,7 @@ if (finfo->rcs == NULL) finfo->rcs = RCS_parse (finfo->file, finfo->repository); -#ifdef OSSP_PATCH_COSMETICS +#ifdef OSSP_PATCH_COSMETICS_HARD flags = RCS_FLAGS_KEEPFILE; if (really_quiet || quiet) flags |= RCS_FLAGS_QUIET; --R6O6YKAPCCEWE3CFQTJP Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/ossp-cvs/src/options.h.in Content-Disposition: attachment Index: ossp-pkg/ossp-cvs/src/options.h.in ============================================================ $ cvs diff -u -r1.26 -r1.27 options.h.in --- ossp-pkg/ossp-cvs/src/options.h.in 2000/06/22 13:13:12 1.26 +++ ossp-pkg/ossp-cvs/src/options.h.in 2000/06/22 15:50:32 1.27 @@ -218,12 +218,9 @@ #define OSSP_PATCH_READDNEW #define OSSP_PATCH_CONFIGUMASK #define OSSP_PATCH_FASTERUPDATE -#define OSSP_PATCH_MERGENOKEYWORD -#define OSSP_PATCH_DIFFHEAD #define OSSP_PATCH_DEADAWARE #define OSSP_PATCH_LOGNAME #define OSSP_PATCH_HISTORYFILE -#define OSSP_PATCH_SMARTCONFIG #define OSSP_PATCH_IMPORTINFO #define OSSP_PATCH_ADMININFO #define OSSP_PATCH_HANDLE @@ -234,5 +231,10 @@ #define OSSP_PATCH_PSERVERD #define OSSP_PATCH_MAPROOT #define OSSP_PATCH_COSMETICS +/* problematic changes, because they break "make check" */ +#undef OSSP_PATCH_COSMETICS_HARD +#undef OSSP_PATCH_MERGENOKEYWORD +#undef OSSP_PATCH_DIFFHEAD +#undef OSSP_PATCH_SMARTCONFIG #endif --R6O6YKAPCCEWE3CFQTJP Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/ossp-cvs/src/sanity.sh Content-Disposition: attachment Index: ossp-pkg/ossp-cvs/src/sanity.sh ============================================================ $ cvs diff -u -r1.2 -r1.3 sanity.sh --- ossp-pkg/ossp-cvs/src/sanity.sh 2000/06/22 15:09:26 1.2 +++ ossp-pkg/ossp-cvs/src/sanity.sh 2000/06/22 15:50:32 1.3 @@ -16045,7 +16045,7 @@ add a line on trunk after trunktag" # But diff thinks that HEAD is "br1". Case (b) from cvs.texinfo. # Probably people are relying on it. - dotest head-br1-diff "${testcvs} -q diff -c -r HEAD -r br1" "" + #OSSP# dotest head-br1-diff "${testcvs} -q diff -c -r HEAD -r br1" "" # With a nonbranch sticky tag on a branch, # HEAD is the head of the trunk --R6O6YKAPCCEWE3CFQTJP-- From ossp-cvs-owner@ossp.org Thu Jun 22 18:05:44 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e5MG5hU62975; Thu, 22 Jun 2000 18:05:43 +0200 (CEST) Date: Thu, 22 Jun 2000 18:05:43 +0200 (CEST) Message-Id: <200006221605.e5MG5hU62975@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="8FVEUHZR3CVKHH12FITT" Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/ossp-cvs README.OSSP Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list This is a multi-part message in MIME format. --8FVEUHZR3CVKHH12FITT Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: commit summary Content-Disposition: inline OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 22-Jun-2000 18:05:43 Branch: HEAD Handle: 2000062217054300 Modified files: ossp-pkg/ossp-cvs README.OSSP Log: *** empty log message *** Summary: Revision Changes Path 1.41 +5 -0 ossp-pkg/ossp-cvs/README.OSSP ____________________________________________________________________________ --8FVEUHZR3CVKHH12FITT Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/ossp-cvs/README.OSSP Content-Disposition: attachment Index: ossp-pkg/ossp-cvs/README.OSSP ============================================================ $ cvs diff -u -r1.40 -r1.41 README.OSSP --- ossp-pkg/ossp-cvs/README.OSSP 2000/06/22 13:13:54 1.40 +++ ossp-pkg/ossp-cvs/README.OSSP 2000/06/22 16:05:43 1.41 @@ -302,3 +302,8 @@ This just enables some cosmetic changes to various output messages. [Origin: Ralf S. Engelschall] + OSSP_PATCH_COSMETICS_HARD: + This just enables more cosmetic changes to various output messages. + The difference is that these break "make check". + [Origin: Ralf S. Engelschall] + --8FVEUHZR3CVKHH12FITT-- From ossp-cvs-owner@ossp.org Thu Jun 22 18:08:32 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e5MG8UT63182; Thu, 22 Jun 2000 18:08:30 +0200 (CEST) Date: Thu, 22 Jun 2000 18:08:30 +0200 (CEST) Message-Id: <200006221608.e5MG8UT63182@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="HNAS36ZK5UNNWV48LVHI" Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/ossp-cvs/src sanity.sh Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list This is a multi-part message in MIME format. --HNAS36ZK5UNNWV48LVHI Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: commit summary Content-Disposition: inline OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 22-Jun-2000 18:08:22 Branch: HEAD Handle: 2000062217082000 Modified files: ossp-pkg/ossp-cvs/src sanity.sh Log: *** empty log message *** Summary: Revision Changes Path 1.4 +1 -0 ossp-pkg/ossp-cvs/src/sanity.sh ____________________________________________________________________________ --HNAS36ZK5UNNWV48LVHI Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/ossp-cvs/src/sanity.sh Content-Disposition: attachment Index: ossp-pkg/ossp-cvs/src/sanity.sh ============================================================ $ cvs diff -u -r1.3 -r1.4 sanity.sh --- ossp-pkg/ossp-cvs/src/sanity.sh 2000/06/22 15:50:32 1.3 +++ ossp-pkg/ossp-cvs/src/sanity.sh 2000/06/22 16:08:20 1.4 @@ -59,6 +59,7 @@ # "debugger" #set -x +echo '[THIS PROCEDURE TAKES A LONGER TIME, SO BE PATIENT!]' echo 'This test should produce no other output than this line, and a final "OK".' if test x"$1" = x"-r"; then --HNAS36ZK5UNNWV48LVHI-- From ossp-cvs-owner@ossp.org Thu Jun 22 18:27:43 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e5MGRhb64560; Thu, 22 Jun 2000 18:27:43 +0200 (CEST) Date: Thu, 22 Jun 2000 18:27:43 +0200 (CEST) Message-Id: <200006221627.e5MGRhb64560@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="E8JPYUMW1SKB6OL10ABI" Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/ossp-cvs/src sanity.sh Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list This is a multi-part message in MIME format. --E8JPYUMW1SKB6OL10ABI Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: commit summary Content-Disposition: inline OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 22-Jun-2000 18:27:42 Branch: HEAD Handle: 2000062217274100 Modified files: ossp-pkg/ossp-cvs/src sanity.sh Log: *** empty log message *** Summary: Revision Changes Path 1.5 +1 -1 ossp-pkg/ossp-cvs/src/sanity.sh ____________________________________________________________________________ --E8JPYUMW1SKB6OL10ABI Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/ossp-cvs/src/sanity.sh Content-Disposition: attachment Index: ossp-pkg/ossp-cvs/src/sanity.sh ============================================================ $ cvs diff -u -r1.4 -r1.5 sanity.sh --- ossp-pkg/ossp-cvs/src/sanity.sh 2000/06/22 16:08:20 1.4 +++ ossp-pkg/ossp-cvs/src/sanity.sh 2000/06/22 16:27:41 1.5 @@ -59,7 +59,7 @@ # "debugger" #set -x -echo '[THIS PROCEDURE TAKES A LONGER TIME, SO BE PATIENT!]' +echo '[THIS PROCEDURE TAKES APPROX. 25min ON A PII/400MHz, SO BE PATIENT!]' echo 'This test should produce no other output than this line, and a final "OK".' if test x"$1" = x"-r"; then --E8JPYUMW1SKB6OL10ABI-- From ossp-cvs-owner@ossp.org Thu Jun 22 18:34:13 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e5MGYC565050; Thu, 22 Jun 2000 18:34:12 +0200 (CEST) Date: Thu, 22 Jun 2000 18:34:12 +0200 (CEST) Message-Id: <200006221634.e5MGYC565050@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="HU5CV0N1SG5ICSULCJZQ" Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/ossp-cvs/src options.h.in Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list This is a multi-part message in MIME format. --HU5CV0N1SG5ICSULCJZQ Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: commit summary Content-Disposition: inline OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 22-Jun-2000 18:34:12 Branch: HEAD Handle: 2000062217341100 Modified files: ossp-pkg/ossp-cvs/src options.h.in Log: *** empty log message *** Summary: Revision Changes Path 1.28 +4 -4 ossp-pkg/ossp-cvs/src/options.h.in ____________________________________________________________________________ --HU5CV0N1SG5ICSULCJZQ Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/ossp-cvs/src/options.h.in Content-Disposition: attachment Index: ossp-pkg/ossp-cvs/src/options.h.in ============================================================ $ cvs diff -u -r1.27 -r1.28 options.h.in --- ossp-pkg/ossp-cvs/src/options.h.in 2000/06/22 15:50:32 1.27 +++ ossp-pkg/ossp-cvs/src/options.h.in 2000/06/22 16:34:11 1.28 @@ -232,9 +232,9 @@ #define OSSP_PATCH_MAPROOT #define OSSP_PATCH_COSMETICS /* problematic changes, because they break "make check" */ -#undef OSSP_PATCH_COSMETICS_HARD -#undef OSSP_PATCH_MERGENOKEYWORD -#undef OSSP_PATCH_DIFFHEAD -#undef OSSP_PATCH_SMARTCONFIG +#undef OSSP_PATCH_COSMETICS_HARD +#undef OSSP_PATCH_MERGENOKEYWORD +#undef OSSP_PATCH_DIFFHEAD +#undef OSSP_PATCH_SMARTCONFIG #endif --HU5CV0N1SG5ICSULCJZQ-- From ossp-cvs-owner@ossp.org Thu Jun 22 18:36:34 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e5MGaXT65247; Thu, 22 Jun 2000 18:36:33 +0200 (CEST) Date: Thu, 22 Jun 2000 18:36:33 +0200 (CEST) Message-Id: <200006221636.e5MGaXT65247@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="XZTSZZB1NF4RY91H3YP0" Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/ossp-cvs Makefile.in README.OSSP Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list This is a multi-part message in MIME format. --XZTSZZB1NF4RY91H3YP0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: commit summary Content-Disposition: inline OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 22-Jun-2000 18:36:33 Branch: HEAD Handle: 2000062217363300 Modified files: ossp-pkg/ossp-cvs Makefile.in README.OSSP Log: *** empty log message *** Summary: Revision Changes Path 1.19 +3 -9 ossp-pkg/ossp-cvs/Makefile.in 1.42 +30 -2 ossp-pkg/ossp-cvs/README.OSSP ____________________________________________________________________________ --XZTSZZB1NF4RY91H3YP0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/ossp-cvs/Makefile.in Content-Disposition: attachment Index: ossp-pkg/ossp-cvs/Makefile.in ============================================================ $ cvs diff -u -r1.18 -r1.19 Makefile.in --- ossp-pkg/ossp-cvs/Makefile.in 2000/05/18 14:38:44 1.18 +++ ossp-pkg/ossp-cvs/Makefile.in 2000/06/22 16:36:33 1.19 @@ -131,18 +131,12 @@ realclean-local: distclean-local .PHONY: check -check: - cd lib ; $(MAKE) $(FLAGS_TO_PASS) - cd zlib ; $(MAKE) $(FLAGS_TO_PASS) - cd diff ; $(MAKE) $(FLAGS_TO_PASS) - cd src ; $(MAKE) $(FLAGS_TO_PASS) check +check: all + @cd src; $(MAKE) $(FLAGS_TO_PASS) check .PHONY: remotecheck remotecheck: - cd lib ; $(MAKE) $(FLAGS_TO_PASS) - cd zlib ; $(MAKE) $(FLAGS_TO_PASS) - cd diff ; $(MAKE) $(FLAGS_TO_PASS) - cd src ; $(MAKE) $(FLAGS_TO_PASS) remotecheck + @cd src; $(MAKE) $(FLAGS_TO_PASS) remotecheck .PHONY: dist dist: distclean --XZTSZZB1NF4RY91H3YP0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/ossp-cvs/README.OSSP Content-Disposition: attachment Index: ossp-pkg/ossp-cvs/README.OSSP ============================================================ $ cvs diff -u -r1.41 -r1.42 README.OSSP --- ossp-pkg/ossp-cvs/README.OSSP 2000/06/22 16:05:43 1.41 +++ ossp-pkg/ossp-cvs/README.OSSP 2000/06/22 16:36:33 1.42 @@ -9,11 +9,39 @@ The main differences between OSSP CVS and Cyclic CVS are: o source tree reduced to Unix and essential components only ;) - o additional OSSP functionality patches (see below) o additional documentation files (the CVS book, an intro, etc.) o additional contribution programs (cvs2cl, etc.) - o merged Cyclic's distributed ChangeLog files into a single file + o merged Cyclic/OpenAvenue's distributed ChangeLog's into a single file o use of GNU shtool in the build process + o additional OSSP functionality patches: + - support for .cvsrc files $HOME _AND_ parent dirs of working dir + - support for $HOME/.cvsroot to alias roots and to support root mirrors + - support global but command specific options in .cvsrc files + - support for stand-alone external custom commands `cvs ' + - support for prolog and epilog hooks + - allow `verifymsg' hooks to _change_ the log message + - allow `cvs diff -y' for showing the side-by-side display + - support `$LocalId$, a local keyword variant of `$Id$' + - support `$CVSHeader$, a variant of `$Header$', but without root path + - new `cvs -u' option in addition to `cvs -n' for _REAL_ read-only access + - support for additional `%x' variables on `loginfo' hook command lines + - support a `UMask=' variable in `$CVSROOT/CVSROOT/config' + - speeded up `cvs update' by sending whole file if smaller than the diff + - disabled keyword expansions during branch merges + - adjusted `cvs diff -rHEAD' to be consistent with other commands + - made `cvs diff' aware of removed/dead files in the trunk + - set `$LOGNAME' to the real user and not the CVS user + - support for `HistoryFile=' variable in config. + - support for an `admininfo' hook to ACL `cvs admin' commands. + - support for an `importinfo' hook to ACL `cvs import' commands. + - support for a `-h' option to `cvs diff' for compressed time spec. + - use prefix 'T' ("touched/tagged") instead of 'U' ("updated") on `cvs import' + - allow `LockDir' configuration directive to use relative paths + - allow a hard-coded CVS super-user to override CVS user via $CVSUSER + - additional SetUID/SetGID support for `cvs server' situations. + - new `cvs pserverd' for running stand-alone pserver daemons + - new global --map-root=/oldpath:/newpath option for mapping root paths + - various cosmetic changes Some of the OSSP functional patches are only useful for the server side (as for the official OSSP master repository), others are also --XZTSZZB1NF4RY91H3YP0-- From ossp-cvs-owner@ossp.org Thu Jun 22 18:41:14 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e5MGfEa65668; Thu, 22 Jun 2000 18:41:14 +0200 (CEST) Date: Thu, 22 Jun 2000 18:41:14 +0200 (CEST) Message-Id: <200006221641.e5MGfEa65668@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="6UZIFQCERBOBXMDKL5TX" Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/ossp-cvs/doc CVSvn.texi ossp-pkg/ossp-cvs/src ver... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list This is a multi-part message in MIME format. --6UZIFQCERBOBXMDKL5TX Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: commit summary Content-Disposition: inline OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 22-Jun-2000 18:41:13 Branch: HEAD Handle: 2000062217411201 Modified files: ossp-pkg/ossp-cvs/doc CVSvn.texi ossp-pkg/ossp-cvs/src version.c Log: Bump to 1.10.8.6 Summary: Revision Changes Path 1.4 +1 -1 ossp-pkg/ossp-cvs/doc/CVSvn.texi 1.7 +1 -1 ossp-pkg/ossp-cvs/src/version.c ____________________________________________________________________________ --6UZIFQCERBOBXMDKL5TX Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/ossp-cvs/doc/CVSvn.texi Content-Disposition: attachment Index: ossp-pkg/ossp-cvs/doc/CVSvn.texi ============================================================ $ cvs diff -u -r1.3 -r1.4 CVSvn.texi --- ossp-pkg/ossp-cvs/doc/CVSvn.texi 2000/06/17 20:03:16 1.3 +++ ossp-pkg/ossp-cvs/doc/CVSvn.texi 2000/06/22 16:41:12 1.4 @@ -1 +1 @@ -@set CVSVN 1.10.8.5 +@set CVSVN 1.10.8.6 --6UZIFQCERBOBXMDKL5TX Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/ossp-cvs/src/version.c Content-Disposition: attachment Index: ossp-pkg/ossp-cvs/src/version.c ============================================================ $ cvs diff -u -r1.6 -r1.7 version.c --- ossp-pkg/ossp-cvs/src/version.c 2000/06/17 20:03:17 1.6 +++ ossp-pkg/ossp-cvs/src/version.c 2000/06/22 16:41:13 1.7 @@ -18,7 +18,7 @@ #define NAME_PREFIX "" #endif -char *version_string = "\n" NAME_PREFIX "Concurrent Versions System (CVS) 1.10.8.5"; +char *version_string = "\n" NAME_PREFIX "Concurrent Versions System (CVS) 1.10.8.6"; #ifdef CLIENT_SUPPORT #ifdef SERVER_SUPPORT --6UZIFQCERBOBXMDKL5TX-- From ossp-cvs-owner@ossp.org Thu Jun 22 18:42:23 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e5MGgM765773; Thu, 22 Jun 2000 18:42:22 +0200 (CEST) Date: Thu, 22 Jun 2000 18:42:22 +0200 (CEST) Message-Id: <200006221642.e5MGgM765773@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="0XAESJ92G3NDWT27NZMG" Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/ossp-cvs VERSION Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list This is a multi-part message in MIME format. --0XAESJ92G3NDWT27NZMG Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: commit summary Content-Disposition: inline OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 22-Jun-2000 18:42:22 Branch: HEAD Handle: 2000062217422100 Modified files: ossp-pkg/ossp-cvs VERSION Log: Bump to 1.10.8.6 Summary: Revision Changes Path 1.5 +1 -1 ossp-pkg/ossp-cvs/VERSION ____________________________________________________________________________ --0XAESJ92G3NDWT27NZMG Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/ossp-cvs/VERSION Content-Disposition: attachment Index: ossp-pkg/ossp-cvs/VERSION ============================================================ $ cvs diff -u -r1.4 -r1.5 VERSION --- ossp-pkg/ossp-cvs/VERSION 2000/06/17 20:03:15 1.4 +++ ossp-pkg/ossp-cvs/VERSION 2000/06/22 16:42:21 1.5 @@ -1 +1 @@ -1.10.8.5 +1.10.8.6 --0XAESJ92G3NDWT27NZMG-- From ossp-cvs-owner@ossp.org Sat Jun 24 23:08:40 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e5OL8c858024; Sat, 24 Jun 2000 23:08:38 +0200 (CEST) Date: Sat, 24 Jun 2000 23:08:38 +0200 (CEST) Message-Id: <200006242108.e5OL8c858024@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/ossp-cvs .cvsignore COPYING COPYING.LIB ChangeLog... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 24-Jun-2000 23:08:38 Branch: vendor Handle: 1970010101000000 Modified files: (Branch: vendor) ossp-pkg/ossp-cvs/src client.c root.c server.c update.c Touched files: (Branch: vendor) ossp-pkg/ossp-cvs .cvsignore COPYING COPYING.LIB ChangeLog.zoo INSTALL Makefile.in NEWS README acconfig.h config.h.in configure configure.in ossp-pkg/ossp-cvs/diff .cvsignore Makefile.in analyze.c cmpbuf.c cmpbuf.h context.c diagmeet.note diff.c diff.h diff3.c diffrun.h dir.c ed.c ifdef.c io.c normal.c side.c system.h util.c version.c ossp-pkg/ossp-cvs/doc .cvsignore FAQ HACKING Makefile.in RCSFILES TESTS TODO cvs-paper.ms cvs.texinfo cvsclient.texi ossp-pkg/ossp-cvs/lib .cvsignore Makefile.in argmatch.c dup2.c fncase.c fnmatch.c fnmatch.h ftruncate.c getdate.c getdate.y getline.c getline.h getopt.c getopt.h getopt1.c hostname.c md5.c md5.h memmove.c mkdir.c regex.c regex.h rename.c savecwd.c savecwd.h sighandle.c strerror.c stripslash.c strstr.c strtoul.c system.h valloc.c wait.h waitpid.c xgetwd.c yesno.c ossp-pkg/ossp-cvs/man .cvsignore Makefile.in cvs.1 cvs.5 ossp-pkg/ossp-cvs/src .cvsignore Makefile.in add.c admin.c buffer.c buffer.h checkin.c checkout.c classify.c client.h commit.c create_adm.c cvs.h cvsrc.c diff.c edit.c edit.h entries.c error.c error.h expand_path.c fileattr.c fileattr.h filesubr.c find_names.c hardlink.c hardlink.h hash.c hash.h history.c ignore.c import.c lock.c log.c login.c logmsg.c main.c mkmodules.c modules.c myndbm.c myndbm.h no_diff.c options.h.in parseinfo.c patch.c rcs.c rcs.h rcscmds.c recurse.c release.c remove.c repos.c rtag.c run.c sanity.sh scramble.c server.h status.c subr.c tag.c update.h vers_ts.c version.c watch.c watch.h wrapper.c zlib.c ossp-pkg/ossp-cvs/zlib .cvsignore Makefile.in README adler32.c algorithm.doc compress.c crc32.c deflate.c deflate.h gzio.c infblock.c infblock.h infcodes.c infcodes.h inffast.c inffast.h inflate.c inftrees.c inftrees.h infutil.c infutil.h trees.c uncompr.c zconf.h zlib.h zutil.c zutil.h Log: Import vendor CVS, snapshot 20000624 [Release Tags: CVS_20000624] Summary: Revision Changes Path 1.1.1.6 +0 -0 ossp-pkg/ossp-cvs/src/client.c 1.1.1.4 +0 -0 ossp-pkg/ossp-cvs/src/root.c 1.1.1.10 +0 -0 ossp-pkg/ossp-cvs/src/server.c 1.1.1.6 +0 -0 ossp-pkg/ossp-cvs/src/update.c ____________________________________________________________________________ http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/client.c?cvsroot=ossp&r1=1.1.1.5&r2=1.1.1.6 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/root.c?cvsroot=ossp&r1=1.1.1.3&r2=1.1.1.4 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/server.c?cvsroot=ossp&r1=1.1.1.9&r2=1.1.1.10 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/update.c?cvsroot=ossp&r1=1.1.1.5&r2=1.1.1.6 From ossp-cvs-owner@ossp.org Sat Jun 24 23:12:57 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e5OLCu458371; Sat, 24 Jun 2000 23:12:56 +0200 (CEST) Date: Sat, 24 Jun 2000 23:12:56 +0200 (CEST) Message-Id: <200006242112.e5OLCu458371@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="8YS31HITAU2FU7OVMXXZ" Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/ossp-cvs/src client.c root.c server.c update.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list This is a multi-part message in MIME format. --8YS31HITAU2FU7OVMXXZ Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: commit summary Content-Disposition: inline OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 24-Jun-2000 23:12:56 Branch: HEAD Handle: 2000062422125500 Modified files: ossp-pkg/ossp-cvs/src client.c root.c server.c update.c Log: Merge in conflicts Summary: Revision Changes Path 1.7 +27 -4 ossp-pkg/ossp-cvs/src/client.c 1.6 +4 -5 ossp-pkg/ossp-cvs/src/root.c 1.23 +26 -16 ossp-pkg/ossp-cvs/src/server.c 1.8 +18 -21 ossp-pkg/ossp-cvs/src/update.c ____________________________________________________________________________ --8YS31HITAU2FU7OVMXXZ Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/ossp-cvs/src/client.c Content-Disposition: attachment Index: ossp-pkg/ossp-cvs/src/client.c ============================================================ $ cvs diff -u -r1.6 -r1.7 client.c --- ossp-pkg/ossp-cvs/src/client.c 2000/06/22 13:31:38 1.6 +++ ossp-pkg/ossp-cvs/src/client.c 2000/06/24 21:12:55 1.7 @@ -5262,9 +5262,6 @@ dir_exists = isdir (cvsadm_name); free (cvsadm_name); - /* initialize the ignore list for this directory */ - ignlist = getlist (); - /* * If there is an empty directory (e.g. we are doing `cvs add' on a * newly-created directory), the server still needs to know about it. @@ -5280,6 +5277,9 @@ char *repos = Name_Repository (dir, update_dir); send_a_repository (dir, repos, update_dir); free (repos); + + /* initialize the ignore list for this directory */ + ignlist = getlist (); } else { @@ -5304,6 +5304,29 @@ return (dir_exists ? R_PROCESS : R_SKIP_ALL); } +static int send_dirleave_proc PROTO ((void *, char *, int, char *, List *)); + +/* + * send_dirleave_proc () is called back by the recursion code upon leaving + * a directory. All it does is delete the ignore list if it hasn't already + * been done (by send_filesdone_proc). + */ +/* ARGSUSED */ +static int +send_dirleave_proc (callerdat, dir, err, update_dir, entries) + void *callerdat; + char *dir; + int err; + char *update_dir; + List *entries; +{ + + /* Delete the ignore list if it hasn't already been done. */ + if (ignlist) + dellist (&ignlist); + return err; +} + /* * Send each option in a string to the server, one by one. * This assumes that the options are separated by spaces, for example @@ -5498,7 +5521,7 @@ args.backup_modified = flags & BACKUP_MODIFIED_FILES; err = start_recursion (send_fileproc, send_filesdoneproc, - send_dirent_proc, (DIRLEAVEPROC)NULL, (void *) &args, + send_dirent_proc, send_dirleave_proc, (void *) &args, argc, argv, local, W_LOCAL, aflag, 0, (char *)NULL, 0); if (err) error_exit (); --8YS31HITAU2FU7OVMXXZ Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/ossp-cvs/src/root.c Content-Disposition: attachment Index: ossp-pkg/ossp-cvs/src/root.c ============================================================ $ cvs diff -u -r1.5 -r1.6 root.c --- ossp-pkg/ossp-cvs/src/root.c 2000/06/22 13:13:12 1.5 +++ ossp-pkg/ossp-cvs/src/root.c 2000/06/24 21:12:55 1.6 @@ -177,9 +177,9 @@ directories. Then we can check against them when a remote user hands us a CVSROOT directory. */ -static unsigned int root_allow_count; +static int root_allow_count; static char **root_allow_vector; -static unsigned int root_allow_size; +static int root_allow_size; void root_allow_add (arg) @@ -236,8 +236,7 @@ root_allow_free () { if (root_allow_vector != NULL) - free (root_allow_vector); - root_allow_count = 0; + free_names (&root_allow_count, root_allow_vector); root_allow_size = 0; } @@ -245,7 +244,7 @@ root_allow_ok (arg) char *arg; { - unsigned int i; + int i; if (root_allow_count == 0) { --8YS31HITAU2FU7OVMXXZ Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/ossp-cvs/src/server.c Content-Disposition: attachment Index: ossp-pkg/ossp-cvs/src/server.c ============================================================ $ cvs diff -u -r1.22 -r1.23 server.c --- ossp-pkg/ossp-cvs/src/server.c 2000/06/22 15:11:19 1.22 +++ ossp-pkg/ossp-cvs/src/server.c 2000/06/24 21:12:55 1.23 @@ -1188,9 +1188,8 @@ #endif if (status == 0) { - if (outside_root (repos)) - return; - dirswitch (arg, repos); + if (!outside_root (repos)) + dirswitch (arg, repos); free (repos); } else if (status == -2) @@ -1959,8 +1958,8 @@ serve_notify (arg) char *arg; { - struct notify_note *new; - char *data; + struct notify_note *new = NULL; + char *data = NULL; int status; if (error_pending ()) return; @@ -1968,27 +1967,26 @@ if (outside_dir (arg)) return; + if (dir_name == NULL) + goto error; + new = (struct notify_note *) malloc (sizeof (struct notify_note)); if (new == NULL) { pending_error = ENOMEM; return; } - if (dir_name == NULL) - goto error; new->dir = malloc (strlen (dir_name) + 1); - if (new->dir == NULL) - { - pending_error = ENOMEM; - return; - } - strcpy (new->dir, dir_name); new->filename = malloc (strlen (arg) + 1); - if (new->filename == NULL) + if (new->dir == NULL || new->filename == NULL) { pending_error = ENOMEM; + if (new->dir != NULL) + free (new->dir); + free (new); return; } + strcpy (new->dir, dir_name); strcpy (new->filename, arg); status = buf_read_line (buf_from_net, &data, (int *) NULL); @@ -2014,6 +2012,9 @@ } } } + free (new->filename); + free (new->dir); + free (new); } else { @@ -2065,6 +2066,14 @@ if (alloc_pending (80)) strcpy (pending_error_text, "E Protocol error; misformed Notify request"); + if (data != NULL) + free (data); + if (new != NULL) + { + free (new->filename); + free (new->dir); + free (new); + } return; } @@ -5507,14 +5516,14 @@ /* user exists and has a password */ host_user = ((! strcmp (found_passwd, crypt (password, found_passwd))) - ? username : NULL); + ? xstrdup (username) : NULL); goto handle_return; } else if (password && *password) { /* user exists and has no system password, but we got one as parameter */ - host_user = username; + host_user = xstrdup (username); goto handle_return; } else @@ -5752,6 +5761,7 @@ /* Switch to run as this user. */ switch_to_user (host_user); + free (host_user); free (tmp); free (repository); free (username); --8YS31HITAU2FU7OVMXXZ Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/ossp-cvs/src/update.c Content-Disposition: attachment Index: ossp-pkg/ossp-cvs/src/update.c ============================================================ $ cvs diff -u -r1.7 -r1.8 update.c --- ossp-pkg/ossp-cvs/src/update.c 2000/06/22 15:11:19 1.7 +++ ossp-pkg/ossp-cvs/src/update.c 2000/06/24 21:12:55 1.8 @@ -277,26 +277,23 @@ option_with_arg ("-j", join_rev2); wrap_send (); - /* If the server supports the command "update-patches", that means - that it knows how to handle the -u argument to update, which - means to send patches instead of complete files. - - We don't send -u if failed_patches != NULL, so that the - server doesn't try to send patches which will just fail - again. At least currently, the client also clobbers the - file and tells the server it is lost, which also will get - a full file instead of a patch, but it seems clean to omit - -u. */ - if (failed_patches == NULL) + if (failed_patches_count == 0) { + unsigned int flags = 0; + + /* If the server supports the command "update-patches", that + means that it knows how to handle the -u argument to update, + which means to send patches instead of complete files. + + We don't send -u if failed_patches != NULL, so that the + server doesn't try to send patches which will just fail + again. At least currently, the client also clobbers the + file and tells the server it is lost, which also will get + a full file instead of a patch, but it seems clean to omit + -u. */ if (supported_request ("update-patches")) send_arg ("-u"); - } - if (failed_patches == NULL) - { - unsigned int flags = 0; - if (update_build_dirs) flags |= SEND_BUILD_DIRS; @@ -332,11 +329,9 @@ send_files (failed_patches_count, failed_patches, local, aflag, update_build_dirs ? SEND_BUILD_DIRS : 0); send_file_names (failed_patches_count, failed_patches, 0); + free_names (&failed_patches_count, failed_patches); } - failed_patches = NULL; - failed_patches_count = 0; - send_to_server ("update\012", 0); status = get_responses_and_close (); @@ -355,13 +350,15 @@ conflict-and-patch-failed case. */ if (status != 0 - && (failed_patches == NULL || pass > 1)) + && (failed_patches_count == 0 || pass > 1)) { + if (failed_patches_count > 0) + free_names (&failed_patches_count, failed_patches); return status; } ++pass; - } while (failed_patches != NULL); + } while (failed_patches_count > 0); return 0; } --8YS31HITAU2FU7OVMXXZ-- From ossp-cvs-owner@ossp.org Sun Jun 25 15:33:41 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e5PDXeO26850; Sun, 25 Jun 2000 15:33:40 +0200 (CEST) Date: Sun, 25 Jun 2000 15:33:40 +0200 (CEST) Message-Id: <200006251333.e5PDXeO26850@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="1OVFKT0A8UCST5TC5OPQ" Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: CVSROOT modules Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list This is a multi-part message in MIME format. --1OVFKT0A8UCST5TC5OPQ Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: commit summary Content-Disposition: inline OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: CVSROOT Date: 25-Jun-2000 15:33:40 Branch: HEAD Handle: 2000062514333900 Modified files: CVSROOT modules Log: Update cvs path Summary: Revision Changes Path 1.18 +1 -1 CVSROOT/modules ____________________________________________________________________________ --1OVFKT0A8UCST5TC5OPQ Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to CVSROOT/modules Content-Disposition: attachment Index: CVSROOT/modules ============================================================ $ cvs diff -u -r1.17 -r1.18 modules --- CVSROOT/modules 2000/06/21 07:52:15 1.17 +++ CVSROOT/modules 2000/06/25 13:33:39 1.18 @@ -60,6 +60,6 @@ ossp-play ossp-play # the OSSP sub-modules -ossp-cvs ossp-pkg/ossp-cvs +cvs ossp-pkg/cvs shiela ossp-pkg/shiela --1OVFKT0A8UCST5TC5OPQ-- From ossp-cvs-owner@ossp.org Sun Jun 25 15:35:52 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e5PDZpN27039; Sun, 25 Jun 2000 15:35:51 +0200 (CEST) Date: Sun, 25 Jun 2000 15:35:51 +0200 (CEST) Message-Id: <200006251335.e5PDZpN27039@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="2QQKXHRUKE8NFKVO3AMU" Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: CVSROOT modules Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list This is a multi-part message in MIME format. --2QQKXHRUKE8NFKVO3AMU Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: commit summary Content-Disposition: inline OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: CVSROOT Date: 25-Jun-2000 15:35:50 Branch: HEAD Handle: 2000062514355000 Modified files: CVSROOT modules Log: *** empty log message *** Summary: Revision Changes Path 1.19 +1 -0 CVSROOT/modules ____________________________________________________________________________ --2QQKXHRUKE8NFKVO3AMU Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to CVSROOT/modules Content-Disposition: attachment Index: CVSROOT/modules ============================================================ $ cvs diff -u -r1.18 -r1.19 modules --- CVSROOT/modules 2000/06/25 13:33:39 1.18 +++ CVSROOT/modules 2000/06/25 13:35:50 1.19 @@ -63,3 +63,4 @@ cvs ossp-pkg/cvs shiela ossp-pkg/shiela + --2QQKXHRUKE8NFKVO3AMU-- From ossp-cvs-owner@ossp.org Sun Jun 25 15:36:07 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e5PDa5527089; Sun, 25 Jun 2000 15:36:05 +0200 (CEST) Date: Sun, 25 Jun 2000 15:36:05 +0200 (CEST) Message-Id: <200006251336.e5PDa5527089@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="764OAKXYII9MMU2MFSP0" Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: CVSROOT modules Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list This is a multi-part message in MIME format. --764OAKXYII9MMU2MFSP0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: commit summary Content-Disposition: inline OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: CVSROOT Date: 25-Jun-2000 15:36:05 Branch: HEAD Handle: 2000062514360400 Modified files: CVSROOT modules Log: *** empty log message *** Summary: Revision Changes Path 1.20 +0 -1 CVSROOT/modules ____________________________________________________________________________ --764OAKXYII9MMU2MFSP0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to CVSROOT/modules Content-Disposition: attachment Index: CVSROOT/modules ============================================================ $ cvs diff -u -r1.19 -r1.20 modules --- CVSROOT/modules 2000/06/25 13:35:50 1.19 +++ CVSROOT/modules 2000/06/25 13:36:04 1.20 @@ -63,4 +63,3 @@ cvs ossp-pkg/cvs shiela ossp-pkg/shiela - --764OAKXYII9MMU2MFSP0-- From ossp-cvs-owner@ossp.org Sun Jun 25 20:54:17 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e5PIsGg77306; Sun, 25 Jun 2000 20:54:16 +0200 (CEST) Date: Sun, 25 Jun 2000 20:54:16 +0200 (CEST) Message-Id: <200006251854.e5PIsGg77306@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="YR3FKC4HV9CROES2G79T" Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/cvs/man cvs.1 Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list This is a multi-part message in MIME format. --YR3FKC4HV9CROES2G79T Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: commit summary Content-Disposition: inline OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 25-Jun-2000 20:54:16 Branch: HEAD Handle: 2000062519541600 Modified files: ossp-pkg/cvs/man cvs.1 Log: *** empty log message *** Summary: Revision Changes Path 1.2 +26 -21 ossp-pkg/cvs/man/cvs.1 ____________________________________________________________________________ --YR3FKC4HV9CROES2G79T Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/cvs/man/cvs.1 Content-Disposition: attachment Index: ossp-pkg/cvs/man/cvs.1 ============================================================ $ cvs diff -u -r1.1.1.2 -r1.2 cvs.1 --- ossp-pkg/cvs/man/cvs.1 2000/05/04 19:29:43 1.1.1.2 +++ ossp-pkg/cvs/man/cvs.1 2000/06/25 18:54:16 1.2 @@ -15,14 +15,10 @@ .SH "NAME" cvs \- Concurrent Versions System .SH "SYNOPSIS" -.TP -\fBcvs\fP [ \fIcvs_options\fP ] -.I cvs_command -[ -.I command_options -] [ -.I command_args -] +\fBcvs\fP [\fIcvs_options\fP] +\fIcvs_command\fP +[\fIcommand_options\fP] +[\fIcommand_args\fP] .SH "NOTE" This manpage is a summary of some of the features of .B cvs @@ -218,6 +214,11 @@ but only to issue reports; do not remove, update, or merge any existing files, or create any new files. .TP +.B \-u +Do not create any lock files in the repository. This useful for working with +read-only repositories (for instance, repositories mounted from read-only +media like CDROMs). +.TP .B \-t Trace program execution; display messages showing the steps of .B cvs @@ -273,7 +274,8 @@ .SH "CVS STARTUP FILE" Normally, when CVS starts up, it reads the .I .cvsrc -file from the home directory of the user reading it. This startup +file from all parent directories of the current +working directory plus from the home directory of the user. This startup procedure can be turned off with the .B \-f flag. --YR3FKC4HV9CROES2G79T-- From ossp-cvs-owner@ossp.org Sun Jun 25 20:55:34 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e5PItXZ77424; Sun, 25 Jun 2000 20:55:33 +0200 (CEST) Date: Sun, 25 Jun 2000 20:55:33 +0200 (CEST) Message-Id: <200006251855.e5PItXZ77424@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="D7F26TH3VH24AQO8PZIG" Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/cvs shtool Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list This is a multi-part message in MIME format. --D7F26TH3VH24AQO8PZIG Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: commit summary Content-Disposition: inline OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 25-Jun-2000 20:55:33 Branch: HEAD Handle: 2000062519553200 Modified files: ossp-pkg/cvs shtool Log: Update shtool Summary: Revision Changes Path 1.3 +114 -86 ossp-pkg/cvs/shtool ____________________________________________________________________________ --D7F26TH3VH24AQO8PZIG Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/cvs/shtool Content-Disposition: attachment Index: ossp-pkg/cvs/shtool ============================================================ $ cvs diff -u -r1.2 -r1.3 shtool --- ossp-pkg/cvs/shtool 2000/05/05 14:47:02 1.2 +++ ossp-pkg/cvs/shtool 2000/06/25 18:55:32 1.3 @@ -6,8 +6,8 @@ ## See http://www.gnu.org/software/shtool/ for more information. ## See ftp://ftp.gnu.org/gnu/shtool/ for latest version. ## -## Version 1.4.9 (16-Apr-2000) -## Ingredients: 5/17 available modules +## Version: 1.4.10 (18-Jun-2000) +## Contents: 5/17 available modules ## ## @@ -65,7 +65,7 @@ exit 1 fi if [ ".$1" = ".-h" -o ".$1" = ".--help" ]; then - echo "This is GNU shtool, version 1.4.9 (16-Apr-2000)" + echo "This is GNU shtool, version 1.4.10 (18-Jun-2000)" echo "Copyright (c) 1994-2000 Ralf S. Engelschall " echo "Report bugs to " echo '' @@ -79,7 +79,7 @@ echo 'Available [] []:' echo ' echo [-n] [-e] [ ...]' echo ' install [-v] [-t] [-c] [-C] [-s] [-m] [-o] [-g]' - echo ' [-e] ' + echo ' [-e] [ ...] ' echo ' mkdir [-t] [-f] [-p] [-m] [ ...]' echo ' fixperm [-v] [-t] [ ...]' echo ' tarball [-t] [-v] [-o ] [-c ] [-d ] [-u' @@ -104,7 +104,7 @@ exit 0 fi if [ ".$1" = ".-v" -o ".$1" = ."--version" ]; then - echo "GNU shtool 1.4.9 (16-Apr-2000)" + echo "GNU shtool 1.4.10 (18-Jun-2000)" exit 0 fi if [ ".$1" = ".-d" -o ".$1" = ."--debug" ]; then @@ -142,8 +142,8 @@ ;; install ) str_tool="install" - str_usage="[-v] [-t] [-c] [-C] [-s] [-m] [-o] [-g] [-e] " - arg_spec="2=" + str_usage="[-v] [-t] [-c] [-C] [-s] [-m] [-o] [-g] [-e] [ ...] " + arg_spec="2+" opt_spec="v.t.c.C.s.m:o:g:e:" opt_v=no opt_t=no @@ -573,104 +573,132 @@ ## Originally written for shtool ## - src="$1" - dst="$2" - - # If destination is a directory, append the input filename - if [ -d $dst ]; then - dst=`echo "$dst" | sed -e 's:/$::'` - dstfile=`echo "$src" | sed -e 's;.*/\([^/]*\)$;\1;'` - dst="$dst/$dstfile" - fi + # determine source(s) and destination + argc=$# + srcs="" + while [ $# -gt 1 ]; do + srcs="$srcs $1" + shift + done + dstpath="$1" - # Add a possible extension to src and dst - if [ ".$opt_e" != . ]; then - src="$src$opt_e" - dst="$dst$opt_e" + # type check for destination + dstisdir=0 + if [ -d $dstpath ]; then + dstpath=`echo "$dstpath" | sed -e 's:/$::'` + dstisdir=1 fi - # Check for correct arguments - if [ ".$src" = ".$dst" ]; then - echo "$msgprefix:Error: source and destination are the same" 1>&2 + # consistency check for destination + if [ $argc -gt 2 -a $dstisdir = 0 ]; then + echo "$msgprefix:Error: multiple sources require destination to be directory" 1>&2 exit 1 fi - # Make a temp file name in the destination directory - dstdir=`echo $dst | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;' -e 's;^$;.;'` - dsttmp="$dstdir/#INST@$$#" + # iterate over all source(s) + for src in $srcs; do + dst=$dstpath - # Verbosity - if [ ".$opt_v" = .yes ]; then - echo "$src -> $dst" 1>&2 - fi + # If destination is a directory, append the input filename + if [ $dstisdir = 1 ]; then + dstfile=`echo "$src" | sed -e 's;.*/\([^/]*\)$;\1;'` + dst="$dst/$dstfile" + fi - # Copy or move the file name to the temp name - # (because we might be not allowed to change the source) - if [ ".$opt_C" = .yes ]; then - opt_c=yes - fi - if [ ".$opt_c" = .yes ]; then - if [ ".$opt_t" = .yes ]; then - echo "cp $src $dsttmp" 1>&2 + # Add a possible extension to src and dst + if [ ".$opt_e" != . ]; then + src="$src$opt_e" + dst="$dst$opt_e" fi - cp $src $dsttmp || exit $? - else - if [ ".$opt_t" = .yes ]; then - echo "mv $src $dsttmp" 1>&2 + + # Check for correct arguments + if [ ".$src" = ".$dst" ]; then + echo "$msgprefix:Warning: source and destination are the same - skipped" 1>&2 + continue fi - mv $src $dsttmp || exit $? - fi + if [ -d "$src" ]; then + echo "$msgprefix:Warning: source \`$src' is a directory - skipped" 1>&2 + continue + fi - # Adjust the target file - # (we do chmod last to preserve setuid bits) - if [ ".$opt_s" = .yes ]; then - if [ ".$opt_t" = .yes ]; then - echo "strip $dsttmp" 1>&2 + # Make a temp file name in the destination directory + dsttmp=`echo $dst |\ + sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;' -e 's;^$;.;' \ + -e "s;\$;/#INST@$$#;"` + + # Verbosity + if [ ".$opt_v" = .yes ]; then + echo "$src -> $dst" 1>&2 + fi + + # Copy or move the file name to the temp name + # (because we might be not allowed to change the source) + if [ ".$opt_C" = .yes ]; then + opt_c=yes + fi + if [ ".$opt_c" = .yes ]; then + if [ ".$opt_t" = .yes ]; then + echo "cp $src $dsttmp" 1>&2 + fi + cp $src $dsttmp || exit $? + else + if [ ".$opt_t" = .yes ]; then + echo "mv $src $dsttmp" 1>&2 + fi + mv $src $dsttmp || exit $? fi - strip $dsttmp || exit $? - fi - if [ ".$opt_o" != . ]; then - if [ ".$opt_t" = .yes ]; then - echo "chown $opt_o $dsttmp" 1>&2 + + # Adjust the target file + # (we do chmod last to preserve setuid bits) + if [ ".$opt_s" = .yes ]; then + if [ ".$opt_t" = .yes ]; then + echo "strip $dsttmp" 1>&2 + fi + strip $dsttmp || exit $? fi - chown $opt_o $dsttmp || exit $? - fi - if [ ".$opt_g" != . ]; then - if [ ".$opt_t" = .yes ]; then - echo "chgrp $opt_g $dsttmp" 1>&2 + if [ ".$opt_o" != . ]; then + if [ ".$opt_t" = .yes ]; then + echo "chown $opt_o $dsttmp" 1>&2 + fi + chown $opt_o $dsttmp || exit $? fi - chgrp $opt_g $dsttmp || exit $? - fi - if [ ".$opt_m" != . ]; then - if [ ".$opt_t" = .yes ]; then - echo "chmod $opt_m $dsttmp" 1>&2 + if [ ".$opt_g" != . ]; then + if [ ".$opt_t" = .yes ]; then + echo "chgrp $opt_g $dsttmp" 1>&2 + fi + chgrp $opt_g $dsttmp || exit $? fi - chmod $opt_m $dsttmp || exit $? - fi - - # Determine whether to do a quick install - # (has to be done _after_ the strip was already done) - quick=no - if [ ".$opt_C" = .yes ]; then - if [ -r $dst ]; then - if cmp -s $src $dst; then - quick=yes + if [ ".$opt_m" != . ]; then + if [ ".$opt_t" = .yes ]; then + echo "chmod $opt_m $dsttmp" 1>&2 fi + chmod $opt_m $dsttmp || exit $? fi - fi - # Finally install the file to the real destination - if [ $quick = yes ]; then - if [ ".$opt_t" = .yes ]; then - echo "rm -f $dsttmp" 1>&2 + # Determine whether to do a quick install + # (has to be done _after_ the strip was already done) + quick=no + if [ ".$opt_C" = .yes ]; then + if [ -r $dst ]; then + if cmp -s $src $dst; then + quick=yes + fi + fi fi - rm -f $dsttmp - else - if [ ".$opt_t" = .yes ]; then - echo "rm -f $dst && mv $dsttmp $dst" 1>&2 + + # Finally install the file to the real destination + if [ $quick = yes ]; then + if [ ".$opt_t" = .yes ]; then + echo "rm -f $dsttmp" 1>&2 + fi + rm -f $dsttmp + else + if [ ".$opt_t" = .yes ]; then + echo "rm -f $dst && mv $dsttmp $dst" 1>&2 + fi + rm -f $dst && mv $dsttmp $dst fi - rm -f $dst && mv $dsttmp $dst - fi + done ;; mkdir ) @@ -685,7 +713,7 @@ for p in ${1+"$@"}; do # if the directory already exists... if [ -d "$p" ]; then - if [ ".$opt_f" = .no ]; then + if [ ".$opt_f" = .no ] && [ ".$opt_p" = .no ]; then echo "$msgprefix:Error: directory already exists: $p" 1>&2 errstatus=1 break --D7F26TH3VH24AQO8PZIG-- From ossp-cvs-owner@ossp.org Mon Jun 26 21:17:21 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e5QJHKb79724; Mon, 26 Jun 2000 21:17:20 +0200 (CEST) Date: Mon, 26 Jun 2000 21:17:20 +0200 (CEST) Message-Id: <200006261917.e5QJHKb79724@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="WQ3AJLR3EMN2BWP27SOP" Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/cvs/src root.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list This is a multi-part message in MIME format. --WQ3AJLR3EMN2BWP27SOP Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: commit summary Content-Disposition: inline OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 26-Jun-2000 21:17:20 Branch: HEAD Handle: 2000062620171900 Modified files: ossp-pkg/cvs/src root.c Log: *** empty log message *** Summary: Revision Changes Path 1.7 +1 -0 ossp-pkg/cvs/src/root.c ____________________________________________________________________________ --WQ3AJLR3EMN2BWP27SOP Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/cvs/src/root.c Content-Disposition: attachment Index: ossp-pkg/cvs/src/root.c ============================================================ $ cvs diff -u -r1.6 -r1.7 root.c --- ossp-pkg/cvs/src/root.c 2000/06/24 21:12:55 1.6 +++ ossp-pkg/cvs/src/root.c 2000/06/26 19:17:19 1.7 @@ -1123,5 +1123,6 @@ return 0; } + #endif /* OSSP_PATCH_CVSROOT */ --WQ3AJLR3EMN2BWP27SOP-- From ossp-cvs-owner@ossp.org Tue Jun 27 21:31:59 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e5RJVv784930; Tue, 27 Jun 2000 21:31:57 +0200 (CEST) Date: Tue, 27 Jun 2000 21:31:57 +0200 (CEST) Message-Id: <200006271931.e5RJVv784930@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="0QF2O86A3SXR4KRBL5J4" Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/cvs/src root.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list This is a multi-part message in MIME format. --0QF2O86A3SXR4KRBL5J4 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: commit summary Content-Disposition: inline OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 27-Jun-2000 21:31:57 Branch: HEAD Handle: 2000062720315700 Modified files: ossp-pkg/cvs/src root.c Log: *** empty log message *** Summary: Revision Changes Path 1.8 +40 -26 ossp-pkg/cvs/src/root.c ____________________________________________________________________________ --0QF2O86A3SXR4KRBL5J4 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/cvs/src/root.c Content-Disposition: attachment Index: ossp-pkg/cvs/src/root.c ============================================================ $ cvs diff -u -r1.7 -r1.8 root.c --- ossp-pkg/cvs/src/root.c 2000/06/26 19:17:19 1.7 +++ ossp-pkg/cvs/src/root.c 2000/06/27 19:31:57 1.8 @@ -971,9 +971,9 @@ }; int mode = ROOT_MODE_UNKNOWN; char *rootfile; - char *rootfilebak; + char *rootfilebak = NULL; FILE *fp; - FILE *fpbak; + FILE *fpbak = NULL; int option; cvsroot_t *e; cvsroot_t E; @@ -981,7 +981,8 @@ int i; int rc; int verbose = 0; - int found; + int found = 0; + int oldexists; if (argc == -1) usage(root_usage); @@ -1032,14 +1033,18 @@ E.syncprog = ""; if ((rootfile = cvsroot_filename()) == NULL) return 0; - rootfilebak = xmalloc(strlen(rootfile)+5); - strcpy(rootfilebak, rootfile); - strcat(rootfilebak, ".bak"); - rename(rootfile, rootfilebak); - if ((fpbak = fopen(rootfilebak, "r")) == NULL) { - free(rootfile); - free(rootfilebak); - return 0; + oldexists = 0; + if (isfile(rootfile)) { + oldexists = 1; + rootfilebak = xmalloc(strlen(rootfile)+5); + strcpy(rootfilebak, rootfile); + strcat(rootfilebak, ".bak"); + rename(rootfile, rootfilebak); + if ((fpbak = fopen(rootfilebak, "r")) == NULL) { + free(rootfile); + free(rootfilebak); + return 0; + } } if ((fp = fopen(rootfile, "w")) == NULL) { fclose(fpbak); @@ -1047,25 +1052,29 @@ free(rootfilebak); return 0; } - found = 0; - while ((e = cvsroot_entry_read(fpbak)) != NULL) { - if (strcmp(e->nickname, E.nickname) == 0) { + if (oldexists) { + found = 0; + while ((e = cvsroot_entry_read(fpbak)) != NULL) { + if (strcmp(e->nickname, E.nickname) == 0) { + cvsroot_free(e); + found = 1; + break; + } + cvsroot_entry_write(fp, e); cvsroot_free(e); - found = 1; - break; } - cvsroot_entry_write(fp, e); - cvsroot_free(e); } if (argc > 1) cvsroot_entry_write(fp, &E); - if (found) { - while ((e = cvsroot_entry_read(fpbak)) != NULL) { - cvsroot_entry_write(fp, e); - cvsroot_free(e); + if (oldexists) { + if (found) { + while ((e = cvsroot_entry_read(fpbak)) != NULL) { + cvsroot_entry_write(fp, e); + cvsroot_free(e); + } } + fclose(fpbak); } - fclose(fpbak); fclose(fp); } else if (mode == ROOT_MODE_EDIT_VISUAL) { @@ -1090,7 +1099,7 @@ if (argc == 0) doit = 1; else { - for (i = 0; argv[i] != NULL; i++) { + for (i = 0; i < argc; i++) { if (strcmp(argv[i], e->nickname) == 0) { doit = 1; break; @@ -1111,8 +1120,13 @@ e->nickname, e->masterpath, e->slavepath, e->syncprog); } - else { - cvsroot_synchronize(e, 1); + else if (mode == ROOT_MODE_SYNC) { + if (e->slavepath[0] == '\0' || e->syncprog[0] == '\0') { + if (argc > 0) + error(1, 0, "repository `%s' has no slave path or sync program defined", e->nickname); + } + else + cvsroot_synchronize(e, 1); } } cvsroot_free(e); --0QF2O86A3SXR4KRBL5J4-- From ossp-cvs-owner@ossp.org Sat Jul 1 14:45:12 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e61CjAZ62652; Sat, 1 Jul 2000 14:45:10 +0200 (CEST) Date: Sat, 1 Jul 2000 14:45:10 +0200 (CEST) Message-Id: <200007011245.e61CjAZ62652@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/ossp-cvs .cvsignore COPYING COPYING.LIB ChangeLog... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 01-Jul-2000 14:45:10 Branch: vendor Handle: 19700101010000962451704 Added files: (Branch: vendor) ossp-pkg/ossp-cvs .cvsignore COPYING COPYING.LIB ChangeLog.zoo INSTALL Makefile.in NEWS README acconfig.h config.h.in configure configure.in ossp-pkg/ossp-cvs/diff .cvsignore Makefile.in analyze.c cmpbuf.c cmpbuf.h context.c diagmeet.note diff.c diff.h diff3.c diffrun.h dir.c ed.c ifdef.c io.c normal.c side.c system.h util.c version.c ossp-pkg/ossp-cvs/doc .cvsignore FAQ HACKING Makefile.in RCSFILES TESTS TODO cvs-paper.ms cvs.texinfo cvsclient.texi ossp-pkg/ossp-cvs/lib .cvsignore Makefile.in argmatch.c dup2.c fncase.c fnmatch.c fnmatch.h ftruncate.c getdate.c getdate.y getline.c getline.h getopt.c getopt.h getopt1.c hostname.c md5.c md5.h memmove.c mkdir.c regex.c regex.h rename.c savecwd.c savecwd.h sighandle.c strerror.c stripslash.c strstr.c strtoul.c system.h valloc.c wait.h waitpid.c xgetwd.c yesno.c ossp-pkg/ossp-cvs/man .cvsignore Makefile.in cvs.1 cvs.5 ossp-pkg/ossp-cvs/src .cvsignore Makefile.in add.c admin.c buffer.c buffer.h checkin.c checkout.c classify.c client.c client.h commit.c create_adm.c cvs.h cvsrc.c diff.c edit.c edit.h entries.c error.c error.h expand_path.c fileattr.c fileattr.h filesubr.c find_names.c hardlink.c hardlink.h hash.c hash.h history.c ignore.c import.c lock.c log.c login.c logmsg.c main.c mkmodules.c modules.c myndbm.c myndbm.h no_diff.c options.h.in parseinfo.c patch.c rcs.c rcs.h rcscmds.c recurse.c release.c remove.c repos.c root.c rtag.c run.c sanity.sh scramble.c server.c server.h status.c subr.c tag.c update.c update.h vers_ts.c version.c watch.c watch.h wrapper.c zlib.c ossp-pkg/ossp-cvs/zlib .cvsignore Makefile.in README adler32.c algorithm.doc compress.c crc32.c deflate.c deflate.h gzio.c infblock.c infblock.h infcodes.c infcodes.h inffast.c inffast.h inflate.c inftrees.c inftrees.h infutil.c infutil.h trees.c uncompr.c zconf.h zlib.h zutil.c zutil.h Log: Import of vendor CVS version, snapshot 20000701 [Release Tags: CVS_20000701] Summary: Revision Changes Path 1.1.1.1 +17 -0 ossp-pkg/ossp-cvs/.cvsignore 1.1.1.1 +251 -0 ossp-pkg/ossp-cvs/COPYING 1.1.1.1 +484 -0 ossp-pkg/ossp-cvs/COPYING.LIB 1.1.1.1 +700 -0 ossp-pkg/ossp-cvs/ChangeLog.zoo 1.1.1.1 +418 -0 ossp-pkg/ossp-cvs/INSTALL 1.1.1.1 +284 -0 ossp-pkg/ossp-cvs/Makefile.in 1.1.1.1 +1106 -0 ossp-pkg/ossp-cvs/NEWS 1.1.1.1 +197 -0 ossp-pkg/ossp-cvs/README 1.1.1.1 +45 -0 ossp-pkg/ossp-cvs/acconfig.h 1.1.1.1 +283 -0 ossp-pkg/ossp-cvs/config.h.in 1.1.1.1 BLOB ossp-pkg/ossp-cvs/configure 1.1.1.1 +314 -0 ossp-pkg/ossp-cvs/configure.in 1.1.1.1 +3 -0 ossp-pkg/ossp-cvs/diff/.cvsignore 1.1.1.1 +102 -0 ossp-pkg/ossp-cvs/diff/Makefile.in 1.1.1.1 +1085 -0 ossp-pkg/ossp-cvs/diff/analyze.c 1.1.1.1 +38 -0 ossp-pkg/ossp-cvs/diff/cmpbuf.c 1.1.1.1 +18 -0 ossp-pkg/ossp-cvs/diff/cmpbuf.h 1.1.1.1 +462 -0 ossp-pkg/ossp-cvs/diff/context.c 1.1.1.1 +71 -0 ossp-pkg/ossp-cvs/diff/diagmeet.note 1.1.1.1 +1259 -0 ossp-pkg/ossp-cvs/diff/diff.c 1.1.1.1 +354 -0 ossp-pkg/ossp-cvs/diff/diff.h 1.1.1.1 +1903 -0 ossp-pkg/ossp-cvs/diff/diff3.c 1.1.1.1 +69 -0 ossp-pkg/ossp-cvs/diff/diffrun.h 1.1.1.1 +218 -0 ossp-pkg/ossp-cvs/diff/dir.c 1.1.1.1 +198 -0 ossp-pkg/ossp-cvs/diff/ed.c 1.1.1.1 +436 -0 ossp-pkg/ossp-cvs/diff/ifdef.c 1.1.1.1 +712 -0 ossp-pkg/ossp-cvs/diff/io.c 1.1.1.1 +69 -0 ossp-pkg/ossp-cvs/diff/normal.c 1.1.1.1 +294 -0 ossp-pkg/ossp-cvs/diff/side.c 1.1.1.1 +271 -0 ossp-pkg/ossp-cvs/diff/system.h 1.1.1.1 +847 -0 ossp-pkg/ossp-cvs/diff/util.c 1.1.1.1 +5 -0 ossp-pkg/ossp-cvs/diff/version.c 1.1.1.1 +34 -0 ossp-pkg/ossp-cvs/doc/.cvsignore 1.1.1.1 +8556 -0 ossp-pkg/ossp-cvs/doc/FAQ 1.1.1.1 +271 -0 ossp-pkg/ossp-cvs/doc/HACKING 1.1.1.1 +197 -0 ossp-pkg/ossp-cvs/doc/Makefile.in 1.1.1.1 +276 -0 ossp-pkg/ossp-cvs/doc/RCSFILES 1.1.1.1 +163 -0 ossp-pkg/ossp-cvs/doc/TESTS 1.1.1.1 +1149 -0 ossp-pkg/ossp-cvs/doc/TODO 1.1.1.1 +1069 -0 ossp-pkg/ossp-cvs/doc/cvs-paper.ms 1.1.1.1 +13599 -0 ossp-pkg/ossp-cvs/doc/cvs.texinfo 1.1.1.1 +2074 -0 ossp-pkg/ossp-cvs/doc/cvsclient.texi 1.1.1.1 +2 -0 ossp-pkg/ossp-cvs/lib/.cvsignore 1.1.1.1 +168 -0 ossp-pkg/ossp-cvs/lib/Makefile.in 1.1.1.1 +85 -0 ossp-pkg/ossp-cvs/lib/argmatch.c 1.1.1.1 +40 -0 ossp-pkg/ossp-cvs/lib/dup2.c 1.1.1.1 +115 -0 ossp-pkg/ossp-cvs/lib/fncase.c 1.1.1.1 +181 -0 ossp-pkg/ossp-cvs/lib/fnmatch.c 1.1.1.1 +40 -0 ossp-pkg/ossp-cvs/lib/fnmatch.h 1.1.1.1 +76 -0 ossp-pkg/ossp-cvs/lib/ftruncate.c 1.1.1.1 +1598 -0 ossp-pkg/ossp-cvs/lib/getdate.c 1.1.1.1 +1040 -0 ossp-pkg/ossp-cvs/lib/getdate.y 1.1.1.1 +145 -0 ossp-pkg/ossp-cvs/lib/getline.c 1.1.1.1 +18 -0 ossp-pkg/ossp-cvs/lib/getline.h 1.1.1.1 +755 -0 ossp-pkg/ossp-cvs/lib/getopt.c 1.1.1.1 +125 -0 ossp-pkg/ossp-cvs/lib/getopt.h 1.1.1.1 +183 -0 ossp-pkg/ossp-cvs/lib/getopt1.c 1.1.1.1 +45 -0 ossp-pkg/ossp-cvs/lib/hostname.c 1.1.1.1 +332 -0 ossp-pkg/ossp-cvs/lib/md5.c 1.1.1.1 +26 -0 ossp-pkg/ossp-cvs/lib/md5.h 1.1.1.1 +54 -0 ossp-pkg/ossp-cvs/lib/memmove.c 1.1.1.1 +125 -0 ossp-pkg/ossp-cvs/lib/mkdir.c 1.1.1.1 +6376 -0 ossp-pkg/ossp-cvs/lib/regex.c 1.1.1.1 +510 -0 ossp-pkg/ossp-cvs/lib/regex.h 1.1.1.1 +80 -0 ossp-pkg/ossp-cvs/lib/rename.c 1.1.1.1 +141 -0 ossp-pkg/ossp-cvs/lib/savecwd.c 1.1.1.1 +20 -0 ossp-pkg/ossp-cvs/lib/savecwd.h 1.1.1.1 +418 -0 ossp-pkg/ossp-cvs/lib/sighandle.c 1.1.1.1 +808 -0 ossp-pkg/ossp-cvs/lib/strerror.c 1.1.1.1 +40 -0 ossp-pkg/ossp-cvs/lib/stripslash.c 1.1.1.1 +40 -0 ossp-pkg/ossp-cvs/lib/strstr.c 1.1.1.1 +100 -0 ossp-pkg/ossp-cvs/lib/strtoul.c 1.1.1.1 +533 -0 ossp-pkg/ossp-cvs/lib/system.h 1.1.1.1 +25 -0 ossp-pkg/ossp-cvs/lib/valloc.c 1.1.1.1 +39 -0 ossp-pkg/ossp-cvs/lib/wait.h 1.1.1.1 +80 -0 ossp-pkg/ossp-cvs/lib/waitpid.c 1.1.1.1 +67 -0 ossp-pkg/ossp-cvs/lib/xgetwd.c 1.1.1.1 +38 -0 ossp-pkg/ossp-cvs/lib/yesno.c 1.1.1.1 +1 -0 ossp-pkg/ossp-cvs/man/.cvsignore 1.1.1.1 +91 -0 ossp-pkg/ossp-cvs/man/Makefile.in 1.1.1.1 +2132 -0 ossp-pkg/ossp-cvs/man/cvs.1 1.1.1.1 +325 -0 ossp-pkg/ossp-cvs/man/cvs.5 1.1.1.1 +10 -0 ossp-pkg/ossp-cvs/src/.cvsignore 1.1.1.1 +193 -0 ossp-pkg/ossp-cvs/src/Makefile.in 1.1.1.1 +876 -0 ossp-pkg/ossp-cvs/src/add.c 1.1.1.1 +851 -0 ossp-pkg/ossp-cvs/src/admin.c 1.1.1.1 +1774 -0 ossp-pkg/ossp-cvs/src/buffer.c 1.1.1.1 +152 -0 ossp-pkg/ossp-cvs/src/buffer.h 1.1.1.1 +180 -0 ossp-pkg/ossp-cvs/src/checkin.c 1.1.1.1 +1190 -0 ossp-pkg/ossp-cvs/src/checkout.c 1.1.1.1 +470 -0 ossp-pkg/ossp-cvs/src/classify.c 1.1.1.1 +5837 -0 ossp-pkg/ossp-cvs/src/client.c 1.1.1.1 +201 -0 ossp-pkg/ossp-cvs/src/client.h 1.1.1.1 +2372 -0 ossp-pkg/ossp-cvs/src/commit.c 1.1.1.1 +188 -0 ossp-pkg/ossp-cvs/src/create_adm.c 1.1.1.1 +883 -0 ossp-pkg/ossp-cvs/src/cvs.h 1.1.1.1 +167 -0 ossp-pkg/ossp-cvs/src/cvsrc.c 1.1.1.1 +996 -0 ossp-pkg/ossp-cvs/src/diff.c 1.1.1.1 +1135 -0 ossp-pkg/ossp-cvs/src/edit.c 1.1.1.1 +38 -0 ossp-pkg/ossp-cvs/src/edit.h 1.1.1.1 +1185 -0 ossp-pkg/ossp-cvs/src/entries.c 1.1.1.1 +237 -0 ossp-pkg/ossp-cvs/src/error.c 1.1.1.1 +57 -0 ossp-pkg/ossp-cvs/src/error.h 1.1.1.1 +335 -0 ossp-pkg/ossp-cvs/src/expand_path.c 1.1.1.1 +652 -0 ossp-pkg/ossp-cvs/src/fileattr.c 1.1.1.1 +136 -0 ossp-pkg/ossp-cvs/src/fileattr.h 1.1.1.1 +973 -0 ossp-pkg/ossp-cvs/src/filesubr.c 1.1.1.1 +425 -0 ossp-pkg/ossp-cvs/src/find_names.c 1.1.1.1 +305 -0 ossp-pkg/ossp-cvs/src/hardlink.c 1.1.1.1 +33 -0 ossp-pkg/ossp-cvs/src/hardlink.h 1.1.1.1 +518 -0 ossp-pkg/ossp-cvs/src/hash.c 1.1.1.1 +59 -0 ossp-pkg/ossp-cvs/src/hash.h 1.1.1.1 +1598 -0 ossp-pkg/ossp-cvs/src/history.c 1.1.1.1 +499 -0 ossp-pkg/ossp-cvs/src/ignore.c 1.1.1.1 +1613 -0 ossp-pkg/ossp-cvs/src/import.c 1.1.1.1 +941 -0 ossp-pkg/ossp-cvs/src/lock.c 1.1.1.1 +1526 -0 ossp-pkg/ossp-cvs/src/log.c 1.1.1.1 +502 -0 ossp-pkg/ossp-cvs/src/login.c 1.1.1.1 +888 -0 ossp-pkg/ossp-cvs/src/logmsg.c 1.1.1.1 +1157 -0 ossp-pkg/ossp-cvs/src/main.c 1.1.1.1 +953 -0 ossp-pkg/ossp-cvs/src/mkmodules.c 1.1.1.1 +1073 -0 ossp-pkg/ossp-cvs/src/modules.c 1.1.1.1 +309 -0 ossp-pkg/ossp-cvs/src/myndbm.c 1.1.1.1 +45 -0 ossp-pkg/ossp-cvs/src/myndbm.h 1.1.1.1 +93 -0 ossp-pkg/ossp-cvs/src/no_diff.c 1.1.1.1 +200 -0 ossp-pkg/ossp-cvs/src/options.h.in 1.1.1.1 +426 -0 ossp-pkg/ossp-cvs/src/parseinfo.c 1.1.1.1 +794 -0 ossp-pkg/ossp-cvs/src/patch.c 1.1.1.1 +8547 -0 ossp-pkg/ossp-cvs/src/rcs.c 1.1.1.1 +244 -0 ossp-pkg/ossp-cvs/src/rcs.h 1.1.1.1 +667 -0 ossp-pkg/ossp-cvs/src/rcscmds.c 1.1.1.1 +1214 -0 ossp-pkg/ossp-cvs/src/recurse.c 1.1.1.1 +299 -0 ossp-pkg/ossp-cvs/src/release.c 1.1.1.1 +278 -0 ossp-pkg/ossp-cvs/src/remove.c 1.1.1.1 +206 -0 ossp-pkg/ossp-cvs/src/repos.c 1.1.1.1 +591 -0 ossp-pkg/ossp-cvs/src/root.c 1.1.1.1 +764 -0 ossp-pkg/ossp-cvs/src/rtag.c 1.1.1.1 +451 -0 ossp-pkg/ossp-cvs/src/run.c 1.1.1.1 +20593 -0 ossp-pkg/ossp-cvs/src/sanity.sh 1.1.1.1 +245 -0 ossp-pkg/ossp-cvs/src/scramble.c 1.1.1.1 +6478 -0 ossp-pkg/ossp-cvs/src/server.c 1.1.1.1 +178 -0 ossp-pkg/ossp-cvs/src/server.h 1.1.1.1 +356 -0 ossp-pkg/ossp-cvs/src/status.c 1.1.1.1 +777 -0 ossp-pkg/ossp-cvs/src/subr.c 1.1.1.1 +941 -0 ossp-pkg/ossp-cvs/src/tag.c 1.1.1.1 +2868 -0 ossp-pkg/ossp-cvs/src/update.c 1.1.1.1 +18 -0 ossp-pkg/ossp-cvs/src/update.h 1.1.1.1 +403 -0 ossp-pkg/ossp-cvs/src/vers_ts.c 1.1.1.1 +29 -0 ossp-pkg/ossp-cvs/src/version.c 1.1.1.1 +530 -0 ossp-pkg/ossp-cvs/src/watch.c 1.1.1.1 +52 -0 ossp-pkg/ossp-cvs/src/watch.h 1.1.1.1 +614 -0 ossp-pkg/ossp-cvs/src/wrapper.c 1.1.1.1 +662 -0 ossp-pkg/ossp-cvs/src/zlib.c 1.1.1.1 +5 -0 ossp-pkg/ossp-cvs/zlib/.cvsignore 1.1.1.1 +150 -0 ossp-pkg/ossp-cvs/zlib/Makefile.in 1.1.1.1 +99 -0 ossp-pkg/ossp-cvs/zlib/README 1.1.1.1 +48 -0 ossp-pkg/ossp-cvs/zlib/adler32.c 1.1.1.1 +105 -0 ossp-pkg/ossp-cvs/zlib/algorithm.doc 1.1.1.1 +57 -0 ossp-pkg/ossp-cvs/zlib/compress.c 1.1.1.1 +162 -0 ossp-pkg/ossp-cvs/zlib/crc32.c 1.1.1.1 +1207 -0 ossp-pkg/ossp-cvs/zlib/deflate.c 1.1.1.1 +275 -0 ossp-pkg/ossp-cvs/zlib/deflate.h 1.1.1.1 +523 -0 ossp-pkg/ossp-cvs/zlib/gzio.c 1.1.1.1 +402 -0 ossp-pkg/ossp-cvs/zlib/infblock.c 1.1.1.1 +37 -0 ossp-pkg/ossp-cvs/zlib/infblock.h 1.1.1.1 +247 -0 ossp-pkg/ossp-cvs/zlib/infcodes.c 1.1.1.1 +27 -0 ossp-pkg/ossp-cvs/zlib/infcodes.h 1.1.1.1 +168 -0 ossp-pkg/ossp-cvs/zlib/inffast.c 1.1.1.1 +17 -0 ossp-pkg/ossp-cvs/zlib/inffast.h 1.1.1.1 +345 -0 ossp-pkg/ossp-cvs/zlib/inflate.c 1.1.1.1 +470 -0 ossp-pkg/ossp-cvs/zlib/inftrees.c 1.1.1.1 +59 -0 ossp-pkg/ossp-cvs/zlib/inftrees.h 1.1.1.1 +87 -0 ossp-pkg/ossp-cvs/zlib/infutil.c 1.1.1.1 +99 -0 ossp-pkg/ossp-cvs/zlib/infutil.h 1.1.1.1 +1141 -0 ossp-pkg/ossp-cvs/zlib/trees.c 1.1.1.1 +58 -0 ossp-pkg/ossp-cvs/zlib/uncompr.c 1.1.1.1 +184 -0 ossp-pkg/ossp-cvs/zlib/zconf.h 1.1.1.1 +780 -0 ossp-pkg/ossp-cvs/zlib/zlib.h 1.1.1.1 +211 -0 ossp-pkg/ossp-cvs/zlib/zutil.c 1.1.1.1 +203 -0 ossp-pkg/ossp-cvs/zlib/zutil.h ____________________________________________________________________________ http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/.cvsignore?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/COPYING?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/COPYING.LIB?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/ChangeLog.zoo?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/INSTALL?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/Makefile.in?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/NEWS?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/README?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/acconfig.h?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/config.h.in?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/configure?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/configure.in?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/diff/.cvsignore?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/diff/Makefile.in?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/diff/analyze.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/diff/cmpbuf.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/diff/cmpbuf.h?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/diff/context.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/diff/diagmeet.note?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/diff/diff.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/diff/diff.h?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/diff/diff3.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/diff/diffrun.h?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/diff/dir.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/diff/ed.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/diff/ifdef.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/diff/io.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/diff/normal.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/diff/side.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/diff/system.h?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/diff/util.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/diff/version.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/doc/.cvsignore?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/doc/FAQ?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/doc/HACKING?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/doc/Makefile.in?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/doc/RCSFILES?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/doc/TESTS?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/doc/TODO?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/doc/cvs-paper.ms?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/doc/cvs.texinfo?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/doc/cvsclient.texi?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/lib/.cvsignore?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/lib/Makefile.in?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/lib/argmatch.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/lib/dup2.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/lib/fncase.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/lib/fnmatch.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/lib/fnmatch.h?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/lib/ftruncate.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/lib/getdate.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/lib/getdate.y?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/lib/getline.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/lib/getline.h?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/lib/getopt.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/lib/getopt.h?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/lib/getopt1.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/lib/hostname.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/lib/md5.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/lib/md5.h?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/lib/memmove.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/lib/mkdir.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/lib/regex.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/lib/regex.h?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/lib/rename.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/lib/savecwd.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/lib/savecwd.h?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/lib/sighandle.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/lib/strerror.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/lib/stripslash.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/lib/strstr.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/lib/strtoul.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/lib/system.h?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/lib/valloc.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/lib/wait.h?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/lib/waitpid.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/lib/xgetwd.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/lib/yesno.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/man/.cvsignore?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/man/Makefile.in?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/man/cvs.1?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/man/cvs.5?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/.cvsignore?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/Makefile.in?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/add.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/admin.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/buffer.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/buffer.h?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/checkin.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/checkout.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/classify.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/client.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/client.h?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/commit.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/create_adm.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/cvs.h?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/cvsrc.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/diff.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/edit.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/edit.h?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/entries.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/error.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/error.h?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/expand_path.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/fileattr.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/fileattr.h?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/filesubr.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/find_names.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/hardlink.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/hardlink.h?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/hash.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/hash.h?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/history.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/ignore.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/import.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/lock.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/log.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/login.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/logmsg.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/main.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/mkmodules.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/modules.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/myndbm.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/myndbm.h?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/no_diff.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/options.h.in?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/parseinfo.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/patch.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/rcs.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/rcs.h?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/rcscmds.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/recurse.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/release.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/remove.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/repos.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/root.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/rtag.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/run.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/sanity.sh?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/scramble.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/server.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/server.h?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/status.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/subr.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/tag.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/update.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/update.h?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/vers_ts.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/version.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/watch.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/watch.h?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/wrapper.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/src/zlib.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/zlib/.cvsignore?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/zlib/Makefile.in?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/zlib/README?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/zlib/adler32.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/zlib/algorithm.doc?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/zlib/compress.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/zlib/crc32.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/zlib/deflate.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/zlib/deflate.h?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/zlib/gzio.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/zlib/infblock.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/zlib/infblock.h?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/zlib/infcodes.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/zlib/infcodes.h?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/zlib/inffast.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/zlib/inffast.h?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/zlib/inflate.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/zlib/inftrees.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/zlib/inftrees.h?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/zlib/infutil.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/zlib/infutil.h?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/zlib/trees.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/zlib/uncompr.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/zlib/zconf.h?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/zlib/zlib.h?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/zlib/zutil.c?cvsroot=ossp&r1=NONE&r2=1.1.1.1 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/ossp-cvs/zlib/zutil.h?cvsroot=ossp&r1=NONE&r2=1.1.1.1 From ossp-cvs-owner@ossp.org Sat Jul 1 15:02:58 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e61D2vY64527; Sat, 1 Jul 2000 15:02:57 +0200 (CEST) Date: Sat, 1 Jul 2000 15:02:57 +0200 (CEST) Message-Id: <200007011302.e61D2vY64527@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/cvs .cvsignore COPYING COPYING.LIB ChangeLog.zoo ... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 01-Jul-2000 15:02:57 Branch: vendor Handle: 1970010101000000 Modified files: (Branch: vendor) ossp-pkg/cvs/src add.c checkout.c client.c create_adm.c cvs.h error.c modules.c rcs.c rcs.h server.c update.c Touched files: (Branch: vendor) ossp-pkg/cvs .cvsignore COPYING COPYING.LIB ChangeLog.zoo INSTALL Makefile.in NEWS README acconfig.h config.h.in configure configure.in ossp-pkg/cvs/diff .cvsignore Makefile.in analyze.c cmpbuf.c cmpbuf.h context.c diagmeet.note diff.c diff.h diff3.c diffrun.h dir.c ed.c ifdef.c io.c normal.c side.c system.h util.c version.c ossp-pkg/cvs/doc .cvsignore FAQ HACKING Makefile.in RCSFILES TESTS TODO cvs-paper.ms cvs.texinfo cvsclient.texi ossp-pkg/cvs/lib .cvsignore Makefile.in argmatch.c dup2.c fncase.c fnmatch.c fnmatch.h ftruncate.c getdate.c getdate.y getline.c getline.h getopt.c getopt.h getopt1.c hostname.c md5.c md5.h memmove.c mkdir.c regex.c regex.h rename.c savecwd.c savecwd.h sighandle.c strerror.c stripslash.c strstr.c strtoul.c system.h valloc.c wait.h waitpid.c xgetwd.c yesno.c ossp-pkg/cvs/man .cvsignore Makefile.in cvs.1 cvs.5 ossp-pkg/cvs/src .cvsignore Makefile.in admin.c buffer.c buffer.h checkin.c classify.c client.h commit.c cvsrc.c diff.c edit.c edit.h entries.c error.h expand_path.c fileattr.c fileattr.h filesubr.c find_names.c hardlink.c hardlink.h hash.c hash.h history.c ignore.c import.c lock.c log.c login.c logmsg.c main.c mkmodules.c myndbm.c myndbm.h no_diff.c options.h.in parseinfo.c patch.c rcscmds.c recurse.c release.c remove.c repos.c root.c rtag.c run.c sanity.sh scramble.c server.h status.c subr.c tag.c update.h vers_ts.c version.c watch.c watch.h wrapper.c zlib.c ossp-pkg/cvs/zlib .cvsignore Makefile.in README adler32.c algorithm.doc compress.c crc32.c deflate.c deflate.h gzio.c infblock.c infblock.h infcodes.c infcodes.h inffast.c inffast.h inflate.c inftrees.c inftrees.h infutil.c infutil.h trees.c uncompr.c zconf.h zlib.h zutil.c zutil.h Log: Import of vendor CVS version, snapshot 20000701 [Release Tags: CVS_20000701] Summary: Revision Changes Path 1.1.1.4 +0 -0 ossp-pkg/cvs/src/add.c 1.1.1.7 +0 -0 ossp-pkg/cvs/src/checkout.c 1.1.1.7 +0 -0 ossp-pkg/cvs/src/client.c 1.1.1.2 +0 -0 ossp-pkg/cvs/src/create_adm.c 1.1.1.5 +0 -0 ossp-pkg/cvs/src/cvs.h 1.1.1.3 +0 -0 ossp-pkg/cvs/src/error.c 1.1.1.4 +0 -0 ossp-pkg/cvs/src/modules.c 1.1.1.9 +0 -0 ossp-pkg/cvs/src/rcs.c 1.1.1.4 +0 -0 ossp-pkg/cvs/src/rcs.h 1.1.1.11 +0 -0 ossp-pkg/cvs/src/server.c 1.1.1.7 +0 -0 ossp-pkg/cvs/src/update.c ____________________________________________________________________________ http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/cvs/src/add.c?cvsroot=ossp&r1=1.1.1.3&r2=1.1.1.4 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/cvs/src/checkout.c?cvsroot=ossp&r1=1.1.1.6&r2=1.1.1.7 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/cvs/src/client.c?cvsroot=ossp&r1=1.1.1.6&r2=1.1.1.7 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/cvs/src/create_adm.c?cvsroot=ossp&r1=1.1.1.1&r2=1.1.1.2 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/cvs/src/cvs.h?cvsroot=ossp&r1=1.1.1.4&r2=1.1.1.5 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/cvs/src/error.c?cvsroot=ossp&r1=1.1.1.2&r2=1.1.1.3 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/cvs/src/modules.c?cvsroot=ossp&r1=1.1.1.3&r2=1.1.1.4 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/cvs/src/rcs.c?cvsroot=ossp&r1=1.1.1.8&r2=1.1.1.9 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/cvs/src/rcs.h?cvsroot=ossp&r1=1.1.1.3&r2=1.1.1.4 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/cvs/src/server.c?cvsroot=ossp&r1=1.1.1.10&r2=1.1.1.11 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/cvs/src/update.c?cvsroot=ossp&r1=1.1.1.6&r2=1.1.1.7 From ossp-cvs-owner@ossp.org Sat Jul 1 15:12:57 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e61DCt065285; Sat, 1 Jul 2000 15:12:55 +0200 (CEST) Date: Sat, 1 Jul 2000 15:12:55 +0200 (CEST) Message-Id: <200007011312.e61DCt065285@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="NBHC0SR66M9V5VQT8WGE" Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/cvs/src add.c checkout.c client.c cvs.h modules.c... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list This is a multi-part message in MIME format. --NBHC0SR66M9V5VQT8WGE Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: commit summary Content-Disposition: inline OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 01-Jul-2000 15:12:55 Branch: HEAD Handle: 2000070114125301 Modified files: ossp-pkg/cvs/src add.c checkout.c client.c cvs.h modules.c rcs.c server.c update.c Log: Merge in conflicts Summary: Revision Changes Path 1.8 +2 -4 ossp-pkg/cvs/src/add.c 1.8 +4 -3 ossp-pkg/cvs/src/checkout.c 1.8 +10 -2 ossp-pkg/cvs/src/client.c 1.16 +1 -1 ossp-pkg/cvs/src/cvs.h 1.5 +1 -1 ossp-pkg/cvs/src/modules.c 1.12 +23 -26 ossp-pkg/cvs/src/rcs.c 1.24 +2 -0 ossp-pkg/cvs/src/server.c 1.9 +2 -1 ossp-pkg/cvs/src/update.c ____________________________________________________________________________ --NBHC0SR66M9V5VQT8WGE Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/cvs/src/add.c Content-Disposition: attachment Index: ossp-pkg/cvs/src/add.c ============================================================ $ cvs diff -u -r1.7 -r1.8 add.c --- ossp-pkg/cvs/src/add.c 2000/06/14 07:18:45 1.7 +++ ossp-pkg/cvs/src/add.c 2000/07/01 13:12:53 1.8 @@ -245,7 +245,7 @@ sprintf (rcsdir, "%s/%s", repository, p); Create_Admin (p, argv[i], rcsdir, tag, date, - nonbranch, 0); + nonbranch, 0, 1); if (found_slash) send_a_repository ("", repository, update_dir); @@ -803,10 +803,8 @@ #ifdef SERVER_SUPPORT if (!server_active) - Create_Admin (".", finfo->fullname, rcsdir, tag, date, nonbranch, 0); -#else - Create_Admin (".", finfo->fullname, rcsdir, tag, date, nonbranch, 0); #endif + Create_Admin (".", finfo->fullname, rcsdir, tag, date, nonbranch, 0, 1); if (tag) free (tag); if (date) --NBHC0SR66M9V5VQT8WGE Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/cvs/src/checkout.c Content-Disposition: attachment Index: ossp-pkg/cvs/src/checkout.c ============================================================ $ cvs diff -u -r1.7 -r1.8 checkout.c --- ossp-pkg/cvs/src/checkout.c 2000/06/16 19:57:37 1.7 +++ ossp-pkg/cvs/src/checkout.c 2000/07/01 13:12:53 1.8 @@ -479,7 +479,7 @@ then rewrite it later via WriteTag, once we've had a chance to call RCS_nodeisbranch on each file. */ - 0, 1)) + 0, 1, 1)) return; if (!noexec) @@ -926,7 +926,8 @@ error (1, 0, "there is no repository %s", repository); Create_Admin (".", preload_update_dir, repository, - (char *) NULL, (char *) NULL, 0, 0); + (char *) NULL, (char *) NULL, 0, 0, + m_type == CHECKOUT); fp = open_file (CVSADM_ENTSTAT, "w+"); if (fclose(fp) == EOF) error(1, errno, "cannot close %s", CVSADM_ENTSTAT); @@ -949,7 +950,7 @@ then rewrite it later via WriteTag, once we've had a chance to call RCS_nodeisbranch on each file. */ - 0, 0); + 0, 0, m_type == CHECKOUT); } } else --NBHC0SR66M9V5VQT8WGE Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/cvs/src/client.c Content-Disposition: attachment Index: ossp-pkg/cvs/src/client.c ============================================================ $ cvs diff -u -r1.7 -r1.8 client.c --- ossp-pkg/cvs/src/client.c 2000/06/24 21:12:55 1.7 +++ ossp-pkg/cvs/src/client.c 2000/07/01 13:12:53 1.8 @@ -1112,7 +1112,7 @@ strcpy (r, "/."); Create_Admin (".", ".", repo, (char *) NULL, - (char *) NULL, 0, 1); + (char *) NULL, 0, 1, 1); free (repo); } @@ -1249,7 +1249,7 @@ strcpy (r, reposdirname); Create_Admin (dir, dir, repo, - (char *)NULL, (char *)NULL, 0, 0); + (char *)NULL, (char *)NULL, 0, 0, 1); free (repo); b = strrchr (dir, '/'); @@ -2491,7 +2491,11 @@ { char *prog; struct save_prog *p; + read_line (&prog); + if (strcmp (command_name, "export") == 0) + return; + p = (struct save_prog *) xmalloc (sizeof (struct save_prog)); p->next = checkin_progs; p->dir = xstrdup (args); @@ -2506,7 +2510,11 @@ { char *prog; struct save_prog *p; + read_line (&prog); + if (strcmp (command_name, "export") == 0) + return; + p = (struct save_prog *) xmalloc (sizeof (struct save_prog)); p->next = update_progs; p->dir = xstrdup (args); --NBHC0SR66M9V5VQT8WGE Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/cvs/src/cvs.h Content-Disposition: attachment Index: ossp-pkg/cvs/src/cvs.h ============================================================ $ cvs diff -u -r1.15 -r1.16 cvs.h --- ossp-pkg/cvs/src/cvs.h 2000/06/22 13:13:12 1.15 +++ ossp-pkg/cvs/src/cvs.h 2000/07/01 13:12:53 1.16 @@ -558,7 +558,7 @@ time_t get_date PROTO((char *date, struct timeb *now)); extern int Create_Admin PROTO ((char *dir, char *update_dir, char *repository, char *tag, char *date, - int nonbranch, int warn)); + int nonbranch, int warn, int dotemplate)); extern int expand_at_signs PROTO ((char *, off_t, FILE *)); /* Locking subsystem (implemented in lock.c). */ --NBHC0SR66M9V5VQT8WGE Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/cvs/src/modules.c Content-Disposition: attachment Index: ossp-pkg/cvs/src/modules.c ============================================================ $ cvs diff -u -r1.4 -r1.5 modules.c --- ossp-pkg/cvs/src/modules.c 2000/06/18 13:50:37 1.4 +++ ossp-pkg/cvs/src/modules.c 2000/07/01 13:12:53 1.5 @@ -553,7 +553,7 @@ nullrepos = emptydir_name (); Create_Admin (".", dir, - nullrepos, (char *) NULL, (char *) NULL, 0, 0); + nullrepos, (char *) NULL, (char *) NULL, 0, 0, 1); if (!noexec) { FILE *fp; --NBHC0SR66M9V5VQT8WGE Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/cvs/src/rcs.c Content-Disposition: attachment Index: ossp-pkg/cvs/src/rcs.c ============================================================ $ cvs diff -u -r1.11 -r1.12 rcs.c --- ossp-pkg/cvs/src/rcs.c 2000/06/22 15:10:32 1.11 +++ ossp-pkg/cvs/src/rcs.c 2000/07/01 13:12:53 1.12 @@ -159,6 +159,7 @@ #define whitespace(c) (spacetab[(unsigned char)c] != 0) static char *rcs_lockfile; +static int rcs_lockfd = -1; /* A few generic thoughts on error handling, in particular the printing of unexpected characters that we find in the RCS file @@ -7895,21 +7896,8 @@ /* Find the delta node for this revision. */ p = findnode (rcs->versions, rev); - if(p == NULL){ - /* This shouldn't happen if the repository is in good shape. - We need to clean up the lockfile, but we can't call - rcs_internal_unlockfile, because that assumes that things - are behaving normally. rcs_internal_unlockfile copies the - lockfile back onto the repository (,v) file. - Since the repository file is corrupt, this isn't a terribly - destructive thing to do, but just in case the user isn't - maintaining backups, and the ,v file does contain useful - information, we'll just delete the lockfile and let the - user sort out the problem. */ - - if (fclose(fp) == EOF) - error (1, 0, "error closing lock file %s", rcs_lockfile); - unlink_file(rcs_lockfile); + if (p == NULL) + { error (1, 0, "error parsing repository file %s, file may be corrupt.", rcs->path); @@ -8155,7 +8143,7 @@ /* * Clean up temporary files */ -static RETSIGTYPE +RETSIGTYPE rcs_cleanup () { /* Note that the checks for existence_error are because we are @@ -8169,11 +8157,18 @@ of a just-created file) reentrancy won't be an issue. */ if (rcs_lockfile != NULL) { - if (unlink_file (rcs_lockfile) < 0 + char *tmp = rcs_lockfile; + rcs_lockfile = NULL; + if (rcs_lockfd >= 0) + { + if (close (rcs_lockfd) != 0) + error (0, errno, "error closing lock file %s", tmp); + rcs_lockfd = -1; + } + if (unlink_file (tmp) < 0 && !existence_error (errno)) - error (0, errno, "cannot remove %s", rcs_lockfile); + error (0, errno, "cannot remove %s", tmp); } - rcs_lockfile = NULL; } /* RCS_internal_lockfile and RCS_internal_unlockfile perform RCS-style @@ -8207,7 +8202,6 @@ rcs_internal_lockfile (rcsfile) char *rcsfile; { - int fd; struct stat rstat; FILE *fp; static int first_call = 1; @@ -8235,6 +8229,7 @@ /* Get the lock file name: `,file,' for RCS file `file,v'. */ assert (rcs_lockfile == NULL); + assert (rcs_lockfd < 0); rcs_lockfile = rcs_lockfilename (rcsfile); /* Use the existing RCS file mode, or read-only if this is a new @@ -8261,11 +8256,11 @@ rely on O_EXCL these days. This might be true for unix (I don't really know), but I am still pretty skeptical in the case of the non-unix systems. */ - fd = open (rcs_lockfile, - OPEN_BINARY | O_WRONLY | O_CREAT | O_EXCL | O_TRUNC, - S_IRUSR | S_IRGRP | S_IROTH); + rcs_lockfd = open (rcs_lockfile, + OPEN_BINARY | O_WRONLY | O_CREAT | O_EXCL | O_TRUNC, + S_IRUSR | S_IRGRP | S_IROTH); - if (fd < 0) + if (rcs_lockfd < 0) { error (1, errno, "could not open lock file `%s'", rcs_lockfile); } @@ -8274,10 +8269,10 @@ /* Because we change the modes later, we don't worry about this in the non-HAVE_FCHMOD case. */ #ifdef HAVE_FCHMOD - if (fchmod (fd, rstat.st_mode) < 0) + if (fchmod (rcs_lockfd, rstat.st_mode) < 0) error (1, errno, "cannot change mode for %s", rcs_lockfile); #endif - fp = fdopen (fd, FOPEN_BINARY_WRITE); + fp = fdopen (rcs_lockfd, FOPEN_BINARY_WRITE); if (fp == NULL) error (1, errno, "cannot fdopen %s", rcs_lockfile); @@ -8290,6 +8285,7 @@ char *rcsfile; { assert (rcs_lockfile != NULL); + assert (rcs_lockfd >= 0); /* Abort if we could not write everything successfully to LOCKFILE. This is not a great error-handling mechanism, but should prevent @@ -8305,6 +8301,7 @@ error (1, 0, "error writing to lock file %s", rcs_lockfile); if (fclose (fp) == EOF) error (1, errno, "error closing lock file %s", rcs_lockfile); + rcs_lockfd = -1; rename_file (rcs_lockfile, rcsfile); --NBHC0SR66M9V5VQT8WGE Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/cvs/src/server.c Content-Disposition: attachment Index: ossp-pkg/cvs/src/server.c ============================================================ $ cvs diff -u -r1.23 -r1.24 server.c --- ossp-pkg/cvs/src/server.c 2000/06/24 21:12:55 1.23 +++ ossp-pkg/cvs/src/server.c 2000/07/01 13:12:53 1.24 @@ -5261,9 +5261,11 @@ the client. */ umask (0); +#ifdef AUTH_SERVER_SUPPORT /* Make sure our CVS_Username has been set. */ if (CVS_Username == NULL) CVS_Username = xstrdup (username); +#endif #if HAVE_PUTENV /* Set LOGNAME and USER in the environment, in case they are --NBHC0SR66M9V5VQT8WGE Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/cvs/src/update.c Content-Disposition: attachment Index: ossp-pkg/cvs/src/update.c ============================================================ $ cvs diff -u -r1.8 -r1.9 update.c --- ossp-pkg/cvs/src/update.c 2000/06/24 21:12:55 1.8 +++ ossp-pkg/cvs/src/update.c 2000/07/01 13:12:54 1.9 @@ -973,7 +973,8 @@ /* This is a guess. We will rewrite it later via WriteTag. */ 0, - 0); + 0, + 1); rewrite_tag = 1; nonbranch = 0; Subdir_Register (entries, (char *) NULL, dir); --NBHC0SR66M9V5VQT8WGE-- From ossp-cvs-owner@ossp.org Mon Jul 3 11:31:45 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e639ViA51057; Mon, 3 Jul 2000 11:31:44 +0200 (CEST) Date: Mon, 3 Jul 2000 11:31:44 +0200 (CEST) Message-Id: <200007030931.e639ViA51057@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="IK7JREUMPJZ8DJ0W5MW1" Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/eperl Makefile.in Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list This is a multi-part message in MIME format. --IK7JREUMPJZ8DJ0W5MW1 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: commit summary Content-Disposition: inline OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 03-Jul-2000 11:31:44 Branch: HEAD Handle: 2000070310314400 Modified files: ossp-pkg/eperl Makefile.in Log: *** empty log message *** Summary: Revision Changes Path 1.8 +1 -1 ossp-pkg/eperl/Makefile.in ____________________________________________________________________________ --IK7JREUMPJZ8DJ0W5MW1 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/eperl/Makefile.in Content-Disposition: attachment Index: ossp-pkg/eperl/Makefile.in ============================================================ $ cvs diff -u -r1.7 -r1.8 Makefile.in --- ossp-pkg/eperl/Makefile.in 2000/07/03 09:05:26 1.7 +++ ossp-pkg/eperl/Makefile.in 2000/07/03 09:31:44 1.8 @@ -54,7 +54,7 @@ _BUILDDIST = \ $(SHTOOL) tarball -o $${_tarball} -d $${_distname} -u rse -g eperl \ - -e 'CVS,\.cvsignore,\.configure,\.\#.*,\.[ao]$$' -c 'gzip --best' . + -e 'CVS,\.cvsignore,\.configure,\.\#.*,\.[ao]$$' -c 'gzip --best' .; \ ls -l $${_tarball} _NEWVERS = \ --IK7JREUMPJZ8DJ0W5MW1-- From ossp-cvs-owner@ossp.org Mon Jul 3 11:34:25 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e639YOL51276; Mon, 3 Jul 2000 11:34:24 +0200 (CEST) Date: Mon, 3 Jul 2000 11:34:24 +0200 (CEST) Message-Id: <200007030934.e639YOL51276@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Y3Z2CWIHZ008QG7ZGVN4" Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/eperl ChangeLog eperl_perl5.c eperl_sys.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list This is a multi-part message in MIME format. --Y3Z2CWIHZ008QG7ZGVN4 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: commit summary Content-Disposition: inline OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 03-Jul-2000 11:34:24 Branch: HEAD Handle: 2000070310342300 Modified files: ossp-pkg/eperl ChangeLog eperl_perl5.c eperl_sys.c Log: *** empty log message *** Summary: Revision Changes Path 1.13 +3 -0 ossp-pkg/eperl/ChangeLog 1.3 +5 -0 ossp-pkg/eperl/eperl_perl5.c 1.7 +1 -1 ossp-pkg/eperl/eperl_sys.c ____________________________________________________________________________ --Y3Z2CWIHZ008QG7ZGVN4 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/eperl/ChangeLog Content-Disposition: attachment Index: ossp-pkg/eperl/ChangeLog ============================================================ $ cvs diff -u -r1.12 -r1.13 ChangeLog --- ossp-pkg/eperl/ChangeLog 2000/07/03 09:20:02 1.12 +++ ossp-pkg/eperl/ChangeLog 2000/07/03 09:34:23 1.13 @@ -21,6 +21,9 @@ Changes between 2.2.14 and 2.3.0 (12-Jun-1996 to 03-Jul-2000) + *) Ported to Perl 5.6.0 + [Ralf S. Engelschall, 03-Jul-2000] + *) Upgraded to GNU Shtool 1.5.0 [Ralf S. Engelschall, 03-Jul-2000] --Y3Z2CWIHZ008QG7ZGVN4 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/eperl/eperl_perl5.c Content-Disposition: attachment Index: ossp-pkg/eperl/eperl_perl5.c ============================================================ $ cvs diff -u -r1.2 -r1.3 eperl_perl5.c --- ossp-pkg/eperl/eperl_perl5.c 2000/07/03 08:34:55 1.2 +++ ossp-pkg/eperl/eperl_perl5.c 2000/07/03 09:34:23 1.3 @@ -102,8 +102,13 @@ dTHR; #endif ENTER; +#if AC_perl_vnum >= 500600 + save_hptr(&PL_curstash); + PL_curstash = gv_stashpv(pname, TRUE); +#else save_hptr(&curstash); curstash = gv_stashpv(pname, TRUE); +#endif sv_setpv(perl_get_sv(vname, TRUE), vvalue); LEAVE; return; --Y3Z2CWIHZ008QG7ZGVN4 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/eperl/eperl_sys.c Content-Disposition: attachment Index: ossp-pkg/eperl/eperl_sys.c ============================================================ $ cvs diff -u -r1.6 -r1.7 eperl_sys.c --- ossp-pkg/eperl/eperl_sys.c 2000/07/03 09:05:26 1.6 +++ ossp-pkg/eperl/eperl_sys.c 2000/07/03 09:34:23 1.7 @@ -268,7 +268,7 @@ if (stringEQ(filename, "-")) { /* file is given on stdin */ ptr_tmpfile = mytmpfile("ePerl.source"); - stcpy(tmpfile, ptr_tmpfile); + strcpy(tmpfile, ptr_tmpfile); if ((fp = fopen(tmpfile, "w")) == NULL) { ePerl_SetError("Cannot open temporary source file %s for writing", tmpfile); CU(NULL); --Y3Z2CWIHZ008QG7ZGVN4-- From ossp-cvs-owner@ossp.org Mon Jul 3 11:35:35 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e639ZYg51385; Mon, 3 Jul 2000 11:35:34 +0200 (CEST) Date: Mon, 3 Jul 2000 11:35:34 +0200 (CEST) Message-Id: <200007030935.e639ZYg51385@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="03HX2L4G6VPMYMMP7J77" Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/eperl Makefile.in Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list This is a multi-part message in MIME format. --03HX2L4G6VPMYMMP7J77 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: commit summary Content-Disposition: inline OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 03-Jul-2000 11:35:34 Branch: HEAD Handle: 2000070310353300 Modified files: ossp-pkg/eperl Makefile.in Log: *** empty log message *** Summary: Revision Changes Path 1.9 +0 -1 ossp-pkg/eperl/Makefile.in ____________________________________________________________________________ --03HX2L4G6VPMYMMP7J77 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/eperl/Makefile.in Content-Disposition: attachment Index: ossp-pkg/eperl/Makefile.in ============================================================ $ cvs diff -u -r1.8 -r1.9 Makefile.in --- ossp-pkg/eperl/Makefile.in 2000/07/03 09:31:44 1.8 +++ ossp-pkg/eperl/Makefile.in 2000/07/03 09:35:33 1.9 @@ -338,7 +338,6 @@ distclean: -rm -f eperl_perl5_sm.h - -rm -f eperl.1 eperl-*.tar.gz -rm -f config_ac.h config_sc.h -rm -f config.status config.cache config.log -rm -f Makefile --03HX2L4G6VPMYMMP7J77-- From ossp-cvs-owner@ossp.org Mon Jul 3 11:47:24 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e639lN752297; Mon, 3 Jul 2000 11:47:23 +0200 (CEST) Date: Mon, 3 Jul 2000 11:47:23 +0200 (CEST) Message-Id: <200007030947.e639lN752297@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="3FOJRQWH94IKJWSS1JBJ" Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/str ChangeLog Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list This is a multi-part message in MIME format. --3FOJRQWH94IKJWSS1JBJ Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: commit summary Content-Disposition: inline OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 03-Jul-2000 11:47:23 Branch: HEAD Handle: 2000070310472200 Modified files: ossp-pkg/str ChangeLog Log: *** empty log message *** Summary: Revision Changes Path 1.21 +1 -1 ossp-pkg/str/ChangeLog ____________________________________________________________________________ --3FOJRQWH94IKJWSS1JBJ Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/str/ChangeLog Content-Disposition: attachment Index: ossp-pkg/str/ChangeLog ============================================================ $ cvs diff -u -r1.20 -r1.21 ChangeLog --- ossp-pkg/str/ChangeLog 2000/05/25 13:04:22 1.20 +++ ossp-pkg/str/ChangeLog 2000/07/03 09:47:22 1.21 @@ -9,7 +9,7 @@ ChangeLog - Changes between 0.9.3 and 0.9.4 (04-Feb-2000 to 26-May-2000): + Changes between 0.9.3 and 0.9.4 (04-Feb-2000 to 03-Jul-2000): *) Avoid isupper() check in str_tolower() macro, because it breaks for things like str_tolower(*s++). --3FOJRQWH94IKJWSS1JBJ-- From ossp-cvs-owner@ossp.org Mon Jul 3 16:15:20 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e63EFIx71172; Mon, 3 Jul 2000 16:15:18 +0200 (CEST) Date: Mon, 3 Jul 2000 16:15:18 +0200 (CEST) Message-Id: <200007031415.e63EFIx71172@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="QN8DD4WCIA4DI16JQSKU" Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/sfio/etc config.guess config.sub ltconfig ltmain.... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list This is a multi-part message in MIME format. --QN8DD4WCIA4DI16JQSKU Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: commit summary Content-Disposition: inline OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 03-Jul-2000 16:15:18 Branch: HEAD Handle: 2000070315151600 Modified files: ossp-pkg/sfio/etc config.guess config.sub ltconfig ltmain.sh shtool Log: Update GNU libtool and GNU shtool Summary: Revision Changes Path 1.2 +59 -163 ossp-pkg/sfio/etc/config.guess 1.2 +11 -4 ossp-pkg/sfio/etc/config.sub 1.2 +165 -68 ossp-pkg/sfio/etc/ltconfig 1.2 +81 -32 ossp-pkg/sfio/etc/ltmain.sh 1.3 +545 -486 ossp-pkg/sfio/etc/shtool ____________________________________________________________________________ --QN8DD4WCIA4DI16JQSKU Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/sfio/etc/config.guess Content-Disposition: attachment Index: ossp-pkg/sfio/etc/config.guess ============================================================ $ cvs diff -u -r1.1 -r1.2 config.guess --- ossp-pkg/sfio/etc/config.guess 1999/11/12 14:42:20 1.1 +++ ossp-pkg/sfio/etc/config.guess 2000/07/03 14:15:16 1.2 @@ -226,7 +226,7 @@ exit 0 ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not - # "atarist" or "atariste" at least should have a processor + # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not @@ -579,13 +579,22 @@ echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:FreeBSD:*:*) - if test -x /usr/bin/objformat; then - if test "elf" = "`/usr/bin/objformat`"; then - echo ${UNAME_MACHINE}-unknown-freebsdelf`echo ${UNAME_RELEASE}|sed -e 's/[-_].*//'` - exit 0 - fi - fi - echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + # echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + VERS=`echo ${UNAME_RELEASE} | sed -e 's/[-(].*//'` + MACH=`/sbin/sysctl -n hw.model` + ARCH='unknown' + case ${MACH} in + *386* ) MACH="i386" ;; + *486* ) MACH="i486" ;; + Pentium\ II*) MACH="i686" ;; + Pentium* ) MACH="i586" ;; + Alpha* ) MACH="alpha" ;; + * ) MACH="$UNAME_MACHINE" ;; + esac + case ${MACH} in + i[0-9]86 ) ARCH="pc" ;; + esac + echo "${MACH}-${ARCH}-freebsd${VERS}" exit 0 ;; *:NetBSD:*:*) echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` @@ -618,176 +627,60 @@ echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit 0 ;; *:Linux:*:*) - # uname on the ARM produces all sorts of strangeness, and we need to - # filter it out. - case "$UNAME_MACHINE" in - armv*) UNAME_MACHINE=$UNAME_MACHINE ;; - arm* | sa110*) UNAME_MACHINE="arm" ;; + # determine canonical machine name + MACHINE="$UNAME_MACHINE" + case "$MACHINE" in + arm*|sa110*) MACHINE="arm" ;; esac + + # determine (distribution) vendor + VENDOR="gnu" + for tagfile in dummy `cd /etc && echo *-release *_version 2>/dev/null`; do + test ! -f /etc/$tagfile && continue + VENDOR=`echo $tagfile | sed -e 's/-release$//' -e 's/_version$//' |\ + tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + done + + # determine kernel version + KERNEL=`echo ${UNAME_RELEASE} | sed -e 's/^\([0-9]*\.[0-9]*\)\..*$/\1/'` - # The BFD linker knows what the default object file format is, so - # first see if it will tell us. cd to the root directory to prevent - # problems with other programs or directories called `ld' in the path. - ld_help_string=`cd /; ld --help 2>&1` - ld_supported_emulations=`echo $ld_help_string \ - | sed -ne '/supported emulations:/!d - s/[ ][ ]*/ /g - s/.*supported emulations: *// - s/ .*// - p'` - case "$ld_supported_emulations" in - i?86linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" ; exit 0 ;; - i?86coff) echo "${UNAME_MACHINE}-pc-linux-gnucoff" ; exit 0 ;; - sparclinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;; - armlinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;; - m68klinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;; - elf32ppc) - # Determine Lib Version - cat >$dummy.c <$dummy.c < #include -#if defined(__GLIBC__) -extern char __libc_version[]; -extern char __libc_release[]; -#endif main(argc, argv) - int argc; - char *argv[]; +int argc; +char *argv[]; { -#if defined(__GLIBC__) - printf("%s %s\n", __libc_version, __libc_release); +#if defined(__GLIBC__) && !defined(__GLIBC_MINOR__) + printf("%d", __GLIBC__); +#elif defined(__GLIBC__) && defined(__GLIBC_MINOR__) + printf("%d.%d", __GLIBC__, __GLIBC_MINOR__); +#elif defined(__GNU_LIBRARY__) + printf("%d", __GNU_LIBRARY__); #else - printf("unkown\n"); + printf("1"); #endif - return 0; + return 0; } EOF - LIBC="" - $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null - if test "$?" = 0 ; then - ./$dummy | grep 1\.99 > /dev/null - if test "$?" = 0 ; then - LIBC="libc1" - fi - fi - rm -f $dummy.c $dummy - echo powerpc-unknown-linux-gnu${LIBC} ; exit 0 ;; - esac - - if test "${UNAME_MACHINE}" = "alpha" ; then - sed 's/^ //' <$dummy.s - .globl main - .ent main - main: - .frame \$30,0,\$26,0 - .prologue 0 - .long 0x47e03d80 # implver $0 - lda \$2,259 - .long 0x47e20c21 # amask $2,$1 - srl \$1,8,\$2 - sll \$2,2,\$2 - sll \$0,3,\$0 - addl \$1,\$0,\$0 - addl \$2,\$0,\$0 - ret \$31,(\$26),1 - .end main -EOF - LIBC="" - $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null - if test "$?" = 0 ; then - ./$dummy - case "$?" in - 7) - UNAME_MACHINE="alpha" - ;; - 15) - UNAME_MACHINE="alphaev5" - ;; - 14) - UNAME_MACHINE="alphaev56" - ;; - 10) - UNAME_MACHINE="alphapca56" - ;; - 16) - UNAME_MACHINE="alphaev6" - ;; - esac - - objdump --private-headers $dummy | \ - grep ld.so.1 > /dev/null - if test "$?" = 0 ; then - LIBC="libc1" - fi - fi - rm -f $dummy.s $dummy - echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0 - elif test "${UNAME_MACHINE}" = "mips" ; then - cat >$dummy.c </dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0 - rm -f $dummy.c $dummy - else - # Either a pre-BFD a.out linker (linux-gnuoldld) - # or one that does not give us useful --help. - # GCC wants to distinguish between linux-gnuoldld and linux-gnuaout. - # If ld does not provide *any* "supported emulations:" - # that means it is gnuoldld. - echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations:" - test $? != 0 && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0 + LIBC="1" + $CC_FOR_BUILD $dummy.c -o $dummy # 2>/dev/null + if [ $? = 0 ]; then + LIBC=`./$dummy | sed -e 's/^\([0-9]*\.[0-9]*\)\..*$/\1/'` + fi + rm -f $dummy.c $dummy - case "${UNAME_MACHINE}" in - i?86) - VENDOR=pc; - ;; - *) - VENDOR=unknown; - ;; - esac - # Determine whether the default compiler is a.out or elf - cat >$dummy.c < -#ifdef __cplusplus - int main (int argc, char *argv[]) { -#else - int main (argc, argv) int argc; char *argv[]; { -#endif -#ifdef __ELF__ -# ifdef __GLIBC__ -# if __GLIBC__ >= 2 - printf ("%s-${VENDOR}-linux-gnu\n", argv[1]); -# else - printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]); -# endif -# else - printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]); -# endif -#else - printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]); -#endif - return 0; -} -EOF - $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0 - rm -f $dummy.c $dummy - fi ;; + echo "${MACHINE}-${VENDOR}-linux${KERNEL}glibc${LIBC}" + ;; # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions # are messed up and put the nodename in both sysname and nodename. i?86:DYNIX/ptx:4*:*) echo i386-sequent-sysv4 exit 0 ;; + i?86:UnixWare:*:* ) + echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}uw${UNAME_VERSION} + exit 0 ;; i?86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... @@ -881,6 +774,9 @@ exit 0 ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} + exit 0 ;; + BS2000:POSIX-BC:*:*) + echo BS2000-siemens-sysv4 exit 0 ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 --QN8DD4WCIA4DI16JQSKU Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/sfio/etc/config.sub Content-Disposition: attachment Index: ossp-pkg/sfio/etc/config.sub ============================================================ $ cvs diff -u -r1.1 -r1.2 config.sub --- ossp-pkg/sfio/etc/config.sub 1999/11/12 14:42:21 1.1 +++ ossp-pkg/sfio/etc/config.sub 2000/07/03 14:15:16 1.2 @@ -162,7 +162,7 @@ case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. - tahoe | i860 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \ + tahoe | i860 | ia64 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \ | arme[lb] | pyramid | mn10200 | mn10300 | tron | a29k \ | 580 | i960 | h8300 \ | hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \ @@ -171,7 +171,7 @@ | 1750a | dsp16xx | pdp11 | mips16 | mips64 | mipsel | mips64el \ | mips64orion | mips64orionel | mipstx39 | mipstx39el \ | mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \ - | mips64vr5000 | miprs64vr5000el \ + | mips64vr5000 | miprs64vr5000el | mcore \ | sparc | sparclet | sparclite | sparc64 | sparcv9 | v850 | c4x \ | thumb | d10v) basic_machine=$basic_machine-unknown @@ -191,7 +191,8 @@ exit 1 ;; # Recognize the basic CPU types with company name. - vax-* | tahoe-* | i[34567]86-* | i860-* | m32r-* | m68k-* | m68000-* \ + # FIXME: clean up the formatting here. + vax-* | tahoe-* | i[34567]86-* | i860-* | ia64-* | m32r-* | m68k-* | m68000-* \ | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \ | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \ | power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \ @@ -204,7 +205,7 @@ | sparc64-* | sparcv9-* | sparc86x-* | mips16-* | mips64-* | mipsel-* \ | mips64el-* | mips64orion-* | mips64orionel-* \ | mips64vr4100-* | mips64vr4100el-* | mips64vr4300-* | mips64vr4300el-* \ - | mipstx39-* | mipstx39el-* \ + | mipstx39-* | mipstx39el-* | mcore-* \ | f301-* | armv*-* | t3e-* \ | m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \ | thumb-* | v850-* | d30v-* | tic30-* | c30-* ) @@ -722,6 +723,9 @@ basic_machine=i386-sequent os=-dynix ;; + s390*) + basic_machine=s390-ibm + ;; t3e) basic_machine=t3e-cray os=-unicos @@ -849,6 +853,8 @@ basic_machine=c4x-none os=-coff ;; + BS2000-siemens) + ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 @@ -1213,3 +1219,4 @@ esac echo $basic_machine$os +exit 0 --QN8DD4WCIA4DI16JQSKU Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/sfio/etc/ltconfig Content-Disposition: attachment Index: ossp-pkg/sfio/etc/ltconfig ============================================================ $ cvs diff -u -r1.1 -r1.2 ltconfig --- ossp-pkg/sfio/etc/ltconfig 1999/11/12 14:42:21 1.1 +++ ossp-pkg/sfio/etc/ltconfig 2000/07/03 14:15:16 1.2 @@ -53,7 +53,7 @@ # Find the correct PATH separator. Usually this is `:', but # DJGPP uses `;' like DOS. -if test "X${PATH_SEPARATOR+set}" != "Xset"; then +if test "X${PATH_SEPARATOR+set}" != Xset; then UNAME=${UNAME-`uname 2>/dev/null`} case X$UNAME in *-DOS) PATH_SEPARATOR=';' ;; @@ -63,9 +63,9 @@ # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. -if test "${CDPATH+set}" = set; then CDPATH=; export CDPATH; fi +if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi -if test "X${echo_test_string+set}" != "Xset"; then +if test "X${echo_test_string+set}" != Xset; then # find a string as large as possible, as long as the shell can cope with it for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... @@ -169,10 +169,10 @@ # Constants: PROGRAM=ltconfig PACKAGE=libtool -VERSION=1.3.3 -TIMESTAMP=" (1.385.2.181 1999/07/02 15:49:11)" -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.c 1>&5' -ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.c $LIBS 1>&5' +VERSION=1.3.5 +TIMESTAMP=" (1.385.2.206 2000/05/27 11:12:27)" +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' rm="rm -f" help="Try \`$progname --help' for more information." @@ -369,8 +369,8 @@ # Only set LANG and LC_ALL to C if already set. # These must not be set unconditionally because not all systems understand # e.g. LANG=C (notably SCO). -if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi -if test "${LANG+set}" = set; then LANG=C; export LANG; fi +if test "X${LC_ALL+set}" = Xset; then LC_ALL=C; export LC_ALL; fi +if test "X${LANG+set}" = Xset; then LANG=C; export LANG; fi if test -n "$cache_file" && test -r "$cache_file"; then echo "loading cache $cache_file within ltconfig" @@ -462,7 +462,7 @@ # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. - if test "${COLLECT_NAMES+set}" != set; then + if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi @@ -663,7 +663,7 @@ link_static_flag='-static' case "$host_os" in - beos* | irix5* | irix6* | osf3* | osf4*) + beos* | irix5* | irix6* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; aix*) @@ -718,7 +718,7 @@ # We can build DLLs from non-PIC. ;; - osf3* | osf4*) + osf3* | osf4* | osf5*) # All OSF/1 code is PIC. wl='-Wl,' link_static_flag='-non_shared' @@ -1164,15 +1164,21 @@ # Extract the symbol export list from an `--export-all' def file, # then regenerate the def file from the symbol export list, so that # the compiled dll only exports the symbol export list. + # Be careful not to strip the DATA tag left by newer dlltools. export_symbols_cmds='test -f $objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $objdir/$soname-ltdll.c~ test -f $objdir/$soname-ltdll.$objext || (cd $objdir && $CC -c $soname-ltdll.c)~ $DLLTOOL --export-all --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --output-def $objdir/$soname-def $objdir/$soname-ltdll.$objext $libobjs $convenience~ - sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]* ; *//" < $objdir/$soname-def > $export_symbols' + sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]*//" -e "s/ *;.*$//" < $objdir/$soname-def > $export_symbols' + # If DATA tags from a recent dlltool are present, honour them! archive_expsym_cmds='echo EXPORTS > $objdir/$soname-def~ _lt_hint=1; - for symbol in `cat $export_symbols`; do - echo " \$symbol @ \$_lt_hint ; " >> $objdir/$soname-def; + cat $export_symbols | while read symbol; do + set dummy \$symbol; + case \$# in + 2) echo " \$2 @ \$_lt_hint ; " >> $objdir/$soname-def;; + *) echo " \$2 @ \$_lt_hint \$3 ; " >> $objdir/$soname-def;; + esac; _lt_hint=`expr 1 + \$_lt_hint`; done~ test -f $objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $objdir/$soname-ltdll.c~ @@ -1187,7 +1193,7 @@ ;; netbsd*) - if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else @@ -1196,7 +1202,7 @@ fi ;; - solaris*) + solaris* | sysv5*) if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <&2 @@ -1244,7 +1250,12 @@ whole_archive_flag_spec= ;; *) - whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec= + fi ;; esac fi @@ -1405,7 +1416,7 @@ old_archive_from_new_cmds='emximp -o $objdir/$libname.a $objdir/$libname.def' ;; - osf3* | osf4*) + osf3*) if test "$with_gcc" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $linkopts ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' @@ -1417,6 +1428,24 @@ hardcode_libdir_separator=: ;; + osf4* | osf5*) # As osf3* with the addition of the -msym flag + if test "$with_gcc" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $linkopts ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linkopts -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' + fi + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + rhapsody*) + archive_cmds='$CC -bundle -undefined suppress -o $lib $libobjs $deplibs $linkopts' + hardcode_libdir_flags_spec='-L$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + sco3.2v5*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' hardcode_shlibpath_var=no @@ -1449,7 +1478,13 @@ ;; sysv4) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $linkopts' + else + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' + fi runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no hardcode_direct=no #Motorola manual says yes, but my tests say they lie @@ -1461,6 +1496,18 @@ export_dynamic_flag_spec='-Bexport' ;; + sysv5*) + no_undefined_flag=' -z text' + # $CC -shared without GNU ld will not create a library from C++ + # object files and a static libstdc++, better avoid it by now + archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linkopts' + archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linkopts~$rm $lib.exp' + hardcode_libdir_flag_spec= + hardcode_shlibpath_var=no + runpath_var='LD_RUN_PATH' + ;; + uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' hardcode_libdir_flag_spec='-L$libdir' @@ -1474,14 +1521,28 @@ ;; sysv4*MP*) - if test -d /usr/nec ;then - # archive_cmds='$LD -G -z text -h $soname -o $lib$libobjs$deplibs' - archive_cmds='$LD -G -h $soname -o $lib$libobjs$deplibs' + if test -d /usr/nec; then + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' + hardcode_shlibpath_var=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs=yes + fi + ;; + + sysv4.2uw2*) + archive_cmds='$LD -G -o $lib $libobjs $deplibs $linkopts' + hardcode_direct=yes + hardcode_minus_L=no hardcode_shlibpath_var=no - runpath_var=LD_RUN_PATH hardcode_runpath_var=yes - ld_shlibs=yes - fi + runpath_var=LD_RUN_PATH + ;; + + unixware7*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var=no ;; *) @@ -1589,11 +1650,11 @@ main(){nm_test_var='a';nm_test_func();return(0);} EOF - echo "$progname:1592: checking if global_symbol_pipe works" >&5 - if { (eval echo $progname:1593: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.$objext; then + echo "$progname:1653: checking if global_symbol_pipe works" >&5 + if { (eval echo $progname:1654: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.$objext; then # Now try to grab the symbols. nlist=conftest.nm - if { echo "$progname:1596: eval \"$NM conftest.$objext | $global_symbol_pipe > $nlist\"" >&5; eval "$NM conftest.$objext | $global_symbol_pipe > $nlist 2>&5"; } && test -s "$nlist"; then + if { echo "$progname:1657: eval \"$NM conftest.$objext | $global_symbol_pipe > $nlist\"" >&5; eval "$NM conftest.$objext | $global_symbol_pipe > $nlist 2>&5"; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then @@ -1645,7 +1706,7 @@ save_CFLAGS="$CFLAGS" LIBS="conftstm.$objext" CFLAGS="$CFLAGS$no_builtin_flag" - if { (eval echo $progname:1648: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then + if { (eval echo $progname:1709: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then pipe_works=yes else echo "$progname: failed program was:" >&5 @@ -1787,8 +1848,9 @@ bsdi4*) version_type=linux - library_names_spec='${libname}.so$major ${libname}.so' - soname_spec='${libname}.so' + need_version=no + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + soname_spec='${libname}${release}.so$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' @@ -1796,6 +1858,7 @@ file_magic_test_file=/shlib/libc.so sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + export_dynamic_flag_spec=-rdynamic # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs @@ -1841,10 +1904,9 @@ need_version=yes ;; esac - finish_cmds='PATH="\$PATH:/sbin" OBJFORMAT="'"$objformat"'" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH case "$host_os" in - freebsd2* | freebsd3.[01]*) + freebsd2* | freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes ;; *) # from 3.2 on @@ -1875,6 +1937,14 @@ soname_spec='${libname}${release}.sl$major' # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' + case "$host_os" in + hpux10.20*) + # TODO: Does this work for hpux-11 too? + deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' + file_magic_cmd=/usr/bin/file + file_magic_test_file=/usr/lib/libc.sl + ;; + esac ;; irix5* | irix6*) @@ -1896,8 +1966,6 @@ *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac - # this will be overridden with pass_all, but let us keep it just in case - deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1" ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH @@ -1924,9 +1992,7 @@ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no - deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' - file_magic_cmd=/usr/bin/file - file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` + deplibs_check_method=pass_all if test -f /lib/ld.so.1; then dynamic_linker='GNU ld.so' @@ -1972,7 +2038,7 @@ shlibpath_var=LIBPATH ;; -osf3* | osf4*) +osf3* | osf4* | osf5*) version_type=osf need_version=no soname_spec='${libname}${release}.so' @@ -1987,6 +2053,14 @@ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; +rhapsody*) + version_type=sunos + library_names_spec='${libname}.so' + soname_spec='${libname}.so' + shlibpath_var=DYLD_LIBRARY_PATH + deplibs_check_method=pass_all + ;; + sco3.2v5*) version_type=osf soname_spec='${libname}${release}.so$major' @@ -2027,6 +2101,10 @@ soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH case "$host_vendor" in + sequent) + file_magic_cmd='/bin/file' + deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' + ;; ncr) deplibs_check_method='pass_all' ;; @@ -2167,7 +2245,7 @@ if eval "test \"`echo '$''{'lt_cv_dlopen'+set}'`\" != set"; then lt_cv_dlopen=no lt_cv_dlopen_libs= echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "$progname:2170: checking for dlopen in -ldl" >&5 +echo "$progname:2248: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2175,17 +2253,20 @@ ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo $progname:2269: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2204,18 +2285,21 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for dlopen""... $ac_c" 1>&6 -echo "$progname:2207: checking for dlopen" >&5 +echo "$progname:2288: checking for dlopen" >&5 if eval "test \"`echo '$''{'ac_cv_func_dlopen'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif char dlopen(); int main() { @@ -2231,7 +2315,7 @@ ; return 0; } EOF -if { (eval echo $progname:2234: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo $progname:2318: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_dlopen=yes" else @@ -2248,7 +2332,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for dld_link in -ldld""... $ac_c" 1>&6 -echo "$progname:2251: checking for dld_link in -ldld" >&5 +echo "$progname:2335: checking for dld_link in -ldld" >&5 ac_lib_var=`echo dld'_'dld_link | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2256,17 +2340,20 @@ ac_save_LIBS="$LIBS" LIBS="-ldld $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo $progname:2356: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2285,18 +2372,21 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for shl_load""... $ac_c" 1>&6 -echo "$progname:2288: checking for shl_load" >&5 +echo "$progname:2375: checking for shl_load" >&5 if eval "test \"`echo '$''{'ac_cv_func_shl_load'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif char shl_load(); int main() { @@ -2312,7 +2402,7 @@ ; return 0; } EOF -if { (eval echo $progname:2315: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo $progname:2405: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_shl_load=yes" else @@ -2330,7 +2420,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6 -echo "$progname:2333: checking for shl_load in -ldld" >&5 +echo "$progname:2423: checking for shl_load in -ldld" >&5 ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2338,18 +2428,21 @@ ac_save_LIBS="$LIBS" LIBS="-ldld $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo $progname:2445: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2392,17 +2485,17 @@ for ac_hdr in dlfcn.h; do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "$progname:2395: checking for $ac_hdr" >&5 +echo "$progname:2488: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int fnord = 0; EOF -ac_try="$ac_compile conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo $progname:2405: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_try="$ac_compile >/dev/null 2>conftest.out" +{ (eval echo $progname:2498: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2430,7 +2523,7 @@ LIBS="$lt_cv_dlopen_libs $LIBS" echo $ac_n "checking whether a program can dlopen itself""... $ac_c" 1>&6 -echo "$progname:2433: checking whether a program can dlopen itself" >&5 +echo "$progname:2526: checking whether a program can dlopen itself" >&5 if test "${lt_cv_dlopen_self+set}" = set; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2438,7 +2531,7 @@ lt_cv_dlopen_self=cross else cat > conftest.c < @@ -2484,7 +2577,7 @@ if(ptr1 || ptr2) { dlclose(self); exit(0); } } exit(1); } EOF -if { (eval echo $progname:2487: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo $progname:2580: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then lt_cv_dlopen_self=yes else @@ -2503,7 +2596,7 @@ if test "$lt_cv_dlopen_self" = yes; then LDFLAGS="$LDFLAGS $link_static_flag" echo $ac_n "checking whether a statically linked program can dlopen itself""... $ac_c" 1>&6 -echo "$progname:2506: checking whether a statically linked program can dlopen itself" >&5 +echo "$progname:2599: checking whether a statically linked program can dlopen itself" >&5 if test "${lt_cv_dlopen_self_static+set}" = set; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2511,7 +2604,7 @@ lt_cv_dlopen_self_static=cross else cat > conftest.c < @@ -2557,7 +2650,7 @@ if(ptr1 || ptr2) { dlclose(self); exit(0); } } exit(1); } EOF -if { (eval echo $progname:2560: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo $progname:2653: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then lt_cv_dlopen_self_static=yes else @@ -2649,7 +2742,7 @@ # NOTE: Changes made to this file will be lost: look at ltconfig or ltmain.sh. # # Copyright (C) 1996-1999 Free Software Foundation, Inc. -# Gordon Matzigkeit , 1996 +# Originally by Gordon Matzigkeit , 1996 # # 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 @@ -2675,7 +2768,7 @@ # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. -if test "\${CDPATH+set}" = set; then CDPATH=; export CDPATH; fi +if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi ### BEGIN LIBTOOL CONFIG EOF @@ -2938,7 +3031,7 @@ # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. -if test "${COLLECT_NAMES+set}" != set; then +if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi @@ -2948,6 +3041,10 @@ # Append the ltmain.sh script. sed '$q' "$ltmain" >> "$ofile" || (rm -f "$ofile"; exit 1) + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? chmod +x "$ofile" ;; --QN8DD4WCIA4DI16JQSKU Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/sfio/etc/ltmain.sh Content-Disposition: attachment Index: ossp-pkg/sfio/etc/ltmain.sh ============================================================ $ cvs diff -u -r1.1 -r1.2 ltmain.sh --- ossp-pkg/sfio/etc/ltmain.sh 1999/11/12 14:42:21 1.1 +++ ossp-pkg/sfio/etc/ltmain.sh 2000/07/03 14:15:16 1.2 @@ -54,8 +54,8 @@ # Constants. PROGRAM=ltmain.sh PACKAGE=libtool -VERSION=1.3.3 -TIMESTAMP=" (1.385.2.181 1999/07/02 15:49:11)" +VERSION=1.3.5 +TIMESTAMP=" (1.385.2.206 2000/05/27 11:12:27)" default_mode= help="Try \`$progname --help' for more information." @@ -435,7 +435,7 @@ fbsd_hideous_sh_bug=$base_compile # All platforms use -DPIC, to notify preprocessed assembler code. - command="$base_compile $pic_flag -DPIC $srcfile" + command="$base_compile $srcfile $pic_flag -DPIC" if test "$build_old_libs" = yes; then lo_libobj="$libobj" dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'` @@ -521,9 +521,17 @@ exit $error fi + xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$obj"; then + xdir="." + else + xdir="$xdir" + fi + baseobj=`$echo "X$obj" | $Xsed -e "s%.*/%%"` + libobj=`$echo "X$baseobj" | $Xsed -e "$o2lo"` # Now arrange that obj and lo_libobj become the same file - $show "$LN_S $obj $lo_libobj" - if $run $LN_S $obj $lo_libobj; then + $show "(cd $xdir && $LN_S $baseobj $libobj)" + if $run eval '(cd $xdir && $LN_S $baseobj $libobj)'; then exit 0 else error=$? @@ -613,8 +621,6 @@ # libtool link mode link) modename="$modename: link" - C_compiler="$CC" # save it, to compile generated C sources - CC="$nonopt" case "$host" in *-*-cygwin* | *-*-mingw* | *-*-os2*) # It is impossible to link a dll without this setting, and @@ -802,8 +808,8 @@ allow_undefined=yes ;; esac - compile_command="$CC" - finalize_command="$CC" + compile_command="$nonopt" + finalize_command="$nonopt" compile_rpath= finalize_rpath= @@ -1789,6 +1795,10 @@ *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*) # these systems don't actually have a c library (as such)! ;; + *-*-rhapsody*) + # rhapsody is a little odd... + deplibs="$deplibs -framework System" + ;; *) # Add libc to deplibs on all other systems. deplibs="$deplibs -lc" @@ -1851,7 +1861,7 @@ int main() { return 0; } EOF $rm conftest - $C_compiler -o conftest conftest.c $deplibs + $CC -o conftest conftest.c $deplibs if test $? -eq 0 ; then ldd_output=`ldd conftest` for i in $deplibs; do @@ -1884,7 +1894,7 @@ # If $name is empty we are operating on a -L argument. if test "$name" != "" ; then $rm conftest - $C_compiler -o conftest conftest.c $i + $CC -o conftest conftest.c $i # Did it work? if test $? -eq 0 ; then ldd_output=`ldd conftest` @@ -2047,13 +2057,20 @@ done # Ensure that we have .o objects for linkers which dislike .lo - # (e.g. aix) incase we are running --disable-static + # (e.g. aix) in case we are running --disable-static for obj in $libobjs; do - oldobj=`$echo "X$obj" | $Xsed -e "$lo2o"` - if test ! -f $oldobj; then - $show "${LN_S} $obj $oldobj" - $run ${LN_S} $obj $oldobj || exit $? + xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$obj"; then + xdir="." + else + xdir="$xdir" fi + baseobj=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` + oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"` + if test ! -f $xdir/$oldobj; then + $show "(cd $xdir && ${LN_S} $baseobj $oldobj)" + $run eval '(cd $xdir && ${LN_S} $baseobj $oldobj)' || exit $? + fi done # Use standard objects if they are pic @@ -2311,8 +2328,16 @@ # Just create a symlink. $show $rm $libobj $run $rm $libobj - $show "$LN_S $obj $libobj" - $run $LN_S $obj $libobj || exit $? + xdir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$libobj"; then + xdir="." + else + xdir="$xdir" + fi + baseobj=`$echo "X$libobj" | $Xsed -e 's%^.*/%%'` + oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"` + $show "(cd $xdir && $LN_S $oldobj $baseobj)" + $run eval '(cd $xdir && $LN_S $oldobj $baseobj)' || exit $? fi if test -n "$gentop"; then @@ -2598,16 +2623,21 @@ # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. - *-*-freebsd2*|*-*-freebsd3.0*) + *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) case "$compile_command " in *" -static "*) ;; *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";; + esac;; + *-*-hpux*) + case "$compile_command " in + *" -static "*) ;; + *) pic_flag_for_symtable=" $pic_flag -DPIC";; esac esac # Now compile the dynamic symbol file. - $show "(cd $output_objdir && $C_compiler -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" - $run eval '(cd $output_objdir && $C_compiler -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? + $show "(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" + $run eval '(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? # Clean up the generated files. $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" @@ -2776,7 +2806,7 @@ # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. -if test \"\${CDPATH+set}\" = set; then CDPATH=; export CDPATH; fi +if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi relink_command=\"$relink_command\" @@ -2865,7 +2895,7 @@ fi" else echo >> $output "\ - program='$outputname$exeext' + program='$outputname' progdir=\"\$thisdir/$objdir\" " fi @@ -2901,13 +2931,21 @@ # Run the actual program with our arguments. " case $host in - *-*-cygwin* | *-*-mingw | *-*-os2*) # win32 systems need to use the prog path for dll # lookup to work + *-*-cygwin*) $echo >> $output "\ + exec \$progdir/\$program \${1+\"\$@\"} +" + ;; + + # Backslashes separate directories on plain windows + *-*-mingw | *-*-os2*) + $echo >> $output "\ exec \$progdir\\\\\$program \${1+\"\$@\"} " ;; + *) $echo >> $output "\ # Export the path to the program. @@ -2995,14 +3033,21 @@ if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then eval cmds=\"$old_archive_from_new_cmds\" else - # Ensure that we have .o objects in place incase we decided + # Ensure that we have .o objects in place in case we decided # not to build a shared library, and have fallen back to building # static libs even though --disable-static was passed! for oldobj in $oldobjs; do if test ! -f $oldobj; then - obj=`$echo "X$oldobj" | $Xsed -e "$o2lo"` - $show "${LN_S} $obj $oldobj" - $run ${LN_S} $obj $oldobj || exit $? + xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$oldobj"; then + xdir="." + else + xdir="$xdir" + fi + baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'` + obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"` + $show "(cd $xdir && ${LN_S} $obj $baseobj)" + $run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $? fi done @@ -3672,8 +3717,10 @@ done if test -z "$run"; then - # Export the shlibpath_var. - eval "export $shlibpath_var" + if test -n "$shlibpath_var"; then + # Export the shlibpath_var. + eval "export $shlibpath_var" + fi # Restore saved enviroment variables if test "${save_LC_ALL+set}" = set; then @@ -3690,8 +3737,10 @@ exit 1 else # Display what would be done. - eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" - $echo "export $shlibpath_var" + if test -n "$shlibpath_var"; then + eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" + $echo "export $shlibpath_var" + fi $echo "$cmd$args" exit 0 fi --QN8DD4WCIA4DI16JQSKU Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/sfio/etc/shtool Content-Disposition: attachment Index: ossp-pkg/sfio/etc/shtool ============================================================ $ cvs diff -u -r1.2 -r1.3 shtool --- ossp-pkg/sfio/etc/shtool 1999/11/12 14:42:21 1.2 +++ ossp-pkg/sfio/etc/shtool 2000/07/03 14:15:16 1.3 @@ -1,13 +1,13 @@ #!/bin/sh ## ## GNU shtool -- The GNU Portable Shell Tool -## Copyright (c) 1994-1999 Ralf S. Engelschall +## Copyright (c) 1994-2000 Ralf S. Engelschall ## ## See http://www.gnu.org/software/shtool/ for more information. ## See ftp://ftp.gnu.org/gnu/shtool/ for latest version. ## -## Version 1.4.6 (05-Sep-1999) -## Ingredients: all available modules +## Version: 1.5.0 (01-Jul-2000) +## Contents: all available modules ## ## @@ -40,20 +40,20 @@ ## 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 +## table Pretty-print a field-separated list as a table ## prop Display progress with a running propeller -## move Move files with simultan substitution +## 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 +## mkshadow Make a shadow tree through symbolic links ## fixperm Fix file permissions inside a source tree ## tarball Roll distribution tarballs -## guessos Simple OS/platform guesser +## guessos Simple operating system guesser ## arx Extended archive command ## slo Separate linker options by library class ## scpp Sharing C Pre-Processor -## version Generate and maintain a version information file +## version Maintain a version information file ## path Deal with program paths ## @@ -63,8 +63,8 @@ exit 1 fi if [ ".$1" = ".-h" -o ".$1" = ".--help" ]; then - echo "This is GNU shtool, version 1.4.6 (05-Sep-1999)" - echo "Copyright (c) 1994-1999 Ralf S. Engelschall " + echo "This is GNU shtool, version 1.5.0 (01-Jul-2000)" + echo "Copyright (c) 1994-2000 Ralf S. Engelschall " echo "Report bugs to " echo '' echo "Usage: shtool [] [ [] []]" @@ -73,6 +73,7 @@ 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 [] []:' echo ' echo [-n] [-e] [ ...]' @@ -81,7 +82,7 @@ echo ' prop [-p]' echo ' move [-v] [-t] [-e] [-p] ' echo ' install [-v] [-t] [-c] [-C] [-s] [-m] [-o] [-g]' - echo ' [-e] ' + echo ' [-e] [ ...] ' echo ' mkdir [-t] [-f] [-p] [-m] [ ...]' echo ' mkln [-t] [-f] [-s] [ ...] ' echo ' mkshadow [-v] [-t] [-a] ' @@ -90,19 +91,23 @@ echo ' ] [-g ] [-e ] [ ...]' echo ' guessos ' echo ' arx [-t] [-C] [ ...]' - echo ' slo -- -L -l [ -L -l ... ]' - echo ' scpp [-v] [-p] [-o] [-t] [-M] [-D]' - echo ' [-C] [ ...]' - echo ' version [-l] [-n] [-p] [-s] [-i]' - echo ' [-d] ' + echo ' slo [-p] -- -L -l [-L -l ...]' + echo ' scpp [-v] [-p] [-f] [-o] [-t] [-M]' + echo ' [-D] [-C] [ ...]' + echo ' version [-l] [-n] [-p] [-s] [-e]' + echo ' [-i] [-d] ' echo ' path [-s] [-r] [-d] [-b] [-m] [-p] [ ...]' echo '' exit 0 fi if [ ".$1" = ".-v" -o ".$1" = ."--version" ]; then - echo "GNU shtool 1.4.6 (05-Sep-1999)" + echo "GNU shtool 1.5.0 (01-Jul-2000)" exit 0 fi +if [ ".$1" = ".-r" -o ".$1" = ."--recreate" ]; then + shtoolize -oshtool all + exit 0 +fi if [ ".$1" = ".-d" -o ".$1" = ."--debug" ]; then shift set -x @@ -132,13 +137,19 @@ str_tool="echo" str_usage="[-n] [-e] [ ...]" arg_spec="0+" - opt_spec="ne" + opt_spec="n.e." + opt_n=no + opt_e=no ;; mdate ) str_tool="mdate" str_usage="[-n] [-z] [-s] [-d] [-f] [-o] " - arg_spec="1" - opt_spec="nzsdf:!o:!" + arg_spec="1=" + opt_spec="n.z.s.d.f:o:" + opt_n=no + opt_z=no + opt_s=no + opt_d=no opt_f=" " opt_o="dmy" ;; @@ -146,7 +157,7 @@ str_tool="table" str_usage="[-F] [-w] [-c] [-s] ..." arg_spec="1+" - opt_spec="F:!w:!c:!s:!" + opt_spec="F:w:c:s:" opt_F=":" opt_w=15 opt_c=3 @@ -155,79 +166,116 @@ prop ) str_tool="prop" str_usage="[-p]" - arg_spec="0" + arg_spec="0=" opt_spec="p:" + opt_p="" ;; move ) str_tool="move" str_usage="[-v] [-t] [-e] [-p] " - arg_spec="2" - opt_spec="vtep" + arg_spec="2=" + opt_spec="v.t.e.p." + opt_v=no + opt_t=no + opt_e=no + opt_p=no ;; install ) str_tool="install" - str_usage="[-v] [-t] [-c] [-C] [-s] [-m] [-o] [-g] [-e] " - arg_spec="2" - opt_spec="vtcCsm:o:g:e:" + str_usage="[-v] [-t] [-c] [-C] [-s] [-m] [-o] [-g] [-e] [ ...] " + arg_spec="2+" + opt_spec="v.t.c.C.s.m:o:g:e:" + opt_v=no + opt_t=no + opt_c=no + opt_C=no + opt_s=no + opt_m="" + opt_o="" + opt_g="" + opt_e="" ;; mkdir ) str_tool="mkdir" str_usage="[-t] [-f] [-p] [-m] [ ...]" arg_spec="1+" - opt_spec="tfpm:" + opt_spec="t.f.p.m:" + opt_t=no + opt_f=no + opt_p=no + opt_m="" ;; mkln ) str_tool="mkln" str_usage="[-t] [-f] [-s] [ ...] " arg_spec="2+" - opt_spec="tfs" + opt_spec="t.f.s." + opt_t=no + opt_f=no + opt_s=no ;; mkshadow ) str_tool="mkshadow" str_usage="[-v] [-t] [-a] " - arg_spec="2" - opt_spec="vta" + arg_spec="2=" + opt_spec="v.t.a." + opt_v=no + opt_t=no + opt_a=no ;; fixperm ) str_tool="fixperm" str_usage="[-v] [-t] [ ...]" - gen_tmpfile=yes arg_spec="1+" - opt_spec="vt" + opt_spec="v.t." + opt_v=no + opt_t=no ;; tarball ) str_tool="tarball" str_usage="[-t] [-v] [-o ] [-c ] [-d ] [-u ] [-g ] [-e ] [ ...]" gen_tmpfile=yes arg_spec="1+" - opt_spec="tvo:c:d:u:g:e:!" + opt_spec="t.v.o:c:d:u:g:e:" + opt_t=no + opt_v=no + opt_o="" + opt_c="" + opt_d="" + opt_u="" + opt_g="" opt_e="CVS,\\.cvsignore,\\.[oa]\$" ;; guessos ) str_tool="guessos" str_usage="" - arg_spec="0" + arg_spec="0=" opt_spec="" ;; arx ) str_tool="arx" str_usage="[-t] [-C] [ ...]" arg_spec="2+" - opt_spec="tC:!" + opt_spec="t.C:" + opt_t=no opt_C="ar" ;; slo ) str_tool="slo" - str_usage="-- -L -l [ -L -l ... ]" + str_usage="[-p] -- -L -l [-L -l ...]" arg_spec="1+" - opt_spec="" + opt_spec="p:" + opt_p="SLO_" ;; scpp ) str_tool="scpp" - str_usage="[-v] [-p] [-o] [-t] [-M] [-D] [-C] [ ...]" + str_usage="[-v] [-p] [-f] [-o] [-t] [-M] [-D] [-C] [ ...]" gen_tmpfile=yes arg_spec="1+" - opt_spec="vpo:!t:!M:!D:!C:!" + opt_spec="v.p.f+o:t:M:D:C:" + opt_v=no + opt_p=no + opt_f="" opt_o="lib.h" opt_t="lib.h.in" opt_M="%%MARK%%" @@ -236,25 +284,35 @@ ;; version ) str_tool="version" - str_usage="[-l] [-n] [-p] [-s] [-i] [-d] " - arg_spec="1+" - opt_spec="l:!n:!p:!s:!i:!d:!" + str_usage="[-l] [-n] [-p] [-s] [-e] [-i] [-d] " + arg_spec="1=" + opt_spec="l:n:p:s:i:e.d:" opt_l="txt" opt_n="unknown" - opt_p="unknown" - opt_s="unknown" - opt_i="P" - opt_d="NO" - gen_tmpfile=yes + opt_p="" + opt_s="" + opt_e="no" + opt_i="" + opt_d="short" ;; path ) str_tool="path" str_usage="[-s] [-r] [-d] [-b] [-m] [-p] [ ...]" gen_tmpfile=yes arg_spec="1+" - opt_spec="srdbmp:!" + opt_spec="s.r.d.b.m.p:" + opt_s=no + opt_r=no + opt_d=no + opt_b=no + opt_m=no opt_p="$PATH" ;; + -* ) + echo "$0:Error: unknown option \`$tool'" 2>&1 + echo "$0:Hint: run \`$0 -h' for usage" 2>&1 + exit 1 + ;; * ) echo "$0:Error: unknown command \`$tool'" 2>&1 echo "$0:Hint: run \`$0 -h' for usage" 2>&1 @@ -268,36 +326,24 @@ # determine name of tool if [ ".$tool" != . ]; then - # inside shtool + # used inside shtool script toolcmd="$0 $tool" toolcmdhelp="shtool $tool" msgprefix="shtool:$tool" else - # standalone + # used as standalone script toolcmd="$0" - toolcmdhelp="sh.$tool" + toolcmdhelp="sh $0" msgprefix="$str_tool" fi # parse argument specification string -eval `echo $arg_spec | sed -e 's/^\([0-9]*\)\(.*\)/arg_NUMS="\1"; arg_MODE="\2"/'` -test ".$arg_MODE" = . && arg_MODE="=" +eval `echo $arg_spec |\ + sed -e 's/^\([0-9]*\)\([+=]\)/arg_NUMS=\1; arg_MODE=\2/'` # parse option specification string -for opt in `echo "h$opt_spec" | sed -e 's/\([a-zA-Z0-9][!:+]*\)/\1 /g'`; do - opt_MODE="."; opt_INIT="." - eval `echo $opt |\ - sed -e 's/^\([a-zA-Z0-9]\)/opt_THIS="\1";/' \ - -e 's/";\([:+]\)/"; opt_MODE="\1";/' \ - -e 's/";\(!\)/"; opt_INIT="\1"/'` - eval "opt_MODE_${opt_THIS}=${opt_MODE}" - if [ ".$opt_INIT" != ".!" ]; then - case "$opt_MODE" in - "." ) eval "opt_${opt_THIS}=no" ;; - ":"|"+" ) eval "opt_${opt_THIS}=\"\"" ;; - esac - fi -done +eval `echo h.$opt_spec |\ + sed -e 's/\([a-zA-Z0-9]\)\([.:+]\)/opt_MODE_\1=\2;/g'` # interate over argument line opt_PREV='' @@ -315,7 +361,7 @@ opt_OPT="$opt_PREV" opt_ARG="$1" opt_ARG_OK=yes - opt_PREV="" + opt_PREV='' else # split argument into option and argument case "$1" in @@ -325,8 +371,7 @@ -e 's/";\(.*\)$/"; opt_ARG="\1"/'` ;; -[a-zA-Z0-9]) - opt_OPT=`awk 'BEGIN { printf("%s", substr(OPT, 2)); }' \ - "OPT=$1" &2 echo "$msgprefix:Hint: run \`$toolcmd -h' or \`man shtool' for details" 1>&2 exit 1 fi ;; - "+" ) + '+' ) if [ $# -lt $arg_NUMS ]; then echo "$msgprefix:Error: invalid number of arguments (at least $arg_NUMS expected)" 1>&2 echo "$msgprefix:Hint: run \`$toolcmd -h' or \`man shtool' for details" 1>&2 @@ -400,13 +445,12 @@ # establish a temporary file on request if [ ".$gen_tmpfile" = .yes ]; then - tmpdir="/tmp" if [ ".$TMPDIR" != . ]; then tmpdir="$TMPDIR" + elif [ ".$TEMPDIR" != . ]; then + tmpdir="$TEMPDIR" else - if [ ".$TEMPDIR" != . ]; then - tmpdir="$TEMPDIR" - fi + tmpdir="/tmp" fi tmpfile="$tmpdir/.shtool.$$" rm -f $tmpfile >/dev/null 2>&1 @@ -422,7 +466,7 @@ echo ) ## ## echo -- Print string with optional construct expansion - ## Copyright (c) 1998-1999 Ralf S. Engelschall + ## Copyright (c) 1998-2000 Ralf S. Engelschall ## Originally written for WML as buildinfo ## @@ -449,8 +493,8 @@ term_bold='' term_norm='' if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%[Bb]'`" != . ]; then - # the most important terminals we directly know case $TERM in + # for the most important terminal types we directly know the sequences xterm|xterm*|vt220|vt220*) term_bold=`awk 'BEGIN { printf("%c%c%c%c", 27, 91, 49, 109); }' /dev/null` term_norm=`awk 'BEGIN { printf("%c%c%c", 27, 91, 109); }' /dev/null` @@ -459,35 +503,37 @@ term_bold=`awk 'BEGIN { printf("%c%c%c%c%c%c", 27, 91, 49, 109, 0, 0); }' /dev/null` term_norm=`awk 'BEGIN { printf("%c%c%c%c%c", 27, 91, 109, 0, 0); }' /dev/null` ;; - esac - # then try 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 "$dir/$tool" ]; then - for seq in bold md smso; do # smso is last - bold="`$dir/$tool $seq 2>/dev/null`" - if [ ".$bold" != . ]; then - term_bold="$bold" + # 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 "$dir/$tool" ]; then + for seq in bold md smso; do # 'smso' is last + bold="`$dir/$tool $seq 2>/dev/null`" + if [ ".$bold" != . ]; then + term_bold="$bold" + break + fi + done + if [ ".$term_bold" != . ]; then + for seq in sgr0 me rmso reset; do # 'reset' is last + norm="`$dir/$tool $seq 2>/dev/null`" + if [ ".$norm" != . ]; then + term_norm="$norm" + break + fi + done + fi break fi done - if [ ".$term_bold" != . ]; then - for seq in sgr0 me rmso reset; do # 'reset' is last - norm="`$dir/$tool $seq 2>/dev/null`" - if [ ".$norm" != . ]; then - term_norm="$norm" - break - fi - done + if [ ".$term_bold" != . -a ".$term_norm" != . ]; then + break; fi - break - fi - done - if [ ".$term_bold" != . -a ".$term_norm" != . ]; then - break; - fi - done + done + ;; + esac if [ ".$term_bold" = . -o ".$term_norm" = . ]; then echo "$msgprefix:Warning: unable to determine terminal sequence for bold mode" 1>&2 fi @@ -628,12 +674,12 @@ # create output if [ .$opt_n = .no ]; then - echo $seo $text + echo $seo "$text" else # the harder part: echo -n is best, because - # awk complains about some \xx sequences. + # awk may complain about some \xx sequences. if [ ".$minusn" != . ]; then - echo $seo $minusn $text + echo $seo $minusn "$text" else echo dummy | awk '{ printf("%s", TEXT); }' TEXT="$text" fi @@ -767,8 +813,8 @@ table ) ## - ## table -- Pretty print a field-separated list as a table - ## Copyright (c) 1998-1999 Ralf S. Engelschall + ## table -- Pretty-print a field-separated list as a table + ## Copyright (c) 1998-2000 Ralf S. Engelschall ## Originally written for Apache ## @@ -832,7 +878,7 @@ prop ) ## ## prop -- Display progress with a running propeller - ## Copyright (c) 1998-1999 Ralf S. Engelschall + ## Copyright (c) 1998-2000 Ralf S. Engelschall ## Originally written for mod_ssl ## @@ -856,7 +902,7 @@ printf(STDERR "\r%s \n", $ARGV[0]); ' "$opt_p" else - # But when Perl doesn't exists we use Awk even + # But if Perl doesn't exists we use Awk even # some Awk's buffer even the /dev/stderr writing :-( awk ' BEGIN { @@ -876,8 +922,8 @@ move ) ## - ## move -- Move files with simultan substitution - ## Copyright (c) 1999 Ralf S. Engelschall + ## move -- Move files with simultaneous substitution + ## Copyright (c) 1999-2000 Ralf S. Engelschall ## Originally written for shtool ## @@ -969,131 +1015,159 @@ install ) ## ## install -- Install a program, script or datafile - ## Copyright (c) 1997-1999 Ralf S. Engelschall + ## Copyright (c) 1997-2000 Ralf S. Engelschall ## Originally written for shtool ## - src="$1" - dst="$2" - - # If destination is a directory, append the input filename - if [ -d $dst ]; then - dst=`echo "$dst" | sed -e 's:/$::'` - dstfile=`echo "$src" | sed -e 's;.*/\([^/]*\)$;\1;'` - dst="$dst/$dstfile" - fi + # determine source(s) and destination + argc=$# + srcs="" + while [ $# -gt 1 ]; do + srcs="$srcs $1" + shift + done + dstpath="$1" - # Add a possible extension to src and dst - if [ ".$opt_e" != . ]; then - src="$src$opt_e" - dst="$dst$opt_e" + # type check for destination + dstisdir=0 + if [ -d $dstpath ]; then + dstpath=`echo "$dstpath" | sed -e 's:/$::'` + dstisdir=1 fi - # Check for correct arguments - if [ ".$src" = ".$dst" ]; then - echo "$msgprefix:Error: source and destination are the same" 1>&2 + # consistency check for destination + if [ $argc -gt 2 -a $dstisdir = 0 ]; then + echo "$msgprefix:Error: multiple sources require destination to be directory" 1>&2 exit 1 fi - - # Make a temp file name in the destination directory - dstdir=`echo $dst | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;' -e 's;^$;.;'` - dsttmp="$dstdir/#INST@$$#" - # Verbosity - if [ ".$opt_v" = .yes ]; then - echo "$src -> $dst" 1>&2 - fi + # iterate over all source(s) + for src in $srcs; do + dst=$dstpath - # Copy or move the file name to the temp name - # (because we might be not allowed to change the source) - if [ ".$opt_C" = .yes ]; then - opt_c=yes - fi - if [ ".$opt_c" = .yes ]; then - if [ ".$opt_t" = .yes ]; then - echo "cp $src $dsttmp" 1>&2 + # If destination is a directory, append the input filename + if [ $dstisdir = 1 ]; then + dstfile=`echo "$src" | sed -e 's;.*/\([^/]*\)$;\1;'` + dst="$dst/$dstfile" fi - cp $src $dsttmp || exit $? - else - if [ ".$opt_t" = .yes ]; then - echo "mv $src $dsttmp" 1>&2 + + # Add a possible extension to src and dst + if [ ".$opt_e" != . ]; then + src="$src$opt_e" + dst="$dst$opt_e" fi - mv $src $dsttmp || exit $? - fi - # Adjust the target file - # (we do chmod last to preserve setuid bits) - if [ ".$opt_s" = .yes ]; then - if [ ".$opt_t" = .yes ]; then - echo "strip $dsttmp" 1>&2 + # Check for correct arguments + if [ ".$src" = ".$dst" ]; then + echo "$msgprefix:Warning: source and destination are the same - skipped" 1>&2 + continue fi - strip $dsttmp || exit $? - fi - if [ ".$opt_o" != . ]; then - if [ ".$opt_t" = .yes ]; then - echo "chown $opt_o $dsttmp" 1>&2 + if [ -d "$src" ]; then + echo "$msgprefix:Warning: source \`$src' is a directory - skipped" 1>&2 + continue fi - chown $opt_o $dsttmp || exit $? - fi - if [ ".$opt_g" != . ]; then - if [ ".$opt_t" = .yes ]; then - echo "chgrp $opt_g $dsttmp" 1>&2 + + # Make a temp file name in the destination directory + dsttmp=`echo $dst |\ + sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;' -e 's;^$;.;' \ + -e "s;\$;/#INST@$$#;"` + + # Verbosity + if [ ".$opt_v" = .yes ]; then + echo "$src -> $dst" 1>&2 fi - chgrp $opt_g $dsttmp || exit $? - fi - if [ ".$opt_m" != . ]; then - if [ ".$opt_t" = .yes ]; then - echo "chmod $opt_m $dsttmp" 1>&2 + + # Copy or move the file name to the temp name + # (because we might be not allowed to change the source) + if [ ".$opt_C" = .yes ]; then + opt_c=yes fi - chmod $opt_m $dsttmp || exit $? - fi + if [ ".$opt_c" = .yes ]; then + if [ ".$opt_t" = .yes ]; then + echo "cp $src $dsttmp" 1>&2 + fi + cp $src $dsttmp || exit $? + else + if [ ".$opt_t" = .yes ]; then + echo "mv $src $dsttmp" 1>&2 + fi + mv $src $dsttmp || exit $? + fi - # Determine whether to do a quick install - # (has to be done _after_ the strip was already done) - quick=no - if [ ".$opt_C" = .yes ]; then - if [ -r $dst ]; then - if cmp -s $src $dst; then - quick=yes + # Adjust the target file + # (we do chmod last to preserve setuid bits) + if [ ".$opt_s" = .yes ]; then + if [ ".$opt_t" = .yes ]; then + echo "strip $dsttmp" 1>&2 fi + strip $dsttmp || exit $? fi - fi + if [ ".$opt_o" != . ]; then + if [ ".$opt_t" = .yes ]; then + echo "chown $opt_o $dsttmp" 1>&2 + fi + chown $opt_o $dsttmp || exit $? + fi + if [ ".$opt_g" != . ]; then + if [ ".$opt_t" = .yes ]; then + echo "chgrp $opt_g $dsttmp" 1>&2 + fi + chgrp $opt_g $dsttmp || exit $? + fi + if [ ".$opt_m" != . ]; then + if [ ".$opt_t" = .yes ]; then + echo "chmod $opt_m $dsttmp" 1>&2 + fi + chmod $opt_m $dsttmp || exit $? + fi - # Finally install the file to the real destination - if [ $quick = yes ]; then - if [ ".$opt_t" = .yes ]; then - echo "rm -f $dsttmp" 1>&2 + # Determine whether to do a quick install + # (has to be done _after_ the strip was already done) + quick=no + if [ ".$opt_C" = .yes ]; then + if [ -r $dst ]; then + if cmp -s $src $dst; then + quick=yes + fi + fi fi - rm -f $dsttmp - else - if [ ".$opt_t" = .yes ]; then - echo "rm -f $dst && mv $dsttmp $dst" 1>&2 + + # Finally install the file to the real destination + if [ $quick = yes ]; then + if [ ".$opt_t" = .yes ]; then + echo "rm -f $dsttmp" 1>&2 + fi + rm -f $dsttmp + else + if [ ".$opt_t" = .yes ]; then + echo "rm -f $dst && mv $dsttmp $dst" 1>&2 + fi + rm -f $dst && mv $dsttmp $dst fi - rm -f $dst && mv $dsttmp $dst - fi + done ;; mkdir ) ## ## mkdir -- Make one or more directories - ## Copyright (c) 1996-1999 Ralf S. Engelschall + ## Copyright (c) 1996-2000 Ralf S. Engelschall ## Originally written for public domain by Noah Friedman ## Cleaned up and enhanced for shtool ## errstatus=0 for p in ${1+"$@"}; do - # when the directory already exists... + # if the directory already exists... if [ -d "$p" ]; then - if [ ".$opt_f" = .no ]; then - echo "$msgprefix:Error: file exists: $p" 1>&2 + if [ ".$opt_f" = .no ] && [ ".$opt_p" = .no ]; then + echo "$msgprefix:Error: directory already exists: $p" 1>&2 errstatus=1 break else continue fi fi - # when the directory has to be created + # if the directory has to be created... if [ ".$opt_p" = .no ]; then if [ ".$opt_t" = .yes ]; then echo "mkdir $p" 1>&2 @@ -1107,7 +1181,7 @@ -e 's/\// /g' \ -e 's/^%/\//'` shift - pathcomp= + pathcomp='' for d in ${1+"$@"}; do pathcomp="$pathcomp$d" case "$pathcomp" in @@ -1135,7 +1209,7 @@ mkln ) ## ## mkln -- Make link with calculation of relative paths - ## Copyright (c) 1999 Ralf S. Engelschall + ## Copyright (c) 1999-2000 Ralf S. Engelschall ## Originally written for shtool ## @@ -1273,14 +1347,14 @@ mkshadow ) ## - ## mkshadow -- Make a shadow tree - ## Copyright (c) 1998-1999 Ralf S. Engelschall + ## mkshadow -- Make a shadow tree through symbolic links + ## Copyright (c) 1998-2000 Ralf S. Engelschall ## Originally written for Apache ## # source and destination directory - src=`echo "$1" | sed -e 's:/$::'` - dst=`echo "$2" | sed -e 's:/$::'` + src=`echo "$1" | sed -e 's:/$::' -e 's:^\./\(.\):\1:'` + dst=`echo "$2" | sed -e 's:/$::' -e 's:^\./\(.\):\1:'` # check whether source exists if [ ! -d $src ]; then @@ -1301,10 +1375,21 @@ # determine reverse directory for destination directory dstrevdir='' if [ $oneisabs = 0 ]; then - # (inlined fp2rp) + # derive reverse path from forward path + pwd=`pwd` OIFS="$IFS"; IFS='/' for pe in $dst; do - dstrevdir="../$dstrevdir" + if [ "x$pe" = "x.." ]; then + OIFS2="$IFS"; IFS="$DIFS" + eval `echo "$pwd" |\ + sed -e 's:\([^/]*\)$:; dir="\1":' \ + -e 's:^\(.*\)/[^/]*;:pwd="\1";:'\ + -e 's:^;:pwd="";:'` + dstrevdir="$dir/$dstrevdir" + IFS="$OIFS2" + else + dstrevdir="../$dstrevdir" + fi done IFS="$OIFS" else @@ -1355,7 +1440,7 @@ if [ $oneisabs = 0 ]; then if [ ".$dir" != . ]; then subdir=`echo $dir | sed -e 's:/$::'` - # (inlined fp2rp) + # derive reverse path from forward path revdir='' OIFS="$IFS"; IFS='/' for pe in $subdir; do @@ -1380,25 +1465,18 @@ fixperm ) ## ## fixperm -- Fix file permissions inside a source tree - ## Copyright (c) 1996-1999 Ralf S. Engelschall + ## Copyright (c) 1996-2000 Ralf S. Engelschall ## Originally written for ePerl ## paths="$*" # check whether the test command supports the -x option - cat >$tmpfile </dev/null; then + if [ -x /bin/sh ] 2>/dev/null; then minusx="-x" else minusx="-r" fi - rm -f $tmpfile # iterate over paths for p in $paths; do @@ -1443,25 +1521,18 @@ tarball ) ## ## tarball -- Roll distribution tarballs - ## Copyright (c) 1999 Ralf S. Engelschall + ## Copyright (c) 1999-2000 Ralf S. Engelschall ## Originally written for shtool ## srcs="$*" # check whether the test command supports the -x option - cat >$tmpfile </dev/null; then + if [ -x /bin/sh ] 2>/dev/null; then minusx="-x" else minusx="-r" fi - rm -f $tmpfile # find the tools paths="`echo $PATH |\ @@ -1579,14 +1650,14 @@ echo "chown -R $opt_u $tmpdir/$tarname >/dev/null 2>&1" 2>&1 fi chown -R $opt_u $tmpdir/$tarname >/dev/null 2>&1 ||\ - echo "$msgprefix:Warning: cannot set user name \`$opt_u' (need root priviledges)" + echo "$msgprefix:Warning: cannot set user name \`$opt_u' (would require root priviledges)" fi if [ ".$opt_g" != . ]; then if [ ".$opt_t" = .yes ]; then echo "chgrp -R $opt_g $tmpdir/$tarname >/dev/null 2>&1" 2>&1 fi chgrp -R $opt_g $tmpdir/$tarname >/dev/null 2>&1 ||\ - echo "$msgprefix:Warning: cannot set group name \`$opt_g' (need root priviledges)" + echo "$msgprefix:Warning: cannot set group name \`$opt_g' (would require root priviledges)" fi if [ ".$opt_t" = .yes ]; then echo "(cd $tmpdir && $prg_find $tarname -type f -depth -print | sort | xargs $prg_tar cf -) | cat $compress >$tmpfile.out" 1>&2 @@ -1612,13 +1683,13 @@ guessos ) ## - ## guessos -- Simple OS/platform guesser + ## guessos -- Simple operating system guesser ## Copyright (c) 1996-1999 The Apache Group, http://www.apache.org/ ## The Apache license applies (see http://www.apache.org/docs/LICENSE) ## Originally written for Apache ## - MACHINE=`(uname -m) 2>/dev/null` || MACHINE="unknown" + MACHINE=`(uname -m) 2>/dev/null` || MACHINE=`(uname -p) 2>/dev/null` || MACHINE="unknown" RELEASE=`(uname -r) 2>/dev/null` || RELEASE="unknown" SYSTEM=`(uname -s) 2>/dev/null` || SYSTEM="unknown" VERSION=`(uname -v) 2>/dev/null` || VERSION="unknown" @@ -1853,13 +1924,13 @@ esac # Fallback - echo "${MACHINE}-whatever-${SYSTEM}/${RELEASE}/${VERSION}" + echo "${MACHINE}-unknown-${SYSTEM}/${RELEASE}/${VERSION}" ;; arx ) ## ## arx -- Extended archive command - ## Copyright (c) 1999 Ralf S. Engelschall + ## Copyright (c) 1999-2000 Ralf S. Engelschall ## Originally written for shtool ## @@ -1903,7 +1974,7 @@ echo "$msgprefix:Error: member extraction failed for archive: $file" 1>&2 exit 1 fi - for member in - `eval $ar_prg t $file`; do + for member in - `eval $ar_prg t $file | sed -e '/_\.SYMDEF/d'`; do [ ".$member" = .- ] && continue nfiles="$nfiles $tmpdir/$member" done @@ -1937,7 +2008,7 @@ slo ) ## ## slo -- Separate linker options by library class - ## Copyright (c) 1998-1999 Ralf S. Engelschall + ## Copyright (c) 1998-2000 Ralf S. Engelschall ## Originally written for Apache ## @@ -1955,7 +2026,7 @@ opt="${optprev}${opt}"; optprev='' fi - # remember options for arg when used stand-alone + # remember options for arg if used stand-alone if [ ".$opt" = ".-L" -o ".$opt" = ".-l" ]; then optprev="$opt" continue; @@ -2086,15 +2157,15 @@ for var in ARGV DIRS_OBJ LIBS_OBJ DIRS_PIC LIBS_PIC DIRS_DSO LIBS_DSO; do eval "val=\"\$${var}\"" val="`echo $val | sed -e 's/^ *//'`" - echo "SLO_${var}=\"${val}\"" + echo "${opt_p}${var}=\"${val}\"" done ;; scpp ) ## ## scpp -- Sharing C Pre-Processor - ## Copyright (c) 1999 Ralf S. Engelschall - ## Originally written for GNU pth + ## Copyright (c) 1999-2000 Ralf S. Engelschall + ## Originally written for GNU Pth ## srcs="$*" @@ -2129,8 +2200,14 @@ for src in $srcs; do if [ ".$opt_v" = .yes ]; then echo $src | $awk '{ printf(" %s", $0); }' 1>&2 + fi + if [ ".$opt_f" = . ]; then + inputcmd="cat $src" + else + inputcmd="sed $opt_f $src" fi - $awk <$src ' + $inputcmd |\ + $awk ' BEGIN { ln = 0; fln = 0; @@ -2298,142 +2375,98 @@ ;; version ) - ## - ## version -- Generate and maintain a version information file - ## Copyright (c) 1994-1999 Ralf S. Engelschall - ## Originally written for ePerl ## + ## version -- Maintain a version information file + ## Copyright (c) 1994-2000 Ralf S. Engelschall + ## Originally written for ePerl, rewritten from scratch for shtool + ## + + file="$1" + + # determine prefix and name + name="$opt_n" + prefix="$opt_p" + + # determine current version + triple="$opt_s" + if [ ".$triple" != . ]; then + # use given triple + if [ ".`echo $triple | grep '[0-9]*.[0-9]*[sabp.][0-9]*'`" = . ]; then + echo "$msgprefix:Error: invalid argument to option \`-s': \`$opt_s'" 1>&2 + exit 1 + fi + eval `echo $triple |\ + sed -e 's%\([0-9]*\)\.\([0-9]*\)\([sabp.]\)\([0-9]*\).*%\ + ver="\1";rev="\2";typ="\3";lev="\4"%'` + 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 |\ + head -1 | sed -e 's%.*Version \([0-9]*\)\.\([0-9]*\)\([sabp.]\)\([0-9]*\) (\([0-9]*-[a-zA-Z]*-[0-9]*\)).*%\ + ver="\1";rev="\2";typ="\3";lev="\4";tim="\5"%'` + else + # intialise to first version + ver=0 + rev=1 + typ=. + lev=0 + tim=calc + fi - LANGUAGE="$opt_l" - NAME="$opt_n" - PREFIX="$opt_p" - FULLVERSION="$opt_s" - INCREASE="$opt_i" - REPORT="$opt_d" - FILE="$1" - - # determine language - if [ ".$LANGUAGE" = .unknown ]; then - case $FILE in - *.txt ) LANGUAGE=txt ;; - *.c ) LANGUAGE=c ;; - *.pl | *.pm ) LANGUAGE=perl ;; - * ) echo "$tool:Error: unknown language type" 1>&2; exit 1 ;; + # determine new version in batch + if [ ".$opt_i" != . ]; 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 "$msgprefix:Error: invalid argument to option \`-i': \`$opt_i'" 1>&2 + exit 1 + ;; esac + tim=calc fi - # determine prefix from name and vice versa - if [ ".$PREFIX" = . -o ".$PREFIX" = .unknown ]; then - if [ ".$NAME" != . -a ".$NAME" != .unknown ]; then - PREFIX="$NAME" - fi - fi - if [ ".$NAME" = . -o ".$NAME" = .unknown ]; then - if [ ".$PREFIX" != . -a ".$PREFIX" != .unknown ]; then - NAME="$PREFIX" - fi + # determine new version interactively + if [ ".$opt_e" = .yes ]; then + echo "old version: ${ver}.${rev}${typ}${lev}" + while [ 1 ]; do + echo dummy | awk '{ printf("new version: "); }' + read triple + case $triple in + [0-9]*.[0-9]*[sabp.][0-9]* ) + ;; + * ) echo "$msgprefix:Error: invalid version string entered: \`$triple'" 1>&2 + continue + ;; + esac + break + done + eval `echo $triple |\ + sed -e 's%^\([0-9]*\)\.\([0-9]*\)\([sabp.]\)\([0-9]*\)$%\ + ver="\1";rev="\2";typ="\3";lev="\4"%'` + tim=calc fi - - # determine version - date=unknown - version=0 - revision=0 - bplevel=0 - if [ ".$FULLVERSION" = .unknown ]; then - if [ -r "$FILE" ]; then - # grep out current information - id=`grep 'Version [0-9]*.[0-9]*[.abps][0-9]* ([0-9]*-[a-zA-Z]*-[0-9]*)' $FILE | \ - head -1 | \ - sed -e 's%.*Version \([0-9]*\)\.\([0-9]*\)\([.abps]\)\([0-9]*\) (\([0-9]*-[a-zA-Z]*-[0-9]*\)).*%\1:\2:\3:\4:\5%'` - version=`echo $id | awk -F: '{ print $1 }'` - revision=`echo $id | awk -F: '{ print $2 }'` - bptype=`echo $id | awk -F: '{ print $3 }'` - bplevel=`echo $id | awk -F: '{ print $4 }'` - date=`echo $id | awk -F: '{ print $5 }'` - if [ .$REPORT = .NO ]; then - case $INCREASE in - b ) bplevel=`expr $bplevel + 1` - bptype=b - ;; - a ) bplevel=`expr $bplevel + 1` - bptype=a - ;; - s ) bplevel=`expr $bplevel + 1` - bptype=s - ;; - P ) bplevel=`expr $bplevel + 1` - bptype=. - ;; - p ) bplevel=`expr $bplevel + 1` - bptype=p - ;; - r ) revision=`expr $revision + 1` - bptype=. - bplevel=0 - ;; - v ) version=`expr $version + 1` - revision=0 - bptype=. - bplevel=0 - ;; - esac - date=calc - fi - FULLVERSION="$version.$revision$bptype$bplevel" - else - # intialise to first version - version=0 - revision=5 - bptype=b - bplevel=0 - date=calc - fi - else - # take given version - V=`echo $FULLVERSION | sed -e 's%\([0-9]*\)\.\([0-9]*\)\([.abps]\)\([0-9]*\).*%\1:\2:\3:\4%'` - version=`echo $V | awk -F: '{ print $1 }'` - revision=`echo $V | awk -F: '{ print $2 }'` - bptype=`echo $V | awk -F: '{ print $3 }'` - bplevel=`echo $V | awk -F: '{ print $4 }'` - date=calc - fi - - # determine hex value of version - case $FULLVERSION in - *.*a* ) - HEX=`echo "$FULLVERSION" | sed -e 's/a.*//' | awk -F. '{ printf("%d%02d", $1, $2); }' && - echo "$FULLVERSION" | sed -e 's/.*a//' | awk '{ printf("0%02d", $1); }'` - ;; - *.*b* ) - HEX=`echo "$FULLVERSION" | sed -e 's/b.*//' | awk -F. '{ printf("%d%02d", $1, $2); }' && - echo "$FULLVERSION" | sed -e 's/.*b//' | awk '{ printf("1%02d", $1); }'` - ;; - *.*.* ) - HEX=`echo "$FULLVERSION" | awk -F. '{ printf("%d%02d2%02d", $1, $2, $3); }'` - ;; - esac - # determine libtool version - case $FULLVERSION in - *.*a* ) - LTV=`echo "$FULLVERSION" | sed -e 's/a.*//' | awk -F. '{ printf("%d:0", $1*10+$2); }'` - ;; - *.*b* ) - LTV=`echo "$FULLVERSION" | sed -e 's/b.*//' | awk -F. '{ printf("%d:0", $1*10+$2); }'` - ;; - *.*.* ) - LTV=`echo "$FULLVERSION" | awk -F. '{ printf("%d:%d", $1*10+$2, $3); }'` - ;; + # 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 - - # determine string out of filename - # (don't try to optimize this in any way - portability!) - FILESTR=`echo "$FILE" |\ - tr 'abcdefghijklmnopqrstuvwxyz./%+' \ - 'ABCDEFGHIJKLMNOPQRSTUVWXYZ____' | sed -e 's/-/_/g'` + hex=`echo "$ver:$rev:$typnum:$levnum" |\ + awk -F: '{ printf("0x%X%02X%1X%02X", $1, $2, $3, $4); }'` + ltv=`echo "$ver:$rev:$typnum:$levnum" |\ + awk -F: '{ printf("%d:%d", $1*10 + $2, $3*10 + $4); }'` # determine date - if [ ".$date" = .calc ]; then + if [ ".$tim" = .calc ]; then day=`date '+%d'` month=`date '+%m'` year=`date '+%Y' 2>/dev/null` @@ -2458,135 +2491,164 @@ 11) month='Nov' ;; 12) month='Dec' ;; esac - date="${day}-${month}-${year}" + tim="${day}-${month}-${year}" fi - if [ .$REPORT != .NO ]; then - case $REPORT in - long ) - echo "$version.$revision$bptype$bplevel ($date)" - ;; + # perform result actions + mode=show + if [ ".$opt_i" != . ]; then + mode=edit + elif [ ".$opt_e" = .yes ]; then + mode=edit + elif [ ".$opt_s" != . ]; then + mode=edit + fi + if [ ".$mode" = .show ]; then + # just display the current version + case $opt_d in short ) - echo "$version.$revision$bptype$bplevel" + echo "${ver}.${rev}${typ}${lev}" + ;; + long ) + echo "${ver}.${rev}${typ}${lev} ($tim)" ;; libtool ) - echo "$LTV" + echo "${ltv}" ;; hex ) - echo "0x$HEX" + echo "${hex}" + ;; + * ) echo "$msgprefix:Error: invalid argument to option \`-d': \`$opt_d'" 1>&2 + exit 1 ;; esac - rm -f $tmpfile >/dev/null 2>&1 - exit 0 - fi + else + # update the version file - # create the version file according the the selected language - echo "new version: $version.$revision$bptype$bplevel ($date)" - case $LANGUAGE in - txt ) - cat >$tmpfile <<'EOT' - - This is @NAME@, Version @VERSION@.@REVISION@@BPTYPE@@BPLEVEL@ (@DAY@-@MONTH@-@YEAR@) -EOT - ;; - c ) - cat >$tmpfile <<'EOT' -/* -** @FILE@ -- Version Information -** [automatically generated and maintained by shtool] -*/ - -#ifdef _AS_HEADER - -#ifndef _@FILESTR@ -#define _@FILESTR@ -#define @PREFIX@_VERSION 0x@HEX@ -extern const int @PREFIX@_Version; -extern const char @PREFIX@_VersionStr[]; -extern const char @PREFIX@_Hello[]; -extern const char @PREFIX@_GNUVersion[]; -extern const char @PREFIX@_WhatID[]; -extern const char @PREFIX@_RCSIdentID[]; -extern const char @PREFIX@_WebID[]; -extern const char @PREFIX@_PlainID[]; -#endif /* _@FILESTR@ */ - -#else - -const int @PREFIX@_Version = 0x@HEX@; -const char @PREFIX@_VersionStr[] = "@VERSION@.@REVISION@@BPTYPE@@BPLEVEL@ (@DAY@-@MONTH@-@YEAR@)"; -const char @PREFIX@_Hello[] = "This is @NAME@, Version @VERSION@.@REVISION@@BPTYPE@@BPLEVEL@ (@DAY@-@MONTH@-@YEAR@)"; -const char @PREFIX@_GNUVersion[] = "@NAME@ Version @VERSION@.@REVISION@@BPTYPE@@BPLEVEL@"; -const char @PREFIX@_WhatID[] = "@(#)@NAME@ Version @VERSION@.@REVISION@@BPTYPE@@BPLEVEL@ (@DAY@-@MONTH@-@YEAR@)"; -const char @PREFIX@_RCSIdentID[] = "$Id: shtool,v 1.2 1999/11/12 14:42:21 rse Exp $"; -const char @PREFIX@_WebID[] = "@NAME@/@VERSION@.@REVISION@@BPTYPE@@BPLEVEL@"; -const char @PREFIX@_PlainID[] = "@VERSION@.@REVISION@@BPTYPE@@BPLEVEL@"; - -#endif -EOT - ;; - perl ) - cat >$tmpfile <<'EOT' -## -## @FILE@ -- Version Information -## [automatically generated and maintained by shtool] -## - -$@PREFIX@_Version = 0x@HEX@; -$@PREFIX@_VersionStr = "@VERSION@.@REVISION@@BPTYPE@@BPLEVEL@ (@DAY@-@MONTH@-@YEAR@)"; -$@PREFIX@_Hello = "This is @NAME@, Version @VERSION@.@REVISION@@BPTYPE@@BPLEVEL@ (@DAY@-@MONTH@-@YEAR@)"; -$@PREFIX@_GNUVersion = "@NAME@ Version @VERSION@.@REVISION@@BPTYPE@@BPLEVEL@"; -$@PREFIX@_WhatID = "@(#)@NAME@ Version @VERSION@.@REVISION@@BPTYPE@@BPLEVEL@ (@DAY@-@MONTH@-@YEAR@)"; -$@PREFIX@_RCSIdentID = "\$Id: shtool,v 1.2 1999/11/12 14:42:21 rse Exp $/"; -$@PREFIX@_WebID = "@NAME@/@VERSION@.@REVISION@@BPTYPE@@BPLEVEL@"; -$@PREFIX@_PlainID = "@VERSION@.@REVISION@@BPTYPE@@BPLEVEL@"; - -1; -EOT - ;; - esac - - # now create the version file - rm -f $FILE >/dev/null 2>&1 - sed \ - -e "s|@FILE@|$FILE|g" \ - -e "s|@FILESTR@|$FILESTR|g" \ - -e "s|@PREFIX@|$PREFIX|g" \ - -e "s|@NAME@|$NAME|g" \ - -e "s|@HEX@|$HEX|g" \ - -e "s|@VERSION@|$version|g" \ - -e "s|@REVISION@|$revision|g" \ - -e "s|@BPTYPE@|$bptype|g" \ - -e "s|@BPLEVEL@|$bplevel|g" \ - -e "s|@YEAR@|$year|g" \ - -e "s|@MONTH@|$month|g" \ - -e "s|@DAY@|$day|g" <$tmpfile >$FILE - rm -f $tmpfile >/dev/null 2>&1 - exit 0 + # pre-generate various strings + triple="${ver}.${rev}${typ}${lev}" + vHex="$hex" + vShort="${triple}" + vLong="${triple} (${tim})" + vTeX="This is ${name}, Version ${triple} (${tim})" + vGNU="${name} ${triple} (${tim})" + vWeb="${name}/${triple}" + vSCCS="@(#)${name} ${triple} (${tim})" + vRCS="\$Id: shtool,v 1.3 2000/07/03 14:15:16 rse Exp ${name} ${triple} (${tim}) \$" + + # determine string out of filename + # (do NOT try to optimize this in any way because of portability) + filestr=`echo $file |\ + tr 'abcdefghijklmnopqrstuvwxyz./%+' \ + 'ABCDEFGHIJKLMNOPQRSTUVWXYZ____' | sed -e 's/-/_/g'` + + # generate uppercase prefix + prefixupper=`echo $prefix |\ + tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + + # create the version file according the the selected language + echo "new version: ${vLong}" + + cp /dev/null $file + case $opt_l in + txt ) + echo >>$file "" + echo >>$file " ${file} -- Version Information for ${name} (syntax: Text)" + echo >>$file " [automatically generated and maintained by GNU shtool]" + echo >>$file "" + echo >>$file " $vTeX" + echo >>$file "" + ;; + c ) + echo >>$file "/*" + echo >>$file "** ${file} -- Version Information for ${name} (syntax: C/C++)" + echo >>$file "** [automatically generated and maintained by GNU shtool]" + echo >>$file "*/" + echo >>$file "" + echo >>$file "#ifdef _${filestr}_AS_HEADER_" + echo >>$file "" + echo >>$file "#ifndef _${filestr}_" + echo >>$file "#define _${filestr}_" + echo >>$file "" + echo >>$file "#define ${prefixupper}VERSION ${vHex}" + echo >>$file "" + echo >>$file "typedef struct {" + echo >>$file " const int v_hex;" + echo >>$file " const char *v_short;" + echo >>$file " const char *v_long;" + echo >>$file " const char *v_tex;" + echo >>$file " const char *v_gnu;" + echo >>$file " const char *v_web;" + echo >>$file " const char *v_sccs;" + echo >>$file " const char *v_rcs;" + echo >>$file "} ${prefix}version_t;" + echo >>$file "" + echo >>$file "extern ${prefix}version_t ${prefix}version;" + echo >>$file "" + echo >>$file "#endif /* _${filestr}_ */" + echo >>$file "" + echo >>$file "#else /* _${filestr}_AS_HEADER_ */" + echo >>$file "" + echo >>$file "#define _${filestr}_AS_HEADER_" + echo >>$file "#include \"${file}\"" + echo >>$file "#undef _${filestr}_AS_HEADER_" + echo >>$file "" + echo >>$file "${prefix}version_t ${prefix}version = {" + echo >>$file " ${vHex}," + echo >>$file " \"${vShort}\"," + echo >>$file " \"${vLong}\"," + echo >>$file " \"${vTeX}\"," + echo >>$file " \"${vGNU}\"," + echo >>$file " \"${vWeb}\"," + echo >>$file " \"${vSCCS}\"," + echo >>$file " \"${vRCS}\"" + echo >>$file "};" + echo >>$file "" + echo >>$file "#endif /* _${filestr}_AS_HEADER_ */" + echo >>$file "" + ;; + perl ) + echo >>$file "##" + echo >>$file "## ${file} -- Version Information for ${name} (syntax: Perl)" + echo >>$file "## [automatically generated and maintained by GNU shtool]" + echo >>$file "##" + echo >>$file "" + echo >>$file "my \$${prefix}version = {" + echo >>$file " 'v_hex' => ${vHex}," + echo >>$file " 'v_short' => \"${vShort}\"," + echo >>$file " 'v_long' => \"${vLong}\"," + echo >>$file " 'v_tex' => \"${vTeX}\"," + echo >>$file " 'v_gnu' => \"${vGNU}\"," + echo >>$file " 'v_web' => \"${vWeb}\"," + echo >>$file " 'v_sccs' => \"${vSCCS}\"," + echo >>$file " 'v_rcs' => \"\\${vRCS}/\"" + echo >>$file "};" + echo >>$file "" + echo >>$file "1;" + echo >>$file "" + ;; + * ) echo "$msgprefix:Error: invalid argument to option \`-l': \`$opt_l'" 1>&2 + exit 1 + ;; + esac + fi ;; path ) ## ## path -- Deal with program paths - ## Copyright (c) 1998-1999 Ralf S. Engelschall + ## Copyright (c) 1998-2000 Ralf S. Engelschall ## Originally written for Apache ## namelist="$*" # check whether the test command supports the -x option - cat >$tmpfile </dev/null; then + if [ -x /bin/sh ] 2>/dev/null; then minusx="-x" else minusx="-r" fi - rm -f $tmpfile # split path string paths="`echo $opt_p |\ @@ -2628,25 +2690,24 @@ if [ ".$opt_m" = .yes ] && [ ".$namelist" = .perl ]; then rm -f $tmpfile touch $tmpfile - c=0 found=0 + pc=99 for dir in $paths; do dir=`echo $dir | sed -e 's;/*$;;'` - for perl in perl5 perl miniperl; do - if [ $minusx "$dir/$perl" ] && [ ! -d "$dir/$perl" ]; then - perl="$dir/$perl" - version=`$perl -v | grep version |\ - sed -e 's/.* version //' -e 's/ built.*//' -e 's/ with.*//'` - versionnum="`echo $version | sed -e 's/\.//g' -e 's/_//g'`" - versionnum=`expr $versionnum - $c` - echo "$versionnum $perl" >>$tmpfile + nc=99 + for name in perl perl5 miniperl; do + if [ $minusx "$dir/$name" ] && [ ! -d "$dir/$name" ]; then + perl="$dir/$name" + pv=`$perl -e 'printf("%.3f", $]);'` + echo "$pv:$pc:$nc:$perl" >>$tmpfile found=1 fi + nc=`expr $nc - 1` done - c=`expr $c + 1` + pc=`expr $pc - 1` done if [ $found = 1 ]; then - perl="`cat $tmpfile | sort -u | tail -1 | cut '-d ' -f2`" + perl="`cat $tmpfile | sort -u | tail -1 | cut -d: -f4`" rm -f $tmpfile echo "$perl" exit 0 @@ -2657,10 +2718,8 @@ # MAGIC SITUATION # C pre-processor (cpp) if [ ".$opt_m" = .yes ] && [ ".$namelist" = .cpp ]; then - cat >$tmpfile.c < - Syntax Error -EOT + echo >$tmpfile.c "#include " + echo >>$tmpfile.c "Syntax Error" # 1. try the standard cc -E approach cpp="${CC-cc} -E" (eval "$cpp $tmpfile.c >/dev/null") 2>$tmpfile.out @@ -2705,7 +2764,7 @@ path=`echo $path | sed -e 's;/*$;;'` if [ $minusx "$path/$name" ] && [ ! -d "$path/$name" ]; then if [ ".$opt_s" != .yes ]; then - echo "$path/$name" 2>&1 + echo "$path/$name" fi exit 0 fi --QN8DD4WCIA4DI16JQSKU-- From ossp-cvs-owner@ossp.org Thu Jul 6 21:14:41 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e66JEeU08310; Thu, 6 Jul 2000 21:14:40 +0200 (CEST) Date: Thu, 6 Jul 2000 21:14:40 +0200 (CEST) Message-Id: <200007061914.e66JEeU08310@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/cvs .cvsignore COPYING COPYING.LIB ChangeLog.zoo ... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 06-Jul-2000 21:14:40 Branch: vendor Handle: 19700101010000962907078 Modified files: (Branch: vendor) ossp-pkg/cvs NEWS ossp-pkg/cvs/doc FAQ cvs.texinfo ossp-pkg/cvs/lib getline.c getline.h ossp-pkg/cvs/src admin.c client.c fileattr.c main.c myndbm.c patch.c rcs.c sanity.sh server.c Touched files: (Branch: vendor) ossp-pkg/cvs .cvsignore COPYING COPYING.LIB ChangeLog.zoo INSTALL Makefile.in README acconfig.h config.h.in configure configure.in ossp-pkg/cvs/diff .cvsignore Makefile.in analyze.c cmpbuf.c cmpbuf.h context.c diagmeet.note diff.c diff.h diff3.c diffrun.h dir.c ed.c ifdef.c io.c normal.c side.c system.h util.c version.c ossp-pkg/cvs/doc .cvsignore HACKING Makefile.in RCSFILES TESTS TODO cvs-paper.ms cvsclient.texi ossp-pkg/cvs/lib .cvsignore Makefile.in argmatch.c dup2.c fncase.c fnmatch.c fnmatch.h ftruncate.c getdate.c getdate.y getopt.c getopt.h getopt1.c hostname.c md5.c md5.h memmove.c mkdir.c regex.c regex.h rename.c savecwd.c savecwd.h sighandle.c strerror.c stripslash.c strstr.c strtoul.c system.h valloc.c wait.h waitpid.c xgetwd.c yesno.c ossp-pkg/cvs/man .cvsignore Makefile.in cvs.1 cvs.5 ossp-pkg/cvs/src .cvsignore Makefile.in add.c buffer.c buffer.h checkin.c checkout.c classify.c client.h commit.c create_adm.c cvs.h cvsrc.c diff.c edit.c edit.h entries.c error.c error.h expand_path.c fileattr.h filesubr.c find_names.c hardlink.c hardlink.h hash.c hash.h history.c ignore.c import.c lock.c log.c login.c logmsg.c mkmodules.c modules.c myndbm.h no_diff.c options.h.in parseinfo.c rcs.h rcscmds.c recurse.c release.c remove.c repos.c root.c rtag.c run.c scramble.c server.h status.c subr.c tag.c update.c update.h vers_ts.c version.c watch.c watch.h wrapper.c zlib.c ossp-pkg/cvs/zlib .cvsignore Makefile.in README adler32.c algorithm.doc compress.c crc32.c deflate.c deflate.h gzio.c infblock.c infblock.h infcodes.c infcodes.h inffast.c inffast.h inflate.c inftrees.c inftrees.h infutil.c infutil.h trees.c uncompr.c zconf.h zlib.h zutil.c zutil.h Log: Import of vendor CVS version, snapshot 20000706 [Release Tags: CVS_20000706] Summary: Revision Changes Path 1.1.1.4 +2 -0 ossp-pkg/cvs/NEWS 1.1.1.2 +0 -0 ossp-pkg/cvs/doc/FAQ 1.1.1.6 +0 -0 ossp-pkg/cvs/doc/cvs.texinfo 1.1.1.2 +0 -0 ossp-pkg/cvs/lib/getline.c 1.1.1.2 +0 -0 ossp-pkg/cvs/lib/getline.h 1.1.1.3 +0 -0 ossp-pkg/cvs/src/admin.c 1.1.1.8 +0 -0 ossp-pkg/cvs/src/client.c 1.1.1.3 +0 -0 ossp-pkg/cvs/src/fileattr.c 1.1.1.6 +0 -0 ossp-pkg/cvs/src/main.c 1.1.1.2 +0 -0 ossp-pkg/cvs/src/myndbm.c 1.1.1.4 +0 -0 ossp-pkg/cvs/src/patch.c 1.1.1.10 +0 -0 ossp-pkg/cvs/src/rcs.c 1.1.1.9 +0 -0 ossp-pkg/cvs/src/sanity.sh 1.1.1.12 +0 -0 ossp-pkg/cvs/src/server.c ____________________________________________________________________________ http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/cvs/NEWS?cvsroot=ossp&r1=1.1.1.3&r2=1.1.1.4 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/cvs/doc/FAQ?cvsroot=ossp&r1=1.1.1.1&r2=1.1.1.2 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/cvs/doc/cvs.texinfo?cvsroot=ossp&r1=1.1.1.5&r2=1.1.1.6 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/cvs/lib/getline.c?cvsroot=ossp&r1=1.1.1.1&r2=1.1.1.2 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/cvs/lib/getline.h?cvsroot=ossp&r1=1.1.1.1&r2=1.1.1.2 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/cvs/src/admin.c?cvsroot=ossp&r1=1.1.1.2&r2=1.1.1.3 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/cvs/src/client.c?cvsroot=ossp&r1=1.1.1.7&r2=1.1.1.8 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/cvs/src/fileattr.c?cvsroot=ossp&r1=1.1.1.2&r2=1.1.1.3 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/cvs/src/main.c?cvsroot=ossp&r1=1.1.1.5&r2=1.1.1.6 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/cvs/src/myndbm.c?cvsroot=ossp&r1=1.1.1.1&r2=1.1.1.2 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/cvs/src/patch.c?cvsroot=ossp&r1=1.1.1.3&r2=1.1.1.4 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/cvs/src/rcs.c?cvsroot=ossp&r1=1.1.1.9&r2=1.1.1.10 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/cvs/src/sanity.sh?cvsroot=ossp&r1=1.1.1.8&r2=1.1.1.9 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/cvs/src/server.c?cvsroot=ossp&r1=1.1.1.11&r2=1.1.1.12 From ossp-cvs-owner@ossp.org Thu Jul 6 21:34:03 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e66JY2R09738; Thu, 6 Jul 2000 21:34:02 +0200 (CEST) Date: Thu, 6 Jul 2000 21:34:02 +0200 (CEST) Message-Id: <200007061934.e66JY2R09738@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="E768A9JOZA8F34KZ7GX5" Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/cvs/src admin.c client.c main.c patch.c rcs.c san... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list This is a multi-part message in MIME format. --E768A9JOZA8F34KZ7GX5 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: commit summary Content-Disposition: inline OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 06-Jul-2000 21:34:02 Branch: HEAD Handle: 2000070620335900 Modified files: ossp-pkg/cvs/src admin.c client.c main.c patch.c rcs.c sanity.sh server.c Log: Merge in conflicts Summary: Revision Changes Path 1.6 +29 -23 ossp-pkg/cvs/src/admin.c 1.9 +2 -0 ossp-pkg/cvs/src/client.c 1.19 +8 -5 ossp-pkg/cvs/src/main.c 1.4 +3 -0 ossp-pkg/cvs/src/patch.c 1.13 +3 -0 ossp-pkg/cvs/src/rcs.c 1.6 +108 -155 ossp-pkg/cvs/src/sanity.sh 1.25 +8 -5 ossp-pkg/cvs/src/server.c ____________________________________________________________________________ --E768A9JOZA8F34KZ7GX5 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/cvs/src/admin.c Content-Disposition: attachment Index: ossp-pkg/cvs/src/admin.c ============================================================ $ cvs diff -u -r1.5 -r1.6 admin.c --- ossp-pkg/cvs/src/admin.c 2000/06/14 07:18:45 1.5 +++ ossp-pkg/cvs/src/admin.c 2000/07/06 19:33:59 1.6 @@ -53,9 +53,7 @@ /* Keyword substitution mode (-k), e.g. "-kb". */ char *kflag; - /* Description (-t). See sanity.sh for various moanings about - files and stdin and such. "" if -t specified without an - argument. It is "-t" followed by the argument. */ + /* Description (-t). */ char *desc; /* Interactive (-I). Problematic with client/server. */ @@ -437,13 +435,15 @@ error (0, 0, "duplicate 't' option"); goto usage_error; } - if (optarg == NULL) - admin_data.desc = xstrdup ("-t"); + if (optarg != NULL && optarg[0] == '-') + admin_data.desc = xstrdup (optarg + 1); else { - admin_data.desc = xmalloc (strlen (optarg) + 5); - strcpy (admin_data.desc, "-t"); - strcat (admin_data.desc, optarg); + size_t bufsize = 0; + size_t len; + + get_file (optarg, optarg, "r", &admin_data.desc, + &bufsize, &len); } break; @@ -567,7 +567,26 @@ if (admin_data.delete_revs != NULL) send_arg (admin_data.delete_revs); if (admin_data.desc != NULL) - send_arg (admin_data.desc); + { + char *p = admin_data.desc; + send_to_server ("Argument -t-", 0); + while (*p) + { + if (*p == '\n') + { + send_to_server ("\012Argumentx ", 0); + ++p; + } + else + { + char *q = strchr (p, '\n'); + if (q == NULL) q = p + strlen (p); + send_to_server (p, q - p); + p = q; + } + } + send_to_server ("\012", 1); + } if (admin_data.quiet) send_arg ("-q"); if (admin_data.kflag != NULL) @@ -762,20 +781,7 @@ if (admin_data->desc != NULL) { free (rcs->desc); - rcs->desc = NULL; - if (admin_data->desc[2] == '-') - rcs->desc = xstrdup (admin_data->desc + 3); - else - { - char *descfile = admin_data->desc + 2; - size_t bufsize = 0; - size_t len; - - /* If -t specified with no argument, read from stdin. */ - if (*descfile == '\0') - descfile = NULL; - get_file (descfile, descfile, "r", &rcs->desc, &bufsize, &len); - } + rcs->desc = xstrdup (admin_data->desc); } if (admin_data->kflag != NULL) { --E768A9JOZA8F34KZ7GX5 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/cvs/src/client.c Content-Disposition: attachment Index: ossp-pkg/cvs/src/client.c ============================================================ $ cvs diff -u -r1.8 -r1.9 client.c --- ossp-pkg/cvs/src/client.c 2000/07/01 13:12:53 1.8 +++ ossp-pkg/cvs/src/client.c 2000/07/06 19:33:59 1.9 @@ -1,3 +1,5 @@ +/* JT thinks BeOS is worth the trouble. */ + /* CVS client-related stuff. This program is free software; you can redistribute it and/or modify --E768A9JOZA8F34KZ7GX5 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/cvs/src/main.c Content-Disposition: attachment Index: ossp-pkg/cvs/src/main.c ============================================================ $ cvs diff -u -r1.18 -r1.19 main.c --- ossp-pkg/cvs/src/main.c 2000/06/22 13:53:36 1.18 +++ ossp-pkg/cvs/src/main.c 2000/07/06 19:33:59 1.19 @@ -469,6 +469,11 @@ switch (sig) { +#ifdef SIGABRT + case SIGABRT: + name = "abort"; + break; +#endif #ifdef SIGHUP case SIGHUP: name = "hangup"; @@ -1122,25 +1127,23 @@ #ifndef DONT_USE_SIGNALS /* make sure we clean up on error */ +#ifdef SIGABRT + (void) SIG_register (SIGABRT, main_cleanup); +#endif #ifdef SIGHUP (void) SIG_register (SIGHUP, main_cleanup); - (void) SIG_register (SIGHUP, Lock_Cleanup); #endif #ifdef SIGINT (void) SIG_register (SIGINT, main_cleanup); - (void) SIG_register (SIGINT, Lock_Cleanup); #endif #ifdef SIGQUIT (void) SIG_register (SIGQUIT, main_cleanup); - (void) SIG_register (SIGQUIT, Lock_Cleanup); #endif #ifdef SIGPIPE (void) SIG_register (SIGPIPE, main_cleanup); - (void) SIG_register (SIGPIPE, Lock_Cleanup); #endif #ifdef SIGTERM (void) SIG_register (SIGTERM, main_cleanup); - (void) SIG_register (SIGTERM, Lock_Cleanup); #endif #endif /* !DONT_USE_SIGNALS */ --E768A9JOZA8F34KZ7GX5 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/cvs/src/patch.c Content-Disposition: attachment Index: ossp-pkg/cvs/src/patch.c ============================================================ $ cvs diff -u -r1.3 -r1.4 patch.c --- ossp-pkg/cvs/src/patch.c 2000/06/15 06:44:45 1.3 +++ ossp-pkg/cvs/src/patch.c 2000/07/06 19:33:59 1.4 @@ -230,6 +230,9 @@ #endif /* clean up if we get a signal */ +#ifdef SIGABRT + (void) SIG_register (SIGABRT, patch_cleanup); +#endif #ifdef SIGHUP (void) SIG_register (SIGHUP, patch_cleanup); #endif --E768A9JOZA8F34KZ7GX5 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/cvs/src/rcs.c Content-Disposition: attachment Index: ossp-pkg/cvs/src/rcs.c ============================================================ $ cvs diff -u -r1.12 -r1.13 rcs.c --- ossp-pkg/cvs/src/rcs.c 2000/07/01 13:12:53 1.12 +++ ossp-pkg/cvs/src/rcs.c 2000/07/06 19:33:59 1.13 @@ -8210,6 +8210,9 @@ { first_call = 0; /* clean up if we get a signal */ +#ifdef SIGABRT + (void) SIG_register (SIGABRT, rcs_cleanup); +#endif #ifdef SIGHUP (void) SIG_register (SIGHUP, rcs_cleanup); #endif --E768A9JOZA8F34KZ7GX5 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/cvs/src/sanity.sh Content-Disposition: attachment Index: ossp-pkg/cvs/src/sanity.sh ============================================================ $ cvs diff -u -r1.5 -r1.6 sanity.sh --- ossp-pkg/cvs/src/sanity.sh 2000/06/22 16:27:41 1.5 +++ ossp-pkg/cvs/src/sanity.sh 2000/07/06 19:33:59 1.6 @@ -7100,76 +7100,88 @@ mkdir 1 cd 1 - if ${testcvs} -q co first-dir; then - pass 143 - else - fail 143 - fi + dotest modules-143 "${testcvs} -q co first-dir" "" cd first-dir mkdir subdir - ${testcvs} add subdir >>${LOGFILE} - cd subdir + dotest modules-143a "${testcvs} add subdir" \ +"Directory ${TESTDIR}/cvsroot/first-dir/subdir added to the repository" + cd subdir mkdir ssdir - ${testcvs} add ssdir >>${LOGFILE} + dotest modules-143b "${testcvs} add ssdir" \ +"Directory ${TESTDIR}/cvsroot/first-dir/subdir/ssdir added to the repository" touch a b - if ${testcvs} add a b 2>>${LOGFILE} ; then - pass 144 - else - fail 144 - fi + dotest modules-144 "${testcvs} add a b" \ +"${PROG} [a-z]*: scheduling file .a. for addition +${PROG} [a-z]*: scheduling file .b. for addition +${PROG} [a-z]*: use .${PROG} commit. to add these files permanently" - if ${testcvs} ci -m added >>${LOGFILE} 2>&1; then - pass 145 - else - fail 145 - fi + dotest modules-145 "${testcvs} ci -m added" \ +"${PROG} [a-z]*: Examining . +${PROG} [a-z]*: Examining ssdir +RCS file: ${TESTDIR}/cvsroot/first-dir/subdir/a,v +done +Checking in a; +${TESTDIR}/cvsroot/first-dir/subdir/a,v <-- a +initial revision: 1\.1 +done +RCS file: ${TESTDIR}/cvsroot/first-dir/subdir/b,v +done +Checking in b; +${TESTDIR}/cvsroot/first-dir/subdir/b,v <-- b +initial revision: 1\.1 +done" cd .. - if ${testcvs} -q co CVSROOT >>${LOGFILE}; then - pass 146 - else - fail 146 - fi + dotest modules-146 "${testcvs} -q co CVSROOT" \ +"U CVSROOT/checkoutlist +U CVSROOT/commitinfo +U CVSROOT/config +U CVSROOT/cvswrappers +U CVSROOT/editinfo +U CVSROOT/loginfo +U CVSROOT/modules +U CVSROOT/notify +U CVSROOT/rcsinfo +U CVSROOT/taginfo +U CVSROOT/verifymsg" # Here we test that CVS can deal with CVSROOT (whose repository # is at top level) in the same directory as subdir (whose repository # is a subdirectory of first-dir). TODO: Might want to check that # files can actually get updated in this state. - if ${testcvs} -q update; then - pass 147 - else - fail 147 - fi + dotest modules-147 "${testcvs} -q update" "" - echo realmodule first-dir/subdir a >CVSROOT/modules - echo dirmodule first-dir/subdir >>CVSROOT/modules - echo namedmodule -d nameddir first-dir/subdir >>CVSROOT/modules - echo aliasmodule -a first-dir/subdir/a >>CVSROOT/modules - echo aliasnested -a first-dir/subdir/ssdir >>CVSROOT/modules - echo topfiles -a first-dir/file1 first-dir/file2 >>CVSROOT/modules - echo world -a . >>CVSROOT/modules - echo statusmod -s Mungeable >>CVSROOT/modules - - # Options must come before arguments. It is possible this should - # be relaxed at some point (though the result would be bizarre for - # -a); for now test the current behavior. - echo bogusalias first-dir/subdir/a -a >>CVSROOT/modules - if ${testcvs} ci -m 'add modules' CVSROOT/modules \ - >>${LOGFILE} 2>&1; then - pass 148 - else - fail 148 - fi + cat >CVSROOT/modules <>${LOGFILE}; then - pass 149a1 - else - fail 149a1 - fi - if test -d realmodule && test -f realmodule/a; then - pass 149a2 - else - fail 149a2 - fi - if test -f realmodule/b; then - fail 149a3 - else - pass 149a3 - fi - if ${testcvs} -q co realmodule; then - pass 149a4 - else - fail 149a4 - fi - if echo "yes" | ${testcvs} release -d realmodule >>${LOGFILE} ; then - pass 149a5 - else - fail 149a5 - fi + dotest modules-149a1 "${testcvs} co realmodule" "U realmodule/a" + dotest modules-149a2 "test -d realmodule && test -f realmodule/a" "" + dotest_fail modules-149a3 "test -f realmodule/b" "" + dotest modules-149a4 "${testcvs} -q co realmodule" "" + dotest modules-149a5 "echo yes | ${testcvs} release -d realmodule" \ +"You have \[0\] altered files in this repository\. +Are you sure you want to release (and delete) directory .realmodule.: " - dotest_fail 149b1 "${testcvs} co realmodule/a" \ + dotest_fail modules-149b1 "${testcvs} co realmodule/a" \ "${PROG}"' [a-z]*: module `realmodule/a'\'' is a request for a file in a module which is not a directory' \ "${PROG}"' [a-z]*: module `realmodule/a'\'' is a request for a file in a module which is not a directory '"${PROG}"' \[[a-z]* aborted\]: cannot expand modules' # Now test the ability to check out a single file from a directory - if ${testcvs} co dirmodule/a >>${LOGFILE}; then - pass 150c - else - fail 150c - fi - if test -d dirmodule && test -f dirmodule/a; then - pass 150d - else - fail 150d - fi - if test -f dirmodule/b; then - fail 150e - else - pass 150e - fi - if echo "yes" | ${testcvs} release -d dirmodule >>${LOGFILE} ; then - pass 150f - else - fail 150f - fi + dotest modules-150c "${testcvs} co dirmodule/a" "U dirmodule/a" + dotest modules-150d "test -d dirmodule && test -f dirmodule/a" "" + dotest_fail modules-150e "test -f dirmodule/b" "" + dotest modules-150f "echo yes | ${testcvs} release -d dirmodule" \ +"You have \[0\] altered files in this repository\. +Are you sure you want to release (and delete) directory .dirmodule.: " # Now test the ability to correctly reject a non-existent filename. # For maximum studliness we would check that an error message is # being output. - if ${testcvs} co dirmodule/nonexist >>${LOGFILE} 2>&1; then - # We accept a zero exit status because it is what CVS does - # (Dec 95). Probably the exit status should be nonzero, - # however. - pass 150g1 - else - pass 150g1 - fi + # We accept a zero exit status because it is what CVS does + # (Dec 95). Probably the exit status should be nonzero, + # however. + dotest modules-150g1 "${testcvs} co dirmodule/nonexist" \ +"${PROG} [a-z]*: warning: new-born dirmodule/nonexist has disappeared" # We tolerate the creation of the dirmodule directory, since that # is what CVS does, not because we view that as preferable to not # creating it. - if test -f dirmodule/a || test -f dirmodule/b; then - fail 150g2 - else - pass 150g2 - fi + dotest_fail modules-150g2 "test -f dirmodule/a || test -f dirmodule/b" "" rm -r dirmodule # Now test that a module using -d checks out to the specified # directory. - dotest 150h1 "${testcvs} -q co namedmodule" 'U nameddir/a + dotest modules-150h1 "${testcvs} -q co namedmodule" \ +'U nameddir/a U nameddir/b' - if test -f nameddir/a && test -f nameddir/b; then - pass 150h2 - else - fail 150h2 - fi + dotest modules-150h2 "test -f nameddir/a && test -f nameddir/b" "" echo add line >>nameddir/a - dotest 150h3 "${testcvs} -q co namedmodule" 'M nameddir/a' + dotest modules-150h3 "${testcvs} -q co namedmodule" 'M nameddir/a' rm nameddir/a - dotest 150h4 "${testcvs} -q co namedmodule" 'U nameddir/a' - if echo "yes" | ${testcvs} release -d nameddir >>${LOGFILE} ; then - pass 150h99 - else - fail 150h99 - fi + dotest modules-150h4 "${testcvs} -q co namedmodule" 'U nameddir/a' + dotest modules-150h99 "echo yes | ${testcvs} release -d nameddir" \ +"You have \[0\] altered files in this repository\. +Are you sure you want to release (and delete) directory .nameddir.: " # Now test that alias modules check out to subdir/a, not # aliasmodule/a. - if ${testcvs} co aliasmodule >>${LOGFILE}; then - pass 151 - else - fail 151 - fi - if test -d aliasmodule; then - fail 152 - else - pass 152 - fi + dotest modules-151 "${testcvs} co aliasmodule" "" + dotest_fail modules-152 "test -d aliasmodule" "" echo abc >>first-dir/subdir/a - dotest 153 "${testcvs} -q co aliasmodule" "M first-dir/subdir/a" + dotest modules-153 "${testcvs} -q co aliasmodule" "M first-dir/subdir/a" cd .. rm -r 1 @@ -13038,18 +12998,13 @@ 1 =============================================================================" - # I believe that in Real Life (TM), this is broken for remote. - # That is, the filename in question must be the filename of a - # file on the server. It only happens to work here because the - # client machine and the server machine are one and the same. echo 'longer description' >${TESTDIR}/descrip echo 'with two lines' >>${TESTDIR}/descrip dotest log2-7 "${testcvs} admin -t${TESTDIR}/descrip file1" \ "RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v done" dotest_fail log2-7a "${testcvs} admin -t${TESTDIR}/nonexist file1" \ -"RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v -${PROG} \[[a-z]* aborted\]: can't stat ${TESTDIR}/nonexist: No such file or directory" +"${PROG} \[[a-z]* aborted\]: can't stat ${TESTDIR}/nonexist: No such file or directory" dotest log2-8 "${testcvs} log -N file1" " RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v Working file: file1 @@ -13068,22 +13023,13 @@ 1 =============================================================================" - # Reading the description from stdin is broken for remote. - # See comments in cvs.texinfo for a few more notes on this. - if test "x$remote" = xno; then + # TODO: `cvs admin -t "my message" file1' is a request to + # read the message from stdin and to operate on two files. + # Should test that there is an error because "my message" + # doesn't exist. - # TODO: `cvs admin -t "my message" file1' is a request to - # read the message from stdin and to operate on two files. - # Should test that there is an error because "my message" - # doesn't exist. - - if echo change from stdin | ${testcvs} admin -t -q file1 - then - pass log2-9 - else - fail log2-9 - fi - dotest log2-10 "${testcvs} log -N file1" " + dotest log2-9 "echo change from stdin | ${testcvs} admin -t -q file1" "" + dotest log2-10 "${testcvs} log -N file1" " RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v Working file: file1 head: 1\.1 @@ -13100,8 +13046,6 @@ 1 =============================================================================" - fi # end of tests skipped for remote - cd .. rm ${TESTDIR}/descrip rm -r first-dir @@ -20196,6 +20140,15 @@ Amquiteunabletocomeupwithinterestingpasswordsanymore END AUTH REQUEST EOF + + # Test protection from D.o.S. attack during pserver auth phase. + # + # The unacceptably long line of 'x's should get cut off + # after PATH_MAX chars -- see calls to getline_safe() in + # server.c -- so even though no newline is ever sent, the + # server should claim a bad protocol start. + dotest_fail pserver-14 "(while true; do echo -n x; done) | ${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \ +"${DOTSTAR} bad auth protocol start: ${DOTSTAR}" # Clean up. echo "# comments only" >config --E768A9JOZA8F34KZ7GX5 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/cvs/src/server.c Content-Disposition: attachment Index: ossp-pkg/cvs/src/server.c ============================================================ $ cvs diff -u -r1.24 -r1.25 server.c --- ossp-pkg/cvs/src/server.c 2000/07/01 13:12:53 1.24 +++ ossp-pkg/cvs/src/server.c 2000/07/06 19:33:59 1.25 @@ -5045,6 +5045,9 @@ } } +#ifdef SIGABRT + (void) SIG_register (SIGABRT, server_cleanup); +#endif #ifdef SIGHUP (void) SIG_register (SIGHUP, server_cleanup); #endif @@ -5655,7 +5658,7 @@ #endif /* Make sure the protocol starts off on the right foot... */ - if (getline (&tmp, &tmp_allocated, stdin) < 0) + if (getline_safe (&tmp, &tmp_allocated, stdin, PATH_MAX) < 0) /* FIXME: what? We could try writing error/eof, but chances are the network connection is dead bidirectionally. log it somewhere? */ @@ -5686,9 +5689,9 @@ /* Get the three important pieces of information in order. */ /* See above comment about error handling. */ - getline (&repository, &repository_allocated, stdin); - getline (&username, &username_allocated, stdin); - getline (&password, &password_allocated, stdin); + getline_safe (&repository, &repository_allocated, stdin, PATH_MAX); + getline_safe (&username, &username_allocated, stdin, PATH_MAX); + getline_safe (&password, &password_allocated, stdin, PATH_MAX); /* Make them pure. */ strip_trailing_newlines (repository); @@ -5701,7 +5704,7 @@ /* ... and make sure the protocol ends on the right foot. */ /* See above comment about error handling. */ - getline (&tmp, &tmp_allocated, stdin); + getline_safe (&tmp, &tmp_allocated, stdin, PATH_MAX); if (strcmp (tmp, verify_and_exit ? "END VERIFICATION REQUEST\n" : "END AUTH REQUEST\n") --E768A9JOZA8F34KZ7GX5-- From ossp-cvs-owner@ossp.org Fri Jul 7 08:18:53 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e676Iqg98734; Fri, 7 Jul 2000 08:18:52 +0200 (CEST) Date: Fri, 7 Jul 2000 08:18:52 +0200 (CEST) Message-Id: <200007070618.e676Iqg98734@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="B2K8VVAV7W939CM1N42H" Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/pcre ChangeLog.OSSP configure ltconfig ltmain.sh ... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list This is a multi-part message in MIME format. --B2K8VVAV7W939CM1N42H Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: commit summary Content-Disposition: inline OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 07-Jul-2000 08:18:51 Branch: HEAD Handle: 2000070707185000 Modified files: ossp-pkg/pcre ChangeLog.OSSP configure ltconfig ltmain.sh shtool Log: *** empty log message *** Summary: Revision Changes Path 1.13 +6 -1 ossp-pkg/pcre/ChangeLog.OSSP 1.8 +1 -1 ossp-pkg/pcre/configure 1.3 +74 -38 ossp-pkg/pcre/ltconfig 1.3 +15 -3 ossp-pkg/pcre/ltmain.sh 1.5 +122 -89 ossp-pkg/pcre/shtool ____________________________________________________________________________ --B2K8VVAV7W939CM1N42H Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/pcre/ChangeLog.OSSP Content-Disposition: attachment Index: ossp-pkg/pcre/ChangeLog.OSSP ============================================================ $ cvs diff -u -r1.12 -r1.13 ChangeLog.OSSP --- ossp-pkg/pcre/ChangeLog.OSSP 2000/05/16 18:48:09 1.12 +++ ossp-pkg/pcre/ChangeLog.OSSP 2000/07/07 06:18:50 1.13 @@ -2,7 +2,12 @@ OSSP ChangeLog for PCRE ======================= - Changes made to OSSP pcre 3.2 (09-Feb-2000 to 16-May-2000): + Changes made to OSSP pcre 3.2-2 (16-May-2000 to 07-Jul-2000): + + *) Upgraded GNU libtool from 1.3.4 to 1.3.5 + *) Upgraded GNU shtool from 1.4.9 to 1.5.0 + + Changes made to OSSP pcre 3.2-1 (09-Feb-2000 to 16-May-2000): *) Merged in changes between PCRE 3.1 to 3.2 *) Upgraded GNU shtool from 1.4.7 to 1.4.9 --B2K8VVAV7W939CM1N42H Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/pcre/configure Content-Disposition: attachment Index: ossp-pkg/pcre/configure ============================================================ $ cvs diff -u -r1.7 -r1.8 configure --- ossp-pkg/pcre/configure 2000/05/16 18:33:29 1.7 +++ ossp-pkg/pcre/configure 2000/07/07 06:18:50 1.8 @@ -1,6 +1,6 @@ #! /bin/sh -# From configure.in Revision: 1.4 +# From configure.in Revision: 1.5 SHTOOL="./shtool" --B2K8VVAV7W939CM1N42H Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/pcre/ltconfig Content-Disposition: attachment Index: ossp-pkg/pcre/ltconfig ============================================================ $ cvs diff -u -r1.2 -r1.3 ltconfig --- ossp-pkg/pcre/ltconfig 2000/02/02 17:22:25 1.2 +++ ossp-pkg/pcre/ltconfig 2000/07/07 06:18:50 1.3 @@ -169,8 +169,8 @@ # Constants: PROGRAM=ltconfig PACKAGE=libtool -VERSION=1.3.4 -TIMESTAMP=" (1.385.2.196 1999/12/07 21:47:57)" +VERSION=1.3.5 +TIMESTAMP=" (1.385.2.206 2000/05/27 11:12:27)" ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' rm="rm -f" @@ -1164,15 +1164,21 @@ # Extract the symbol export list from an `--export-all' def file, # then regenerate the def file from the symbol export list, so that # the compiled dll only exports the symbol export list. + # Be careful not to strip the DATA tag left by newer dlltools. export_symbols_cmds='test -f $objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $objdir/$soname-ltdll.c~ test -f $objdir/$soname-ltdll.$objext || (cd $objdir && $CC -c $soname-ltdll.c)~ $DLLTOOL --export-all --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --output-def $objdir/$soname-def $objdir/$soname-ltdll.$objext $libobjs $convenience~ - sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]* ; *//" < $objdir/$soname-def > $export_symbols' + sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]*//" -e "s/ *;.*$//" < $objdir/$soname-def > $export_symbols' + # If DATA tags from a recent dlltool are present, honour them! archive_expsym_cmds='echo EXPORTS > $objdir/$soname-def~ _lt_hint=1; - for symbol in `cat $export_symbols`; do - echo " \$symbol @ \$_lt_hint ; " >> $objdir/$soname-def; + cat $export_symbols | while read symbol; do + set dummy \$symbol; + case \$# in + 2) echo " \$2 @ \$_lt_hint ; " >> $objdir/$soname-def;; + *) echo " \$2 @ \$_lt_hint \$3 ; " >> $objdir/$soname-def;; + esac; _lt_hint=`expr 1 + \$_lt_hint`; done~ test -f $objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $objdir/$soname-ltdll.c~ @@ -1433,7 +1439,13 @@ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; - + rhapsody*) + archive_cmds='$CC -bundle -undefined suppress -o $lib $libobjs $deplibs $linkopts' + hardcode_libdir_flags_spec='-L$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + sco3.2v5*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' hardcode_shlibpath_var=no @@ -1466,7 +1478,13 @@ ;; sysv4) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $linkopts' + else + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' + fi runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no hardcode_direct=no #Motorola manual says yes, but my tests say they lie @@ -1632,11 +1650,11 @@ main(){nm_test_var='a';nm_test_func();return(0);} EOF - echo "$progname:1635: checking if global_symbol_pipe works" >&5 - if { (eval echo $progname:1636: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.$objext; then + echo "$progname:1653: checking if global_symbol_pipe works" >&5 + if { (eval echo $progname:1654: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.$objext; then # Now try to grab the symbols. nlist=conftest.nm - if { echo "$progname:1639: eval \"$NM conftest.$objext | $global_symbol_pipe > $nlist\"" >&5; eval "$NM conftest.$objext | $global_symbol_pipe > $nlist 2>&5"; } && test -s "$nlist"; then + if { echo "$progname:1657: eval \"$NM conftest.$objext | $global_symbol_pipe > $nlist\"" >&5; eval "$NM conftest.$objext | $global_symbol_pipe > $nlist 2>&5"; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then @@ -1688,7 +1706,7 @@ save_CFLAGS="$CFLAGS" LIBS="conftstm.$objext" CFLAGS="$CFLAGS$no_builtin_flag" - if { (eval echo $progname:1691: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then + if { (eval echo $progname:1709: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then pipe_works=yes else echo "$progname: failed program was:" >&5 @@ -1919,6 +1937,14 @@ soname_spec='${libname}${release}.sl$major' # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' + case "$host_os" in + hpux10.20*) + # TODO: Does this work for hpux-11 too? + deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' + file_magic_cmd=/usr/bin/file + file_magic_test_file=/usr/lib/libc.sl + ;; + esac ;; irix5* | irix6*) @@ -1966,9 +1992,7 @@ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no - deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' - file_magic_cmd=/usr/bin/file - file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` + deplibs_check_method=pass_all if test -f /lib/ld.so.1; then dynamic_linker='GNU ld.so' @@ -2029,6 +2053,14 @@ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; +rhapsody*) + version_type=sunos + library_names_spec='${libname}.so' + soname_spec='${libname}.so' + shlibpath_var=DYLD_LIBRARY_PATH + deplibs_check_method=pass_all + ;; + sco3.2v5*) version_type=osf soname_spec='${libname}${release}.so$major' @@ -2069,6 +2101,10 @@ soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH case "$host_vendor" in + sequent) + file_magic_cmd='/bin/file' + deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' + ;; ncr) deplibs_check_method='pass_all' ;; @@ -2209,7 +2245,7 @@ if eval "test \"`echo '$''{'lt_cv_dlopen'+set}'`\" != set"; then lt_cv_dlopen=no lt_cv_dlopen_libs= echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "$progname:2212: checking for dlopen in -ldl" >&5 +echo "$progname:2248: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2217,7 +2253,7 @@ ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo $progname:2269: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2249,12 +2285,12 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for dlopen""... $ac_c" 1>&6 -echo "$progname:2252: checking for dlopen" >&5 +echo "$progname:2288: checking for dlopen" >&5 if eval "test \"`echo '$''{'ac_cv_func_dlopen'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -2279,7 +2315,7 @@ ; return 0; } EOF -if { (eval echo $progname:2282: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo $progname:2318: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_dlopen=yes" else @@ -2296,7 +2332,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for dld_link in -ldld""... $ac_c" 1>&6 -echo "$progname:2299: checking for dld_link in -ldld" >&5 +echo "$progname:2335: checking for dld_link in -ldld" >&5 ac_lib_var=`echo dld'_'dld_link | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2304,7 +2340,7 @@ ac_save_LIBS="$LIBS" LIBS="-ldld $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo $progname:2356: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2336,12 +2372,12 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for shl_load""... $ac_c" 1>&6 -echo "$progname:2339: checking for shl_load" >&5 +echo "$progname:2375: checking for shl_load" >&5 if eval "test \"`echo '$''{'ac_cv_func_shl_load'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -2366,7 +2402,7 @@ ; return 0; } EOF -if { (eval echo $progname:2369: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo $progname:2405: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_shl_load=yes" else @@ -2384,7 +2420,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6 -echo "$progname:2387: checking for shl_load in -ldld" >&5 +echo "$progname:2423: checking for shl_load in -ldld" >&5 ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2392,7 +2428,7 @@ ac_save_LIBS="$LIBS" LIBS="-ldld $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo $progname:2445: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2449,17 +2485,17 @@ for ac_hdr in dlfcn.h; do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "$progname:2452: checking for $ac_hdr" >&5 +echo "$progname:2488: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int fnord = 0; EOF ac_try="$ac_compile >/dev/null 2>conftest.out" -{ (eval echo $progname:2462: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo $progname:2498: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2487,7 +2523,7 @@ LIBS="$lt_cv_dlopen_libs $LIBS" echo $ac_n "checking whether a program can dlopen itself""... $ac_c" 1>&6 -echo "$progname:2490: checking whether a program can dlopen itself" >&5 +echo "$progname:2526: checking whether a program can dlopen itself" >&5 if test "${lt_cv_dlopen_self+set}" = set; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2495,7 +2531,7 @@ lt_cv_dlopen_self=cross else cat > conftest.c < @@ -2541,7 +2577,7 @@ if(ptr1 || ptr2) { dlclose(self); exit(0); } } exit(1); } EOF -if { (eval echo $progname:2544: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo $progname:2580: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then lt_cv_dlopen_self=yes else @@ -2560,7 +2596,7 @@ if test "$lt_cv_dlopen_self" = yes; then LDFLAGS="$LDFLAGS $link_static_flag" echo $ac_n "checking whether a statically linked program can dlopen itself""... $ac_c" 1>&6 -echo "$progname:2563: checking whether a statically linked program can dlopen itself" >&5 +echo "$progname:2599: checking whether a statically linked program can dlopen itself" >&5 if test "${lt_cv_dlopen_self_static+set}" = set; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2568,7 +2604,7 @@ lt_cv_dlopen_self_static=cross else cat > conftest.c < @@ -2614,7 +2650,7 @@ if(ptr1 || ptr2) { dlclose(self); exit(0); } } exit(1); } EOF -if { (eval echo $progname:2617: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo $progname:2653: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then lt_cv_dlopen_self_static=yes else --B2K8VVAV7W939CM1N42H Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/pcre/ltmain.sh Content-Disposition: attachment Index: ossp-pkg/pcre/ltmain.sh ============================================================ $ cvs diff -u -r1.2 -r1.3 ltmain.sh --- ossp-pkg/pcre/ltmain.sh 2000/02/02 17:22:25 1.2 +++ ossp-pkg/pcre/ltmain.sh 2000/07/07 06:18:50 1.3 @@ -54,8 +54,8 @@ # Constants. PROGRAM=ltmain.sh PACKAGE=libtool -VERSION=1.3.4 -TIMESTAMP=" (1.385.2.196 1999/12/07 21:47:57)" +VERSION=1.3.5 +TIMESTAMP=" (1.385.2.206 2000/05/27 11:12:27)" default_mode= help="Try \`$progname --help' for more information." @@ -1795,6 +1795,10 @@ *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*) # these systems don't actually have a c library (as such)! ;; + *-*-rhapsody*) + # rhapsody is a little odd... + deplibs="$deplibs -framework System" + ;; *) # Add libc to deplibs on all other systems. deplibs="$deplibs -lc" @@ -2927,13 +2931,21 @@ # Run the actual program with our arguments. " case $host in - *-*-cygwin* | *-*-mingw | *-*-os2*) # win32 systems need to use the prog path for dll # lookup to work + *-*-cygwin*) + $echo >> $output "\ + exec \$progdir/\$program \${1+\"\$@\"} +" + ;; + + # Backslashes separate directories on plain windows + *-*-mingw | *-*-os2*) $echo >> $output "\ exec \$progdir\\\\\$program \${1+\"\$@\"} " ;; + *) $echo >> $output "\ # Export the path to the program. --B2K8VVAV7W939CM1N42H Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/pcre/shtool Content-Disposition: attachment Index: ossp-pkg/pcre/shtool ============================================================ $ cvs diff -u -r1.4 -r1.5 shtool --- ossp-pkg/pcre/shtool 2000/05/16 18:47:56 1.4 +++ ossp-pkg/pcre/shtool 2000/07/07 06:18:50 1.5 @@ -6,8 +6,8 @@ ## See http://www.gnu.org/software/shtool/ for more information. ## See ftp://ftp.gnu.org/gnu/shtool/ for latest version. ## -## Version 1.4.9 (16-Apr-2000) -## Ingredients: 6/17 available modules +## Version: 1.5.0 (01-Jul-2000) +## Contents: 6/17 available modules ## ## @@ -55,7 +55,7 @@ ## arx Extended archive command ## slo Separate linker options by library class ## scpp Sharing C Pre-Processor -## version Generate and maintain a version information file +## version Maintain a version information file ## path Deal with program paths ## @@ -65,7 +65,7 @@ exit 1 fi if [ ".$1" = ".-h" -o ".$1" = ".--help" ]; then - echo "This is GNU shtool, version 1.4.9 (16-Apr-2000)" + echo "This is GNU shtool, version 1.5.0 (01-Jul-2000)" echo "Copyright (c) 1994-2000 Ralf S. Engelschall " echo "Report bugs to " echo '' @@ -75,11 +75,12 @@ 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 [] []:' echo ' echo [-n] [-e] [ ...]' echo ' install [-v] [-t] [-c] [-C] [-s] [-m] [-o] [-g]' - echo ' [-e] ' + echo ' [-e] [ ...] ' echo ' mkdir [-t] [-f] [-p] [-m] [ ...]' echo ' fixperm [-v] [-t] [ ...]' echo ' tarball [-t] [-v] [-o ] [-c ] [-d ] [-u' @@ -97,16 +98,20 @@ echo ' slo [-p] -- -L -l [-L -l ...]' echo ' scpp [-v] [-p] [-f] [-o] [-t] [-M]' echo ' [-D] [-C] [ ...]' - echo ' version [-l] [-n] [-p] [-s] [-i]' - echo ' [-d] ' + echo ' version [-l] [-n] [-p] [-s] [-e]' + echo ' [-i] [-d] ' echo ' path [-s] [-r] [-d] [-b] [-m] [-p] [ ...]' echo '' exit 0 fi if [ ".$1" = ".-v" -o ".$1" = ."--version" ]; then - echo "GNU shtool 1.4.9 (16-Apr-2000)" + echo "GNU shtool 1.5.0 (01-Jul-2000)" exit 0 fi +if [ ".$1" = ".-r" -o ".$1" = ."--recreate" ]; then + shtoolize -oshtool echo install mkdir fixperm tarball guessos + exit 0 +fi if [ ".$1" = ".-d" -o ".$1" = ."--debug" ]; then shift set -x @@ -142,8 +147,8 @@ ;; install ) str_tool="install" - str_usage="[-v] [-t] [-c] [-C] [-s] [-m] [-o] [-g] [-e] " - arg_spec="2=" + str_usage="[-v] [-t] [-c] [-C] [-s] [-m] [-o] [-g] [-e] [ ...] " + arg_spec="2+" opt_spec="v.t.c.C.s.m:o:g:e:" opt_v=no opt_t=no @@ -578,105 +583,133 @@ ## Copyright (c) 1997-2000 Ralf S. Engelschall ## Originally written for shtool ## - - src="$1" - dst="$2" - # If destination is a directory, append the input filename - if [ -d $dst ]; then - dst=`echo "$dst" | sed -e 's:/$::'` - dstfile=`echo "$src" | sed -e 's;.*/\([^/]*\)$;\1;'` - dst="$dst/$dstfile" - fi + # determine source(s) and destination + argc=$# + srcs="" + while [ $# -gt 1 ]; do + srcs="$srcs $1" + shift + done + dstpath="$1" - # Add a possible extension to src and dst - if [ ".$opt_e" != . ]; then - src="$src$opt_e" - dst="$dst$opt_e" + # type check for destination + dstisdir=0 + if [ -d $dstpath ]; then + dstpath=`echo "$dstpath" | sed -e 's:/$::'` + dstisdir=1 fi - # Check for correct arguments - if [ ".$src" = ".$dst" ]; then - echo "$msgprefix:Error: source and destination are the same" 1>&2 + # consistency check for destination + if [ $argc -gt 2 -a $dstisdir = 0 ]; then + echo "$msgprefix:Error: multiple sources require destination to be directory" 1>&2 exit 1 fi - # Make a temp file name in the destination directory - dstdir=`echo $dst | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;' -e 's;^$;.;'` - dsttmp="$dstdir/#INST@$$#" + # iterate over all source(s) + for src in $srcs; do + dst=$dstpath - # Verbosity - if [ ".$opt_v" = .yes ]; then - echo "$src -> $dst" 1>&2 - fi + # If destination is a directory, append the input filename + if [ $dstisdir = 1 ]; then + dstfile=`echo "$src" | sed -e 's;.*/\([^/]*\)$;\1;'` + dst="$dst/$dstfile" + fi - # Copy or move the file name to the temp name - # (because we might be not allowed to change the source) - if [ ".$opt_C" = .yes ]; then - opt_c=yes - fi - if [ ".$opt_c" = .yes ]; then - if [ ".$opt_t" = .yes ]; then - echo "cp $src $dsttmp" 1>&2 + # Add a possible extension to src and dst + if [ ".$opt_e" != . ]; then + src="$src$opt_e" + dst="$dst$opt_e" fi - cp $src $dsttmp || exit $? - else - if [ ".$opt_t" = .yes ]; then - echo "mv $src $dsttmp" 1>&2 + + # Check for correct arguments + if [ ".$src" = ".$dst" ]; then + echo "$msgprefix:Warning: source and destination are the same - skipped" 1>&2 + continue fi - mv $src $dsttmp || exit $? - fi + if [ -d "$src" ]; then + echo "$msgprefix:Warning: source \`$src' is a directory - skipped" 1>&2 + continue + fi - # Adjust the target file - # (we do chmod last to preserve setuid bits) - if [ ".$opt_s" = .yes ]; then - if [ ".$opt_t" = .yes ]; then - echo "strip $dsttmp" 1>&2 + # Make a temp file name in the destination directory + dsttmp=`echo $dst |\ + sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;' -e 's;^$;.;' \ + -e "s;\$;/#INST@$$#;"` + + # Verbosity + if [ ".$opt_v" = .yes ]; then + echo "$src -> $dst" 1>&2 + fi + + # Copy or move the file name to the temp name + # (because we might be not allowed to change the source) + if [ ".$opt_C" = .yes ]; then + opt_c=yes + fi + if [ ".$opt_c" = .yes ]; then + if [ ".$opt_t" = .yes ]; then + echo "cp $src $dsttmp" 1>&2 + fi + cp $src $dsttmp || exit $? + else + if [ ".$opt_t" = .yes ]; then + echo "mv $src $dsttmp" 1>&2 + fi + mv $src $dsttmp || exit $? fi - strip $dsttmp || exit $? - fi - if [ ".$opt_o" != . ]; then - if [ ".$opt_t" = .yes ]; then - echo "chown $opt_o $dsttmp" 1>&2 + + # Adjust the target file + # (we do chmod last to preserve setuid bits) + if [ ".$opt_s" = .yes ]; then + if [ ".$opt_t" = .yes ]; then + echo "strip $dsttmp" 1>&2 + fi + strip $dsttmp || exit $? fi - chown $opt_o $dsttmp || exit $? - fi - if [ ".$opt_g" != . ]; then - if [ ".$opt_t" = .yes ]; then - echo "chgrp $opt_g $dsttmp" 1>&2 + if [ ".$opt_o" != . ]; then + if [ ".$opt_t" = .yes ]; then + echo "chown $opt_o $dsttmp" 1>&2 + fi + chown $opt_o $dsttmp || exit $? fi - chgrp $opt_g $dsttmp || exit $? - fi - if [ ".$opt_m" != . ]; then - if [ ".$opt_t" = .yes ]; then - echo "chmod $opt_m $dsttmp" 1>&2 + if [ ".$opt_g" != . ]; then + if [ ".$opt_t" = .yes ]; then + echo "chgrp $opt_g $dsttmp" 1>&2 + fi + chgrp $opt_g $dsttmp || exit $? fi - chmod $opt_m $dsttmp || exit $? - fi - - # Determine whether to do a quick install - # (has to be done _after_ the strip was already done) - quick=no - if [ ".$opt_C" = .yes ]; then - if [ -r $dst ]; then - if cmp -s $src $dst; then - quick=yes + if [ ".$opt_m" != . ]; then + if [ ".$opt_t" = .yes ]; then + echo "chmod $opt_m $dsttmp" 1>&2 fi + chmod $opt_m $dsttmp || exit $? fi - fi - # Finally install the file to the real destination - if [ $quick = yes ]; then - if [ ".$opt_t" = .yes ]; then - echo "rm -f $dsttmp" 1>&2 + # Determine whether to do a quick install + # (has to be done _after_ the strip was already done) + quick=no + if [ ".$opt_C" = .yes ]; then + if [ -r $dst ]; then + if cmp -s $src $dst; then + quick=yes + fi + fi fi - rm -f $dsttmp - else - if [ ".$opt_t" = .yes ]; then - echo "rm -f $dst && mv $dsttmp $dst" 1>&2 + + # Finally install the file to the real destination + if [ $quick = yes ]; then + if [ ".$opt_t" = .yes ]; then + echo "rm -f $dsttmp" 1>&2 + fi + rm -f $dsttmp + else + if [ ".$opt_t" = .yes ]; then + echo "rm -f $dst && mv $dsttmp $dst" 1>&2 + fi + rm -f $dst && mv $dsttmp $dst fi - rm -f $dst && mv $dsttmp $dst - fi + done ;; mkdir ) @@ -691,7 +724,7 @@ for p in ${1+"$@"}; do # if the directory already exists... if [ -d "$p" ]; then - if [ ".$opt_f" = .no ]; then + if [ ".$opt_f" = .no ] && [ ".$opt_p" = .no ]; then echo "$msgprefix:Error: directory already exists: $p" 1>&2 errstatus=1 break --B2K8VVAV7W939CM1N42H-- From ossp-cvs-owner@ossp.org Mon Jul 10 21:57:01 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e6AJv0T22729; Mon, 10 Jul 2000 21:57:00 +0200 (CEST) Date: Mon, 10 Jul 2000 21:57:00 +0200 (CEST) Message-Id: <200007101957.e6AJv0T22729@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/cvs .cvsignore COPYING COPYING.LIB ChangeLog.zoo ... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 10-Jul-2000 21:57:00 Branch: vendor Handle: 19700101010000963255219 Modified files: (Branch: vendor) ossp-pkg/cvs NEWS ossp-pkg/cvs/doc cvs.texinfo cvsclient.texi ossp-pkg/cvs/src cvs.h main.c sanity.sh server.c update.c version.c Touched files: (Branch: vendor) ossp-pkg/cvs .cvsignore COPYING COPYING.LIB ChangeLog.zoo INSTALL Makefile.in README acconfig.h config.h.in configure configure.in ossp-pkg/cvs/diff .cvsignore Makefile.in analyze.c cmpbuf.c cmpbuf.h context.c diagmeet.note diff.c diff.h diff3.c diffrun.h dir.c ed.c ifdef.c io.c normal.c side.c system.h util.c version.c ossp-pkg/cvs/doc .cvsignore FAQ HACKING Makefile.in RCSFILES TESTS TODO cvs-paper.ms ossp-pkg/cvs/lib .cvsignore Makefile.in argmatch.c dup2.c fncase.c fnmatch.c fnmatch.h ftruncate.c getdate.c getdate.y getline.c getline.h getopt.c getopt.h getopt1.c hostname.c md5.c md5.h memmove.c mkdir.c regex.c regex.h rename.c savecwd.c savecwd.h sighandle.c strerror.c stripslash.c strstr.c strtoul.c system.h valloc.c wait.h waitpid.c xgetwd.c yesno.c ossp-pkg/cvs/man .cvsignore Makefile.in cvs.1 cvs.5 ossp-pkg/cvs/src .cvsignore Makefile.in add.c admin.c buffer.c buffer.h checkin.c checkout.c classify.c client.c client.h commit.c create_adm.c cvsrc.c diff.c edit.c edit.h entries.c error.c error.h expand_path.c fileattr.c fileattr.h filesubr.c find_names.c hardlink.c hardlink.h hash.c hash.h history.c ignore.c import.c lock.c log.c login.c logmsg.c mkmodules.c modules.c myndbm.c myndbm.h no_diff.c options.h.in parseinfo.c patch.c rcs.c rcs.h rcscmds.c recurse.c release.c remove.c repos.c root.c rtag.c run.c scramble.c server.h status.c subr.c tag.c update.h vers_ts.c watch.c watch.h wrapper.c zlib.c ossp-pkg/cvs/zlib .cvsignore Makefile.in README adler32.c algorithm.doc compress.c crc32.c deflate.c deflate.h gzio.c infblock.c infblock.h infcodes.c infcodes.h inffast.c inffast.h inflate.c inftrees.c inftrees.h infutil.c infutil.h trees.c uncompr.c zconf.h zlib.h zutil.c zutil.h Log: Import of vendor CVS version, snapshot 20000710 [Release Tags: CVS_20000710] Summary: Revision Changes Path 1.1.1.5 +4 -0 ossp-pkg/cvs/NEWS 1.1.1.7 +0 -0 ossp-pkg/cvs/doc/cvs.texinfo 1.1.1.3 +0 -0 ossp-pkg/cvs/doc/cvsclient.texi 1.1.1.6 +0 -0 ossp-pkg/cvs/src/cvs.h 1.1.1.7 +0 -0 ossp-pkg/cvs/src/main.c 1.1.1.10 +0 -0 ossp-pkg/cvs/src/sanity.sh 1.1.1.13 +0 -0 ossp-pkg/cvs/src/server.c 1.1.1.8 +0 -0 ossp-pkg/cvs/src/update.c 1.1.1.3 +0 -0 ossp-pkg/cvs/src/version.c ____________________________________________________________________________ http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/cvs/NEWS?cvsroot=ossp&r1=1.1.1.4&r2=1.1.1.5 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/cvs/doc/cvs.texinfo?cvsroot=ossp&r1=1.1.1.6&r2=1.1.1.7 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/cvs/doc/cvsclient.texi?cvsroot=ossp&r1=1.1.1.2&r2=1.1.1.3 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/cvs/src/cvs.h?cvsroot=ossp&r1=1.1.1.5&r2=1.1.1.6 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/cvs/src/main.c?cvsroot=ossp&r1=1.1.1.6&r2=1.1.1.7 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/cvs/src/sanity.sh?cvsroot=ossp&r1=1.1.1.9&r2=1.1.1.10 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/cvs/src/server.c?cvsroot=ossp&r1=1.1.1.12&r2=1.1.1.13 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/cvs/src/update.c?cvsroot=ossp&r1=1.1.1.7&r2=1.1.1.8 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/cvs/src/version.c?cvsroot=ossp&r1=1.1.1.2&r2=1.1.1.3 From ossp-cvs-owner@ossp.org Tue Jul 11 07:22:18 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e6B5MHr65197; Tue, 11 Jul 2000 07:22:17 +0200 (CEST) Date: Tue, 11 Jul 2000 07:22:17 +0200 (CEST) Message-Id: <200007110522.e6B5MHr65197@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="62LDC7PQJ6H071XHGIKG" Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/cvs/src cvs.h main.c root.c sanity.sh server.c up... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list This is a multi-part message in MIME format. --62LDC7PQJ6H071XHGIKG Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: commit summary Content-Disposition: inline OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 11-Jul-2000 07:22:16 Branch: HEAD Handle: 2000071106221401 Modified files: ossp-pkg/cvs/src cvs.h main.c root.c sanity.sh server.c update.c version.c Log: Merge in conflicts Summary: Revision Changes Path 1.17 +1 -0 ossp-pkg/cvs/src/cvs.h 1.20 +2 -9 ossp-pkg/cvs/src/main.c 1.9 +8 -6 ossp-pkg/cvs/src/root.c 1.7 +45 -11 ossp-pkg/cvs/src/sanity.sh 1.26 +10 -0 ossp-pkg/cvs/src/server.c 1.10 +18 -11 ossp-pkg/cvs/src/update.c 1.8 +47 -1 ossp-pkg/cvs/src/version.c ____________________________________________________________________________ --62LDC7PQJ6H071XHGIKG Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/cvs/src/cvs.h Content-Disposition: attachment Index: ossp-pkg/cvs/src/cvs.h ============================================================ $ cvs diff -u -r1.16 -r1.17 cvs.h --- ossp-pkg/cvs/src/cvs.h 2000/07/01 13:12:53 1.16 +++ ossp-pkg/cvs/src/cvs.h 2000/07/11 05:22:14 1.17 @@ -932,6 +932,7 @@ extern int rtag PROTO((int argc, char **argv)); extern int cvsstatus PROTO((int argc, char **argv)); extern int cvstag PROTO((int argc, char **argv)); +extern int version PROTO((int argc, char **argv)); extern unsigned long int lookup_command_attribute PROTO((char *)); --62LDC7PQJ6H071XHGIKG Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/cvs/src/main.c Content-Disposition: attachment Index: ossp-pkg/cvs/src/main.c ============================================================ $ cvs diff -u -r1.19 -r1.20 main.c --- ossp-pkg/cvs/src/main.c 2000/07/06 19:33:59 1.19 +++ ossp-pkg/cvs/src/main.c 2000/07/11 05:22:14 1.20 @@ -148,6 +148,7 @@ { "tag", "ta", "freeze", cvstag }, { "unedit", NULL, NULL, unedit }, { "update", "up", "upd", update }, + { "version", "ve", "ver", version }, { "watch", NULL, NULL, watch }, { "watchers", NULL, NULL, watchers }, #ifdef OSSP_PATCH_CVSROOT @@ -517,8 +518,6 @@ char **argv; { char *CVSroot = CVSROOT_DFLT; - extern char *version_string; - extern char *config_string; char *cp, *end; const struct cmd *cm; int c, err = 0; @@ -763,14 +762,8 @@ logoff = 1; break; case 'v': - /* Having the year here is a good idea, so people have - some idea of how long ago their version of CVS was - released. */ - (void) fputs (version_string, stdout); - (void) fputs (config_string, stdout); -#ifndef OSSP_PATCH_COSMETICS (void) fputs ("\n", stdout); -#endif + version (0, (char **) NULL); (void) fputs ("\n", stdout); (void) fputs ("\ Copyright (c) 1989-2000 Brian Berliner, david d `zoo' zuhn, \n\ --62LDC7PQJ6H071XHGIKG Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/cvs/src/root.c Content-Disposition: attachment Index: ossp-pkg/cvs/src/root.c ============================================================ $ cvs diff -u -r1.8 -r1.9 root.c --- ossp-pkg/cvs/src/root.c 2000/06/27 19:31:57 1.8 +++ ossp-pkg/cvs/src/root.c 2000/07/11 05:22:14 1.9 @@ -843,12 +843,14 @@ syncprog++; } if (smart && !force) { - if (strcasecmp(syncprog, "manual") == 0) { - fprintf(stderr, "%s: synchronize SLAVE with MASTER of repository `%s', please!\n", program_name, e->nickname); - } - else { - fprintf(stderr, "%s: synchronize SLAVE with MASTER of repository `%s'\n", program_name, e->nickname); - fprintf(stderr, "%s: by running the command `%s root -s %s', please.\n", program_name, program_name, e->nickname); + if (!really_quiet) { + if (strcasecmp(syncprog, "manual") == 0) { + fprintf(stderr, "%s: synchronize SLAVE with MASTER of repository `%s', please!\n", program_name, e->nickname); + } + else { + fprintf(stderr, "%s: synchronize SLAVE with MASTER of repository `%s'\n", program_name, e->nickname); + fprintf(stderr, "%s: by running the command `%s root -s %s', please.\n", program_name, program_name, e->nickname); + } } return; } --62LDC7PQJ6H071XHGIKG Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/cvs/src/sanity.sh Content-Disposition: attachment Index: ossp-pkg/cvs/src/sanity.sh ============================================================ $ cvs diff -u -r1.6 -r1.7 sanity.sh --- ossp-pkg/cvs/src/sanity.sh 2000/07/06 19:33:59 1.6 +++ ossp-pkg/cvs/src/sanity.sh 2000/07/11 05:22:14 1.7 @@ -635,7 +635,7 @@ tests="${tests} branches branches2 tagc tagf" tests="${tests} rcslib multibranch import importb importc" tests="${tests} import-after-initial" - tests="${tests} join join2 join3 join-readonly-conflict" + tests="${tests} join join2 join3 join-readonly-conflict join-admin" tests="${tests} new newb conflicts conflicts2 conflicts3" tests="${tests} clean" # Checking out various places (modules, checkout -d, &c) @@ -6105,6 +6105,49 @@ rm -rf ${CVSROOT_DIRNAME}/$module ;; + join-admin) + mkdir 1; cd 1 + dotest join-admin-1 "$testcvs -q co -l ." '' + module=x + mkdir $module + $testcvs -q add $module >>$LOGFILE 2>&1 + cd $module + + # Create a file so applying the first tag works. + echo foo > a + $testcvs -Q add a > /dev/null 2>&1 + $testcvs -Q ci -m. a > /dev/null 2>&1 + + $testcvs -Q tag -b B + $testcvs -Q tag -b M1 + echo '$''Id$' > b + $testcvs -Q add b > /dev/null 2>&1 + $testcvs -Q ci -m. b > /dev/null 2>&1 + $testcvs -Q tag -b M2 + + $testcvs -Q update -r B + $testcvs -Q update -kk -jM1 -jM2 + $testcvs -Q ci -m. b >/dev/null 2>&1 + + $testcvs -Q update -A + + # Verify that the -kk flag from the update did not + # propagate to the repository. + dotest join-admin-1 "$testcvs status b" \ +"=================================================================== +File: b Status: Up-to-date + + Working revision: 1\.1.* + Repository revision: 1\.1 ${TESTDIR}/cvsroot/x/b,v + Sticky Tag: (none) + Sticky Date: (none) + Sticky Options: (none)" + + cd ../.. + rm -rf 1 + rm -rf ${CVSROOT_DIRNAME}/$module + ;; + new) # look for stray "no longer pertinent" messages. mkdir ${CVSROOT_DIRNAME}/first-dir @@ -7172,7 +7215,7 @@ dotest modules-148 "${testcvs} ci -m 'add modules' CVSROOT/modules" \ "Checking in CVSROOT/modules; ${TESTDIR}/cvsroot/CVSROOT/modules,v <-- modules -new revision: 1\.5; previous revision: 1\.4 +new revision: 1\.[0-9]*; previous revision: 1\.[0-9]* done ${PROG} [a-z]*: Rebuilding administrative file database" @@ -20140,15 +20183,6 @@ Amquiteunabletocomeupwithinterestingpasswordsanymore END AUTH REQUEST EOF - - # Test protection from D.o.S. attack during pserver auth phase. - # - # The unacceptably long line of 'x's should get cut off - # after PATH_MAX chars -- see calls to getline_safe() in - # server.c -- so even though no newline is ever sent, the - # server should claim a bad protocol start. - dotest_fail pserver-14 "(while true; do echo -n x; done) | ${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \ -"${DOTSTAR} bad auth protocol start: ${DOTSTAR}" # Clean up. echo "# comments only" >config --62LDC7PQJ6H071XHGIKG Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/cvs/src/server.c Content-Disposition: attachment Index: ossp-pkg/cvs/src/server.c ============================================================ $ cvs diff -u -r1.25 -r1.26 server.c --- ossp-pkg/cvs/src/server.c 2000/07/06 19:33:59 1.25 +++ ossp-pkg/cvs/src/server.c 2000/07/11 05:22:15 1.26 @@ -3749,6 +3749,15 @@ do_cvs_command ("noop", noop); } +static void serve_version PROTO ((char *)); + +static void +serve_version (arg) + char *arg; +{ + do_cvs_command ("version", version); +} + static void serve_init PROTO ((char *)); static void @@ -4729,6 +4738,7 @@ REQ_LINE("init", serve_init, RQ_ROOTLESS), REQ_LINE("annotate", serve_annotate, 0), REQ_LINE("noop", serve_noop, 0), + REQ_LINE("version", serve_version, RQ_ROOTLESS), REQ_LINE(NULL, NULL, 0) #undef REQ_LINE --62LDC7PQJ6H071XHGIKG Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/cvs/src/update.c Content-Disposition: attachment Index: ossp-pkg/cvs/src/update.c ============================================================ $ cvs diff -u -r1.9 -r1.10 update.c --- ossp-pkg/cvs/src/update.c 2000/07/01 13:12:54 1.9 +++ ossp-pkg/cvs/src/update.c 2000/07/11 05:22:15 1.10 @@ -2110,7 +2110,7 @@ Vers_TS *vers; { char *backup; - char *options; + char *t_options; int status; char *rev1; @@ -2345,6 +2345,13 @@ xvers = Version_TS (finfo, vers->options, jrev2, jdate2, 1, 0); + /* Reset any keyword expansion option. Otherwise, when a + command like `cvs update -kk -jT1 -jT2' creates a new file + (because a file had the T2 tag, but not T1), the subsequent + commit of that just-added file effectively would set the + admin `-kk' option for that file in the repository. */ + options = NULL; + /* FIXME: If checkout_file fails, we should arrange to return a non-zero exit status. */ status = checkout_file (finfo, xvers, 1, 0, 1); @@ -2433,10 +2440,10 @@ copy_file (finfo->file, backup); xchmod (finfo->file, 1); - options = vers->options; + t_options = vers->options; #if 0 - if (*options == '\0') - options = "-kk"; /* to ignore keyword expansions */ + if (*t_options == '\0') + t_options = "-kk"; /* to ignore keyword expansions */ #endif /* If the source of the merge is the same as the working file @@ -2454,12 +2461,12 @@ /* This is because of the worry below about $Name. If that isn't a problem, I suspect this code probably works for text files too. */ - && (strcmp (options, "-kb") == 0 + && (strcmp (t_options, "-kb") == 0 || wrap_merge_is_copy (finfo->file))) { /* FIXME: what about nametag? What does RCS_merge do with $Name? */ - if (RCS_checkout (finfo->rcs, finfo->file, rev2, NULL, options, + if (RCS_checkout (finfo->rcs, finfo->file, rev2, NULL, t_options, RUN_TTY, (RCSCHECKOUTPROC)0, NULL) != 0) status = 2; else @@ -2483,7 +2490,7 @@ print. */ write_letter (finfo, 'U'); } - else if (strcmp (options, "-kb") == 0 + else if (strcmp (t_options, "-kb") == 0 || wrap_merge_is_copy (finfo->file) || special_file_mismatch (finfo, rev1, rev2)) { @@ -2493,7 +2500,7 @@ the two files, and let them resolve it. It is possible that we should require a "touch foo" or similar step before we allow a checkin. */ - if (RCS_checkout (finfo->rcs, finfo->file, rev2, NULL, options, + if (RCS_checkout (finfo->rcs, finfo->file, rev2, NULL, t_options, RUN_TTY, (RCSCHECKOUTPROC)0, NULL) != 0) status = 2; else @@ -2525,11 +2532,11 @@ else #ifdef OSSP_PATCH_MERGENOKEYWORD { - if (*options == '\0') - options = "-kk"; /* to ignore keyword expansions */ + if (*t_options == '\0') + t_options = "-kk"; /* to ignore keyword expansions */ #endif status = RCS_merge (finfo->rcs, vers->srcfile->path, finfo->file, - options, rev1, rev2); + t_options, rev1, rev2); #ifdef OSSP_PATCH_MERGENOKEYWORD } #endif --62LDC7PQJ6H071XHGIKG Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/cvs/src/version.c Content-Disposition: attachment Index: ossp-pkg/cvs/src/version.c ============================================================ $ cvs diff -u -r1.7 -r1.8 version.c --- ossp-pkg/cvs/src/version.c 2000/06/22 16:41:13 1.7 +++ ossp-pkg/cvs/src/version.c 2000/07/11 05:22:15 1.8 @@ -18,7 +18,7 @@ #define NAME_PREFIX "" #endif -char *version_string = "\n" NAME_PREFIX "Concurrent Versions System (CVS) 1.10.8.6"; +char *version_string = NAME_PREFIX "Concurrent Versions System (CVS) 1.10.8.6"; #ifdef CLIENT_SUPPORT #ifdef SERVER_SUPPORT @@ -33,3 +33,49 @@ char *config_string = "\n"; #endif #endif + +static const char *const version_usage[] = +{ + "Usage: %s %s\n", + NULL +}; + +int +version (argc, argv) + int argc; + char **argv; +{ + int err = 0; + + if (argc == -1) + usage (version_usage); + +#ifdef CLIENT_SUPPORT + if (client_active) + (void) fputs ("Client: ", stdout); +#endif + + /* Having the year here is a good idea, so people have + some idea of how long ago their version of CVS was + released. */ + (void) fputs (version_string, stdout); + (void) fputs (config_string, stdout); + +#ifdef CLIENT_SUPPORT + if (client_active) + { + (void) fputs ("Server: ", stdout); + start_server (); + if (supported_request ("version")) + send_to_server ("version\012", 0); + else + { + send_to_server ("noop\012", 0); + fputs ("(unknown)\n", stdout); + } + err = get_responses_and_close (); + } +#endif + return err; +} + --62LDC7PQJ6H071XHGIKG-- From ossp-cvs-owner@ossp.org Tue Jul 11 08:09:53 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e6B69qx68539; Tue, 11 Jul 2000 08:09:52 +0200 (CEST) Date: Tue, 11 Jul 2000 08:09:52 +0200 (CEST) Message-Id: <200007110609.e6B69qx68539@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="47QMBH3GIT19XT9XXZS6" Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/cvs shtool Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list This is a multi-part message in MIME format. --47QMBH3GIT19XT9XXZS6 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: commit summary Content-Disposition: inline OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 11-Jul-2000 08:09:52 Branch: HEAD Handle: 2000071107095100 Modified files: ossp-pkg/cvs shtool Log: Update shtool Summary: Revision Changes Path 1.4 +11 -6 ossp-pkg/cvs/shtool ____________________________________________________________________________ --47QMBH3GIT19XT9XXZS6 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/cvs/shtool Content-Disposition: attachment Index: ossp-pkg/cvs/shtool ============================================================ $ cvs diff -u -r1.3 -r1.4 shtool --- ossp-pkg/cvs/shtool 2000/06/25 18:55:32 1.3 +++ ossp-pkg/cvs/shtool 2000/07/11 06:09:51 1.4 @@ -6,7 +6,7 @@ ## See http://www.gnu.org/software/shtool/ for more information. ## See ftp://ftp.gnu.org/gnu/shtool/ for latest version. ## -## Version: 1.4.10 (18-Jun-2000) +## Version: 1.5.0 (01-Jul-2000) ## Contents: 5/17 available modules ## @@ -55,7 +55,7 @@ ## arx Extended archive command ## slo Separate linker options by library class ## scpp Sharing C Pre-Processor -## version Generate and maintain a version information file +## version Maintain a version information file ## path Deal with program paths ## @@ -65,7 +65,7 @@ exit 1 fi if [ ".$1" = ".-h" -o ".$1" = ".--help" ]; then - echo "This is GNU shtool, version 1.4.10 (18-Jun-2000)" + echo "This is GNU shtool, version 1.5.0 (01-Jul-2000)" echo "Copyright (c) 1994-2000 Ralf S. Engelschall " echo "Report bugs to " echo '' @@ -75,6 +75,7 @@ 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 [] []:' echo ' echo [-n] [-e] [ ...]' @@ -97,14 +98,18 @@ echo ' slo [-p] -- -L -l [-L -l ...]' echo ' scpp [-v] [-p] [-f] [-o] [-t] [-M]' echo ' [-D] [-C] [ ...]' - echo ' version [-l] [-n] [-p] [-s] [-i]' - echo ' [-d] ' + echo ' version [-l] [-n] [-p] [-s] [-e]' + echo ' [-i] [-d] ' echo ' path [-s] [-r] [-d] [-b] [-m] [-p] [ ...]' echo '' exit 0 fi if [ ".$1" = ".-v" -o ".$1" = ."--version" ]; then - echo "GNU shtool 1.4.10 (18-Jun-2000)" + echo "GNU shtool 1.5.0 (01-Jul-2000)" + exit 0 +fi +if [ ".$1" = ".-r" -o ".$1" = ."--recreate" ]; then + shtoolize -oshtool echo install mkdir fixperm tarball exit 0 fi if [ ".$1" = ".-d" -o ".$1" = ."--debug" ]; then --47QMBH3GIT19XT9XXZS6-- From ossp-cvs-owner@ossp.org Wed Jul 12 08:15:49 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e6C6FmX70822; Wed, 12 Jul 2000 08:15:48 +0200 (CEST) Date: Wed, 12 Jul 2000 08:15:48 +0200 (CEST) Message-Id: <200007120615.e6C6FmX70822@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/cvs .cvsignore COPYING COPYING.LIB ChangeLog.zoo ... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 12-Jul-2000 08:15:48 Branch: vendor Handle: 19700101010000963378736 Modified files: (Branch: vendor) ossp-pkg/cvs config.h.in configure configure.in ossp-pkg/cvs/diff util.c ossp-pkg/cvs/lib savecwd.c ossp-pkg/cvs/src filesubr.c import.c main.c rcs.c update.c zlib.c Touched files: (Branch: vendor) ossp-pkg/cvs .cvsignore COPYING COPYING.LIB ChangeLog.zoo INSTALL Makefile.in NEWS README acconfig.h ossp-pkg/cvs/diff .cvsignore Makefile.in analyze.c cmpbuf.c cmpbuf.h context.c diagmeet.note diff.c diff.h diff3.c diffrun.h dir.c ed.c ifdef.c io.c normal.c side.c system.h version.c ossp-pkg/cvs/doc .cvsignore FAQ HACKING Makefile.in RCSFILES TESTS TODO cvs-paper.ms cvs.texinfo cvsclient.texi ossp-pkg/cvs/lib .cvsignore Makefile.in argmatch.c dup2.c fncase.c fnmatch.c fnmatch.h ftruncate.c getdate.c getdate.y getline.c getline.h getopt.c getopt.h getopt1.c hostname.c md5.c md5.h memmove.c mkdir.c regex.c regex.h rename.c savecwd.h sighandle.c strerror.c stripslash.c strstr.c strtoul.c system.h valloc.c wait.h waitpid.c xgetwd.c yesno.c ossp-pkg/cvs/man .cvsignore Makefile.in cvs.1 cvs.5 ossp-pkg/cvs/src .cvsignore Makefile.in add.c admin.c buffer.c buffer.h checkin.c checkout.c classify.c client.c client.h commit.c create_adm.c cvs.h cvsrc.c diff.c edit.c edit.h entries.c error.c error.h expand_path.c fileattr.c fileattr.h find_names.c hardlink.c hardlink.h hash.c hash.h history.c ignore.c lock.c log.c login.c logmsg.c mkmodules.c modules.c myndbm.c myndbm.h no_diff.c options.h.in parseinfo.c patch.c rcs.h rcscmds.c recurse.c release.c remove.c repos.c root.c rtag.c run.c sanity.sh scramble.c server.c server.h status.c subr.c tag.c update.h vers_ts.c version.c watch.c watch.h wrapper.c ossp-pkg/cvs/zlib .cvsignore Makefile.in README adler32.c algorithm.doc compress.c crc32.c deflate.c deflate.h gzio.c infblock.c infblock.h infcodes.c infcodes.h inffast.c inffast.h inflate.c inftrees.c inftrees.h infutil.c infutil.h trees.c uncompr.c zconf.h zlib.h zutil.c zutil.h Log: Import of vendor CVS version, snapshot 20000712 [Release Tags: CVS_20000712] Summary: Revision Changes Path 1.1.1.3 +6 -0 ossp-pkg/cvs/config.h.in 1.1.1.4 BLOB ossp-pkg/cvs/configure 1.1.1.4 +2 -1 ossp-pkg/cvs/configure.in 1.1.1.2 +0 -0 ossp-pkg/cvs/diff/util.c 1.1.1.2 +0 -0 ossp-pkg/cvs/lib/savecwd.c 1.1.1.2 +0 -0 ossp-pkg/cvs/src/filesubr.c 1.1.1.5 +0 -0 ossp-pkg/cvs/src/import.c 1.1.1.8 +0 -0 ossp-pkg/cvs/src/main.c 1.1.1.11 +0 -0 ossp-pkg/cvs/src/rcs.c 1.1.1.9 +0 -0 ossp-pkg/cvs/src/update.c 1.1.1.2 +0 -0 ossp-pkg/cvs/src/zlib.c ____________________________________________________________________________ http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/cvs/config.h.in?cvsroot=ossp&r1=1.1.1.2&r2=1.1.1.3 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/cvs/configure?cvsroot=ossp&r1=1.1.1.3&r2=1.1.1.4 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/cvs/configure.in?cvsroot=ossp&r1=1.1.1.3&r2=1.1.1.4 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/cvs/diff/util.c?cvsroot=ossp&r1=1.1.1.1&r2=1.1.1.2 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/cvs/lib/savecwd.c?cvsroot=ossp&r1=1.1.1.1&r2=1.1.1.2 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/cvs/src/filesubr.c?cvsroot=ossp&r1=1.1.1.1&r2=1.1.1.2 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/cvs/src/import.c?cvsroot=ossp&r1=1.1.1.4&r2=1.1.1.5 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/cvs/src/main.c?cvsroot=ossp&r1=1.1.1.7&r2=1.1.1.8 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/cvs/src/rcs.c?cvsroot=ossp&r1=1.1.1.10&r2=1.1.1.11 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/cvs/src/update.c?cvsroot=ossp&r1=1.1.1.8&r2=1.1.1.9 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/cvs/src/zlib.c?cvsroot=ossp&r1=1.1.1.1&r2=1.1.1.2 From ossp-cvs-owner@ossp.org Wed Jul 12 17:31:56 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e6CFVtv10029; Wed, 12 Jul 2000 17:31:55 +0200 (CEST) Date: Wed, 12 Jul 2000 17:31:55 +0200 (CEST) Message-Id: <200007121531.e6CFVtv10029@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="DVMYT15EOUHEBG5AOUKI" Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/cvs/src import.c rcs.c update.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list This is a multi-part message in MIME format. --DVMYT15EOUHEBG5AOUKI Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: commit summary Content-Disposition: inline OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 12-Jul-2000 17:31:55 Branch: HEAD Handle: 2000071216315301 Modified files: ossp-pkg/cvs/src import.c rcs.c update.c Log: Merge in conflicts Summary: Revision Changes Path 1.12 +12 -0 ossp-pkg/cvs/src/import.c 1.14 +12 -0 ossp-pkg/cvs/src/rcs.c 1.11 +10 -0 ossp-pkg/cvs/src/update.c ____________________________________________________________________________ --DVMYT15EOUHEBG5AOUKI Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/cvs/src/import.c Content-Disposition: attachment Index: ossp-pkg/cvs/src/import.c ============================================================ $ cvs diff -u -r1.11 -r1.12 import.c --- ossp-pkg/cvs/src/import.c 2000/06/22 13:31:38 1.11 +++ ossp-pkg/cvs/src/import.c 2000/07/12 15:31:53 1.12 @@ -1373,12 +1373,18 @@ case S_IFREG: break; case S_IFCHR: case S_IFBLK: +#ifdef HAVE_ST_RDEV if (fprintf (fprcs, "special\t%s %lu;\012", (file_type == S_IFCHR ? "character" : "block"), (unsigned long) sb.st_rdev) < 0) goto write_error; +#else + error (0, 0, +"can't import %s: unable to import device files on this system", +userfile); +#endif break; default: error (0, 0, @@ -1424,12 +1430,18 @@ case S_IFREG: break; case S_IFCHR: case S_IFBLK: +#ifdef HAVE_ST_RDEV if (fprintf (fprcs, "special\t%s %lu;\012", (file_type == S_IFCHR ? "character" : "block"), (unsigned long) sb.st_rdev) < 0) goto write_error; +#else + error (0, 0, +"can't import %s: unable to import device files on this system", +userfile); +#endif break; default: error (0, 0, --DVMYT15EOUHEBG5AOUKI Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/cvs/src/rcs.c Content-Disposition: attachment Index: ossp-pkg/cvs/src/rcs.c ============================================================ $ cvs diff -u -r1.13 -r1.14 rcs.c --- ossp-pkg/cvs/src/rcs.c 2000/07/06 19:33:59 1.13 +++ ossp-pkg/cvs/src/rcs.c 2000/07/12 15:31:53 1.14 @@ -4346,6 +4346,7 @@ #ifdef PRESERVE_PERMISSIONS_SUPPORT else if (special_file) { +#ifdef HAVE_MKNOD char *dest; /* Can send either to WORKFILE or to SOUT, as long as SOUT is @@ -4366,6 +4367,11 @@ if (mknod (dest, special_file, devnum) < 0) error (1, errno, "could not create special file %s", dest); +#else + error (1, 0, +"cannot create %s: unable to create special files on this system", +workfile); +#endif } #endif else @@ -4968,6 +4974,7 @@ case S_IFREG: break; case S_IFCHR: case S_IFBLK: +#ifdef HAVE_ST_RDEV np = getnode(); np->type = RCSFIELD; np->key = xstrdup ("special"); @@ -4977,6 +4984,11 @@ (unsigned long) sb.st_rdev); np->data = xstrdup (buf); addnode (delta->other_delta, np); +#else + error (0, 0, +"can't preserve %s: unable to save device files on this system", +workfile); +#endif break; default: --DVMYT15EOUHEBG5AOUKI Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/cvs/src/update.c Content-Disposition: attachment Index: ossp-pkg/cvs/src/update.c ============================================================ $ cvs diff -u -r1.10 -r1.11 update.c --- ossp-pkg/cvs/src/update.c 2000/07/11 05:22:15 1.10 +++ ossp-pkg/cvs/src/update.c 2000/07/12 15:31:54 1.11 @@ -2650,6 +2650,7 @@ rev1_symlink = xreadlink (finfo->file); else { +#ifdef HAVE_ST_RDEV if (CVS_LSTAT (finfo->file, &sb) < 0) error (1, errno, "could not get file information for %s", finfo->file); @@ -2658,6 +2659,10 @@ rev1_mode = sb.st_mode; if (S_ISBLK (rev1_mode) || S_ISCHR (rev1_mode)) rev1_dev = sb.st_rdev; +#else + error (1, 0, "cannot handle device files on this system (%s)", + finfo->file); +#endif } rev1_hardlinks = list_linked_files_on_disk (finfo->file); } @@ -2723,6 +2728,7 @@ rev2_symlink = xreadlink (finfo->file); else { +#ifdef HAVE_ST_RDEV if (CVS_LSTAT (finfo->file, &sb) < 0) error (1, errno, "could not get file information for %s", finfo->file); @@ -2731,6 +2737,10 @@ rev2_mode = sb.st_mode; if (S_ISBLK (rev2_mode) || S_ISCHR (rev2_mode)) rev2_dev = sb.st_rdev; +#else + error (1, 0, "cannot handle device files on this system (%s)", + finfo->file); +#endif } rev2_hardlinks = list_linked_files_on_disk (finfo->file); } --DVMYT15EOUHEBG5AOUKI-- From ossp-cvs-owner@ossp.org Wed Jul 12 17:35:09 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e6CFZ8710284; Wed, 12 Jul 2000 17:35:08 +0200 (CEST) Date: Wed, 12 Jul 2000 17:35:08 +0200 (CEST) Message-Id: <200007121535.e6CFZ8710284@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="L2BG6M2C8T7OU6N12W86" Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/cvs configure configure.in Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list This is a multi-part message in MIME format. --L2BG6M2C8T7OU6N12W86 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: commit summary Content-Disposition: inline OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 12-Jul-2000 17:35:08 Branch: HEAD Handle: 2000071216350501 Modified files: ossp-pkg/cvs configure configure.in Log: Merge in conflicts Summary: Revision Changes Path 1.13 BLOB ossp-pkg/cvs/configure 1.13 +2 -1 ossp-pkg/cvs/configure.in ____________________________________________________________________________ --L2BG6M2C8T7OU6N12W86 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/cvs/configure Content-Disposition: attachment Index: ossp-pkg/cvs/configure ============================================================ $ cvs update -p -r1.12 configure >configure.old $ cvs update -p -r1.13 configure >configure.new $ diff -u configure.old configure.new --L2BG6M2C8T7OU6N12W86 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/cvs/configure.in Content-Disposition: attachment Index: ossp-pkg/cvs/configure.in ============================================================ $ cvs diff -u -r1.12 -r1.13 configure.in --- ossp-pkg/cvs/configure.in 2000/06/20 14:26:03 1.12 +++ ossp-pkg/cvs/configure.in 2000/07/12 15:35:06 1.13 @@ -65,8 +65,9 @@ AC_TYPE_SIGNAL AC_STRUCT_ST_BLKSIZE +AC_STRUCT_ST_RDEV AC_REPLACE_FUNCS(mkdir rename strstr dup2 strerror valloc waitpid memmove strtoul) -AC_CHECK_FUNCS(fchmod fsync ftime mktemp putenv vprintf ftruncate timezone getpagesize initgroups fchdir sigaction sigprocmask sigvec sigsetmask sigblock tempnam tzset readlink wait3) +AC_CHECK_FUNCS(fchmod fsync ftime mktemp putenv vprintf ftruncate timezone getpagesize initgroups fchdir sigaction sigprocmask sigvec sigsetmask sigblock tempnam tzset readlink wait3 mknod) dnl dnl The CVS coding standard (as specified in HACKING) is that if it exists --L2BG6M2C8T7OU6N12W86-- From ossp-cvs-owner@ossp.org Wed Jul 12 17:50:10 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e6CFo9411384; Wed, 12 Jul 2000 17:50:09 +0200 (CEST) Date: Wed, 12 Jul 2000 17:50:09 +0200 (CEST) Message-Id: <200007121550.e6CFo9411384@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="PLC7ZZJXQFU8XXAEE2Z3" Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/cvs/src main.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list This is a multi-part message in MIME format. --PLC7ZZJXQFU8XXAEE2Z3 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: commit summary Content-Disposition: inline OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 12-Jul-2000 17:50:09 Branch: HEAD Handle: 2000071216500900 Modified files: ossp-pkg/cvs/src main.c Log: *** empty log message *** Summary: Revision Changes Path 1.21 +2 -0 ossp-pkg/cvs/src/main.c ____________________________________________________________________________ --PLC7ZZJXQFU8XXAEE2Z3 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/cvs/src/main.c Content-Disposition: attachment Index: ossp-pkg/cvs/src/main.c ============================================================ $ cvs diff -u -r1.20 -r1.21 main.c --- ossp-pkg/cvs/src/main.c 2000/07/11 05:22:14 1.20 +++ ossp-pkg/cvs/src/main.c 2000/07/12 15:50:09 1.21 @@ -1008,11 +1008,13 @@ /* remember real user (especially for getcaller()) */ pw = getpwuid(uid); +#ifdef AUTH_SERVER_SUPPORT CVS_Username = xstrdup(pw->pw_name); #if HAVE_PUTENV env = xmalloc(sizeof("LOGNAME=")+strlen(CVS_Username)); (void)sprintf(env, "LOGNAME=%s", CVS_Username); (void)putenv(env); +#endif #endif #if HAVE_PUTENV --PLC7ZZJXQFU8XXAEE2Z3-- From ossp-cvs-owner@ossp.org Wed Jul 12 18:06:52 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e6CG6pe12675; Wed, 12 Jul 2000 18:06:51 +0200 (CEST) Date: Wed, 12 Jul 2000 18:06:51 +0200 (CEST) Message-Id: <200007121606.e6CG6pe12675@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="IH4BE9X7KTA73J73P7A8" Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/cvs/src server.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list This is a multi-part message in MIME format. --IH4BE9X7KTA73J73P7A8 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: commit summary Content-Disposition: inline OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 12-Jul-2000 18:06:50 Branch: HEAD Handle: 2000071217064800 Modified files: ossp-pkg/cvs/src server.c Log: Fix auth stuff Summary: Revision Changes Path 1.27 +1 -1 ossp-pkg/cvs/src/server.c ____________________________________________________________________________ --IH4BE9X7KTA73J73P7A8 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/cvs/src/server.c Content-Disposition: attachment Index: ossp-pkg/cvs/src/server.c ============================================================ $ cvs diff -u -r1.26 -r1.27 server.c --- ossp-pkg/cvs/src/server.c 2000/07/11 05:22:15 1.26 +++ ossp-pkg/cvs/src/server.c 2000/07/12 16:06:48 1.27 @@ -5286,7 +5286,7 @@ { char *env; -#ifdef OSSP_PATCH_LOGNAME +#if defined(OSSP_PATCH_LOGNAME) && defined(AUTH_SERVER_SUPPORT) env = xmalloc (sizeof "LOGNAME=" + strlen (CVS_Username)); (void) sprintf (env, "LOGNAME=%s", CVS_Username); #else --IH4BE9X7KTA73J73P7A8-- From ossp-cvs-owner@ossp.org Fri Jul 14 13:04:44 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e6EB4hj18690; Fri, 14 Jul 2000 13:04:43 +0200 (CEST) Date: Fri, 14 Jul 2000 13:04:43 +0200 (CEST) Message-Id: <200007141104.e6EB4hj18690@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="LJULQEK7M5YK0DE9OWT8" Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/str ChangeLog configure configure.in Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list This is a multi-part message in MIME format. --LJULQEK7M5YK0DE9OWT8 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: commit summary Content-Disposition: inline OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 14-Jul-2000 13:04:43 Branch: HEAD Handle: 2000071412044200 Modified files: ossp-pkg/str ChangeLog configure configure.in Log: *** empty log message *** Summary: Revision Changes Path 1.22 +4 -1 ossp-pkg/str/ChangeLog 1.9 +96 -0 ossp-pkg/str/configure 1.8 +2 -0 ossp-pkg/str/configure.in ____________________________________________________________________________ --LJULQEK7M5YK0DE9OWT8 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/str/ChangeLog Content-Disposition: attachment Index: ossp-pkg/str/ChangeLog ============================================================ $ cvs diff -u -r1.21 -r1.22 ChangeLog --- ossp-pkg/str/ChangeLog 2000/07/03 09:47:22 1.21 +++ ossp-pkg/str/ChangeLog 2000/07/14 11:04:42 1.22 @@ -9,7 +9,10 @@ ChangeLog - Changes between 0.9.3 and 0.9.4 (04-Feb-2000 to 03-Jul-2000): + Changes between 0.9.3 and 0.9.4 (04-Feb-2000 to 13-Jul-2000): + + *) Make sure -lm is used if modf() is not in -lc. + [Unknown , Ralf S. Engelschall] *) Avoid isupper() check in str_tolower() macro, because it breaks for things like str_tolower(*s++). --LJULQEK7M5YK0DE9OWT8 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/str/configure Content-Disposition: attachment Index: ossp-pkg/str/configure ============================================================ $ cvs diff -u -r1.8 -r1.9 configure --- ossp-pkg/str/configure 2000/01/01 13:05:17 1.8 +++ ossp-pkg/str/configure 2000/07/14 11:04:42 1.9 @@ -1481,6 +1481,102 @@ done +echo $ac_n "checking for modf""... $ac_c" 1>&6 +echo "configure:1486: checking for modf" >&5 +if eval "test \"`echo '$''{'ac_cv_func_modf'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char modf(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_modf) || defined (__stub___modf) +choke me +#else +modf(); +#endif + +; return 0; } +EOF +if { (eval echo configure:1514: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_modf=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_modf=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'modf`\" = yes"; then + echo "$ac_t""yes" 1>&6 + : +else + echo "$ac_t""no" 1>&6 +echo $ac_n "checking for modf in -lm""... $ac_c" 1>&6 +echo "configure:1532: checking for modf in -lm" >&5 +ac_lib_var=`echo m'_'modf | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lm $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_lib=HAVE_LIB`echo m | sed -e 's/^a-zA-Z0-9_/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + cat >> confdefs.h <&6 +fi + +fi + + trap '' 1 2 15 cat > confcache <<\EOF # This file is a shell script that caches the results of configure --LJULQEK7M5YK0DE9OWT8 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/str/configure.in Content-Disposition: attachment Index: ossp-pkg/str/configure.in ============================================================ $ cvs diff -u -r1.7 -r1.8 configure.in --- ossp-pkg/str/configure.in 2000/01/01 13:05:17 1.7 +++ ossp-pkg/str/configure.in 2000/07/14 11:04:42 1.8 @@ -30,6 +30,8 @@ AC_HAVE_FUNCS(memmove memset memcmp memchr) +AC_CHECK_FUNC(modf, , AC_CHECK_LIB(m, modf)) + AC_OUTPUT(dnl Makefile dnl str-config dnl --LJULQEK7M5YK0DE9OWT8-- From ossp-cvs-owner@ossp.org Fri Jul 14 13:09:13 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e6EB9CA19040; Fri, 14 Jul 2000 13:09:12 +0200 (CEST) Date: Fri, 14 Jul 2000 13:09:12 +0200 (CEST) Message-Id: <200007141109.e6EB9CA19040@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="AGGVDT0EEXS6UFIPBWLM" Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/str ChangeLog ltconfig ltmain.sh shtool Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list This is a multi-part message in MIME format. --AGGVDT0EEXS6UFIPBWLM Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: commit summary Content-Disposition: inline OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 14-Jul-2000 13:09:12 Branch: HEAD Handle: 2000071412091000 Modified files: ossp-pkg/str ChangeLog ltconfig ltmain.sh shtool Log: *** empty log message *** Summary: Revision Changes Path 1.23 +3 -0 ossp-pkg/str/ChangeLog 1.2 +74 -38 ossp-pkg/str/ltconfig 1.2 +15 -3 ossp-pkg/str/ltmain.sh 1.4 +432 -409 ossp-pkg/str/shtool ____________________________________________________________________________ --AGGVDT0EEXS6UFIPBWLM Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/str/ChangeLog Content-Disposition: attachment Index: ossp-pkg/str/ChangeLog ============================================================ $ cvs diff -u -r1.22 -r1.23 ChangeLog --- ossp-pkg/str/ChangeLog 2000/07/14 11:04:42 1.22 +++ ossp-pkg/str/ChangeLog 2000/07/14 11:09:10 1.23 @@ -11,6 +11,9 @@ Changes between 0.9.3 and 0.9.4 (04-Feb-2000 to 13-Jul-2000): + *) Upgrade to GNU libtool 1.3.5 and GNU shtool 1.5.0. + [Ralf S. Engelschall] + *) Make sure -lm is used if modf() is not in -lc. [Unknown , Ralf S. Engelschall] --AGGVDT0EEXS6UFIPBWLM Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/str/ltconfig Content-Disposition: attachment Index: ossp-pkg/str/ltconfig ============================================================ $ cvs diff -u -r1.1 -r1.2 ltconfig --- ossp-pkg/str/ltconfig 1999/12/26 14:52:03 1.1 +++ ossp-pkg/str/ltconfig 2000/07/14 11:09:10 1.2 @@ -169,8 +169,8 @@ # Constants: PROGRAM=ltconfig PACKAGE=libtool -VERSION=1.3.4 -TIMESTAMP=" (1.385.2.196 1999/12/07 21:47:57)" +VERSION=1.3.5 +TIMESTAMP=" (1.385.2.206 2000/05/27 11:12:27)" ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' rm="rm -f" @@ -1164,15 +1164,21 @@ # Extract the symbol export list from an `--export-all' def file, # then regenerate the def file from the symbol export list, so that # the compiled dll only exports the symbol export list. + # Be careful not to strip the DATA tag left by newer dlltools. export_symbols_cmds='test -f $objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $objdir/$soname-ltdll.c~ test -f $objdir/$soname-ltdll.$objext || (cd $objdir && $CC -c $soname-ltdll.c)~ $DLLTOOL --export-all --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --output-def $objdir/$soname-def $objdir/$soname-ltdll.$objext $libobjs $convenience~ - sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]* ; *//" < $objdir/$soname-def > $export_symbols' + sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]*//" -e "s/ *;.*$//" < $objdir/$soname-def > $export_symbols' + # If DATA tags from a recent dlltool are present, honour them! archive_expsym_cmds='echo EXPORTS > $objdir/$soname-def~ _lt_hint=1; - for symbol in `cat $export_symbols`; do - echo " \$symbol @ \$_lt_hint ; " >> $objdir/$soname-def; + cat $export_symbols | while read symbol; do + set dummy \$symbol; + case \$# in + 2) echo " \$2 @ \$_lt_hint ; " >> $objdir/$soname-def;; + *) echo " \$2 @ \$_lt_hint \$3 ; " >> $objdir/$soname-def;; + esac; _lt_hint=`expr 1 + \$_lt_hint`; done~ test -f $objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $objdir/$soname-ltdll.c~ @@ -1433,7 +1439,13 @@ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; - + rhapsody*) + archive_cmds='$CC -bundle -undefined suppress -o $lib $libobjs $deplibs $linkopts' + hardcode_libdir_flags_spec='-L$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + sco3.2v5*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' hardcode_shlibpath_var=no @@ -1466,7 +1478,13 @@ ;; sysv4) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $linkopts' + else + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' + fi runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no hardcode_direct=no #Motorola manual says yes, but my tests say they lie @@ -1632,11 +1650,11 @@ main(){nm_test_var='a';nm_test_func();return(0);} EOF - echo "$progname:1635: checking if global_symbol_pipe works" >&5 - if { (eval echo $progname:1636: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.$objext; then + echo "$progname:1653: checking if global_symbol_pipe works" >&5 + if { (eval echo $progname:1654: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.$objext; then # Now try to grab the symbols. nlist=conftest.nm - if { echo "$progname:1639: eval \"$NM conftest.$objext | $global_symbol_pipe > $nlist\"" >&5; eval "$NM conftest.$objext | $global_symbol_pipe > $nlist 2>&5"; } && test -s "$nlist"; then + if { echo "$progname:1657: eval \"$NM conftest.$objext | $global_symbol_pipe > $nlist\"" >&5; eval "$NM conftest.$objext | $global_symbol_pipe > $nlist 2>&5"; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then @@ -1688,7 +1706,7 @@ save_CFLAGS="$CFLAGS" LIBS="conftstm.$objext" CFLAGS="$CFLAGS$no_builtin_flag" - if { (eval echo $progname:1691: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then + if { (eval echo $progname:1709: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then pipe_works=yes else echo "$progname: failed program was:" >&5 @@ -1919,6 +1937,14 @@ soname_spec='${libname}${release}.sl$major' # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' + case "$host_os" in + hpux10.20*) + # TODO: Does this work for hpux-11 too? + deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' + file_magic_cmd=/usr/bin/file + file_magic_test_file=/usr/lib/libc.sl + ;; + esac ;; irix5* | irix6*) @@ -1966,9 +1992,7 @@ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no - deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' - file_magic_cmd=/usr/bin/file - file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` + deplibs_check_method=pass_all if test -f /lib/ld.so.1; then dynamic_linker='GNU ld.so' @@ -2029,6 +2053,14 @@ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; +rhapsody*) + version_type=sunos + library_names_spec='${libname}.so' + soname_spec='${libname}.so' + shlibpath_var=DYLD_LIBRARY_PATH + deplibs_check_method=pass_all + ;; + sco3.2v5*) version_type=osf soname_spec='${libname}${release}.so$major' @@ -2069,6 +2101,10 @@ soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH case "$host_vendor" in + sequent) + file_magic_cmd='/bin/file' + deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' + ;; ncr) deplibs_check_method='pass_all' ;; @@ -2209,7 +2245,7 @@ if eval "test \"`echo '$''{'lt_cv_dlopen'+set}'`\" != set"; then lt_cv_dlopen=no lt_cv_dlopen_libs= echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "$progname:2212: checking for dlopen in -ldl" >&5 +echo "$progname:2248: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2217,7 +2253,7 @@ ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo $progname:2269: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2249,12 +2285,12 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for dlopen""... $ac_c" 1>&6 -echo "$progname:2252: checking for dlopen" >&5 +echo "$progname:2288: checking for dlopen" >&5 if eval "test \"`echo '$''{'ac_cv_func_dlopen'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -2279,7 +2315,7 @@ ; return 0; } EOF -if { (eval echo $progname:2282: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo $progname:2318: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_dlopen=yes" else @@ -2296,7 +2332,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for dld_link in -ldld""... $ac_c" 1>&6 -echo "$progname:2299: checking for dld_link in -ldld" >&5 +echo "$progname:2335: checking for dld_link in -ldld" >&5 ac_lib_var=`echo dld'_'dld_link | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2304,7 +2340,7 @@ ac_save_LIBS="$LIBS" LIBS="-ldld $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo $progname:2356: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2336,12 +2372,12 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for shl_load""... $ac_c" 1>&6 -echo "$progname:2339: checking for shl_load" >&5 +echo "$progname:2375: checking for shl_load" >&5 if eval "test \"`echo '$''{'ac_cv_func_shl_load'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -2366,7 +2402,7 @@ ; return 0; } EOF -if { (eval echo $progname:2369: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo $progname:2405: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_shl_load=yes" else @@ -2384,7 +2420,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6 -echo "$progname:2387: checking for shl_load in -ldld" >&5 +echo "$progname:2423: checking for shl_load in -ldld" >&5 ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2392,7 +2428,7 @@ ac_save_LIBS="$LIBS" LIBS="-ldld $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo $progname:2445: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2449,17 +2485,17 @@ for ac_hdr in dlfcn.h; do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "$progname:2452: checking for $ac_hdr" >&5 +echo "$progname:2488: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int fnord = 0; EOF ac_try="$ac_compile >/dev/null 2>conftest.out" -{ (eval echo $progname:2462: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo $progname:2498: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2487,7 +2523,7 @@ LIBS="$lt_cv_dlopen_libs $LIBS" echo $ac_n "checking whether a program can dlopen itself""... $ac_c" 1>&6 -echo "$progname:2490: checking whether a program can dlopen itself" >&5 +echo "$progname:2526: checking whether a program can dlopen itself" >&5 if test "${lt_cv_dlopen_self+set}" = set; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2495,7 +2531,7 @@ lt_cv_dlopen_self=cross else cat > conftest.c < @@ -2541,7 +2577,7 @@ if(ptr1 || ptr2) { dlclose(self); exit(0); } } exit(1); } EOF -if { (eval echo $progname:2544: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo $progname:2580: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then lt_cv_dlopen_self=yes else @@ -2560,7 +2596,7 @@ if test "$lt_cv_dlopen_self" = yes; then LDFLAGS="$LDFLAGS $link_static_flag" echo $ac_n "checking whether a statically linked program can dlopen itself""... $ac_c" 1>&6 -echo "$progname:2563: checking whether a statically linked program can dlopen itself" >&5 +echo "$progname:2599: checking whether a statically linked program can dlopen itself" >&5 if test "${lt_cv_dlopen_self_static+set}" = set; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2568,7 +2604,7 @@ lt_cv_dlopen_self_static=cross else cat > conftest.c < @@ -2614,7 +2650,7 @@ if(ptr1 || ptr2) { dlclose(self); exit(0); } } exit(1); } EOF -if { (eval echo $progname:2617: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo $progname:2653: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then lt_cv_dlopen_self_static=yes else --AGGVDT0EEXS6UFIPBWLM Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/str/ltmain.sh Content-Disposition: attachment Index: ossp-pkg/str/ltmain.sh ============================================================ $ cvs diff -u -r1.1 -r1.2 ltmain.sh --- ossp-pkg/str/ltmain.sh 1999/12/26 14:52:03 1.1 +++ ossp-pkg/str/ltmain.sh 2000/07/14 11:09:10 1.2 @@ -54,8 +54,8 @@ # Constants. PROGRAM=ltmain.sh PACKAGE=libtool -VERSION=1.3.4 -TIMESTAMP=" (1.385.2.196 1999/12/07 21:47:57)" +VERSION=1.3.5 +TIMESTAMP=" (1.385.2.206 2000/05/27 11:12:27)" default_mode= help="Try \`$progname --help' for more information." @@ -1795,6 +1795,10 @@ *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*) # these systems don't actually have a c library (as such)! ;; + *-*-rhapsody*) + # rhapsody is a little odd... + deplibs="$deplibs -framework System" + ;; *) # Add libc to deplibs on all other systems. deplibs="$deplibs -lc" @@ -2927,13 +2931,21 @@ # Run the actual program with our arguments. " case $host in - *-*-cygwin* | *-*-mingw | *-*-os2*) # win32 systems need to use the prog path for dll # lookup to work + *-*-cygwin*) + $echo >> $output "\ + exec \$progdir/\$program \${1+\"\$@\"} +" + ;; + + # Backslashes separate directories on plain windows + *-*-mingw | *-*-os2*) $echo >> $output "\ exec \$progdir\\\\\$program \${1+\"\$@\"} " ;; + *) $echo >> $output "\ # Export the path to the program. --AGGVDT0EEXS6UFIPBWLM Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/str/shtool Content-Disposition: attachment Index: ossp-pkg/str/shtool ============================================================ $ cvs diff -u -r1.3 -r1.4 shtool --- ossp-pkg/str/shtool 1999/12/26 17:38:54 1.3 +++ ossp-pkg/str/shtool 2000/07/14 11:09:10 1.4 @@ -1,13 +1,13 @@ #!/bin/sh ## ## GNU shtool -- The GNU Portable Shell Tool -## Copyright (c) 1994-1999 Ralf S. Engelschall +## Copyright (c) 1994-2000 Ralf S. Engelschall ## ## See http://www.gnu.org/software/shtool/ for more information. ## See ftp://ftp.gnu.org/gnu/shtool/ for latest version. ## -## Version 1.4.7 (24-Dec-1999) -## Ingredients: 6/17 available modules +## Version: 1.5.0 (01-Jul-2000) +## Contents: 6/17 available modules ## ## @@ -43,16 +43,16 @@ ## mkdir Make one or more directories ## fixperm Fix file permissions inside a source tree ## tarball Roll distribution tarballs -## version Generate and maintain a version information file +## version Maintain a version information file ## ## Not available commands (because module was not built-in): ## mdate Pretty-print modification time of a file or dir -## table Pretty print a field-separated list as a table +## table Pretty-print a field-separated list as a table ## prop Display progress with a running propeller -## move Move files with simultan substitution +## move Move files with simultaneous substitution ## mkln Make link with calculation of relative paths -## mkshadow Make a shadow tree -## guessos Simple OS/platform guesser +## mkshadow Make a shadow tree through symbolic links +## guessos Simple operating system guesser ## arx Extended archive command ## slo Separate linker options by library class ## scpp Sharing C Pre-Processor @@ -65,8 +65,8 @@ exit 1 fi if [ ".$1" = ".-h" -o ".$1" = ".--help" ]; then - echo "This is GNU shtool, version 1.4.7 (24-Dec-1999)" - echo "Copyright (c) 1994-1999 Ralf S. Engelschall " + echo "This is GNU shtool, version 1.5.0 (01-Jul-2000)" + echo "Copyright (c) 1994-2000 Ralf S. Engelschall " echo "Report bugs to " echo '' echo "Usage: shtool [] [ [] []]" @@ -75,17 +75,18 @@ 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 [] []:' echo ' echo [-n] [-e] [ ...]' echo ' install [-v] [-t] [-c] [-C] [-s] [-m] [-o] [-g]' - echo ' [-e] ' + echo ' [-e] [ ...] ' echo ' mkdir [-t] [-f] [-p] [-m] [ ...]' echo ' fixperm [-v] [-t] [ ...]' echo ' tarball [-t] [-v] [-o ] [-c ] [-d ] [-u' echo ' ] [-g ] [-e ] [ ...]' - echo ' version [-l] [-n] [-p] [-s] [-i]' - echo ' [-d] ' + echo ' version [-l] [-n] [-p] [-s] [-e]' + echo ' [-i] [-d] ' echo '' echo 'Not available (because module was not built-in):' echo ' mdate [-n] [-z] [-s] [-d] [-f] [-o] ' @@ -96,17 +97,21 @@ echo ' mkshadow [-v] [-t] [-a] ' echo ' guessos ' echo ' arx [-t] [-C] [ ...]' - echo ' slo -- -L -l [ -L -l ... ]' - echo ' scpp [-v] [-p] [-o] [-t] [-M] [-D]' - echo ' [-C] [ ...]' + echo ' slo [-p] -- -L -l [-L -l ...]' + echo ' scpp [-v] [-p] [-f] [-o] [-t] [-M]' + echo ' [-D] [-C] [ ...]' echo ' path [-s] [-r] [-d] [-b] [-m] [-p] [ ...]' echo '' exit 0 fi if [ ".$1" = ".-v" -o ".$1" = ."--version" ]; then - echo "GNU shtool 1.4.7 (24-Dec-1999)" + echo "GNU shtool 1.5.0 (01-Jul-2000)" exit 0 fi +if [ ".$1" = ".-r" -o ".$1" = ."--recreate" ]; then + shtoolize -oshtool echo install mkdir fixperm tarball version + exit 0 +fi if [ ".$1" = ".-d" -o ".$1" = ."--debug" ]; then shift set -x @@ -136,13 +141,20 @@ str_tool="echo" str_usage="[-n] [-e] [ ...]" arg_spec="0+" - opt_spec="ne" + opt_spec="n.e." + opt_n=no + opt_e=no ;; install ) str_tool="install" - str_usage="[-v] [-t] [-c] [-C] [-s] [-m] [-o] [-g] [-e] " - arg_spec="2" - opt_spec="vtcCsm:o:g:e:" + str_usage="[-v] [-t] [-c] [-C] [-s] [-m] [-o] [-g] [-e] [ ...] " + arg_spec="2+" + opt_spec="v.t.c.C.s.m:o:g:e:" + opt_v=no + opt_t=no + opt_c=no + opt_C=no + opt_s=no opt_m="" opt_o="" opt_g="" @@ -152,22 +164,28 @@ str_tool="mkdir" str_usage="[-t] [-f] [-p] [-m] [ ...]" arg_spec="1+" - opt_spec="tfpm:" + opt_spec="t.f.p.m:" + opt_t=no + opt_f=no + opt_p=no opt_m="" ;; fixperm ) str_tool="fixperm" str_usage="[-v] [-t] [ ...]" - gen_tmpfile=yes arg_spec="1+" - opt_spec="vt" + opt_spec="v.t." + opt_v=no + opt_t=no ;; tarball ) str_tool="tarball" str_usage="[-t] [-v] [-o ] [-c ] [-d ] [-u ] [-g ] [-e ] [ ...]" gen_tmpfile=yes arg_spec="1+" - opt_spec="tvo:c:d:u:g:e:" + opt_spec="t.v.o:c:d:u:g:e:" + opt_t=no + opt_v=no opt_o="" opt_c="" opt_d="" @@ -177,17 +195,22 @@ ;; version ) str_tool="version" - str_usage="[-l] [-n] [-p] [-s] [-i] [-d] " - arg_spec="1+" - opt_spec="l:n:p:s:i:d:" + str_usage="[-l] [-n] [-p] [-s] [-e] [-i] [-d] " + arg_spec="1=" + opt_spec="l:n:p:s:i:e.d:" opt_l="txt" opt_n="unknown" - opt_p="unknown" - opt_s="unknown" - opt_i="P" - opt_d="NO" - gen_tmpfile=yes + opt_p="" + opt_s="" + opt_e="no" + opt_i="" + opt_d="short" ;; + -* ) + echo "$0:Error: unknown option \`$tool'" 2>&1 + echo "$0:Hint: run \`$0 -h' for usage" 2>&1 + exit 1 + ;; * ) echo "$0:Error: unknown command \`$tool'" 2>&1 echo "$0:Hint: run \`$0 -h' for usage" 2>&1 @@ -201,30 +224,24 @@ # determine name of tool if [ ".$tool" != . ]; then - # inside shtool + # used inside shtool script toolcmd="$0 $tool" toolcmdhelp="shtool $tool" msgprefix="shtool:$tool" else - # standalone + # used as standalone script toolcmd="$0" - toolcmdhelp="sh.$tool" + toolcmdhelp="sh $0" msgprefix="$str_tool" fi # parse argument specification string -eval `echo $arg_spec | sed -e 's/^\([0-9]*\)\(.*\)/arg_NUMS="\1"; arg_MODE="\2"/'` -test ".$arg_MODE" = . && arg_MODE="=" +eval `echo $arg_spec |\ + sed -e 's/^\([0-9]*\)\([+=]\)/arg_NUMS=\1; arg_MODE=\2/'` # parse option specification string -for opt in `echo "h$opt_spec" | sed -e 's/\([a-zA-Z0-9][:+]*\)/\1 /g'`; do - opt_MODE="." - eval `echo $opt |\ - sed -e 's/^\([a-zA-Z0-9]\)/opt_THIS="\1";/' \ - -e 's/";\([:+]\)/"; opt_MODE="\1";/'` - eval "opt_MODE_${opt_THIS}=${opt_MODE}" - test "$opt_MODE" = . && eval "opt_${opt_THIS}=no" -done +eval `echo h.$opt_spec |\ + sed -e 's/\([a-zA-Z0-9]\)\([.:+]\)/opt_MODE_\1=\2;/g'` # interate over argument line opt_PREV='' @@ -242,7 +259,7 @@ opt_OPT="$opt_PREV" opt_ARG="$1" opt_ARG_OK=yes - opt_PREV="" + opt_PREV='' else # split argument into option and argument case "$1" in @@ -252,8 +269,7 @@ -e 's/";\(.*\)$/"; opt_ARG="\1"/'` ;; -[a-zA-Z0-9]) - opt_OPT=`awk 'BEGIN { printf("%s", substr(OPT, 2)); }' \ - "OPT=$1" &2 echo "$msgprefix:Hint: run \`$toolcmd -h' or \`man shtool' for details" 1>&2 exit 1 fi ;; - "+" ) + '+' ) if [ $# -lt $arg_NUMS ]; then echo "$msgprefix:Error: invalid number of arguments (at least $arg_NUMS expected)" 1>&2 echo "$msgprefix:Hint: run \`$toolcmd -h' or \`man shtool' for details" 1>&2 @@ -327,13 +343,12 @@ # establish a temporary file on request if [ ".$gen_tmpfile" = .yes ]; then - tmpdir="/tmp" if [ ".$TMPDIR" != . ]; then tmpdir="$TMPDIR" + elif [ ".$TEMPDIR" != . ]; then + tmpdir="$TEMPDIR" else - if [ ".$TEMPDIR" != . ]; then - tmpdir="$TEMPDIR" - fi + tmpdir="/tmp" fi tmpfile="$tmpdir/.shtool.$$" rm -f $tmpfile >/dev/null 2>&1 @@ -349,7 +364,7 @@ echo ) ## ## echo -- Print string with optional construct expansion - ## Copyright (c) 1998-1999 Ralf S. Engelschall + ## Copyright (c) 1998-2000 Ralf S. Engelschall ## Originally written for WML as buildinfo ## @@ -376,8 +391,8 @@ term_bold='' term_norm='' if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%[Bb]'`" != . ]; then - # the most important terminals we directly know case $TERM in + # for the most important terminal types we directly know the sequences xterm|xterm*|vt220|vt220*) term_bold=`awk 'BEGIN { printf("%c%c%c%c", 27, 91, 49, 109); }' /dev/null` term_norm=`awk 'BEGIN { printf("%c%c%c", 27, 91, 109); }' /dev/null` @@ -386,35 +401,37 @@ term_bold=`awk 'BEGIN { printf("%c%c%c%c%c%c", 27, 91, 49, 109, 0, 0); }' /dev/null` term_norm=`awk 'BEGIN { printf("%c%c%c%c%c", 27, 91, 109, 0, 0); }' /dev/null` ;; - esac - # then try 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 "$dir/$tool" ]; then - for seq in bold md smso; do # smso is last - bold="`$dir/$tool $seq 2>/dev/null`" - if [ ".$bold" != . ]; then - term_bold="$bold" + # 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 "$dir/$tool" ]; then + for seq in bold md smso; do # 'smso' is last + bold="`$dir/$tool $seq 2>/dev/null`" + if [ ".$bold" != . ]; then + term_bold="$bold" + break + fi + done + if [ ".$term_bold" != . ]; then + for seq in sgr0 me rmso reset; do # 'reset' is last + norm="`$dir/$tool $seq 2>/dev/null`" + if [ ".$norm" != . ]; then + term_norm="$norm" + break + fi + done + fi break fi done - if [ ".$term_bold" != . ]; then - for seq in sgr0 me rmso reset; do # 'reset' is last - norm="`$dir/$tool $seq 2>/dev/null`" - if [ ".$norm" != . ]; then - term_norm="$norm" - break - fi - done + if [ ".$term_bold" != . -a ".$term_norm" != . ]; then + break; fi - break - fi - done - if [ ".$term_bold" != . -a ".$term_norm" != . ]; then - break; - fi - done + done + ;; + esac if [ ".$term_bold" = . -o ".$term_norm" = . ]; then echo "$msgprefix:Warning: unable to determine terminal sequence for bold mode" 1>&2 fi @@ -558,7 +575,7 @@ echo $seo "$text" else # the harder part: echo -n is best, because - # awk complains about some \xx sequences. + # awk may complain about some \xx sequences. if [ ".$minusn" != . ]; then echo $seo $minusn "$text" else @@ -570,131 +587,159 @@ install ) ## ## install -- Install a program, script or datafile - ## Copyright (c) 1997-1999 Ralf S. Engelschall + ## Copyright (c) 1997-2000 Ralf S. Engelschall ## Originally written for shtool ## - - src="$1" - dst="$2" - # If destination is a directory, append the input filename - if [ -d $dst ]; then - dst=`echo "$dst" | sed -e 's:/$::'` - dstfile=`echo "$src" | sed -e 's;.*/\([^/]*\)$;\1;'` - dst="$dst/$dstfile" - fi + # determine source(s) and destination + argc=$# + srcs="" + while [ $# -gt 1 ]; do + srcs="$srcs $1" + shift + done + dstpath="$1" - # Add a possible extension to src and dst - if [ ".$opt_e" != . ]; then - src="$src$opt_e" - dst="$dst$opt_e" + # type check for destination + dstisdir=0 + if [ -d $dstpath ]; then + dstpath=`echo "$dstpath" | sed -e 's:/$::'` + dstisdir=1 fi - # Check for correct arguments - if [ ".$src" = ".$dst" ]; then - echo "$msgprefix:Error: source and destination are the same" 1>&2 + # consistency check for destination + if [ $argc -gt 2 -a $dstisdir = 0 ]; then + echo "$msgprefix:Error: multiple sources require destination to be directory" 1>&2 exit 1 fi - - # Make a temp file name in the destination directory - dstdir=`echo $dst | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;' -e 's;^$;.;'` - dsttmp="$dstdir/#INST@$$#" - # Verbosity - if [ ".$opt_v" = .yes ]; then - echo "$src -> $dst" 1>&2 - fi + # iterate over all source(s) + for src in $srcs; do + dst=$dstpath - # Copy or move the file name to the temp name - # (because we might be not allowed to change the source) - if [ ".$opt_C" = .yes ]; then - opt_c=yes - fi - if [ ".$opt_c" = .yes ]; then - if [ ".$opt_t" = .yes ]; then - echo "cp $src $dsttmp" 1>&2 + # If destination is a directory, append the input filename + if [ $dstisdir = 1 ]; then + dstfile=`echo "$src" | sed -e 's;.*/\([^/]*\)$;\1;'` + dst="$dst/$dstfile" fi - cp $src $dsttmp || exit $? - else - if [ ".$opt_t" = .yes ]; then - echo "mv $src $dsttmp" 1>&2 + + # Add a possible extension to src and dst + if [ ".$opt_e" != . ]; then + src="$src$opt_e" + dst="$dst$opt_e" fi - mv $src $dsttmp || exit $? - fi - # Adjust the target file - # (we do chmod last to preserve setuid bits) - if [ ".$opt_s" = .yes ]; then - if [ ".$opt_t" = .yes ]; then - echo "strip $dsttmp" 1>&2 + # Check for correct arguments + if [ ".$src" = ".$dst" ]; then + echo "$msgprefix:Warning: source and destination are the same - skipped" 1>&2 + continue fi - strip $dsttmp || exit $? - fi - if [ ".$opt_o" != . ]; then - if [ ".$opt_t" = .yes ]; then - echo "chown $opt_o $dsttmp" 1>&2 + if [ -d "$src" ]; then + echo "$msgprefix:Warning: source \`$src' is a directory - skipped" 1>&2 + continue fi - chown $opt_o $dsttmp || exit $? - fi - if [ ".$opt_g" != . ]; then - if [ ".$opt_t" = .yes ]; then - echo "chgrp $opt_g $dsttmp" 1>&2 + + # Make a temp file name in the destination directory + dsttmp=`echo $dst |\ + sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;' -e 's;^$;.;' \ + -e "s;\$;/#INST@$$#;"` + + # Verbosity + if [ ".$opt_v" = .yes ]; then + echo "$src -> $dst" 1>&2 + fi + + # Copy or move the file name to the temp name + # (because we might be not allowed to change the source) + if [ ".$opt_C" = .yes ]; then + opt_c=yes fi - chgrp $opt_g $dsttmp || exit $? - fi - if [ ".$opt_m" != . ]; then - if [ ".$opt_t" = .yes ]; then - echo "chmod $opt_m $dsttmp" 1>&2 + if [ ".$opt_c" = .yes ]; then + if [ ".$opt_t" = .yes ]; then + echo "cp $src $dsttmp" 1>&2 + fi + cp $src $dsttmp || exit $? + else + if [ ".$opt_t" = .yes ]; then + echo "mv $src $dsttmp" 1>&2 + fi + mv $src $dsttmp || exit $? fi - chmod $opt_m $dsttmp || exit $? - fi - # Determine whether to do a quick install - # (has to be done _after_ the strip was already done) - quick=no - if [ ".$opt_C" = .yes ]; then - if [ -r $dst ]; then - if cmp -s $src $dst; then - quick=yes + # Adjust the target file + # (we do chmod last to preserve setuid bits) + if [ ".$opt_s" = .yes ]; then + if [ ".$opt_t" = .yes ]; then + echo "strip $dsttmp" 1>&2 fi + strip $dsttmp || exit $? fi - fi + if [ ".$opt_o" != . ]; then + if [ ".$opt_t" = .yes ]; then + echo "chown $opt_o $dsttmp" 1>&2 + fi + chown $opt_o $dsttmp || exit $? + fi + if [ ".$opt_g" != . ]; then + if [ ".$opt_t" = .yes ]; then + echo "chgrp $opt_g $dsttmp" 1>&2 + fi + chgrp $opt_g $dsttmp || exit $? + fi + if [ ".$opt_m" != . ]; then + if [ ".$opt_t" = .yes ]; then + echo "chmod $opt_m $dsttmp" 1>&2 + fi + chmod $opt_m $dsttmp || exit $? + fi - # Finally install the file to the real destination - if [ $quick = yes ]; then - if [ ".$opt_t" = .yes ]; then - echo "rm -f $dsttmp" 1>&2 + # Determine whether to do a quick install + # (has to be done _after_ the strip was already done) + quick=no + if [ ".$opt_C" = .yes ]; then + if [ -r $dst ]; then + if cmp -s $src $dst; then + quick=yes + fi + fi fi - rm -f $dsttmp - else - if [ ".$opt_t" = .yes ]; then - echo "rm -f $dst && mv $dsttmp $dst" 1>&2 + + # Finally install the file to the real destination + if [ $quick = yes ]; then + if [ ".$opt_t" = .yes ]; then + echo "rm -f $dsttmp" 1>&2 + fi + rm -f $dsttmp + else + if [ ".$opt_t" = .yes ]; then + echo "rm -f $dst && mv $dsttmp $dst" 1>&2 + fi + rm -f $dst && mv $dsttmp $dst fi - rm -f $dst && mv $dsttmp $dst - fi + done ;; mkdir ) ## ## mkdir -- Make one or more directories - ## Copyright (c) 1996-1999 Ralf S. Engelschall + ## Copyright (c) 1996-2000 Ralf S. Engelschall ## Originally written for public domain by Noah Friedman ## Cleaned up and enhanced for shtool ## errstatus=0 for p in ${1+"$@"}; do - # when the directory already exists... + # if the directory already exists... if [ -d "$p" ]; then - if [ ".$opt_f" = .no ]; then - echo "$msgprefix:Error: file exists: $p" 1>&2 + if [ ".$opt_f" = .no ] && [ ".$opt_p" = .no ]; then + echo "$msgprefix:Error: directory already exists: $p" 1>&2 errstatus=1 break else continue fi fi - # when the directory has to be created + # if the directory has to be created... if [ ".$opt_p" = .no ]; then if [ ".$opt_t" = .yes ]; then echo "mkdir $p" 1>&2 @@ -708,7 +753,7 @@ -e 's/\// /g' \ -e 's/^%/\//'` shift - pathcomp= + pathcomp='' for d in ${1+"$@"}; do pathcomp="$pathcomp$d" case "$pathcomp" in @@ -736,25 +781,18 @@ fixperm ) ## ## fixperm -- Fix file permissions inside a source tree - ## Copyright (c) 1996-1999 Ralf S. Engelschall + ## Copyright (c) 1996-2000 Ralf S. Engelschall ## Originally written for ePerl ## paths="$*" # check whether the test command supports the -x option - cat >$tmpfile </dev/null; then + if [ -x /bin/sh ] 2>/dev/null; then minusx="-x" else minusx="-r" fi - rm -f $tmpfile # iterate over paths for p in $paths; do @@ -799,25 +837,18 @@ tarball ) ## ## tarball -- Roll distribution tarballs - ## Copyright (c) 1999 Ralf S. Engelschall + ## Copyright (c) 1999-2000 Ralf S. Engelschall ## Originally written for shtool ## srcs="$*" # check whether the test command supports the -x option - cat >$tmpfile </dev/null; then + if [ -x /bin/sh ] 2>/dev/null; then minusx="-x" else minusx="-r" fi - rm -f $tmpfile # find the tools paths="`echo $PATH |\ @@ -935,14 +966,14 @@ echo "chown -R $opt_u $tmpdir/$tarname >/dev/null 2>&1" 2>&1 fi chown -R $opt_u $tmpdir/$tarname >/dev/null 2>&1 ||\ - echo "$msgprefix:Warning: cannot set user name \`$opt_u' (need root priviledges)" + echo "$msgprefix:Warning: cannot set user name \`$opt_u' (would require root priviledges)" fi if [ ".$opt_g" != . ]; then if [ ".$opt_t" = .yes ]; then echo "chgrp -R $opt_g $tmpdir/$tarname >/dev/null 2>&1" 2>&1 fi chgrp -R $opt_g $tmpdir/$tarname >/dev/null 2>&1 ||\ - echo "$msgprefix:Warning: cannot set group name \`$opt_g' (need root priviledges)" + echo "$msgprefix:Warning: cannot set group name \`$opt_g' (would require root priviledges)" fi if [ ".$opt_t" = .yes ]; then echo "(cd $tmpdir && $prg_find $tarname -type f -depth -print | sort | xargs $prg_tar cf -) | cat $compress >$tmpfile.out" 1>&2 @@ -968,141 +999,97 @@ version ) ## - ## version -- Generate and maintain a version information file - ## Copyright (c) 1994-1999 Ralf S. Engelschall - ## Originally written for ePerl + ## version -- Maintain a version information file + ## Copyright (c) 1994-2000 Ralf S. Engelschall + ## Originally written for ePerl, rewritten from scratch for shtool ## - LANGUAGE="$opt_l" - NAME="$opt_n" - PREFIX="$opt_p" - FULLVERSION="$opt_s" - INCREASE="$opt_i" - REPORT="$opt_d" - FILE="$1" - - # determine language - if [ ".$LANGUAGE" = .unknown ]; then - case $FILE in - *.txt ) LANGUAGE=txt ;; - *.c ) LANGUAGE=c ;; - *.pl | *.pm ) LANGUAGE=perl ;; - * ) echo "$tool:Error: unknown language type" 1>&2; exit 1 ;; - esac - fi + file="$1" - # determine prefix from name and vice versa - if [ ".$PREFIX" = . -o ".$PREFIX" = .unknown ]; then - if [ ".$NAME" != . -a ".$NAME" != .unknown ]; then - PREFIX="$NAME" - fi - fi - if [ ".$NAME" = . -o ".$NAME" = .unknown ]; then - if [ ".$PREFIX" != . -a ".$PREFIX" != .unknown ]; then - NAME="$PREFIX" + # determine prefix and name + name="$opt_n" + prefix="$opt_p" + + # determine current version + triple="$opt_s" + if [ ".$triple" != . ]; then + # use given triple + if [ ".`echo $triple | grep '[0-9]*.[0-9]*[sabp.][0-9]*'`" = . ]; then + echo "$msgprefix:Error: invalid argument to option \`-s': \`$opt_s'" 1>&2 + exit 1 fi + eval `echo $triple |\ + sed -e 's%\([0-9]*\)\.\([0-9]*\)\([sabp.]\)\([0-9]*\).*%\ + ver="\1";rev="\2";typ="\3";lev="\4"%'` + 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 |\ + head -1 | sed -e 's%.*Version \([0-9]*\)\.\([0-9]*\)\([sabp.]\)\([0-9]*\) (\([0-9]*-[a-zA-Z]*-[0-9]*\)).*%\ + ver="\1";rev="\2";typ="\3";lev="\4";tim="\5"%'` + else + # intialise to first version + ver=0 + rev=1 + typ=. + lev=0 + tim=calc fi - # determine version - date=unknown - version=0 - revision=0 - bplevel=0 - if [ ".$FULLVERSION" = .unknown ]; then - if [ -r "$FILE" ]; then - # grep out current information - id=`grep 'Version [0-9]*.[0-9]*[.abps][0-9]* ([0-9]*-[a-zA-Z]*-[0-9]*)' $FILE | \ - head -1 | \ - sed -e 's%.*Version \([0-9]*\)\.\([0-9]*\)\([.abps]\)\([0-9]*\) (\([0-9]*-[a-zA-Z]*-[0-9]*\)).*%\1:\2:\3:\4:\5%'` - version=`echo $id | awk -F: '{ print $1 }'` - revision=`echo $id | awk -F: '{ print $2 }'` - bptype=`echo $id | awk -F: '{ print $3 }'` - bplevel=`echo $id | awk -F: '{ print $4 }'` - date=`echo $id | awk -F: '{ print $5 }'` - if [ .$REPORT = .NO ]; then - case $INCREASE in - b ) bplevel=`expr $bplevel + 1` - bptype=b - ;; - a ) bplevel=`expr $bplevel + 1` - bptype=a - ;; - s ) bplevel=`expr $bplevel + 1` - bptype=s - ;; - P ) bplevel=`expr $bplevel + 1` - bptype=. - ;; - p ) bplevel=`expr $bplevel + 1` - bptype=p - ;; - r ) revision=`expr $revision + 1` - bptype=. - bplevel=0 - ;; - v ) version=`expr $version + 1` - revision=0 - bptype=. - bplevel=0 - ;; - esac - date=calc - fi - FULLVERSION="$version.$revision$bptype$bplevel" - else - # intialise to first version - version=0 - revision=5 - bptype=b - bplevel=0 - date=calc - fi - else - # take given version - V=`echo $FULLVERSION | sed -e 's%\([0-9]*\)\.\([0-9]*\)\([.abps]\)\([0-9]*\).*%\1:\2:\3:\4%'` - version=`echo $V | awk -F: '{ print $1 }'` - revision=`echo $V | awk -F: '{ print $2 }'` - bptype=`echo $V | awk -F: '{ print $3 }'` - bplevel=`echo $V | awk -F: '{ print $4 }'` - date=calc + # determine new version in batch + if [ ".$opt_i" != . ]; 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 "$msgprefix:Error: invalid argument to option \`-i': \`$opt_i'" 1>&2 + exit 1 + ;; + esac + tim=calc fi - # determine hex value of version - case $FULLVERSION in - *.*a* ) - HEX=`echo "$FULLVERSION" | sed -e 's/a.*//' | awk -F. '{ printf("%d%02d", $1, $2); }' && - echo "$FULLVERSION" | sed -e 's/.*a//' | awk '{ printf("0%02d", $1); }'` - ;; - *.*b* ) - HEX=`echo "$FULLVERSION" | sed -e 's/b.*//' | awk -F. '{ printf("%d%02d", $1, $2); }' && - echo "$FULLVERSION" | sed -e 's/.*b//' | awk '{ printf("1%02d", $1); }'` - ;; - *.*.* ) - HEX=`echo "$FULLVERSION" | awk -F. '{ printf("%d%02d2%02d", $1, $2, $3); }'` - ;; - esac + # determine new version interactively + if [ ".$opt_e" = .yes ]; then + echo "old version: ${ver}.${rev}${typ}${lev}" + while [ 1 ]; do + echo dummy | awk '{ printf("new version: "); }' + read triple + case $triple in + [0-9]*.[0-9]*[sabp.][0-9]* ) + ;; + * ) echo "$msgprefix:Error: invalid version string entered: \`$triple'" 1>&2 + continue + ;; + esac + break + done + eval `echo $triple |\ + sed -e 's%^\([0-9]*\)\.\([0-9]*\)\([sabp.]\)\([0-9]*\)$%\ + ver="\1";rev="\2";typ="\3";lev="\4"%'` + tim=calc + fi - # determine libtool version - case $FULLVERSION in - *.*a* ) - LTV=`echo "$FULLVERSION" | sed -e 's/a.*//' | awk -F. '{ printf("%d:0", $1*10+$2); }'` - ;; - *.*b* ) - LTV=`echo "$FULLVERSION" | sed -e 's/b.*//' | awk -F. '{ printf("%d:0", $1*10+$2); }'` - ;; - *.*.* ) - LTV=`echo "$FULLVERSION" | awk -F. '{ printf("%d:%d", $1*10+$2, $3); }'` - ;; + # 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 "$ver:$rev:$typnum:$levnum" |\ + awk -F: '{ printf("0x%X%02X%1X%02X", $1, $2, $3, $4); }'` + ltv=`echo "$ver:$rev:$typnum:$levnum" |\ + awk -F: '{ printf("%d:%d", $1*10 + $2, $3*10 + $4); }'` - # determine string out of filename - # (don't try to optimize this in any way - portability!) - FILESTR=`echo "$FILE" |\ - tr 'abcdefghijklmnopqrstuvwxyz./%+' \ - 'ABCDEFGHIJKLMNOPQRSTUVWXYZ____' | sed -e 's/-/_/g'` - # determine date - if [ ".$date" = .calc ]; then + if [ ".$tim" = .calc ]; then day=`date '+%d'` month=`date '+%m'` year=`date '+%Y' 2>/dev/null` @@ -1127,111 +1114,147 @@ 11) month='Nov' ;; 12) month='Dec' ;; esac - date="${day}-${month}-${year}" + tim="${day}-${month}-${year}" fi - if [ .$REPORT != .NO ]; then - case $REPORT in - long ) - echo "$version.$revision$bptype$bplevel ($date)" - ;; + # perform result actions + mode=show + if [ ".$opt_i" != . ]; then + mode=edit + elif [ ".$opt_e" = .yes ]; then + mode=edit + elif [ ".$opt_s" != . ]; then + mode=edit + fi + if [ ".$mode" = .show ]; then + # just display the current version + case $opt_d in short ) - echo "$version.$revision$bptype$bplevel" + echo "${ver}.${rev}${typ}${lev}" + ;; + long ) + echo "${ver}.${rev}${typ}${lev} ($tim)" ;; libtool ) - echo "$LTV" + echo "${ltv}" ;; hex ) - echo "0x$HEX" + echo "${hex}" + ;; + * ) echo "$msgprefix:Error: invalid argument to option \`-d': \`$opt_d'" 1>&2 + exit 1 ;; esac - rm -f $tmpfile >/dev/null 2>&1 - exit 0 - fi - - # create the version file according the the selected language - echo "new version: $version.$revision$bptype$bplevel ($date)" - case $LANGUAGE in - txt ) - cat >$tmpfile <<'EOT' + else + # update the version file - This is @NAME@, Version @VERSION@.@REVISION@@BPTYPE@@BPLEVEL@ (@DAY@-@MONTH@-@YEAR@) -EOT - ;; - c ) - cat >$tmpfile <<'EOT' -/* -** @FILE@ -- Version Information -** [automatically generated and maintained by shtool] -*/ - -#ifdef _AS_HEADER - -#ifndef _@FILESTR@ -#define _@FILESTR@ -#define @PREFIX@_VERSION 0x@HEX@ -extern const int @PREFIX@_Version; -extern const char @PREFIX@_VersionStr[]; -extern const char @PREFIX@_Hello[]; -extern const char @PREFIX@_GNUVersion[]; -extern const char @PREFIX@_WhatID[]; -extern const char @PREFIX@_RCSIdentID[]; -extern const char @PREFIX@_WebID[]; -extern const char @PREFIX@_PlainID[]; -#endif /* _@FILESTR@ */ - -#else - -const int @PREFIX@_Version = 0x@HEX@; -const char @PREFIX@_VersionStr[] = "@VERSION@.@REVISION@@BPTYPE@@BPLEVEL@ (@DAY@-@MONTH@-@YEAR@)"; -const char @PREFIX@_Hello[] = "This is @NAME@, Version @VERSION@.@REVISION@@BPTYPE@@BPLEVEL@ (@DAY@-@MONTH@-@YEAR@)"; -const char @PREFIX@_GNUVersion[] = "@NAME@ Version @VERSION@.@REVISION@@BPTYPE@@BPLEVEL@"; -const char @PREFIX@_WhatID[] = "@(#)@NAME@ Version @VERSION@.@REVISION@@BPTYPE@@BPLEVEL@ (@DAY@-@MONTH@-@YEAR@)"; -const char @PREFIX@_RCSIdentID[] = "$Id: @NAME@ @VERSION@.@REVISION@@BPTYPE@@BPLEVEL@ @DAY@-@MONTH@-@YEAR@ $"; -const char @PREFIX@_WebID[] = "@NAME@/@VERSION@.@REVISION@@BPTYPE@@BPLEVEL@"; -const char @PREFIX@_PlainID[] = "@VERSION@.@REVISION@@BPTYPE@@BPLEVEL@"; - -#endif -EOT - ;; - perl ) - cat >$tmpfile <<'EOT' -## -## @FILE@ -- Version Information -## [automatically generated and maintained by shtool] -## - -$@PREFIX@_Version = 0x@HEX@; -$@PREFIX@_VersionStr = "@VERSION@.@REVISION@@BPTYPE@@BPLEVEL@ (@DAY@-@MONTH@-@YEAR@)"; -$@PREFIX@_Hello = "This is @NAME@, Version @VERSION@.@REVISION@@BPTYPE@@BPLEVEL@ (@DAY@-@MONTH@-@YEAR@)"; -$@PREFIX@_GNUVersion = "@NAME@ Version @VERSION@.@REVISION@@BPTYPE@@BPLEVEL@"; -$@PREFIX@_WhatID = "@(#)@NAME@ Version @VERSION@.@REVISION@@BPTYPE@@BPLEVEL@ (@DAY@-@MONTH@-@YEAR@)"; -$@PREFIX@_RCSIdentID = "\$Id: @NAME@ @VERSION@.@REVISION@@BPTYPE@@BPLEVEL@ @DAY@-@MONTH@-@YEAR@ $/"; -$@PREFIX@_WebID = "@NAME@/@VERSION@.@REVISION@@BPTYPE@@BPLEVEL@"; -$@PREFIX@_PlainID = "@VERSION@.@REVISION@@BPTYPE@@BPLEVEL@"; - -1; -EOT - ;; - esac - - # now create the version file - rm -f $FILE >/dev/null 2>&1 - sed \ - -e "s|@FILE@|$FILE|g" \ - -e "s|@FILESTR@|$FILESTR|g" \ - -e "s|@PREFIX@|$PREFIX|g" \ - -e "s|@NAME@|$NAME|g" \ - -e "s|@HEX@|$HEX|g" \ - -e "s|@VERSION@|$version|g" \ - -e "s|@REVISION@|$revision|g" \ - -e "s|@BPTYPE@|$bptype|g" \ - -e "s|@BPLEVEL@|$bplevel|g" \ - -e "s|@YEAR@|$year|g" \ - -e "s|@MONTH@|$month|g" \ - -e "s|@DAY@|$day|g" <$tmpfile >$FILE - rm -f $tmpfile >/dev/null 2>&1 - exit 0 + # pre-generate various strings + triple="${ver}.${rev}${typ}${lev}" + vHex="$hex" + vShort="${triple}" + vLong="${triple} (${tim})" + vTeX="This is ${name}, Version ${triple} (${tim})" + vGNU="${name} ${triple} (${tim})" + vWeb="${name}/${triple}" + vSCCS="@(#)${name} ${triple} (${tim})" + vRCS="\$Id: ${name} ${triple} (${tim}) \$" + + # determine string out of filename + # (do NOT try to optimize this in any way because of portability) + filestr=`echo $file |\ + tr 'abcdefghijklmnopqrstuvwxyz./%+' \ + 'ABCDEFGHIJKLMNOPQRSTUVWXYZ____' | sed -e 's/-/_/g'` + + # generate uppercase prefix + prefixupper=`echo $prefix |\ + tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + + # create the version file according the the selected language + echo "new version: ${vLong}" + + cp /dev/null $file + case $opt_l in + txt ) + echo >>$file "" + echo >>$file " ${file} -- Version Information for ${name} (syntax: Text)" + echo >>$file " [automatically generated and maintained by GNU shtool]" + echo >>$file "" + echo >>$file " $vTeX" + echo >>$file "" + ;; + c ) + echo >>$file "/*" + echo >>$file "** ${file} -- Version Information for ${name} (syntax: C/C++)" + echo >>$file "** [automatically generated and maintained by GNU shtool]" + echo >>$file "*/" + echo >>$file "" + echo >>$file "#ifdef _${filestr}_AS_HEADER_" + echo >>$file "" + echo >>$file "#ifndef _${filestr}_" + echo >>$file "#define _${filestr}_" + echo >>$file "" + echo >>$file "#define ${prefixupper}VERSION ${vHex}" + echo >>$file "" + echo >>$file "typedef struct {" + echo >>$file " const int v_hex;" + echo >>$file " const char *v_short;" + echo >>$file " const char *v_long;" + echo >>$file " const char *v_tex;" + echo >>$file " const char *v_gnu;" + echo >>$file " const char *v_web;" + echo >>$file " const char *v_sccs;" + echo >>$file " const char *v_rcs;" + echo >>$file "} ${prefix}version_t;" + echo >>$file "" + echo >>$file "extern ${prefix}version_t ${prefix}version;" + echo >>$file "" + echo >>$file "#endif /* _${filestr}_ */" + echo >>$file "" + echo >>$file "#else /* _${filestr}_AS_HEADER_ */" + echo >>$file "" + echo >>$file "#define _${filestr}_AS_HEADER_" + echo >>$file "#include \"${file}\"" + echo >>$file "#undef _${filestr}_AS_HEADER_" + echo >>$file "" + echo >>$file "${prefix}version_t ${prefix}version = {" + echo >>$file " ${vHex}," + echo >>$file " \"${vShort}\"," + echo >>$file " \"${vLong}\"," + echo >>$file " \"${vTeX}\"," + echo >>$file " \"${vGNU}\"," + echo >>$file " \"${vWeb}\"," + echo >>$file " \"${vSCCS}\"," + echo >>$file " \"${vRCS}\"" + echo >>$file "};" + echo >>$file "" + echo >>$file "#endif /* _${filestr}_AS_HEADER_ */" + echo >>$file "" + ;; + perl ) + echo >>$file "##" + echo >>$file "## ${file} -- Version Information for ${name} (syntax: Perl)" + echo >>$file "## [automatically generated and maintained by GNU shtool]" + echo >>$file "##" + echo >>$file "" + echo >>$file "my \$${prefix}version = {" + echo >>$file " 'v_hex' => ${vHex}," + echo >>$file " 'v_short' => \"${vShort}\"," + echo >>$file " 'v_long' => \"${vLong}\"," + echo >>$file " 'v_tex' => \"${vTeX}\"," + echo >>$file " 'v_gnu' => \"${vGNU}\"," + echo >>$file " 'v_web' => \"${vWeb}\"," + echo >>$file " 'v_sccs' => \"${vSCCS}\"," + echo >>$file " 'v_rcs' => \"\\${vRCS}/\"" + echo >>$file "};" + echo >>$file "" + echo >>$file "1;" + echo >>$file "" + ;; + * ) echo "$msgprefix:Error: invalid argument to option \`-l': \`$opt_l'" 1>&2 + exit 1 + ;; + esac + fi ;; esac --AGGVDT0EEXS6UFIPBWLM-- From ossp-cvs-owner@ossp.org Fri Jul 14 13:11:24 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e6EBBNA19226; Fri, 14 Jul 2000 13:11:23 +0200 (CEST) Date: Fri, 14 Jul 2000 13:11:23 +0200 (CEST) Message-Id: <200007141111.e6EBBNA19226@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="P0KV81U0ELP4NQV7B4YF" Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/str ChangeLog Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list This is a multi-part message in MIME format. --P0KV81U0ELP4NQV7B4YF Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: commit summary Content-Disposition: inline OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 14-Jul-2000 13:11:23 Branch: HEAD Handle: 2000071412112300 Modified files: ossp-pkg/str ChangeLog Log: *** empty log message *** Summary: Revision Changes Path 1.24 +1 -1 ossp-pkg/str/ChangeLog ____________________________________________________________________________ --P0KV81U0ELP4NQV7B4YF Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Description: changes to ossp-pkg/str/ChangeLog Content-Disposition: attachment Index: ossp-pkg/str/ChangeLog ============================================================ $ cvs diff -u -r1.23 -r1.24 ChangeLog --- ossp-pkg/str/ChangeLog 2000/07/14 11:09:10 1.23 +++ ossp-pkg/str/ChangeLog 2000/07/14 11:11:23 1.24 @@ -9,7 +9,7 @@ ChangeLog - Changes between 0.9.3 and 0.9.4 (04-Feb-2000 to 13-Jul-2000): + Changes between 0.9.3 and 0.9.4 (04-Feb-2000 to 14-Jul-2000): *) Upgrade to GNU libtool 1.3.5 and GNU shtool 1.5.0. [Ralf S. Engelschall] --P0KV81U0ELP4NQV7B4YF-- From ossp-cvs-owner@ossp.org Fri Jul 14 16:45:50 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e6EEjnR34793; Fri, 14 Jul 2000 16:45:49 +0200 (CEST) Date: Fri, 14 Jul 2000 16:45:49 +0200 (CEST) Message-Id: <200007141445.e6EEjnR34793@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/cvs .cvsignore COPYING COPYING.LIB ChangeLog.zoo ... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 14-Jul-2000 16:45:49 Branch: vendor Handle: 1970010101000000 Modified files: (Branch: vendor) ossp-pkg/cvs/doc cvs.texinfo ossp-pkg/cvs/src sanity.sh Touched files: (Branch: vendor) ossp-pkg/cvs .cvsignore COPYING COPYING.LIB ChangeLog.zoo INSTALL Makefile.in NEWS README acconfig.h config.h.in configure configure.in ossp-pkg/cvs/diff .cvsignore Makefile.in analyze.c cmpbuf.c cmpbuf.h context.c diagmeet.note diff.c diff.h diff3.c diffrun.h dir.c ed.c ifdef.c io.c normal.c side.c system.h util.c version.c ossp-pkg/cvs/doc .cvsignore FAQ HACKING Makefile.in RCSFILES TESTS TODO cvs-paper.ms cvsclient.texi ossp-pkg/cvs/lib .cvsignore Makefile.in argmatch.c dup2.c fncase.c fnmatch.c fnmatch.h ftruncate.c getdate.c getdate.y getline.c getline.h getopt.c getopt.h getopt1.c hostname.c md5.c md5.h memmove.c mkdir.c regex.c regex.h rename.c savecwd.c savecwd.h sighandle.c strerror.c stripslash.c strstr.c strtoul.c system.h valloc.c wait.h waitpid.c xgetwd.c yesno.c ossp-pkg/cvs/man .cvsignore Makefile.in cvs.1 cvs.5 ossp-pkg/cvs/src .cvsignore Makefile.in add.c admin.c buffer.c buffer.h checkin.c checkout.c classify.c client.c client.h commit.c create_adm.c cvs.h cvsrc.c diff.c edit.c edit.h entries.c error.c error.h expand_path.c fileattr.c fileattr.h filesubr.c find_names.c hardlink.c hardlink.h hash.c hash.h history.c ignore.c import.c lock.c log.c login.c logmsg.c main.c mkmodules.c modules.c myndbm.c myndbm.h no_diff.c options.h.in parseinfo.c patch.c rcs.c rcs.h rcscmds.c recurse.c release.c remove.c repos.c root.c rtag.c run.c scramble.c server.c server.h status.c subr.c tag.c update.c update.h vers_ts.c version.c watch.c watch.h wrapper.c zlib.c ossp-pkg/cvs/zlib .cvsignore Makefile.in README adler32.c algorithm.doc compress.c crc32.c deflate.c deflate.h gzio.c infblock.c infblock.h infcodes.c infcodes.h inffast.c inffast.h inflate.c inftrees.c inftrees.h infutil.c infutil.h trees.c uncompr.c zconf.h zlib.h zutil.c zutil.h Log: Import of vendor CVS version, snapshot 20000714 [Release Tags: CVS_20000714] Summary: Revision Changes Path 1.1.1.8 +0 -0 ossp-pkg/cvs/doc/cvs.texinfo 1.1.1.11 +0 -0 ossp-pkg/cvs/src/sanity.sh ____________________________________________________________________________ http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/cvs/doc/cvs.texinfo?cvsroot=ossp&r1=1.1.1.7&r2=1.1.1.8 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/cvs/src/sanity.sh?cvsroot=ossp&r1=1.1.1.10&r2=1.1.1.11 From ossp-cvs-owner@ossp.org Fri Jul 14 17:14:22 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e6EFELb36795; Fri, 14 Jul 2000 17:14:21 +0200 (CEST) Date: Fri, 14 Jul 2000 17:14:21 +0200 (CEST) Message-Id: <200007141514.e6EFELb36795@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/str ChangeLog Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 14-Jul-2000 17:14:21 Branch: HEAD Handle: 2000071416142100 Modified files: ossp-pkg/str ChangeLog Log: Fix name now that it's known. Summary: Revision Changes Path 1.25 +1 -1 ossp-pkg/str/ChangeLog ____________________________________________________________________________ Index: ossp-pkg/str/ChangeLog ============================================================ $ cvs diff -u -r1.24 -r1.25 ChangeLog --- ossp-pkg/str/ChangeLog 2000/07/14 11:11:23 1.24 +++ ossp-pkg/str/ChangeLog 2000/07/14 15:14:21 1.25 @@ -15,7 +15,7 @@ [Ralf S. Engelschall] *) Make sure -lm is used if modf() is not in -lc. - [Unknown , Ralf S. Engelschall] + [Ed Griffiths , Ralf S. Engelschall] *) Avoid isupper() check in str_tolower() macro, because it breaks for things like str_tolower(*s++). From ossp-cvs-owner@ossp.org Fri Jul 14 17:19:07 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e6EFJ6337160; Fri, 14 Jul 2000 17:19:06 +0200 (CEST) Date: Fri, 14 Jul 2000 17:19:06 +0200 (CEST) Message-Id: <200007141519.e6EFJ6337160@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/cvs/src sanity.sh Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 14-Jul-2000 17:19:06 Branch: HEAD Handle: 2000071416190400 Modified files: ossp-pkg/cvs/src sanity.sh Log: Merge in conflicts Summary: Revision Changes Path 1.8 +221 -1 ossp-pkg/cvs/src/sanity.sh ____________________________________________________________________________ Index: ossp-pkg/cvs/src/sanity.sh ============================================================ $ cvs diff -u -r1.7 -r1.8 sanity.sh --- ossp-pkg/cvs/src/sanity.sh 2000/07/11 05:22:14 1.7 +++ ossp-pkg/cvs/src/sanity.sh 2000/07/14 15:19:04 1.8 @@ -639,7 +639,7 @@ tests="${tests} new newb conflicts conflicts2 conflicts3" tests="${tests} clean" # Checking out various places (modules, checkout -d, &c) - tests="${tests} modules modules2 modules3 modules4" + tests="${tests} modules modules2 modules3 modules4 modules5" tests="${tests} mkmodules-temp-file-removal" tests="${tests} cvsadm emptydir abspath toplevel toplevel2" # Log messages, error messages. @@ -7046,6 +7046,7 @@ # ampersand modules: modules2 # -s: modules. # -d: modules, modules3, cvsadm + # -i, -o, -u, -e, -t: modules5 # slashes in module names: modules3 ############################################################ @@ -7861,6 +7862,225 @@ rm -r 1 rm -rf ${CVSROOT_DIRNAME}/first-dir + ;; + + modules5) + # Test module programs + + mkdir ${CVSROOT_DIRNAME}/first-dir + mkdir 1 + cd 1 + dotest modules5-1 "${testcvs} -q co first-dir" "" + cd first-dir + mkdir subdir + dotest modules5-2 "${testcvs} add subdir" \ +"Directory ${TESTDIR}/cvsroot/first-dir/subdir added to the repository" + cd subdir + mkdir ssdir + dotest modules5-3 "${testcvs} add ssdir" \ +"Directory ${TESTDIR}/cvsroot/first-dir/subdir/ssdir added to the repository" + touch a b + dotest modules5-4 "${testcvs} add a b" \ +"${PROG} [a-z]*: scheduling file .a. for addition +${PROG} [a-z]*: scheduling file .b. for addition +${PROG} [a-z]*: use .${PROG} commit. to add these files permanently" + + dotest modules5-5 "${testcvs} ci -m added" \ +"${PROG} [a-z]*: Examining . +${PROG} [a-z]*: Examining ssdir +RCS file: ${TESTDIR}/cvsroot/first-dir/subdir/a,v +done +Checking in a; +${TESTDIR}/cvsroot/first-dir/subdir/a,v <-- a +initial revision: 1\.1 +done +RCS file: ${TESTDIR}/cvsroot/first-dir/subdir/b,v +done +Checking in b; +${TESTDIR}/cvsroot/first-dir/subdir/b,v <-- b +initial revision: 1\.1 +done" + + cd .. + dotest modules5-6 "${testcvs} -q co CVSROOT" \ +"U CVSROOT/checkoutlist +U CVSROOT/commitinfo +U CVSROOT/config +U CVSROOT/cvswrappers +U CVSROOT/editinfo +U CVSROOT/loginfo +U CVSROOT/modules +U CVSROOT/notify +U CVSROOT/rcsinfo +U CVSROOT/taginfo +U CVSROOT/verifymsg" + + for i in checkin checkout update export tag; do + cat >> ${CVSROOT_DIRNAME}/$i.sh <CVSROOT/modules <>realmodule/a + dotest modules5-13 "${testcvs} -q ci -m." \ +"Checking in realmodule/a; +${CVSROOT_DIRNAME}/first-dir/subdir/a,v <-- a +new revision: 1\.2; previous revision: 1\.1 +done +${PROG} [a-z]*: Executing ..${CVSROOT_DIRNAME}/checkin\.sh. .${CVSROOT_DIRNAME}/first-dir/subdir.. +checkin script invoked in /.*/realmodule +args: ${CVSROOT_DIRNAME}/first-dir/subdir" + else + dotest modules5-11 "${testcvs} -q co realmodule" \ +"checkout script invoked in ${TESTDIR}/1 +args: realmodule" + dotest modules5-12 "${testcvs} -q update" \ +"${PROG} [a-z]*: Executing ..${CVSROOT_DIRNAME}/update\.sh. .${CVSROOT_DIRNAME}/first-dir/subdir.. +update script invoked in ${TESTDIR}/1/realmodule +args: ${CVSROOT_DIRNAME}/first-dir/subdir" + echo "change" >>realmodule/a + dotest modules5-13 "${testcvs} -q ci -m." \ +"Checking in realmodule/a; +${CVSROOT_DIRNAME}/first-dir/subdir/a,v <-- a +new revision: 1\.2; previous revision: 1\.1 +done +${PROG} [a-z]*: Executing ..${CVSROOT_DIRNAME}/checkin\.sh. .${CVSROOT_DIRNAME}/first-dir/subdir.. +checkin script invoked in ${TESTDIR}/1/realmodule +args: ${CVSROOT_DIRNAME}/first-dir/subdir" + fi + dotest modules5-14 "echo yes | ${testcvs} release -d realmodule" \ +"You have \[0\] altered files in this repository\. +Are you sure you want to release (and delete) directory .realmodule.: " + dotest modules5-15 "${testcvs} -q rtag -Dnow MYTAG realmodule" \ +"tag script invoked in ${TESTDIR}/1 +args: realmodule MYTAG" + if test "$remote" = "yes"; then + dotest modules5-16 "${testcvs} -q export -r MYTAG realmodule" \ +"U realmodule/a +export script invoked in .* +args: realmodule" + else + dotest modules5-16 "${testcvs} -q export -r MYTAG realmodule" \ +"U realmodule/a +export script invoked in ${TESTDIR}/1 +args: realmodule" + fi + + dotest_fail modules5-17 "${testcvs} co realmodule/a" \ +"${PROG}"' [a-z]*: module `realmodule/a'\'' is a request for a file in a module which is not a directory' \ +"${PROG}"' [a-z]*: module `realmodule/a'\'' is a request for a file in a module which is not a directory +'"${PROG}"' \[[a-z]* aborted\]: cannot expand modules' + + # FIXCVS: The client gets confused in these cases and tries to + # store the scripts in the wrong places. + if test "$remote" != "yes"; then + # Now test the ability to check out a single file from a directory + dotest modules5-18 "${testcvs} co dirmodule/a" \ +"U dirmodule/a +${PROG} [a-z]*: Executing ..${CVSROOT_DIRNAME}/checkout\.sh. .dirmodule.. +checkout script invoked in ${TESTDIR}/1 +args: dirmodule" + dotest modules5-19 "test -d dirmodule && test -f dirmodule/a" "" + dotest_fail modules5-20 "test -f dirmodule/b" "" + dotest modules5-21 "echo yes | ${testcvs} release -d dirmodule" \ +"You have \[0\] altered files in this repository\. +Are you sure you want to release (and delete) directory .dirmodule.: " + + # Now test the ability to correctly reject a non-existent filename. + # For maximum studliness we would check that an error message is + # being output. + # We accept a zero exit status because it is what CVS does + # (Dec 95). Probably the exit status should be nonzero, + # however. + dotest modules5-22 "${testcvs} co dirmodule/nonexist" \ +"${PROG} [a-z]*: warning: new-born dirmodule/nonexist has disappeared +${PROG} [a-z]*: Executing ..${CVSROOT_DIRNAME}/checkout\.sh. .dirmodule.. +checkout script invoked in ${TESTDIR}/1 +args: dirmodule" + + # We tolerate the creation of the dirmodule directory, since that + # is what CVS does, not because we view that as preferable to not + # creating it. + dotest_fail modules5-23 "test -f dirmodule/a || test -f dirmodule/b" "" + rm -r dirmodule + + # Now test that a module using -d checks out to the specified + # directory. + dotest modules5-24 "${testcvs} -q co namedmodule" \ +"U nameddir/a +U nameddir/b +checkout script invoked in ${TESTDIR}/1 +args: nameddir" + dotest modules5-25 "test -f nameddir/a && test -f nameddir/b" "" + echo add line >>nameddir/a + # This seems suspicious: when we checkout an existing directory, + # the checkout script gets executed in addition to the update + # script. Is that by design or accident? + dotest modules5-26 "${testcvs} -q co namedmodule" \ +"M nameddir/a +${PROG} [a-z]*: Executing ..${CVSROOT_DIRNAME}/update\.sh. .${CVSROOT_DIRNAME}/first-dir/subdir.. +update script invoked in ${TESTDIR}/1/nameddir +args: ${CVSROOT_DIRNAME}/first-dir/subdir +checkout script invoked in ${TESTDIR}/1 +args: nameddir" + rm nameddir/a + dotest modules5-27 "${testcvs} -q co namedmodule" \ +"U nameddir/a +${PROG} [a-z]*: Executing ..${CVSROOT_DIRNAME}/update\.sh. .${CVSROOT_DIRNAME}/first-dir/subdir.. +update script invoked in ${TESTDIR}/1/nameddir +args: ${CVSROOT_DIRNAME}/first-dir/subdir +checkout script invoked in ${TESTDIR}/1 +args: nameddir" + dotest modules5-28 "echo yes | ${testcvs} release -d nameddir" \ +"You have \[0\] altered files in this repository\. +Are you sure you want to release (and delete) directory .nameddir.: " + fi + + cd .. + rm -rf 1 ${CVSROOT_DIRNAME}/first-dir ${CVSROOT_DIRNAME}/*.sh ;; mkmodules-temp-file-removal) From ossp-cvs-owner@ossp.org Fri Jul 14 17:24:18 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e6EFOHc37583; Fri, 14 Jul 2000 17:24:17 +0200 (CEST) Date: Fri, 14 Jul 2000 17:24:17 +0200 (CEST) Message-Id: <200007141524.e6EFOHc37583@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/str ChangeLog Makefile.in README str-config.1 str... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 14-Jul-2000 17:24:17 Branch: HEAD Handle: 2000071416241600 Modified files: ossp-pkg/str ChangeLog Makefile.in README str-config.1 str.3 str_version.c Log: Update str_version.c to new GNU shtool 1.5.0 format. Summary: Revision Changes Path 1.26 +5 -0 ossp-pkg/str/ChangeLog 1.31 +13 -19 ossp-pkg/str/Makefile.in 1.13 +1 -1 ossp-pkg/str/README 1.14 +2 -2 ossp-pkg/str/str-config.1 1.32 +2 -2 ossp-pkg/str/str.3 1.11 +41 -27 ossp-pkg/str/str_version.c ____________________________________________________________________________ Index: ossp-pkg/str/ChangeLog ============================================================ $ cvs diff -u -r1.25 -r1.26 ChangeLog --- ossp-pkg/str/ChangeLog 2000/07/14 15:14:21 1.25 +++ ossp-pkg/str/ChangeLog 2000/07/14 15:24:16 1.26 @@ -9,6 +9,11 @@ ChangeLog + Changes between 0.9.4 and 0.9.5 (14-Jul-2000 to xx-Jul-2000): + + *) Updated str_version.c to new GNU shtool 1.5.0 format. + [Ralf S. Engelschall] + Changes between 0.9.3 and 0.9.4 (04-Feb-2000 to 14-Jul-2000): *) Upgrade to GNU libtool 1.3.5 and GNU shtool 1.5.0. Index: ossp-pkg/str/Makefile.in ============================================================ $ cvs diff -u -r1.30 -r1.31 Makefile.in --- ossp-pkg/str/Makefile.in 2000/01/20 18:59:13 1.30 +++ ossp-pkg/str/Makefile.in 2000/07/14 15:24:16 1.31 @@ -73,14 +73,14 @@ $(S)str_version.c _VERSION = \ - $(SHTOOL) version -l c -n 'Str' -p STR $$OPT $(_VERSION_FILE);\ - V=`$(SHTOOL) version -l c -d long $(_VERSION_FILE)`;\ + $(SHTOOL) version -lc -nStr -pstr_ $$OPT $(_VERSION_FILE);\ + V=`$(SHTOOL) version -lc -dlong $(_VERSION_FILE)`;\ sed -e "s/Version .*(.*)/Version $$V/g" README.n && mv README.n README _MANPAGE = \ - V1=`$(SHTOOL) version -l c -d short $(_VERSION_FILE)`; \ - V2=`$(SHTOOL) version -l c -d long $(_VERSION_FILE)`; \ - D=`$(SHTOOL) version -l c -d long $(_VERSION_FILE) |\ + V1=`$(SHTOOL) version -lc -dshort $(_VERSION_FILE)`; \ + V2=`$(SHTOOL) version -lc -dlong $(_VERSION_FILE)`; \ + D=`$(SHTOOL) version -lc -dlong $(_VERSION_FILE) |\ sed -e 's;.*(;;' -e 's;).*;;'`; \ $(POD2MAN) --section=$${SEC} --center="$${ONELINE}" \ --release="$$D" --date="$${NAME} $$V1" $(S)$${BASENAME}.pod |\ @@ -156,21 +156,15 @@ # increase or update version information new-version: - OPT=-iv && $(_VERSION) -new-revision: - OPT=-ir && $(_VERSION) -new-patchlevel: - OPT=-iP && $(_VERSION) -new-betalevel: - OPT=-ib && $(_VERSION) -new-alphalevel: - OPT=-ia && $(_VERSION) -new-snaplevel: - OPT=-is && $(_VERSION) -new-release: - OPT=-s$(R) && $(_VERSION) + @V="$(VERSION)"; \ + if [ ".$$V" != . ]; then \ + OPT="-s$$V"; \ + else \ + OPT="-e"; \ + fi; \ + $(_VERSION) update-version: - OPT="-s`$(SHTOOL) version -l c -d short $(_VERSION_FILE)`" && $(_VERSION) + @OPT="-s`$(SHTOOL) version -lc -dshort $(_VERSION_FILE)`" && $(_VERSION) update: @$(RM) ltmain.sh ltconfig shtool Index: ossp-pkg/str/README ============================================================ $ cvs diff -u -r1.12 -r1.13 README --- ossp-pkg/str/README 2000/02/29 15:31:04 1.12 +++ ossp-pkg/str/README 2000/07/14 15:24:16 1.13 @@ -5,7 +5,7 @@ |____/ \__|_| Str - String Library - Version 0.9.4 (29-Feb-2000) + Version 0.9.5 (14-Jul-2000) ABSTRACT Index: ossp-pkg/str/str-config.1 ============================================================ $ cvs diff -u -r1.13 -r1.14 str-config.1 --- ossp-pkg/str/str-config.1 2000/02/29 15:31:04 1.13 +++ ossp-pkg/str/str-config.1 2000/07/14 15:24:16 1.14 @@ -93,7 +93,7 @@ .nr % 0 .rr F .\} -.TH STR-CONFIG 1 "29-Feb-2000" "Str 0.9.4" "String Library" +.TH STR-CONFIG 1 "14-Jul-2000" "Str 0.9.5" "String Library" .UC .if n .hy 0 .if n .na @@ -190,7 +190,7 @@ .SH "NAME" \fBstr-config\fR \- Str library build utility .SH "VERSION" -Str 0.9.4 (29-Feb-2000) +Str 0.9.5 (14-Jul-2000) .SH "SYNOPSIS" \fBstr-config\fR [\fB--help\fR] Index: ossp-pkg/str/str.3 ============================================================ $ cvs diff -u -r1.31 -r1.32 str.3 --- ossp-pkg/str/str.3 2000/02/29 15:31:04 1.31 +++ ossp-pkg/str/str.3 2000/07/14 15:24:16 1.32 @@ -93,7 +93,7 @@ .nr % 0 .rr F .\} -.TH str 3 "29-Feb-2000" "Str 0.9.4" "String Library" +.TH str 3 "14-Jul-2000" "Str 0.9.5" "String Library" .UC .if n .hy 0 .if n .na @@ -190,7 +190,7 @@ .SH "NAME" \fBStr\fR \- String Library .SH "VERSION" -Str 0.9.4 (29-Feb-2000) +Str 0.9.5 (14-Jul-2000) .SH "SYNOPSIS" \fBstr_len\fR, \fBstr_copy\fR, Index: ossp-pkg/str/str_version.c ============================================================ $ cvs diff -u -r1.10 -r1.11 str_version.c --- ossp-pkg/str/str_version.c 2000/02/29 15:31:04 1.10 +++ ossp-pkg/str/str_version.c 2000/07/14 15:24:16 1.11 @@ -1,32 +1,46 @@ /* -** str_version.c -- Version Information -** [automatically generated and maintained by shtool] +** str_version.c -- Version Information for Str (syntax: C/C++) +** [automatically generated and maintained by GNU shtool] */ -#ifdef _AS_HEADER +#ifdef _STR_VERSION_C_AS_HEADER_ -#ifndef _STR_VERSION_C -#define _STR_VERSION_C -#define STR_VERSION 0x009204 -extern const int STR_Version; -extern const char STR_VersionStr[]; -extern const char STR_Hello[]; -extern const char STR_GNUVersion[]; -extern const char STR_WhatID[]; -extern const char STR_RCSIdentID[]; -extern const char STR_WebID[]; -extern const char STR_PlainID[]; -#endif /* _STR_VERSION_C */ - -#else - -const int STR_Version = 0x009204; -const char STR_VersionStr[] = "0.9.4 (29-Feb-2000)"; -const char STR_Hello[] = "This is Str, Version 0.9.4 (29-Feb-2000)"; -const char STR_GNUVersion[] = "Str Version 0.9.4"; -const char STR_WhatID[] = "@(#)Str Version 0.9.4 (29-Feb-2000)"; -const char STR_RCSIdentID[] = "$Id: str_version.c,v 1.10 2000/02/29 15:31:04 rse Exp $"; -const char STR_WebID[] = "Str/0.9.4"; -const char STR_PlainID[] = "0.9.4"; +#ifndef _STR_VERSION_C_ +#define _STR_VERSION_C_ -#endif +#define STR_VERSION 0x009205 + +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; +} str_version_t; + +extern str_version_t str_version; + +#endif /* _STR_VERSION_C_ */ + +#else /* _STR_VERSION_C_AS_HEADER_ */ + +#define _STR_VERSION_C_AS_HEADER_ +#include "str_version.c" +#undef _STR_VERSION_C_AS_HEADER_ + +str_version_t str_version = { + 0x009205, + "0.9.5", + "0.9.5 (14-Jul-2000)", + "This is Str, Version 0.9.5 (14-Jul-2000)", + "Str 0.9.5 (14-Jul-2000)", + "Str/0.9.5", + "@(#)Str 0.9.5 (14-Jul-2000)", + "$Id: str_version.c,v 1.11 2000/07/14 15:24:16 rse Exp $" +}; + +#endif /* _STR_VERSION_C_AS_HEADER_ */ + From ossp-cvs-owner@ossp.org Sun Jul 16 14:54:20 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e6GCsIN41281; Sun, 16 Jul 2000 14:54:18 +0200 (CEST) Date: Sun, 16 Jul 2000 14:54:18 +0200 (CEST) Message-Id: <200007161254.e6GCsIN41281@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/cvs configure configure.in Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 16-Jul-2000 14:54:18 Branch: HEAD Handle: 2000071613541800 Modified files: ossp-pkg/cvs configure configure.in Log: *** empty log message *** Summary: Revision Changes Path 1.14 BLOB ossp-pkg/cvs/configure 1.14 +6 -0 ossp-pkg/cvs/configure.in ____________________________________________________________________________ Index: ossp-pkg/cvs/configure ============================================================ $ cvs update -p -r1.13 configure >configure.old $ cvs update -p -r1.14 configure >configure.new $ diff -u configure.old configure.new Index: ossp-pkg/cvs/configure.in ============================================================ $ cvs diff -u -r1.13 -r1.14 configure.in --- ossp-pkg/cvs/configure.in 2000/07/12 15:35:06 1.13 +++ ossp-pkg/cvs/configure.in 2000/07/16 12:54:18 1.14 @@ -133,11 +133,13 @@ AC_ARG_WITH([krb4], [ --with-krb4=value set default \$(KRB4) from value], [KRB4=$withval], + [KRB4=no] )dnl echo "default place for krb4 is $KRB4" AC_SUBST(KRB4)])dnl WITH_KRB4 +if test ".$KRB4" != .no; then krb_h= AC_MSG_CHECKING([for krb.h]) if test "$cross_compiling" != yes && test -r $KRB4/include/krb.h; then @@ -199,6 +201,7 @@ fi fi AC_CHECK_FUNCS(krb_get_err_text) +fi dnl dnl Use --with-gssapi=DIR to enable GSSAPI support. @@ -208,11 +211,13 @@ AC_ARG_WITH([gssapi], [ --with-gssapi=value GSSAPI directory], [GSSAPI=$withval], + [GSSAPI=no] )dnl echo "default place for GSSAPI is $GSSAPI" AC_SUBST(GSSAPI)])dnl WITH_GSSAPI +if test ".$GSSAPI" != .no; then hold_cppflags=$CPPFLAGS CPPFLAGS="$CPPFLAGS -I$GSSAPI/include " AC_CHECK_HEADERS(krb5.h gssapi.h gssapi/gssapi.h gssapi/gssapi_generic.h) @@ -240,6 +245,7 @@ # This is necessary on Irix 5.3, in order to link against libkrb5 -- # there, an_to_ln.o refers to things defined only in -lgen. AC_CHECK_LIB(gen, compile) +fi fi dnl From ossp-cvs-owner@ossp.org Sun Jul 16 20:14:42 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e6GIEf463628; Sun, 16 Jul 2000 20:14:41 +0200 (CEST) Date: Sun, 16 Jul 2000 20:14:41 +0200 (CEST) Message-Id: <200007161814.e6GIEf463628@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/cvs/src client.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 16-Jul-2000 20:14:41 Branch: HEAD Handle: 2000071619144100 Modified files: ossp-pkg/cvs/src client.c Log: *** empty log message *** Summary: Revision Changes Path 1.10 +21 -1 ossp-pkg/cvs/src/client.c ____________________________________________________________________________ Index: ossp-pkg/cvs/src/client.c ============================================================ $ cvs diff -u -r1.9 -r1.10 client.c --- ossp-pkg/cvs/src/client.c 2000/07/06 19:33:59 1.9 +++ ossp-pkg/cvs/src/client.c 2000/07/16 18:14:41 1.10 @@ -262,14 +262,34 @@ this_root = Name_Root ((char *) NULL, (char *) NULL); } +#ifdef OSSP_PATCH_CVSROOT + { + int cvsroot_alias; + cvsroot_t *e; + + cvsroot_alias = 0; + if ((e = cvsroot_lookup(NULL, current_root, NULL)) != NULL) + if (strcmp(e->slavepath, this_root) == 0) + cvsroot_alias = 1; + if ((e = cvsroot_lookup(NULL, NULL, this_root)) != NULL) + if (strcmp(e->masterpath, current_root) == 0) + cvsroot_alias = 1; +#endif + /* Now check the value for root. */ if (this_root && current_root +#ifdef OSSP_PATCH_CVSROOT + && !cvsroot_alias +#endif && (strcmp (this_root, current_root) != 0)) { /* Don't send this, since the CVSROOTs don't match. */ free (this_root); return 1; } +#ifdef OSSP_PATCH_CVSROOT + } +#endif free (this_root); } @@ -2689,7 +2709,7 @@ /* Add a directory name to the list of those sent to the server. */ if (update_dir && (*update_dir != '\0') - && (strcmp (update_dir, ".") != 0) + && (strcmp (update_dir, ".") != 0) /* RSE XXX, alternative to OSSP_PATCH_CVSROOT */ && (findnode (dirs_sent_to_server, update_dir) == NULL)) { Node *n; From ossp-cvs-owner@ossp.org Tue Jul 18 14:55:04 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e6ICt3E84793; Tue, 18 Jul 2000 14:55:03 +0200 (CEST) Date: Tue, 18 Jul 2000 14:55:03 +0200 (CEST) Message-Id: <200007181255.e6ICt3E84793@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/cvs .cvsignore COPYING COPYING.LIB ChangeLog.zoo ... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 18-Jul-2000 14:55:03 Branch: vendor Handle: 1970010101000000 Modified files: (Branch: vendor) ossp-pkg/cvs/src login.c Touched files: (Branch: vendor) ossp-pkg/cvs .cvsignore COPYING COPYING.LIB ChangeLog.zoo INSTALL Makefile.in NEWS README acconfig.h config.h.in configure configure.in ossp-pkg/cvs/diff .cvsignore Makefile.in analyze.c cmpbuf.c cmpbuf.h context.c diagmeet.note diff.c diff.h diff3.c diffrun.h dir.c ed.c ifdef.c io.c normal.c side.c system.h util.c version.c ossp-pkg/cvs/doc .cvsignore FAQ HACKING Makefile.in RCSFILES TESTS TODO cvs-paper.ms cvs.texinfo cvsclient.texi ossp-pkg/cvs/lib .cvsignore Makefile.in argmatch.c dup2.c fncase.c fnmatch.c fnmatch.h ftruncate.c getdate.c getdate.y getline.c getline.h getopt.c getopt.h getopt1.c hostname.c md5.c md5.h memmove.c mkdir.c regex.c regex.h rename.c savecwd.c savecwd.h sighandle.c strerror.c stripslash.c strstr.c strtoul.c system.h valloc.c wait.h waitpid.c xgetwd.c yesno.c ossp-pkg/cvs/man .cvsignore Makefile.in cvs.1 cvs.5 ossp-pkg/cvs/src .cvsignore Makefile.in add.c admin.c buffer.c buffer.h checkin.c checkout.c classify.c client.c client.h commit.c create_adm.c cvs.h cvsrc.c diff.c edit.c edit.h entries.c error.c error.h expand_path.c fileattr.c fileattr.h filesubr.c find_names.c hardlink.c hardlink.h hash.c hash.h history.c ignore.c import.c lock.c log.c logmsg.c main.c mkmodules.c modules.c myndbm.c myndbm.h no_diff.c options.h.in parseinfo.c patch.c rcs.c rcs.h rcscmds.c recurse.c release.c remove.c repos.c root.c rtag.c run.c sanity.sh scramble.c server.c server.h status.c subr.c tag.c update.c update.h vers_ts.c version.c watch.c watch.h wrapper.c zlib.c ossp-pkg/cvs/zlib .cvsignore Makefile.in README adler32.c algorithm.doc compress.c crc32.c deflate.c deflate.h gzio.c infblock.c infblock.h infcodes.c infcodes.h inffast.c inffast.h inflate.c inftrees.c inftrees.h infutil.c infutil.h trees.c uncompr.c zconf.h zlib.h zutil.c zutil.h Log: Import of vendor CVS version, snapshot 20000718 [Release Tags: CVS_20000718] Summary: Revision Changes Path 1.1.1.2 +0 -0 ossp-pkg/cvs/src/login.c ____________________________________________________________________________ http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/cvs/src/login.c?cvsroot=ossp&r1=1.1.1.1&r2=1.1.1.2 From ossp-cvs-owner@ossp.org Tue Jul 18 14:57:53 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e6ICvqf85011; Tue, 18 Jul 2000 14:57:52 +0200 (CEST) Date: Tue, 18 Jul 2000 14:57:52 +0200 (CEST) Message-Id: <200007181257.e6ICvqf85011@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/cvs/src login.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 18-Jul-2000 14:57:52 Branch: HEAD Handle: 2000071813575200 Modified files: ossp-pkg/cvs/src login.c Log: Merge in conflicts Summary: Revision Changes Path 1.4 +2 -0 ossp-pkg/cvs/src/login.c ____________________________________________________________________________ Index: ossp-pkg/cvs/src/login.c ============================================================ $ cvs diff -u -r1.3 -r1.4 login.c --- ossp-pkg/cvs/src/login.c 2000/05/12 15:18:18 1.3 +++ ossp-pkg/cvs/src/login.c 2000/07/18 12:57:52 1.4 @@ -370,6 +370,8 @@ strtok (linebuf, " "); tmp = strtok (NULL, "\n"); + if (tmp == NULL) + error (1, 0, "bad entry in %s for %s", passfile, CVSroot_original); /* Give it permanent storage. */ password = xstrdup (tmp); From ossp-cvs-owner@ossp.org Tue Jul 18 17:24:28 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e6IFOSe95313; Tue, 18 Jul 2000 17:24:28 +0200 (CEST) Date: Tue, 18 Jul 2000 17:24:28 +0200 (CEST) Message-Id: <200007181524.e6IFOSe95313@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/shiela shiela.pl Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 18-Jul-2000 17:24:27 Branch: HEAD Handle: 2000071816242700 Modified files: ossp-pkg/shiela shiela.pl Log: beautify imports Summary: Revision Changes Path 1.2 +1 -1 ossp-pkg/shiela/shiela.pl ____________________________________________________________________________ Index: ossp-pkg/shiela/shiela.pl ============================================================ $ cvs diff -u -r1.1.1.1 -r1.2 shiela.pl --- ossp-pkg/shiela/shiela.pl 2000/06/18 14:30:52 1.1.1.1 +++ ossp-pkg/shiela/shiela.pl 2000/07/18 15:24:27 1.2 @@ -1376,7 +1376,7 @@ @cvsinfo = (); $cvsmsg =~ s|Status:\n+Vendor Tag:\s+(\S+).*?\nRelease Tags:\s+(.+?)\s*\n(.+)$||s; my ($It, $IT, $list) = ($1, $2, $3); - $cvsmsg .= "[Release Tags: $IT]\n"; + $cvsmsg .= sprintf("[Release Tag%s: %s]\n", ($IT =~ m|\s| ? 's' : ''), $IT); while ($list =~ s|\n([ILNUCT])\s+(\S+)||s) { my ($Io, $Is) = ($1, $2); From ossp-cvs-owner@ossp.org Tue Jul 18 17:27:13 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e6IFRCC95529; Tue, 18 Jul 2000 17:27:12 +0200 (CEST) Date: Tue, 18 Jul 2000 17:27:12 +0200 (CEST) Message-Id: <200007181527.e6IFRCC95529@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/shiela INSTALL Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 18-Jul-2000 17:27:12 Branch: HEAD Handle: 2000071816271100 Modified files: ossp-pkg/shiela INSTALL Log: Redirect people to the manual page Summary: Revision Changes Path 1.2 +1 -0 ossp-pkg/shiela/INSTALL ____________________________________________________________________________ Index: ossp-pkg/shiela/INSTALL ============================================================ $ cvs diff -u -r1.1.1.1 -r1.2 INSTALL --- ossp-pkg/shiela/INSTALL 2000/06/18 14:30:47 1.1.1.1 +++ ossp-pkg/shiela/INSTALL 2000/07/18 15:27:11 1.2 @@ -10,4 +10,5 @@ INSTALLATION Usually you want to use Shiela inside the repository tree. + Read the shiela-install manual page for details. From ossp-cvs-owner@ossp.org Tue Jul 18 17:28:01 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e6IFS0k95611; Tue, 18 Jul 2000 17:28:00 +0200 (CEST) Date: Tue, 18 Jul 2000 17:28:00 +0200 (CEST) Message-Id: <200007181528.e6IFS0k95611@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/shiela shtool Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 18-Jul-2000 17:28:00 Branch: HEAD Handle: 2000071816275900 Modified files: ossp-pkg/shiela shtool Log: Upgrade shtool to 1.5.0 Summary: Revision Changes Path 1.2 +231 -257 ossp-pkg/shiela/shtool ____________________________________________________________________________ Index: ossp-pkg/shiela/shtool ============================================================ $ cvs diff -u -r1.1.1.1 -r1.2 shtool --- ossp-pkg/shiela/shtool 2000/06/18 14:30:49 1.1.1.1 +++ ossp-pkg/shiela/shtool 2000/07/18 15:27:59 1.2 @@ -6,7 +6,7 @@ ## See http://www.gnu.org/software/shtool/ for more information. ## See ftp://ftp.gnu.org/gnu/shtool/ for latest version. ## -## Version: 1.4.10 (18-Jun-2000) +## Version: 1.5.0 (01-Jul-2000) ## Contents: 7/17 available modules ## @@ -43,7 +43,7 @@ ## mkdir Make one or more directories ## fixperm Fix file permissions inside a source tree ## tarball Roll distribution tarballs -## version Generate and maintain a version information file +## version Maintain a version information file ## path Deal with program paths ## ## Not available commands (because module was not built-in): @@ -65,7 +65,7 @@ exit 1 fi if [ ".$1" = ".-h" -o ".$1" = ".--help" ]; then - echo "This is GNU shtool, version 1.4.10 (18-Jun-2000)" + echo "This is GNU shtool, version 1.5.0 (01-Jul-2000)" echo "Copyright (c) 1994-2000 Ralf S. Engelschall " echo "Report bugs to " echo '' @@ -75,6 +75,7 @@ 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 [] []:' echo ' echo [-n] [-e] [ ...]' @@ -84,8 +85,8 @@ echo ' fixperm [-v] [-t] [ ...]' echo ' tarball [-t] [-v] [-o ] [-c ] [-d ] [-u' echo ' ] [-g ] [-e ] [ ...]' - echo ' version [-l] [-n] [-p] [-s] [-i]' - echo ' [-d] ' + echo ' version [-l] [-n] [-p] [-s] [-e]' + echo ' [-i] [-d] ' echo ' path [-s] [-r] [-d] [-b] [-m] [-p] [ ...]' echo '' echo 'Not available (because module was not built-in):' @@ -104,9 +105,13 @@ exit 0 fi if [ ".$1" = ".-v" -o ".$1" = ."--version" ]; then - echo "GNU shtool 1.4.10 (18-Jun-2000)" + echo "GNU shtool 1.5.0 (01-Jul-2000)" exit 0 fi +if [ ".$1" = ".-r" -o ".$1" = ."--recreate" ]; then + shtoolize -oshtool echo install mkdir fixperm tarball version path + exit 0 +fi if [ ".$1" = ".-d" -o ".$1" = ."--debug" ]; then shift set -x @@ -190,16 +195,16 @@ ;; version ) str_tool="version" - str_usage="[-l] [-n] [-p] [-s] [-i] [-d] " - arg_spec="1+" - opt_spec="l:n:p:s:i:d:" + str_usage="[-l] [-n] [-p] [-s] [-e] [-i] [-d] " + arg_spec="1=" + opt_spec="l:n:p:s:i:e.d:" opt_l="txt" opt_n="unknown" - opt_p="unknown" - opt_s="unknown" - opt_i="P" - opt_d="NO" - gen_tmpfile=yes + opt_p="" + opt_s="" + opt_e="no" + opt_i="" + opt_d="short" ;; path ) str_tool="path" @@ -1007,142 +1012,97 @@ version ) ## - ## version -- Generate and maintain a version information file + ## version -- Maintain a version information file ## Copyright (c) 1994-2000 Ralf S. Engelschall - ## Originally written for ePerl + ## Originally written for ePerl, rewritten from scratch for shtool ## - LANGUAGE="$opt_l" - NAME="$opt_n" - PREFIX="$opt_p" - FULLVERSION="$opt_s" - INCREASE="$opt_i" - REPORT="$opt_d" - FILE="$1" - - # determine language - if [ ".$LANGUAGE" = .unknown ]; then - case $FILE in - *.txt ) LANGUAGE=txt ;; - *.c ) LANGUAGE=c ;; - *.pl | *.pm ) LANGUAGE=perl ;; - *.py) LANGUAGE=python ;; - * ) echo "$tool:Error: unknown language type" 1>&2; exit 1 ;; - esac - fi + file="$1" - # determine prefix from name and vice versa - if [ ".$PREFIX" = . -o ".$PREFIX" = .unknown ]; then - if [ ".$NAME" != . -a ".$NAME" != .unknown ]; then - PREFIX="$NAME" - fi - fi - if [ ".$NAME" = . -o ".$NAME" = .unknown ]; then - if [ ".$PREFIX" != . -a ".$PREFIX" != .unknown ]; then - NAME="$PREFIX" + # determine prefix and name + name="$opt_n" + prefix="$opt_p" + + # determine current version + triple="$opt_s" + if [ ".$triple" != . ]; then + # use given triple + if [ ".`echo $triple | grep '[0-9]*.[0-9]*[sabp.][0-9]*'`" = . ]; then + echo "$msgprefix:Error: invalid argument to option \`-s': \`$opt_s'" 1>&2 + exit 1 fi + eval `echo $triple |\ + sed -e 's%\([0-9]*\)\.\([0-9]*\)\([sabp.]\)\([0-9]*\).*%\ + ver="\1";rev="\2";typ="\3";lev="\4"%'` + 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 |\ + head -1 | sed -e 's%.*Version \([0-9]*\)\.\([0-9]*\)\([sabp.]\)\([0-9]*\) (\([0-9]*-[a-zA-Z]*-[0-9]*\)).*%\ + ver="\1";rev="\2";typ="\3";lev="\4";tim="\5"%'` + else + # intialise to first version + ver=0 + rev=1 + typ=. + lev=0 + tim=calc fi - # determine version - date=unknown - version=0 - revision=0 - bplevel=0 - if [ ".$FULLVERSION" = .unknown ]; then - if [ -r "$FILE" ]; then - # grep out current information - id=`grep 'Version [0-9]*.[0-9]*[.abps][0-9]* ([0-9]*-[a-zA-Z]*-[0-9]*)' $FILE | \ - head -1 | \ - sed -e 's%.*Version \([0-9]*\)\.\([0-9]*\)\([.abps]\)\([0-9]*\) (\([0-9]*-[a-zA-Z]*-[0-9]*\)).*%\1:\2:\3:\4:\5%'` - version=`echo $id | awk -F: '{ print $1 }'` - revision=`echo $id | awk -F: '{ print $2 }'` - bptype=`echo $id | awk -F: '{ print $3 }'` - bplevel=`echo $id | awk -F: '{ print $4 }'` - date=`echo $id | awk -F: '{ print $5 }'` - if [ .$REPORT = .NO ]; then - case $INCREASE in - b ) bplevel=`expr $bplevel + 1` - bptype=b - ;; - a ) bplevel=`expr $bplevel + 1` - bptype=a - ;; - s ) bplevel=`expr $bplevel + 1` - bptype=s - ;; - P ) bplevel=`expr $bplevel + 1` - bptype=. - ;; - p ) bplevel=`expr $bplevel + 1` - bptype=p - ;; - r ) revision=`expr $revision + 1` - bptype=. - bplevel=0 - ;; - v ) version=`expr $version + 1` - revision=0 - bptype=. - bplevel=0 - ;; - esac - date=calc - fi - FULLVERSION="$version.$revision$bptype$bplevel" - else - # intialise to first version - version=0 - revision=5 - bptype=b - bplevel=0 - date=calc - fi - else - # take given version - V=`echo $FULLVERSION | sed -e 's%\([0-9]*\)\.\([0-9]*\)\([.abps]\)\([0-9]*\).*%\1:\2:\3:\4%'` - version=`echo $V | awk -F: '{ print $1 }'` - revision=`echo $V | awk -F: '{ print $2 }'` - bptype=`echo $V | awk -F: '{ print $3 }'` - bplevel=`echo $V | awk -F: '{ print $4 }'` - date=calc + # determine new version in batch + if [ ".$opt_i" != . ]; 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 "$msgprefix:Error: invalid argument to option \`-i': \`$opt_i'" 1>&2 + exit 1 + ;; + esac + tim=calc fi - # determine hex value of version - case $FULLVERSION in - *.*a* ) - HEX=`echo "$FULLVERSION" | sed -e 's/a.*//' | awk -F. '{ printf("%d%02d", $1, $2); }' && - echo "$FULLVERSION" | sed -e 's/.*a//' | awk '{ printf("0%02d", $1); }'` - ;; - *.*b* ) - HEX=`echo "$FULLVERSION" | sed -e 's/b.*//' | awk -F. '{ printf("%d%02d", $1, $2); }' && - echo "$FULLVERSION" | sed -e 's/.*b//' | awk '{ printf("1%02d", $1); }'` - ;; - *.*.* ) - HEX=`echo "$FULLVERSION" | awk -F. '{ printf("%d%02d2%02d", $1, $2, $3); }'` - ;; - esac + # determine new version interactively + if [ ".$opt_e" = .yes ]; then + echo "old version: ${ver}.${rev}${typ}${lev}" + while [ 1 ]; do + echo dummy | awk '{ printf("new version: "); }' + read triple + case $triple in + [0-9]*.[0-9]*[sabp.][0-9]* ) + ;; + * ) echo "$msgprefix:Error: invalid version string entered: \`$triple'" 1>&2 + continue + ;; + esac + break + done + eval `echo $triple |\ + sed -e 's%^\([0-9]*\)\.\([0-9]*\)\([sabp.]\)\([0-9]*\)$%\ + ver="\1";rev="\2";typ="\3";lev="\4"%'` + tim=calc + fi - # determine libtool version - case $FULLVERSION in - *.*a* ) - LTV=`echo "$FULLVERSION" | sed -e 's/a.*//' | awk -F. '{ printf("%d:0", $1*10+$2); }'` - ;; - *.*b* ) - LTV=`echo "$FULLVERSION" | sed -e 's/b.*//' | awk -F. '{ printf("%d:0", $1*10+$2); }'` - ;; - *.*.* ) - LTV=`echo "$FULLVERSION" | awk -F. '{ printf("%d:%d", $1*10+$2, $3); }'` - ;; + # 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 "$ver:$rev:$typnum:$levnum" |\ + awk -F: '{ printf("0x%X%02X%1X%02X", $1, $2, $3, $4); }'` + ltv=`echo "$ver:$rev:$typnum:$levnum" |\ + awk -F: '{ printf("%d:%d", $1*10 + $2, $3*10 + $4); }'` - # determine string out of filename - # (don't try to optimize this in any way - portability!) - FILESTR=`echo "$FILE" |\ - tr 'abcdefghijklmnopqrstuvwxyz./%+' \ - 'ABCDEFGHIJKLMNOPQRSTUVWXYZ____' | sed -e 's/-/_/g'` - # determine date - if [ ".$date" = .calc ]; then + if [ ".$tim" = .calc ]; then day=`date '+%d'` month=`date '+%m'` year=`date '+%Y' 2>/dev/null` @@ -1167,131 +1127,147 @@ 11) month='Nov' ;; 12) month='Dec' ;; esac - date="${day}-${month}-${year}" + tim="${day}-${month}-${year}" fi - if [ .$REPORT != .NO ]; then - case $REPORT in - long ) - echo "$version.$revision$bptype$bplevel ($date)" - ;; + # perform result actions + mode=show + if [ ".$opt_i" != . ]; then + mode=edit + elif [ ".$opt_e" = .yes ]; then + mode=edit + elif [ ".$opt_s" != . ]; then + mode=edit + fi + if [ ".$mode" = .show ]; then + # just display the current version + case $opt_d in short ) - echo "$version.$revision$bptype$bplevel" + echo "${ver}.${rev}${typ}${lev}" + ;; + long ) + echo "${ver}.${rev}${typ}${lev} ($tim)" ;; libtool ) - echo "$LTV" + echo "${ltv}" ;; hex ) - echo "0x$HEX" + echo "${hex}" + ;; + * ) echo "$msgprefix:Error: invalid argument to option \`-d': \`$opt_d'" 1>&2 + exit 1 ;; esac - rm -f $tmpfile >/dev/null 2>&1 - exit 0 - fi - - # create the version file according the the selected language - echo "new version: $version.$revision$bptype$bplevel ($date)" - case $LANGUAGE in - txt ) - cat >$tmpfile <<'EOT' - - This is @NAME@, Version @VERSION@.@REVISION@@BPTYPE@@BPLEVEL@ (@DAY@-@MONTH@-@YEAR@) - -EOT - ;; - c ) - cat >$tmpfile <<'EOT' -/* -** @FILE@ -- Version Information -** [automatically generated and maintained by GNU shtool] -*/ - -#ifdef _AS_HEADER - -#ifndef _@FILESTR@ -#define _@FILESTR@ -#define @PREFIX@_VERSION 0x@HEX@ -extern const int @PREFIX@_Version; -extern const char @PREFIX@_VersionStr[]; -extern const char @PREFIX@_Hello[]; -extern const char @PREFIX@_GNUVersion[]; -extern const char @PREFIX@_WhatID[]; -extern const char @PREFIX@_RCSIdentID[]; -extern const char @PREFIX@_WebID[]; -extern const char @PREFIX@_PlainID[]; -#endif /* _@FILESTR@ */ - -#else - -const int @PREFIX@_Version = 0x@HEX@; -const char @PREFIX@_VersionStr[] = "@VERSION@.@REVISION@@BPTYPE@@BPLEVEL@ (@DAY@-@MONTH@-@YEAR@)"; -const char @PREFIX@_Hello[] = "This is @NAME@, Version @VERSION@.@REVISION@@BPTYPE@@BPLEVEL@ (@DAY@-@MONTH@-@YEAR@)"; -const char @PREFIX@_GNUVersion[] = "@NAME@ Version @VERSION@.@REVISION@@BPTYPE@@BPLEVEL@"; -const char @PREFIX@_WhatID[] = "@(#)@NAME@ Version @VERSION@.@REVISION@@BPTYPE@@BPLEVEL@ (@DAY@-@MONTH@-@YEAR@)"; -const char @PREFIX@_RCSIdentID[] = "$Id: shtool,v 1.1.1.1 2000/06/18 14:30:49 rse Exp $"; -const char @PREFIX@_WebID[] = "@NAME@/@VERSION@.@REVISION@@BPTYPE@@BPLEVEL@"; -const char @PREFIX@_PlainID[] = "@VERSION@.@REVISION@@BPTYPE@@BPLEVEL@"; - -#endif - -EOT - ;; - perl ) - cat >$tmpfile <<'EOT' -## -## @FILE@ -- Version Information -## [automatically generated and maintained by GNU shtool] -## - -$@PREFIX@_Version = 0x@HEX@; -$@PREFIX@_VersionStr = "@VERSION@.@REVISION@@BPTYPE@@BPLEVEL@ (@DAY@-@MONTH@-@YEAR@)"; -$@PREFIX@_Hello = "This is @NAME@, Version @VERSION@.@REVISION@@BPTYPE@@BPLEVEL@ (@DAY@-@MONTH@-@YEAR@)"; -$@PREFIX@_GNUVersion = "@NAME@ Version @VERSION@.@REVISION@@BPTYPE@@BPLEVEL@"; -$@PREFIX@_WhatID = "@(#)@NAME@ Version @VERSION@.@REVISION@@BPTYPE@@BPLEVEL@ (@DAY@-@MONTH@-@YEAR@)"; -$@PREFIX@_RCSIdentID = "\$Id: shtool,v 1.1.1.1 2000/06/18 14:30:49 rse Exp $/"; -$@PREFIX@_WebID = "@NAME@/@VERSION@.@REVISION@@BPTYPE@@BPLEVEL@"; -$@PREFIX@_PlainID = "@VERSION@.@REVISION@@BPTYPE@@BPLEVEL@"; - -1; -EOT - ;; - python ) - cat >$tmpfile <<'EOT' -## -## @FILE@ -- Version Information -## [automatically generated and maintained by GNU shtool] -## - -@PREFIX@_Version = 0x@HEX@ -@PREFIX@_VersionStr = "@VERSION@.@REVISION@@BPTYPE@@BPLEVEL@ (@DAY@-@MONTH@-@YEAR@)" -@PREFIX@_Hello = "This is @NAME@, Version @VERSION@.@REVISION@@BPTYPE@@BPLEVEL@ (@DAY@-@MONTH@-@YEAR@)" -@PREFIX@_GNUVersion = "@NAME@ Version @VERSION@.@REVISION@@BPTYPE@@BPLEVEL@" -@PREFIX@_WhatID = "@(#)@NAME@ Version @VERSION@.@REVISION@@BPTYPE@@BPLEVEL@ (@DAY@-@MONTH@-@YEAR@)" -@PREFIX@_RCSIdentID = "$Id: shtool,v 1.1.1.1 2000/06/18 14:30:49 rse Exp $" -@PREFIX@_WebID = "@NAME@/@VERSION@.@REVISION@@BPTYPE@@BPLEVEL@" -@PREFIX@_PlainID = "@VERSION@.@REVISION@@BPTYPE@@BPLEVEL@" - -EOT - ;; - esac + else + # update the version file - # now create the version file - rm -f $FILE >/dev/null 2>&1 - sed \ - -e "s|@FILE@|$FILE|g" \ - -e "s|@FILESTR@|$FILESTR|g" \ - -e "s|@PREFIX@|$PREFIX|g" \ - -e "s|@NAME@|$NAME|g" \ - -e "s|@HEX@|$HEX|g" \ - -e "s|@VERSION@|$version|g" \ - -e "s|@REVISION@|$revision|g" \ - -e "s|@BPTYPE@|$bptype|g" \ - -e "s|@BPLEVEL@|$bplevel|g" \ - -e "s|@YEAR@|$year|g" \ - -e "s|@MONTH@|$month|g" \ - -e "s|@DAY@|$day|g" <$tmpfile >$FILE - rm -f $tmpfile >/dev/null 2>&1 - exit 0 + # pre-generate various strings + triple="${ver}.${rev}${typ}${lev}" + vHex="$hex" + vShort="${triple}" + vLong="${triple} (${tim})" + vTeX="This is ${name}, Version ${triple} (${tim})" + vGNU="${name} ${triple} (${tim})" + vWeb="${name}/${triple}" + vSCCS="@(#)${name} ${triple} (${tim})" + vRCS="\$Id: shtool,v 1.2 2000/07/18 15:27:59 rse Exp ${name} ${triple} (${tim}) \$" + + # determine string out of filename + # (do NOT try to optimize this in any way because of portability) + filestr=`echo $file |\ + tr 'abcdefghijklmnopqrstuvwxyz./%+' \ + 'ABCDEFGHIJKLMNOPQRSTUVWXYZ____' | sed -e 's/-/_/g'` + + # generate uppercase prefix + prefixupper=`echo $prefix |\ + tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + + # create the version file according the the selected language + echo "new version: ${vLong}" + + cp /dev/null $file + case $opt_l in + txt ) + echo >>$file "" + echo >>$file " ${file} -- Version Information for ${name} (syntax: Text)" + echo >>$file " [automatically generated and maintained by GNU shtool]" + echo >>$file "" + echo >>$file " $vTeX" + echo >>$file "" + ;; + c ) + echo >>$file "/*" + echo >>$file "** ${file} -- Version Information for ${name} (syntax: C/C++)" + echo >>$file "** [automatically generated and maintained by GNU shtool]" + echo >>$file "*/" + echo >>$file "" + echo >>$file "#ifdef _${filestr}_AS_HEADER_" + echo >>$file "" + echo >>$file "#ifndef _${filestr}_" + echo >>$file "#define _${filestr}_" + echo >>$file "" + echo >>$file "#define ${prefixupper}VERSION ${vHex}" + echo >>$file "" + echo >>$file "typedef struct {" + echo >>$file " const int v_hex;" + echo >>$file " const char *v_short;" + echo >>$file " const char *v_long;" + echo >>$file " const char *v_tex;" + echo >>$file " const char *v_gnu;" + echo >>$file " const char *v_web;" + echo >>$file " const char *v_sccs;" + echo >>$file " const char *v_rcs;" + echo >>$file "} ${prefix}version_t;" + echo >>$file "" + echo >>$file "extern ${prefix}version_t ${prefix}version;" + echo >>$file "" + echo >>$file "#endif /* _${filestr}_ */" + echo >>$file "" + echo >>$file "#else /* _${filestr}_AS_HEADER_ */" + echo >>$file "" + echo >>$file "#define _${filestr}_AS_HEADER_" + echo >>$file "#include \"${file}\"" + echo >>$file "#undef _${filestr}_AS_HEADER_" + echo >>$file "" + echo >>$file "${prefix}version_t ${prefix}version = {" + echo >>$file " ${vHex}," + echo >>$file " \"${vShort}\"," + echo >>$file " \"${vLong}\"," + echo >>$file " \"${vTeX}\"," + echo >>$file " \"${vGNU}\"," + echo >>$file " \"${vWeb}\"," + echo >>$file " \"${vSCCS}\"," + echo >>$file " \"${vRCS}\"" + echo >>$file "};" + echo >>$file "" + echo >>$file "#endif /* _${filestr}_AS_HEADER_ */" + echo >>$file "" + ;; + perl ) + echo >>$file "##" + echo >>$file "## ${file} -- Version Information for ${name} (syntax: Perl)" + echo >>$file "## [automatically generated and maintained by GNU shtool]" + echo >>$file "##" + echo >>$file "" + echo >>$file "my \$${prefix}version = {" + echo >>$file " 'v_hex' => ${vHex}," + echo >>$file " 'v_short' => \"${vShort}\"," + echo >>$file " 'v_long' => \"${vLong}\"," + echo >>$file " 'v_tex' => \"${vTeX}\"," + echo >>$file " 'v_gnu' => \"${vGNU}\"," + echo >>$file " 'v_web' => \"${vWeb}\"," + echo >>$file " 'v_sccs' => \"${vSCCS}\"," + echo >>$file " 'v_rcs' => \"\\${vRCS}/\"" + echo >>$file "};" + echo >>$file "" + echo >>$file "1;" + echo >>$file "" + ;; + * ) echo "$msgprefix:Error: invalid argument to option \`-l': \`$opt_l'" 1>&2 + exit 1 + ;; + esac + fi ;; path ) @@ -1378,10 +1354,8 @@ # MAGIC SITUATION # C pre-processor (cpp) if [ ".$opt_m" = .yes ] && [ ".$namelist" = .cpp ]; then - cat >$tmpfile.c <<'EOT' -#include -Syntax Error -EOT + echo >$tmpfile.c "#include " + echo >>$tmpfile.c "Syntax Error" # 1. try the standard cc -E approach cpp="${CC-cc} -E" (eval "$cpp $tmpfile.c >/dev/null") 2>$tmpfile.out @@ -1426,7 +1400,7 @@ path=`echo $path | sed -e 's;/*$;;'` if [ $minusx "$path/$name" ] && [ ! -d "$path/$name" ]; then if [ ".$opt_s" != .yes ]; then - echo "$path/$name" 2>&1 + echo "$path/$name" fi exit 0 fi From ossp-cvs-owner@ossp.org Tue Jul 18 17:31:59 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e6IFVxI95938; Tue, 18 Jul 2000 17:31:59 +0200 (CEST) Date: Tue, 18 Jul 2000 17:31:59 +0200 (CEST) Message-Id: <200007181531.e6IFVxI95938@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/shiela .cvsignore Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 18-Jul-2000 17:31:58 Branch: HEAD Handle: 2000071816315800 Added files: ossp-pkg/shiela .cvsignore Log: Ignore Makefile Summary: Revision Changes Path 1.1 +1 -0 ossp-pkg/shiela/.cvsignore ____________________________________________________________________________ Index: ossp-pkg/shiela/.cvsignore ============================================================ $ cvs update -p -r1.1 .cvsignore Makefile From ossp-cvs-owner@ossp.org Tue Jul 18 17:39:57 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e6IFdv396508; Tue, 18 Jul 2000 17:39:57 +0200 (CEST) Date: Tue, 18 Jul 2000 17:39:57 +0200 (CEST) Message-Id: <200007181539.e6IFdv396508@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/shiela TODO Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 18-Jul-2000 17:39:51 Branch: HEAD Handle: 2000071816395100 Modified files: ossp-pkg/shiela TODO Log: More todo Summary: Revision Changes Path 1.2 +4 -0 ossp-pkg/shiela/TODO ____________________________________________________________________________ Index: ossp-pkg/shiela/TODO ============================================================ $ cvs diff -u -r1.1.1.1 -r1.2 TODO --- ossp-pkg/shiela/TODO 2000/06/18 14:30:49 1.1.1.1 +++ ossp-pkg/shiela/TODO 2000/07/18 15:39:51 1.2 @@ -12,6 +12,10 @@ For version 1.0: ---------------- + o We could replace "cvs update -p -rX file" with "cvs diff -N -u3 + -Dyesterday file" to allow people to pass the log email directly to patch(1) + and this way let new files beeing added. Same for deleted files. + o Subject can be compressed by reducing common prefix and just repeating the subdirs together with the files: << [CVS] OSSP: ossp-pkg/ossp-cvs README.OSSP ossp-pkg/ossp-cvs/src cvsrc.c From ossp-cvs-owner@ossp.org Tue Jul 18 17:44:53 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e6IFiqA96887; Tue, 18 Jul 2000 17:44:52 +0200 (CEST) Date: Tue, 18 Jul 2000 17:44:52 +0200 (CEST) Message-Id: <200007181544.e6IFiqA96887@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: CVSROOT modules Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: CVSROOT Date: 18-Jul-2000 17:44:52 Branch: HEAD Handle: 2000071816445100 Modified files: CVSROOT modules Log: Add missing packages Summary: Revision Changes Path 1.21 +9 -0 CVSROOT/modules ____________________________________________________________________________ Index: CVSROOT/modules ============================================================ $ cvs diff -u -r1.20 -r1.21 modules --- CVSROOT/modules 2000/06/25 13:36:04 1.20 +++ CVSROOT/modules 2000/07/18 15:44:51 1.21 @@ -60,6 +60,15 @@ ossp-play ossp-play # the OSSP sub-modules +adns ossp-pkg/adns cvs ossp-pkg/cvs +eperl ossp-pkg/eperl +ev ossp-pkg/ev +jitterbug ossp-pkg/jitterbug +mm ossp-pkg/mm +pcre ossp-pkg/pcre +petidomo ossp-pkg/petidomo +sfio ossp-pkg/sfio shiela ossp-pkg/shiela +str ossp-pkg/str From ossp-cvs-owner@ossp.org Wed Jul 19 09:43:26 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e6J7hJk64450; Wed, 19 Jul 2000 09:43:19 +0200 (CEST) Date: Wed, 19 Jul 2000 09:43:19 +0200 (CEST) Message-Id: <200007190743.e6J7hJk64450@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/cvs README.OSSP ossp-pkg/cvs/src hash.c options.h... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 19-Jul-2000 09:43:19 Branch: HEAD Handle: 2000071908431701 Modified files: ossp-pkg/cvs README.OSSP ossp-pkg/cvs/src hash.c options.h.in Log: Replace hash function with a better one Summary: Revision Changes Path 1.43 +6 -0 ossp-pkg/cvs/README.OSSP 1.2 +9 -0 ossp-pkg/cvs/src/hash.c 1.29 +1 -0 ossp-pkg/cvs/src/options.h.in ____________________________________________________________________________ Index: ossp-pkg/cvs/README.OSSP ============================================================ $ cvs diff -u -r1.42 -r1.43 README.OSSP --- ossp-pkg/cvs/README.OSSP 2000/06/22 16:36:33 1.42 +++ ossp-pkg/cvs/README.OSSP 2000/07/19 07:43:17 1.43 @@ -326,6 +326,12 @@ the host. [Origin: Ralf S. Engelschall] + OSSP_PATCH_HASHFUNC: + This replaces the obscure hash function in src/hash.c with D.J.Berstein's + popular "times 33" function which is faster to compute and still + distributes very well. + [Origin: Ralf S. Engelschall] + OSSP_PATCH_COSMETICS: This just enables some cosmetic changes to various output messages. [Origin: Ralf S. Engelschall] Index: ossp-pkg/cvs/src/hash.c ============================================================ $ cvs diff -u -r1.1.1.2 -r1.2 hash.c --- ossp-pkg/cvs/src/hash.c 2000/06/10 18:19:29 1.1.1.2 +++ ossp-pkg/cvs/src/hash.c 2000/07/19 07:43:18 1.2 @@ -25,17 +25,25 @@ const char *key; { unsigned int h = 0; +#ifndef OSSP_PATCH_HASHFUNC unsigned int g; +#endif assert(key != NULL); while (*key != 0) { +#ifdef OSSP_PATCH_HASHFUNC + /* D.J. Bernstein's popular times 33 function + (fast and distributes very well) */ + h = ((h << 5) + h) + FOLD_FN_CHAR(*key++); +#else unsigned int c = *key++; /* The FOLD_FN_CHAR is so that findnode_fn works. */ h = (h << 4) + FOLD_FN_CHAR (c); if ((g = h & 0xf0000000) != 0) h = (h ^ (g >> 24)) ^ g; +#endif } return (h % HASHSIZE); Index: ossp-pkg/cvs/src/options.h.in ============================================================ $ cvs diff -u -r1.28 -r1.29 options.h.in --- ossp-pkg/cvs/src/options.h.in 2000/06/22 16:34:11 1.28 +++ ossp-pkg/cvs/src/options.h.in 2000/07/19 07:43:18 1.29 @@ -231,6 +231,7 @@ #define OSSP_PATCH_PSERVERD #define OSSP_PATCH_MAPROOT #define OSSP_PATCH_COSMETICS +#define OSSP_PATCH_HASHFUNC /* problematic changes, because they break "make check" */ #undef OSSP_PATCH_COSMETICS_HARD #undef OSSP_PATCH_MERGENOKEYWORD From ossp-cvs-owner@ossp.org Fri Jul 21 23:46:51 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e6LLkp857833; Fri, 21 Jul 2000 23:46:51 +0200 (CEST) Date: Fri, 21 Jul 2000 23:46:51 +0200 (CEST) Message-Id: <200007212146.e6LLkp857833@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/cvs README.OSSP ossp-pkg/cvs/src checkin.c option... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 21-Jul-2000 23:46:50 Branch: HEAD Handle: 2000072122464901 Modified files: ossp-pkg/cvs README.OSSP ossp-pkg/cvs/src checkin.c options.h.in update.c Log: New stuff from RCVS Summary: Revision Changes Path 1.44 +14 -0 ossp-pkg/cvs/README.OSSP 1.4 +10 -0 ossp-pkg/cvs/src/checkin.c 1.30 +3 -0 ossp-pkg/cvs/src/options.h.in 1.12 +17 -0 ossp-pkg/cvs/src/update.c ____________________________________________________________________________ Index: ossp-pkg/cvs/README.OSSP ============================================================ $ cvs diff -u -r1.43 -r1.44 README.OSSP --- ossp-pkg/cvs/README.OSSP 2000/07/19 07:43:17 1.43 +++ ossp-pkg/cvs/README.OSSP 2000/07/21 21:46:49 1.44 @@ -332,6 +332,20 @@ distributes very well. [Origin: Ralf S. Engelschall] + OSSP_PATCH_UPDATECMERGE: + Let "cvs update -C" to not complain if a file was modified and + would need merging. Instead just checkout the latest version. + [Origin: Ralf S. Engelschall] + + OSSP_PATCH_ADDFILEATTR: + Let the default file attrbuters set on newly added files. + [Origin: Noel Yap] + + OSSP_PATCH_BUGFIX: + This enabled various bugfixes which are still not present in the + official CVS version. + [Origin: Ralf S. Engelschall] + OSSP_PATCH_COSMETICS: This just enables some cosmetic changes to various output messages. [Origin: Ralf S. Engelschall] Index: ossp-pkg/cvs/src/checkin.c ============================================================ $ cvs diff -u -r1.3 -r1.4 checkin.c --- ossp-pkg/cvs/src/checkin.c 2000/06/22 15:50:32 1.3 +++ ossp-pkg/cvs/src/checkin.c 2000/07/21 21:46:50 1.4 @@ -139,6 +139,16 @@ history_write (type, NULL, vers->vn_rcs, finfo->file, finfo->repository); +#ifdef OSSP_PATCH_ADDFILEATTR + if (type == 'A') { + char *attr; + if ((attr = fileattr_getall(NULL)) != NULL) { + fileattr_setall(finfo->file, attr); + free(attr); + } + } +#endif + if (tocvsPath) if (unlink_file_dir (tocvsPath) < 0) error (0, errno, "cannot remove %s", tocvsPath); Index: ossp-pkg/cvs/src/options.h.in ============================================================ $ cvs diff -u -r1.29 -r1.30 options.h.in --- ossp-pkg/cvs/src/options.h.in 2000/07/19 07:43:18 1.29 +++ ossp-pkg/cvs/src/options.h.in 2000/07/21 21:46:50 1.30 @@ -232,6 +232,9 @@ #define OSSP_PATCH_MAPROOT #define OSSP_PATCH_COSMETICS #define OSSP_PATCH_HASHFUNC +#define OSSP_PATCH_UPDATECMERGE +#define OSSP_PATCH_ADDFILEATTR +#define OSSP_PATCH_BUGFIX /* problematic changes, because they break "make check" */ #undef OSSP_PATCH_COSMETICS_HARD #undef OSSP_PATCH_MERGENOKEYWORD Index: ossp-pkg/cvs/src/update.c ============================================================ $ cvs diff -u -r1.11 -r1.12 update.c --- ossp-pkg/cvs/src/update.c 2000/07/12 15:31:54 1.11 +++ ossp-pkg/cvs/src/update.c 2000/07/21 21:46:50 1.12 @@ -654,6 +654,23 @@ write_letter (finfo, 'C'); break; case T_NEEDS_MERGE: /* needs merging */ +#ifdef OSSP_PATCH_UPDATECMERGE + if (toss_local_changes) { + char *bakname; + bakname = backup_file (finfo->file, vers->vn_user); +#ifdef SERVER_SUPPORT + if ((! really_quiet) && (! server_active)) +#else /* ! SERVER_SUPPORT */ + if (! really_quiet) +#endif /* SERVER_SUPPORT */ + (void) printf ("(Locally modified %s moved to %s)\n", + finfo->file, bakname); + free (bakname); + status = T_CHECKOUT; + retval = checkout_file (finfo, vers, 0, 0, 1); + } + else +#endif retval = merge_file (finfo, vers); break; case T_MODIFIED: /* locally modified */ From ossp-cvs-owner@ossp.org Sun Jul 23 16:44:10 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e6NEi8F29158; Sun, 23 Jul 2000 16:44:08 +0200 (CEST) Date: Sun, 23 Jul 2000 16:44:08 +0200 (CEST) Message-Id: <200007231444.e6NEi8F29158@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/cvs/src create_adm.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 23-Jul-2000 16:44:08 Branch: HEAD Handle: 2000072315440600 Modified files: ossp-pkg/cvs/src create_adm.c Log: Add support for local CVS/Template Summary: Revision Changes Path 1.2 +35 -2 ossp-pkg/cvs/src/create_adm.c ____________________________________________________________________________ Index: ossp-pkg/cvs/src/create_adm.c ============================================================ $ cvs diff -u -r1.1.1.2 -r1.2 create_adm.c --- ossp-pkg/cvs/src/create_adm.c 2000/07/01 13:01:13 1.1.1.2 +++ ossp-pkg/cvs/src/create_adm.c 2000/07/23 14:44:06 1.2 @@ -21,6 +21,23 @@ or after which CVS might do something non-useful. If WARN is zero, then don't print warnings; all errors are fatal then. */ +#ifdef OSSP_PATCH_CVSROOT +static int local_template_cb(char *repository, char *template) +{ + copy_file(template, CVSADM_TEMPLATE); + return 0; +} + +static void local_template(char *update_dir, char *repository) +{ + cvsroot_t *e; + + if ((e = cvsroot_lookup(NULL, NULL, CVSroot_original)) != NULL) + Parse_Info(CVSROOTADM_RCSINFO, repository, local_template_cb, 1); + return; +} +#endif + int Create_Admin (dir, update_dir, repository, tag, date, nonbranch, warn, dotemplate) @@ -180,6 +197,20 @@ fprintf (stderr, "%c<- Create_Admin\n", (server_active) ? 'S' : ' '); } +#endif +#ifdef OSSP_PATCH_CVSROOT + /* Under our "cvs root" feature, checkouts are performed + locally (from the repository copy and without C/S), but commits + are performed remotely (to the master repository with C/S). + Unfortunately, CVS "optimizes" processing and doesn't provide + CVS/Template files on non-C/S checkouts. This would mean that + if "cvs root" feature is used, the rcsinfo-configured templates + are never used. So, if and only if we do a non-C/S checkout (or + similar operation which creates CVS/Template) _and_ the current + CVSROOT is known to be a repository copy, we force the creation + of CVS/Template. */ + if (!server_active && !client_active && dotemplate) + local_template(update_dir, repository); #endif free (reposcopy); From ossp-cvs-owner@ossp.org Sun Jul 23 19:40:14 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e6NHeDv42010; Sun, 23 Jul 2000 19:40:13 +0200 (CEST) Date: Sun, 23 Jul 2000 19:40:13 +0200 (CEST) Message-Id: <200007231740.e6NHeDv42010@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/cvs .cvsignore COPYING COPYING.LIB ChangeLog.zoo ... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 23-Jul-2000 19:40:13 Branch: vendor Handle: 1970010101000000 Modified files: (Branch: vendor) ossp-pkg/cvs/src mkmodules.c sanity.sh Touched files: (Branch: vendor) ossp-pkg/cvs .cvsignore COPYING COPYING.LIB ChangeLog.zoo INSTALL Makefile.in NEWS README acconfig.h config.h.in configure configure.in ossp-pkg/cvs/diff .cvsignore Makefile.in analyze.c cmpbuf.c cmpbuf.h context.c diagmeet.note diff.c diff.h diff3.c diffrun.h dir.c ed.c ifdef.c io.c normal.c side.c system.h util.c version.c ossp-pkg/cvs/doc .cvsignore FAQ HACKING Makefile.in RCSFILES TESTS TODO cvs-paper.ms cvs.texinfo cvsclient.texi ossp-pkg/cvs/lib .cvsignore Makefile.in argmatch.c dup2.c fncase.c fnmatch.c fnmatch.h ftruncate.c getdate.c getdate.y getline.c getline.h getopt.c getopt.h getopt1.c hostname.c md5.c md5.h memmove.c mkdir.c regex.c regex.h rename.c savecwd.c savecwd.h sighandle.c strerror.c stripslash.c strstr.c strtoul.c system.h valloc.c wait.h waitpid.c xgetwd.c yesno.c ossp-pkg/cvs/man .cvsignore Makefile.in cvs.1 cvs.5 ossp-pkg/cvs/src .cvsignore Makefile.in add.c admin.c buffer.c buffer.h checkin.c checkout.c classify.c client.c client.h commit.c create_adm.c cvs.h cvsrc.c diff.c edit.c edit.h entries.c error.c error.h expand_path.c fileattr.c fileattr.h filesubr.c find_names.c hardlink.c hardlink.h hash.c hash.h history.c ignore.c import.c lock.c log.c login.c logmsg.c main.c modules.c myndbm.c myndbm.h no_diff.c options.h.in parseinfo.c patch.c rcs.c rcs.h rcscmds.c recurse.c release.c remove.c repos.c root.c rtag.c run.c scramble.c server.c server.h status.c subr.c tag.c update.c update.h vers_ts.c version.c watch.c watch.h wrapper.c zlib.c ossp-pkg/cvs/zlib .cvsignore Makefile.in README adler32.c algorithm.doc compress.c crc32.c deflate.c deflate.h gzio.c infblock.c infblock.h infcodes.c infcodes.h inffast.c inffast.h inflate.c inftrees.c inftrees.h infutil.c infutil.h trees.c uncompr.c zconf.h zlib.h zutil.c zutil.h Log: Import of vendor CVS version, snapshot 20000723 [Release Tag: CVS_20000723] Summary: Revision Changes Path 1.1.1.3 +0 -0 ossp-pkg/cvs/src/mkmodules.c 1.1.1.12 +0 -0 ossp-pkg/cvs/src/sanity.sh ____________________________________________________________________________ http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/cvs/src/mkmodules.c?cvsroot=ossp&r1=1.1.1.2&r2=1.1.1.3 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/cvs/src/sanity.sh?cvsroot=ossp&r1=1.1.1.11&r2=1.1.1.12 From ossp-cvs-owner@ossp.org Sun Jul 23 19:45:34 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e6NHjXU42414; Sun, 23 Jul 2000 19:45:33 +0200 (CEST) Date: Sun, 23 Jul 2000 19:45:33 +0200 (CEST) Message-Id: <200007231745.e6NHjXU42414@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/cvs/src mkmodules.c sanity.sh Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 23-Jul-2000 19:45:27 Branch: HEAD Handle: 2000072318452600 Modified files: ossp-pkg/cvs/src mkmodules.c sanity.sh Log: Merge in conflicts Summary: Revision Changes Path 1.5 +5 -0 ossp-pkg/cvs/src/mkmodules.c 1.9 +6 -2 ossp-pkg/cvs/src/sanity.sh ____________________________________________________________________________ Index: ossp-pkg/cvs/src/mkmodules.c ============================================================ $ cvs diff -u -r1.4 -r1.5 mkmodules.c --- ossp-pkg/cvs/src/mkmodules.c 2000/05/12 20:14:37 1.4 +++ ossp-pkg/cvs/src/mkmodules.c 2000/07/23 17:45:26 1.5 @@ -322,10 +322,15 @@ "# Set this to \"no\" if pserver shouldn't check system users/passwords\n", "#SystemAuth=no\n", "\n", + "# Put CVS lock files in this directory rather than directly in the repository.\n", + "#LockDir=/var/lock/cvs\n", + "\n", +#ifdef PRESERVE_PERMISSIONS_SUPPORT "# Set `PreservePermissions' to `yes' to save file status information\n", "# in the repository.\n", "#PreservePermissions=no\n", "\n", +#endif "# Set `TopLevelAdmin' to `yes' to create a CVS directory at the top\n", "# level of the new working directory when using the `cvs checkout'\n", "# command.\n", Index: ossp-pkg/cvs/src/sanity.sh ============================================================ $ cvs diff -u -r1.8 -r1.9 sanity.sh --- ossp-pkg/cvs/src/sanity.sh 2000/07/14 15:19:04 1.8 +++ ossp-pkg/cvs/src/sanity.sh 2000/07/23 17:45:26 1.9 @@ -7932,6 +7932,7 @@ EOF dotest modules5-7 "${testcvs} ci -m 'add modules' CVSROOT/modules" \ +"" \ "Checking in CVSROOT/modules; ${TESTDIR}/cvsroot/CVSROOT/modules,v <-- modules new revision: 1\.[0-9]*; previous revision: 1\.[0-9]* @@ -8214,7 +8215,9 @@ ${CVSROOT_DIRNAME}/CVSROOT/modules,v <-- modules new revision: 1\.[0-9]*; previous revision: 1\.[0-9]* done -${PROG} [a-z]*: Rebuilding administrative file database" +${PROG} [a-z]*: Rebuilding administrative file database" \ +"${PROG} [a-z]*: Examining . +${PROG} [a-z]*: Examining CVSROOT" rm -rf CVS CVSROOT; # Create the various modules @@ -9561,7 +9564,8 @@ ${CVSROOT_DIRNAME}/CVSROOT/modules,v <-- modules new revision: 1\.[0-9]*; previous revision: 1\.[0-9]* done -${PROG} [a-z]*: Rebuilding administrative file database" +${PROG} [a-z]*: Rebuilding administrative file database" \ +"${PROG} [a-z]*: Examining CVSROOT" rm -rf CVS CVSROOT mkdir ${CVSROOT_DIRNAME}/mod1 ${CVSROOT_DIRNAME}/moda From ossp-cvs-owner@ossp.org Sun Jul 23 19:50:41 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e6NHoeG42802; Sun, 23 Jul 2000 19:50:40 +0200 (CEST) Date: Sun, 23 Jul 2000 19:50:40 +0200 (CEST) Message-Id: <200007231750.e6NHoeG42802@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/cvs/src import.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 23-Jul-2000 19:50:39 Branch: HEAD Handle: 2000072318503900 Modified files: ossp-pkg/cvs/src import.c Log: Shorten import output Summary: Revision Changes Path 1.13 +8 -0 ossp-pkg/cvs/src/import.c ____________________________________________________________________________ Index: ossp-pkg/cvs/src/import.c ============================================================ $ cvs diff -u -r1.12 -r1.13 import.c --- ossp-pkg/cvs/src/import.c 2000/07/12 15:31:53 1.12 +++ ossp-pkg/cvs/src/import.c 2000/07/23 17:50:39 1.13 @@ -467,7 +467,11 @@ "Use the following command to help the merge:"); cvs_output_tagged ("newline", NULL); cvs_output_tagged ("newline", NULL); +#ifdef OSSP_PATCH_COSMETICS + cvs_output_tagged ("text", " "); +#else cvs_output_tagged ("text", "\t"); +#endif cvs_output_tagged ("text", program_name); if (CVSroot_cmdline != NULL) { @@ -497,7 +501,11 @@ conflicts); (void) fprintf (logfp, "Use the following command to help the merge:\n\n"); +#ifdef OSSP_PATCH_COSMETICS + (void) fprintf (logfp, " %s checkout ", program_name); +#else (void) fprintf (logfp, "\t%s checkout ", program_name); +#endif (void) fprintf (logfp, "-j%s:yesterday -j%s %s\n\n", argv[1], argv[1], argv[0]); } From ossp-cvs-owner@ossp.org Sun Jul 23 19:53:45 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e6NHrjV43037; Sun, 23 Jul 2000 19:53:45 +0200 (CEST) Date: Sun, 23 Jul 2000 19:53:45 +0200 (CEST) Message-Id: <200007231753.e6NHrjV43037@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/cvs/src main.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 23-Jul-2000 19:53:45 Branch: HEAD Handle: 2000072318534400 Modified files: ossp-pkg/cvs/src main.c Log: Typo Summary: Revision Changes Path 1.22 +1 -1 ossp-pkg/cvs/src/main.c ____________________________________________________________________________ Index: ossp-pkg/cvs/src/main.c ============================================================ $ cvs diff -u -r1.21 -r1.22 main.c --- ossp-pkg/cvs/src/main.c 2000/07/12 15:50:09 1.21 +++ ossp-pkg/cvs/src/main.c 2000/07/23 17:53:44 1.22 @@ -1251,7 +1251,7 @@ if (e->slavepath[0] != '\0') { /* command does not modify repository and we still operare on the master repository, so switch to the slave repository, - because it is faster per definition. */ + because it is faster by definition. */ if (!quiet) { fprintf(stderr, "%s: switching to SLAVE location of repository `%s'\n", program_name, e->nickname); fprintf(stderr, "%s: %s --> %s\n", program_name, e->masterpath, e->slavepath); From ossp-cvs-owner@ossp.org Mon Jul 24 18:28:30 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e6OGSSD42123; Mon, 24 Jul 2000 18:28:28 +0200 (CEST) Date: Mon, 24 Jul 2000 18:28:28 +0200 (CEST) Message-Id: <200007241628.e6OGSSD42123@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/cvs/src create_adm.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 24-Jul-2000 18:28:28 Branch: HEAD Handle: 2000072417282700 Modified files: ossp-pkg/cvs/src create_adm.c Log: Manually do copy to avoid problems Summary: Revision Changes Path 1.3 +19 -1 ossp-pkg/cvs/src/create_adm.c ____________________________________________________________________________ Index: ossp-pkg/cvs/src/create_adm.c ============================================================ $ cvs diff -u -r1.2 -r1.3 create_adm.c --- ossp-pkg/cvs/src/create_adm.c 2000/07/23 14:44:06 1.2 +++ ossp-pkg/cvs/src/create_adm.c 2000/07/24 16:28:27 1.3 @@ -24,7 +24,25 @@ #ifdef OSSP_PATCH_CVSROOT static int local_template_cb(char *repository, char *template) { - copy_file(template, CVSADM_TEMPLATE); + FILE *fpIN, *fpOUT; + char buf[1024]; + size_t n; + + if ((fpOUT = CVS_FOPEN(CVSADM_TEMPLATE, "w+")) == NULL) + error(1, errno, "cannot open %s for writing", CVSADM_TEMPLATE); + if ((fpIN = CVS_FOPEN(template, "r")) == NULL) + error(1, errno, "cannot open %s for reading", template); + while (!feof(fpIN)) { + n = fread(buf, 1, sizeof buf, fpIN); + if (n == 0) { + if (ferror(fpIN)) + error(0, errno, "cannot read template file %s", template); + break; + } + fwrite(buf, 1, n, fpOUT); + } + fclose(fpIN); + fclose(fpOUT); return 0; } From ossp-cvs-owner@ossp.org Tue Jul 25 12:01:35 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e6PA1XM23828; Tue, 25 Jul 2000 12:01:33 +0200 (CEST) Date: Tue, 25 Jul 2000 12:01:33 +0200 (CEST) Message-Id: <200007251001.e6PA1XM23828@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/cvs acconfig.h config.h.in configure configure.in Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 25-Jul-2000 12:01:33 Branch: HEAD Handle: 2000072511013200 Modified files: ossp-pkg/cvs acconfig.h config.h.in configure configure.in Log: Fix pserverd code for SVR4 Summary: Revision Changes Path 1.2 +7 -0 ossp-pkg/cvs/acconfig.h 1.2 +45 -25 ossp-pkg/cvs/config.h.in 1.15 BLOB ossp-pkg/cvs/configure 1.15 +2 -0 ossp-pkg/cvs/configure.in ____________________________________________________________________________ Index: ossp-pkg/cvs/acconfig.h ============================================================ $ cvs diff -u -r1.1.1.1 -r1.2 acconfig.h --- ossp-pkg/cvs/acconfig.h 2000/04/08 13:11:36 1.1.1.1 +++ ossp-pkg/cvs/acconfig.h 2000/07/25 10:01:32 1.2 @@ -43,3 +43,10 @@ /* Define if the diff library should use setmode for binary files. FIXME: Why two different macros for setmode? */ #undef HAVE_SETMODE + +#undef HAVE_CRYPT +#undef HAVE_GETSPNAM +#undef REGEX_MALLOC +#undef _REGEX_RE_COMP + + Index: ossp-pkg/cvs/config.h.in ============================================================ $ cvs diff -u -r1.1.1.3 -r1.2 config.h.in --- ossp-pkg/cvs/config.h.in 2000/07/12 06:12:12 1.1.1.3 +++ ossp-pkg/cvs/config.h.in 2000/07/25 10:01:32 1.2 @@ -16,6 +16,9 @@ /* Define to `int' if doesn't define. */ #undef gid_t +/* Define if your system has a working fnmatch function. */ +#undef HAVE_FNMATCH + /* Define if you support file names longer than 14 characters. */ #undef HAVE_LONG_FILE_NAMES @@ -97,9 +100,6 @@ /* Define if you have the connect function. */ #undef HAVE_CONNECT -/* Define if this system supports chown(), link(), and friends. */ -#undef PRESERVE_PERMISSIONS_SUPPORT - /* Define if you have memchr (always for CVS). */ #undef HAVE_MEMCHR @@ -117,8 +117,13 @@ FIXME: Why two different macros for setmode? */ #undef HAVE_SETMODE -/* Define if you have the crypt function. */ #undef HAVE_CRYPT +#undef HAVE_GETSPNAM +#undef REGEX_MALLOC +#undef _REGEX_RE_COMP + +/* Define if you have the dup2 function. */ +#undef HAVE_DUP2 /* Define if you have the fchdir function. */ #undef HAVE_FCHDIR @@ -138,15 +143,21 @@ /* Define if you have the getpagesize function. */ #undef HAVE_GETPAGESIZE -/* Define if you have the getspnam function. */ -#undef HAVE_GETSPNAM - /* Define if you have the initgroups function. */ #undef HAVE_INITGROUPS /* Define if you have the krb_get_err_text function. */ #undef HAVE_KRB_GET_ERR_TEXT +/* Define if you have the memmove function. */ +#undef HAVE_MEMMOVE + +/* Define if you have the mkdir function. */ +#undef HAVE_MKDIR + +/* Define if you have the mknod function. */ +#undef HAVE_MKNOD + /* Define if you have the mktemp function. */ #undef HAVE_MKTEMP @@ -156,6 +167,12 @@ /* Define if you have the readlink function. */ #undef HAVE_READLINK +/* Define if you have the rename function. */ +#undef HAVE_RENAME + +/* Define if you have the setsid function. */ +#undef HAVE_SETSID + /* Define if you have the sigaction function. */ #undef HAVE_SIGACTION @@ -171,6 +188,15 @@ /* Define if you have the sigvec function. */ #undef HAVE_SIGVEC +/* Define if you have the strerror function. */ +#undef HAVE_STRERROR + +/* Define if you have the strstr function. */ +#undef HAVE_STRSTR + +/* Define if you have the strtoul function. */ +#undef HAVE_STRTOUL + /* Define if you have the tempnam function. */ #undef HAVE_TEMPNAM @@ -180,14 +206,17 @@ /* Define if you have the tzset function. */ #undef HAVE_TZSET +/* Define if you have the valloc function. */ +#undef HAVE_VALLOC + /* Define if you have the vprintf function. */ #undef HAVE_VPRINTF /* Define if you have the wait3 function. */ #undef HAVE_WAIT3 -/* Define if you have the mknod function. */ -#undef HAVE_MKNOD +/* Define if you have the waitpid function. */ +#undef HAVE_WAITPID /* Define if you have the header file. */ #undef HAVE_DIRECT_H @@ -213,6 +242,9 @@ /* Define if you have the header file. */ #undef HAVE_IO_H +/* Define if you have the header file. */ +#undef HAVE_KRB5_H + /* Define if you have the header file. */ #undef HAVE_LIMITS_H @@ -261,29 +293,5 @@ /* Define if you have the header file. */ #undef HAVE_UTIME_H -/* Define if you have the crypt library (-lcrypt). */ -#undef HAVE_LIBCRYPT - /* Define if you have the gen library (-lgen). */ #undef HAVE_LIBGEN - -/* Define if you have the inet library (-linet). */ -#undef HAVE_LIBINET - -/* Define if you have the nsl library (-lnsl). */ -#undef HAVE_LIBNSL - -/* Define if you have the nsl_s library (-lnsl_s). */ -#undef HAVE_LIBNSL_S - -/* Define if you have the sec library (-lsec). */ -#undef HAVE_LIBSEC - -/* Define if you have the socket library (-lsocket). */ -#undef HAVE_LIBSOCKET - -/* Define to force lib/regex.c to use malloc instead of alloca. */ -#undef REGEX_MALLOC - -/* Define to force lib/regex.c to define re_comp et al. */ -#undef _REGEX_RE_COMP Index: ossp-pkg/cvs/configure ============================================================ $ cvs update -p -r1.14 configure >configure.old $ cvs update -p -r1.15 configure >configure.new $ diff -u configure.old configure.new Index: ossp-pkg/cvs/configure.in ============================================================ $ cvs diff -u -r1.14 -r1.15 configure.in --- ossp-pkg/cvs/configure.in 2000/07/16 12:54:18 1.14 +++ ossp-pkg/cvs/configure.in 2000/07/25 10:01:32 1.15 @@ -331,6 +331,8 @@ dnl cp ./src/options.h ./src/options.h-SAVED dnl) +AC_CHECK_FUNCS(setsid) + AC_ARG_ENABLE(ossp, [ --disable-ossp disable the OSSP source patches],dnl [dnl From ossp-cvs-owner@ossp.org Tue Jul 25 13:18:40 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e6PBIdc29221; Tue, 25 Jul 2000 13:18:39 +0200 (CEST) Date: Tue, 25 Jul 2000 13:18:39 +0200 (CEST) Message-Id: <200007251118.e6PBIdc29221@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/cvs/src subr.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 25-Jul-2000 13:18:39 Branch: HEAD Handle: 2000072512183800 Modified files: ossp-pkg/cvs/src subr.c Log: Made time stuff more portable Summary: Revision Changes Path 1.8 +1 -5 ossp-pkg/cvs/src/subr.c ____________________________________________________________________________ Index: ossp-pkg/cvs/src/subr.c ============================================================ $ cvs diff -u -r1.7 -r1.8 subr.c --- ossp-pkg/cvs/src/subr.c 2000/06/15 06:44:45 1.7 +++ ossp-pkg/cvs/src/subr.c 2000/07/25 11:18:38 1.8 @@ -832,17 +832,13 @@ Y = atoi(buf); /* assemble parts into a time value */ + memset(&tm, 0, sizeof tm); tm.tm_sec = s; tm.tm_min = m; tm.tm_hour = h; tm.tm_mday = D; tm.tm_mon = M - 1; tm.tm_year = Y - 1900; - tm.tm_wday = 0; - tm.tm_yday = 0; - tm.tm_isdst = 0; - tm.tm_zone = NULL; - tm.tm_gmtoff = 0; t = mktime(&tm); if (t == -1) return 0; From ossp-cvs-owner@ossp.org Tue Jul 25 13:53:26 2000 Received: by mail.ossp.org (Sendmail 8.10.2+) for ossp-cvs@ossp.org id e6PBrQT31734; Tue, 25 Jul 2000 13:53:26 +0200 (CEST) Date: Tue, 25 Jul 2000 13:53:26 +0200 (CEST) Message-Id: <200007251153.e6PBrQT31734@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/iselect Makefile.in configure configure.in iselec... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 25-Jul-2000 13:53:25 Branch: HEAD Handle: 2000072512532401 Modified files: ossp-pkg/iselect Makefile.in configure configure.in iselect.1 iselect_version.c Log: Merge in pending changes Summary: Revision Changes Path 1.2 +29 -32 ossp-pkg/iselect/Makefile.in 1.2 +335 -152 ossp-pkg/iselect/configure 1.2 +41 -11 ossp-pkg/iselect/configure.in 1.2 +223 -43 ossp-pkg/iselect/iselect.1 1.3 +0 -0 ossp-pkg/iselect/iselect_version.c ____________________________________________________________________________ Index: ossp-pkg/iselect/Makefile.in ============================================================ $ cvs diff -u -r1.1.1.4 -r1.2 Makefile.in --- ossp-pkg/iselect/Makefile.in 1999/03/31 06:49:32 1.1.1.4 +++ ossp-pkg/iselect/Makefile.in 2000/07/25 11:53:24 1.2 @@ -16,7 +16,7 @@ # installation tools SHTOOL = @SHTOOL@ -NEWVERS = $(SHTOOL) newvers +NEWVERS = $(SHTOOL) version INSTALL = $(SHTOOL) install MKDIR = $(SHTOOL) mkdir FIXPERM = $(SHTOOL) fixperm @@ -53,7 +53,7 @@ # ------------------------------------------------ _GETDISTINFO = \ - _version=`$(NEWVERS) -l c -d short iselect_version.c`; \ + _version=`$(NEWVERS) -lc -dshort iselect_version.c`; \ _date=`date '+%y%m%d_%H%M'` _BUILDDIST = \ @@ -67,15 +67,15 @@ ls -l $${_tarball} _NEWVERS = \ - $(NEWVERS) -l c -p iSelect $$OPT iselect_version.c; \ - V=`$(NEWVERS) -l c -d long iselect_version.c`;\ + $(NEWVERS) -lc -piSelect $$OPT iselect_version.c; \ + V=`$(NEWVERS) -lc -dlong iselect_version.c`;\ sed -e "s/Version .*(.*)/Version $$V/g" README.n && mv README.n README; \ sed -e "s/Version .*(.*)/Version $$V/g" iselect_readme.txt.n && mv iselect_readme.txt.n iselect_readme.txt; _UPDATEVERS = \ - V=`$(NEWVERS) -l c -d short iselect_version.c`;\ - $(NEWVERS) -l c -p iSelect -r $$V iselect_version.c; \ - V=`$(NEWVERS) -l c -d long iselect_version.c`;\ + V=`$(NEWVERS) -lc -dshort iselect_version.c`;\ + $(NEWVERS) -lc -piSelect -s $$V iselect_version.c; \ + V=`$(NEWVERS) -lc -dlong iselect_version.c`;\ sed -e "s/Version .*(.*)/Version $$V/g" README.n && mv README.n README; \ sed -e "s/Version .*(.*)/Version $$V/g" iselect_readme.txt.n && mv iselect_readme.txt.n iselect_readme.txt; @@ -96,20 +96,15 @@ mv /tmp/$${_distname}.tar.gz $${_distname}.tar.gz new-version: - OPT="-i v"; $(_NEWVERS) - + OPT="-iv"; $(_NEWVERS) new-revision: - OPT="-i r"; $(_NEWVERS) - + OPT="-ir"; $(_NEWVERS) new-betalevel: - OPT="-i b"; $(_NEWVERS) - + OPT="-ib"; $(_NEWVERS) new-patchlevel: - OPT="-i P"; $(_NEWVERS) - + OPT="-iP"; $(_NEWVERS) new-release: - OPT="-r $(R)"; $(_NEWVERS) - + OPT="-s$(R)"; $(_NEWVERS) update-version: $(_UPDATEVERS) Index: ossp-pkg/iselect/configure ============================================================ $ cvs diff -u -r1.1.1.3 -r1.2 configure --- ossp-pkg/iselect/configure 1999/03/31 06:45:41 1.1.1.3 +++ ossp-pkg/iselect/configure 2000/07/25 11:53:24 1.2 @@ -2,9 +2,9 @@ # From configure.in Revision: 1.12 SHTOOL="./etc/shtool" -T_MD=`$SHTOOL becho -b 2>/dev/null` -T_ME=`$SHTOOL becho -e 2>/dev/null` -echo "${T_MD}Configuring for iSelect `./etc/shtool newvers -l c -d long iselect_version.c`${T_ME}" +T_MD=`$SHTOOL echo -e %B 2>/dev/null` +T_ME=`$SHTOOL echo -e %b 2>/dev/null` +echo "${T_MD}Configuring for iSelect `./etc/shtool version -lc -dlong iselect_version.c`${T_ME}" echo "Copyright (c) 1996-1999 Ralf S. Engelschall, All Rights Reserved." Index: ossp-pkg/iselect/configure.in ============================================================ $ cvs diff -u -r1.1.1.3 -r1.2 configure.in --- ossp-pkg/iselect/configure.in 1999/03/31 06:37:26 1.1.1.3 +++ ossp-pkg/iselect/configure.in 2000/07/25 11:53:24 1.2 @@ -4,11 +4,11 @@ dnl ## AC_PREREQ(2.10)dnl -AC_REVISION($Revision: 1.1.1.3 $) +AC_REVISION($Revision: 1.2 $) SHTOOL="./etc/shtool" -T_MD=`$SHTOOL becho -b 2>/dev/null` -T_ME=`$SHTOOL becho -e 2>/dev/null` -echo "${T_MD}Configuring for iSelect `./etc/shtool newvers -l c -d long iselect_version.c`${T_ME}" +T_MD=`$SHTOOL echo -e %B 2>/dev/null` +T_ME=`$SHTOOL echo -e %b 2>/dev/null` +echo "${T_MD}Configuring for iSelect `./etc/shtool version -lc -dlong iselect_version.c`${T_ME}" echo "Copyright (c) 1996-1999 Ralf S. Engelschall, All Rights Reserved." AC_INIT(README) Index: ossp-pkg/iselect/iselect.1 ============================================================ $ cvs diff -u -r1.1.1.4 -r1.2 iselect.1 --- ossp-pkg/iselect/iselect.1 1999/03/31 06:50:38 1.1.1.4 +++ ossp-pkg/iselect/iselect.1 2000/07/25 11:53:24 1.2 @@ -1,9 +1,9 @@ .rn '' }` -''' $RCSfile: iselect.1,v $$Revision: 1.1.1.4 $$Date: 1999/03/31 06:50:38 $ +''' $RCSfile: iselect.1,v $$Revision: 1.2 $$Date: 2000/07/25 11:53:24 $ ''' ''' $Log: iselect.1,v $ -''' Revision 1.1.1.4 1999/03/31 06:50:38 rse -''' Import iSelect 1.2.0 +''' Revision 1.2 2000/07/25 11:53:24 rse +''' Merge in pending changes ''' ''' .de Sh @@ -96,7 +96,7 @@ .nr % 0 .rr F .\} -.TH ISELECT 1 "EN" "31/Mar/99" "Ralf S. Engelschall" +.TH ISELECT 1 "EN" "22/Jun/1999" "Ralf S. Engelschall" .UC .if n .hy 0 .if n .na @@ -246,10 +246,10 @@ selected. .PP When you use a specific result via ``\f(CW\fR'\*(R' the \fIresult -text\fR can contain ``\f(CW%s[query text]s\fR'\*(R' and ``\f(CW%s[query text]S\fR'\*(R' +text\fR can contain ``\f(CW%[query text]s\fR'\*(R' and ``\f(CW%[query text]S\fR'\*(R' constructs. For every such construct an interactive query is done and the -result replaces the construct. The ``\f(CW%s[query text]S\fR'\*(R' construct is like -``\f(CW%s[query text]s\fR'\*(R' except that the empty string as the query result is not +result replaces the construct. The ``\f(CW%[query text]S\fR'\*(R' construct is like +``\f(CW%[query text]s\fR'\*(R' except that the empty string as the query result is not accepted on input. .PP The Curses-based full-screen selection is always done via \fI/dev/tty\fR, because Index: ossp-pkg/iselect/iselect_version.c ============================================================ $ cvs diff -u -r1.2 -r1.3 iselect_version.c --- ossp-pkg/iselect/iselect_version.c 2000/07/25 11:44:00 1.2 +++ ossp-pkg/iselect/iselect_version.c 2000/07/25 11:53:25 1.3 @@ -24,7 +24,7 @@ const char iSelect_Hello[] = "This is iSelect Version 1.2.0 (31-Mar-1999)"; const char iSelect_GNUVersion[] = "iSelect Version 1.2.0"; const char iSelect_WhatID[] = "@(#)iSelect Version 1.2.0 (31-Mar-1999)"; -const char iSelect_RCSIdentID[] = "$Id: iselect_version.c,v 1.2 2000/07/25 11:44:00 rse Exp $"; +const char iSelect_RCSIdentID[] = "$Id: iselect_version.c,v 1.3 2000/07/25 11:53:25 rse Exp $"; const char iSelect_WebID[] = "iSelect/1.2.0"; const char iSelect_PlainID[] = "1.2.0"; From ossp-cvs-owner@ossp.org Sat Jul 29 17:11:47 2000 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id e6TFBkq63964; Sat, 29 Jul 2000 17:11:46 +0200 (CEST) Date: Sat, 29 Jul 2000 17:11:46 +0200 (CEST) Message-Id: <200007291511.e6TFBkq63964@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/cvs .cvsignore COPYING COPYING.LIB ChangeLog.zoo ... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 29-Jul-2000 17:11:46 Branch: vendor Handle: 1970010101000000 Modified files: (Branch: vendor) ossp-pkg/cvs/doc cvsclient.texi ossp-pkg/cvs/src admin.c commit.c lock.c modules.c root.c sanity.sh server.c update.c Touched files: (Branch: vendor) ossp-pkg/cvs .cvsignore COPYING COPYING.LIB ChangeLog.zoo INSTALL Makefile.in NEWS README acconfig.h config.h.in configure configure.in ossp-pkg/cvs/diff .cvsignore Makefile.in analyze.c cmpbuf.c cmpbuf.h context.c diagmeet.note diff.c diff.h diff3.c diffrun.h dir.c ed.c ifdef.c io.c normal.c side.c system.h util.c version.c ossp-pkg/cvs/doc .cvsignore FAQ HACKING Makefile.in RCSFILES TESTS TODO cvs-paper.ms cvs.texinfo ossp-pkg/cvs/lib .cvsignore Makefile.in argmatch.c dup2.c fncase.c fnmatch.c fnmatch.h ftruncate.c getdate.c getdate.y getline.c getline.h getopt.c getopt.h getopt1.c hostname.c md5.c md5.h memmove.c mkdir.c regex.c regex.h rename.c savecwd.c savecwd.h sighandle.c strerror.c stripslash.c strstr.c strtoul.c system.h valloc.c wait.h waitpid.c xgetwd.c yesno.c ossp-pkg/cvs/man .cvsignore Makefile.in cvs.1 cvs.5 ossp-pkg/cvs/src .cvsignore Makefile.in add.c buffer.c buffer.h checkin.c checkout.c classify.c client.c client.h create_adm.c cvs.h cvsrc.c diff.c edit.c edit.h entries.c error.c error.h expand_path.c fileattr.c fileattr.h filesubr.c find_names.c hardlink.c hardlink.h hash.c hash.h history.c ignore.c import.c log.c login.c logmsg.c main.c mkmodules.c myndbm.c myndbm.h no_diff.c options.h.in parseinfo.c patch.c rcs.c rcs.h rcscmds.c recurse.c release.c remove.c repos.c rtag.c run.c scramble.c server.h status.c subr.c tag.c update.h vers_ts.c version.c watch.c watch.h wrapper.c zlib.c ossp-pkg/cvs/zlib .cvsignore Makefile.in README adler32.c algorithm.doc compress.c crc32.c deflate.c deflate.h gzio.c infblock.c infblock.h infcodes.c infcodes.h inffast.c inffast.h inflate.c inftrees.c inftrees.h infutil.c infutil.h trees.c uncompr.c zconf.h zlib.h zutil.c zutil.h Log: Import of vendor CVS version, snapshot 20000729 [Release Tag: CVS_20000729] Summary: Revision Changes Path 1.1.1.4 +0 -0 ossp-pkg/cvs/doc/cvsclient.texi 1.1.1.4 +0 -0 ossp-pkg/cvs/src/admin.c 1.1.1.6 +0 -0 ossp-pkg/cvs/src/commit.c 1.1.1.2 +0 -0 ossp-pkg/cvs/src/lock.c 1.1.1.5 +0 -0 ossp-pkg/cvs/src/modules.c 1.1.1.5 +0 -0 ossp-pkg/cvs/src/root.c 1.1.1.13 +0 -0 ossp-pkg/cvs/src/sanity.sh 1.1.1.14 +0 -0 ossp-pkg/cvs/src/server.c 1.1.1.10 +0 -0 ossp-pkg/cvs/src/update.c ____________________________________________________________________________ http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/cvs/doc/cvsclient.texi?cvsroot=ossp&r1=1.1.1.3&r2=1.1.1.4 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/cvs/src/admin.c?cvsroot=ossp&r1=1.1.1.3&r2=1.1.1.4 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/cvs/src/commit.c?cvsroot=ossp&r1=1.1.1.5&r2=1.1.1.6 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/cvs/src/lock.c?cvsroot=ossp&r1=1.1.1.1&r2=1.1.1.2 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/cvs/src/modules.c?cvsroot=ossp&r1=1.1.1.4&r2=1.1.1.5 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/cvs/src/root.c?cvsroot=ossp&r1=1.1.1.4&r2=1.1.1.5 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/cvs/src/sanity.sh?cvsroot=ossp&r1=1.1.1.12&r2=1.1.1.13 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/cvs/src/server.c?cvsroot=ossp&r1=1.1.1.13&r2=1.1.1.14 http://cvs.ossp.org/cvsweb.cgi/ossp-pkg/cvs/src/update.c?cvsroot=ossp&r1=1.1.1.9&r2=1.1.1.10 From ossp-cvs-owner@ossp.org Sat Jul 29 17:14:30 2000 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id e6TFESa64215; Sat, 29 Jul 2000 17:14:28 +0200 (CEST) Date: Sat, 29 Jul 2000 17:14:28 +0200 (CEST) Message-Id: <200007291514.e6TFESa64215@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/cvs/src admin.c commit.c lock.c modules.c root.c ... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 29-Jul-2000 17:14:28 Branch: HEAD Handle: 2000072916142600 Modified files: ossp-pkg/cvs/src admin.c commit.c lock.c modules.c root.c sanity.sh server.c update.c Log: Merge in conflicts Summary: Revision Changes Path 1.7 +39 -1 ossp-pkg/cvs/src/admin.c 1.10 +1 -0 ossp-pkg/cvs/src/commit.c 1.4 +2 -2 ossp-pkg/cvs/src/lock.c 1.6 +1 -0 ossp-pkg/cvs/src/modules.c 1.10 +13 -3 ossp-pkg/cvs/src/root.c 1.10 +9 -5 ossp-pkg/cvs/src/sanity.sh 1.28 +59 -62 ossp-pkg/cvs/src/server.c 1.13 +1 -0 ossp-pkg/cvs/src/update.c ____________________________________________________________________________ Index: ossp-pkg/cvs/src/admin.c ============================================================ $ cvs diff -u -r1.6 -r1.7 admin.c --- ossp-pkg/cvs/src/admin.c 2000/07/06 19:33:59 1.6 +++ ossp-pkg/cvs/src/admin.c 2000/07/29 15:14:26 1.7 @@ -22,7 +22,45 @@ static const char *const admin_usage[] = { - "Usage: %s %s rcs-options files...\n", + "Usage: %s %s [options] files...\n", + "\t-a users Append (comma-separated) user names to access list.\n", + "\t-A file Append another file's access list.\n", + "\t-b[rev] Set default branch (highest branch on trunk if omitted).\n", + "\t-c string Set comment leader.\n", + "\t-e[users] Remove (comma-separated) user names from access list\n", + "\t (all names if omitted).\n", + "\t-I Run interactively.\n", + "\t-k subst Set keyword substitution mode:\n", + "\t kv (Default) Substitue keyword and value.\n", + "\t kvl Substitue keyword, value, and locker (if any).\n", + "\t k Substitue keyword only.\n", + "\t o Preserve original string.\n", + "\t b Like o, but mark file as binary.\n", + "\t v Substitue value only.\n", + "\t-l[rev] Lock revision (latest revision on branch,\n", + "\t latest revision on trunk if omitted).\n", + "\t-L Set strict locking.\n", + "\t-m rev:msg Replace revision's log message.\n", + "\t-n tag[:[rev]] Tag branch or revision. If :rev is omitted,\n", + "\t delete the tag; if rev is omitted, tag the latest\n", + "\t revision on the default branch.\n", + "\t-N tag[:[rev]] Same as -n except override existing tag.\n", + "\t-o range Delete (outdate) specified range of revisions:\n", + "\t rev1::rev2 Between rev1 and rev2, excluding rev1 and rev2.\n", + "\t rev:: After rev on the same branch.\n", + "\t ::rev Before rev on the same branch.\n", + "\t rev Just rev.\n", + "\t rev1:rev2 Between rev1 and rev2, including rev1 and rev2.\n", + "\t rev: rev and following revisions on the same branch.\n", + "\t :rev rev and previous revisions on the same branch.\n", + "\t-q Run quietly.\n", + "\t-s state[:rev] Set revision state (latest revision on branch,\n", + "\t latest revision on trunk if omitted).\n", + "\t-t[file] Get descriptive text from file (stdin if omitted).\n", + "\t-t-string Set descriptive text.\n", + "\t-u[rev] Unlock the revision (latest revision on branch,\n", + "\t latest revision on trunk if omitted).\n", + "\t-U Unset strict locking.\n", "(Specify the --help global option for a list of other help options)\n", NULL }; Index: ossp-pkg/cvs/src/commit.c ============================================================ $ cvs diff -u -r1.9 -r1.10 commit.c --- ossp-pkg/cvs/src/commit.c 2000/06/22 13:31:38 1.9 +++ ossp-pkg/cvs/src/commit.c 2000/07/29 15:14:26 1.10 @@ -1516,6 +1516,7 @@ cvs_output (": Executing '", 0); run_print (stdout); cvs_output ("'\n", 0); + cvs_flushout (); (void) run_exec (RUN_TTY, RUN_TTY, RUN_TTY, RUN_NORMAL); free (repos); } Index: ossp-pkg/cvs/src/lock.c ============================================================ $ cvs diff -u -r1.3 -r1.4 lock.c --- ossp-pkg/cvs/src/lock.c 2000/04/27 16:44:30 1.3 +++ ossp-pkg/cvs/src/lock.c 2000/07/29 15:14:26 1.4 @@ -767,8 +767,8 @@ if (errno != EEXIST) { error (0, errno, - "failed to create lock directory in repository `%s'", - lock->repository); + "failed to create lock directory for `%s' (%s)", + lock->repository, masterlock); return (L_ERROR); } Index: ossp-pkg/cvs/src/modules.c ============================================================ $ cvs diff -u -r1.5 -r1.6 modules.c --- ossp-pkg/cvs/src/modules.c 2000/07/01 13:12:53 1.5 +++ ossp-pkg/cvs/src/modules.c 2000/07/29 15:14:26 1.6 @@ -738,6 +738,7 @@ cvs_output (": Executing '", 0); run_print (stdout); cvs_output ("'\n", 0); + cvs_flushout (); } err += run_exec (RUN_TTY, RUN_TTY, RUN_TTY, RUN_NORMAL); free (expanded_path); Index: ossp-pkg/cvs/src/root.c ============================================================ $ cvs diff -u -r1.9 -r1.10 root.c --- ossp-pkg/cvs/src/root.c 2000/07/11 05:22:14 1.9 +++ ossp-pkg/cvs/src/root.c 2000/07/29 15:14:26 1.10 @@ -517,12 +517,10 @@ switch (CVSroot_method) { case local_method: - case fork_method: if (CVSroot_username || CVSroot_hostname) { error (0, 0, "can't specify hostname and username in CVSROOT"); - error (0, 0, "when using %s access method", - CVSroot_method == local_method ? "local" : "fork"); + error (0, 0, "when using local access method"); error (0, 0, "(%s)", CVSroot); return 1; } @@ -534,6 +532,18 @@ if (!isabsolute (CVSroot_directory)) error (1, 0, "CVSROOT %s must be an absolute pathname", CVSroot_directory); + break; + case fork_method: + /* We want :fork: to behave the same as other remote access + methods. Therefore, don't check to see that the repository + name is absolute -- let the server do it. */ + if (CVSroot_username || CVSroot_hostname) + { + error (0, 0, "can't specify hostname and username in CVSROOT"); + error (0, 0, "when using fork access method"); + error (0, 0, "(%s)", CVSroot); + return 1; + } break; case kserver_method: #ifndef HAVE_KERBEROS Index: ossp-pkg/cvs/src/sanity.sh ============================================================ $ cvs diff -u -r1.9 -r1.10 sanity.sh --- ossp-pkg/cvs/src/sanity.sh 2000/07/23 17:45:26 1.9 +++ ossp-pkg/cvs/src/sanity.sh 2000/07/29 15:14:26 1.10 @@ -12493,6 +12493,7 @@ dotest info-1 "${testcvs} -q co CVSROOT" "[UP] CVSROOT${DOTSTAR}" cd CVSROOT + rm -f $TESTDIR/testlog $TESTDIR/testlog2 echo "ALL sh -c \"echo x\${=MYENV}\${=OTHER}y\${=ZEE}=\$USER=\$CVSROOT= >>$TESTDIR/testlog; cat >/dev/null\"" > loginfo # The following cases test the format string substitution echo "ALL echo %{sVv} >>$TESTDIR/testlog2; cat >/dev/null" >> loginfo @@ -12569,7 +12570,7 @@ dotest info-11 "${testcvs} -q -s ZEE=garbage ci -m nuke-loginfo" \ "Checking in loginfo; ${TESTDIR}/cvsroot/CVSROOT/loginfo,v <-- loginfo -new revision: 1\.[0-9]; previous revision: 1\.[0-9] +new revision: 1\.[0-9]*; previous revision: 1\.[0-9]* done ${PROG} [a-z]*: Rebuilding administrative file database" @@ -12580,6 +12581,7 @@ exit 0 else echo "No BugId found." + sleep 1 exit 1 fi EOF @@ -12588,7 +12590,7 @@ dotest info-v1 "${testcvs} -q ci -m add-verification" \ "Checking in verifymsg; ${TESTDIR}/cvsroot/CVSROOT/verifymsg,v <-- verifymsg -new revision: 1\.2; previous revision: 1\.1 +new revision: 1\.[0-9]*; previous revision: 1\.[0-9]* done ${PROG} [a-z]*: Rebuilding administrative file database" @@ -12624,7 +12626,7 @@ dotest info-cleanup-verifymsg "${testcvs} -q ci -m nuke-verifymsg" \ "Checking in verifymsg; ${TESTDIR}/cvsroot/CVSROOT/verifymsg,v <-- verifymsg -new revision: 1\.[0-9]; previous revision: 1\.[0-9] +new revision: 1\.[0-9]*; previous revision: 1\.[0-9]* done ${PROG} [a-z]*: Rebuilding administrative file database" cd .. @@ -20019,7 +20021,7 @@ # something which doesn't make sense. dotest_fail multiroot3-10 \ "${testcvs} -q -d ${CVSROOT1} diff dir1/file1 dir2/file2" \ -"${PROG} [a-z]*: failed to create lock directory in repository .${TESTDIR}/root1/dir2': No such file or directory +"${PROG} [a-z]*: failed to create lock directory for .${TESTDIR}/root1/dir2' (${TESTDIR}/root1/dir2/#cvs.lock): No such file or directory ${PROG} [a-z]*: failed to obtain dir lock in repository .${TESTDIR}/root1/dir2' ${PROG} \[[a-z]* aborted\]: read lock failed - giving up" else @@ -20698,8 +20700,10 @@ EOF cd first-dir mkdir ${TESTDIR}/bogus + # The ${DOTSTAR} is to match a potential "broken pipe" if the + # client exits before the server script sends everything dotest_fail client-3 "${testcvs} update" "merge-it -${PROG} \[update aborted\]: protocol error: Copy-file tried to specify directory" +${PROG} \[update aborted\]: protocol error: Copy-file tried to specify director${DOTSTAR}" cat >${TESTDIR}/serveme <= 0 - && (FD_ISSET (stdout_pipe[0], &readfds))) - { - int status; - - status = buf_input_data (stdoutbuf, (int *) NULL); - - buf_copy_lines (buf_to_net, stdoutbuf, 'M'); - - if (status == -1) - { - close (stdout_pipe[0]); - stdout_pipe[0] = -1; - } - else if (status > 0) - { - buf_output0 (buf_to_net, "E buf_input_data failed\n"); - print_error (status); - goto error_exit; - } - - /* What should we do with errors? syslog() them? */ - buf_send_output (buf_to_net); - } - - if (stderr_pipe[0] >= 0 - && (FD_ISSET (stderr_pipe[0], &readfds))) - { - int status; - - status = buf_input_data (stderrbuf, (int *) NULL); - - buf_copy_lines (buf_to_net, stderrbuf, 'E'); - - if (status == -1) - { - close (stderr_pipe[0]); - stderr_pipe[0] = -1; - } - else if (status > 0) - { - buf_output0 (buf_to_net, "E buf_input_data failed\n"); - print_error (status); - goto error_exit; - } - - /* What should we do with errors? syslog() them? */ - buf_send_output (buf_to_net); - } - if (protocol_pipe[0] >= 0 && (FD_ISSET (protocol_pipe[0], &readfds))) { @@ -3114,6 +3064,56 @@ } } } + + if (stdout_pipe[0] >= 0 + && (FD_ISSET (stdout_pipe[0], &readfds))) + { + int status; + + status = buf_input_data (stdoutbuf, (int *) NULL); + + buf_copy_lines (buf_to_net, stdoutbuf, 'M'); + + if (status == -1) + { + close (stdout_pipe[0]); + stdout_pipe[0] = -1; + } + else if (status > 0) + { + buf_output0 (buf_to_net, "E buf_input_data failed\n"); + print_error (status); + goto error_exit; + } + + /* What should we do with errors? syslog() them? */ + buf_send_output (buf_to_net); + } + + if (stderr_pipe[0] >= 0 + && (FD_ISSET (stderr_pipe[0], &readfds))) + { + int status; + + status = buf_input_data (stderrbuf, (int *) NULL); + + buf_copy_lines (buf_to_net, stderrbuf, 'E'); + + if (status == -1) + { + close (stderr_pipe[0]); + stderr_pipe[0] = -1; + } + else if (status > 0) + { + buf_output0 (buf_to_net, "E buf_input_data failed\n"); + print_error (status); + goto error_exit; + } + + /* What should we do with errors? syslog() them? */ + buf_send_output (buf_to_net); + } } /* @@ -3730,23 +3730,20 @@ do_cvs_command ("editors", editors); } -static int noop PROTO ((int, char **)); - -static int -noop (argc, argv) - int argc; - char **argv; -{ - return 0; -} - static void serve_noop PROTO ((char *)); static void serve_noop (arg) char *arg; { - do_cvs_command ("noop", noop); + + server_write_entries (); + if (!print_pending_error ()) + { + (void) server_notify (); + buf_output0 (buf_to_net, "ok\n"); + } + buf_flush (buf_to_net, 1); } static void serve_version PROTO ((char *)); @@ -4737,7 +4734,7 @@ REQ_LINE("editors", serve_editors, 0), REQ_LINE("init", serve_init, RQ_ROOTLESS), REQ_LINE("annotate", serve_annotate, 0), - REQ_LINE("noop", serve_noop, 0), + REQ_LINE("noop", serve_noop, RQ_ROOTLESS), REQ_LINE("version", serve_version, RQ_ROOTLESS), REQ_LINE(NULL, NULL, 0) Index: ossp-pkg/cvs/src/update.c ============================================================ $ cvs diff -u -r1.12 -r1.13 update.c --- ossp-pkg/cvs/src/update.c 2000/07/21 21:46:50 1.12 +++ ossp-pkg/cvs/src/update.c 2000/07/29 15:14:26 1.13 @@ -1126,6 +1126,7 @@ cvs_output (": Executing '", 0); run_print (stdout); cvs_output ("'\n", 0); + cvs_flushout (); (void) run_exec (RUN_TTY, RUN_TTY, RUN_TTY, RUN_NORMAL); } else if (ferror (fp)) From ossp-cvs-owner@ossp.org Sat Jul 29 17:29:34 2000 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id e6TFTYK65324; Sat, 29 Jul 2000 17:29:34 +0200 (CEST) Date: Sat, 29 Jul 2000 17:29:34 +0200 (CEST) Message-Id: <200007291529.e6TFTYK65324@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/cvs VERSION ossp-pkg/cvs/doc CVSvn.texi ossp-pkg/... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 29-Jul-2000 17:29:34 Branch: HEAD Handle: 2000072916293102 Modified files: ossp-pkg/cvs VERSION ossp-pkg/cvs/doc CVSvn.texi ossp-pkg/cvs/src version.c Log: Update version Summary: Revision Changes Path 1.6 +1 -1 ossp-pkg/cvs/VERSION 1.5 +1 -1 ossp-pkg/cvs/doc/CVSvn.texi 1.9 +1 -1 ossp-pkg/cvs/src/version.c ____________________________________________________________________________ Index: ossp-pkg/cvs/VERSION ============================================================ $ cvs diff -u -r1.5 -r1.6 VERSION --- ossp-pkg/cvs/VERSION 2000/06/22 16:42:21 1.5 +++ ossp-pkg/cvs/VERSION 2000/07/29 15:29:31 1.6 @@ -1 +1 @@ -1.10.8.6 +1.10.8.7 Index: ossp-pkg/cvs/doc/CVSvn.texi ============================================================ $ cvs diff -u -r1.4 -r1.5 CVSvn.texi --- ossp-pkg/cvs/doc/CVSvn.texi 2000/06/22 16:41:12 1.4 +++ ossp-pkg/cvs/doc/CVSvn.texi 2000/07/29 15:29:32 1.5 @@ -1 +1 @@ -@set CVSVN 1.10.8.6 +@set CVSVN 1.10.8.7 Index: ossp-pkg/cvs/src/version.c ============================================================ $ cvs diff -u -r1.8 -r1.9 version.c --- ossp-pkg/cvs/src/version.c 2000/07/11 05:22:15 1.8 +++ ossp-pkg/cvs/src/version.c 2000/07/29 15:29:33 1.9 @@ -18,7 +18,7 @@ #define NAME_PREFIX "" #endif -char *version_string = NAME_PREFIX "Concurrent Versions System (CVS) 1.10.8.6"; +char *version_string = NAME_PREFIX "Concurrent Versions System (CVS) 1.10.8.7"; #ifdef CLIENT_SUPPORT #ifdef SERVER_SUPPORT From ossp-cvs-owner@ossp.org Mon Jul 31 21:22:04 2000 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id e6VJM4h43256; Mon, 31 Jul 2000 21:22:04 +0200 (CEST) Date: Mon, 31 Jul 2000 21:22:04 +0200 (CEST) Message-Id: <200007311922.e6VJM4h43256@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/cvs README.OSSP ossp-pkg/cvs/src options.h.in ser... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 31-Jul-2000 21:22:03 Branch: HEAD Handle: 2000073120220201 Modified files: ossp-pkg/cvs README.OSSP ossp-pkg/cvs/src options.h.in server.c Log: Merge in wildcard patches for CVSROOT/passwd Summary: Revision Changes Path 1.45 +10 -1 ossp-pkg/cvs/README.OSSP 1.31 +1 -0 ossp-pkg/cvs/src/options.h.in 1.29 +44 -0 ossp-pkg/cvs/src/server.c ____________________________________________________________________________ Index: ossp-pkg/cvs/README.OSSP ============================================================ $ cvs diff -u -r1.44 -r1.45 README.OSSP --- ossp-pkg/cvs/README.OSSP 2000/07/21 21:46:49 1.44 +++ ossp-pkg/cvs/README.OSSP 2000/07/31 19:22:02 1.45 @@ -41,6 +41,7 @@ - additional SetUID/SetGID support for `cvs server' situations. - new `cvs pserverd' for running stand-alone pserver daemons - new global --map-root=/oldpath:/newpath option for mapping root paths + - support for wildcards in CVSROOT/passwd files to decrease admin efforts - various cosmetic changes Some of the OSSP functional patches are only useful for the server @@ -338,8 +339,16 @@ [Origin: Ralf S. Engelschall] OSSP_PATCH_ADDFILEATTR: - Let the default file attrbuters set on newly added files. + Let the default file attributes set on newly added files. [Origin: Noel Yap] + + OSSP_PATCH_WILDPASSWD: + This allows wildcards ("*") in CVSROOT/passwd. That allows one to + just do "*:ULtgRLXo7NRxs:cvsuser" which would let absolutely anyone + use CVS provided they know the password. It would also let you do + things like "*:*:cvsuser" to let only authorized system users use + CVS using their system passwords. + [Larry Jones ] OSSP_PATCH_BUGFIX: This enabled various bugfixes which are still not present in the Index: ossp-pkg/cvs/src/options.h.in ============================================================ $ cvs diff -u -r1.30 -r1.31 options.h.in --- ossp-pkg/cvs/src/options.h.in 2000/07/21 21:46:50 1.30 +++ ossp-pkg/cvs/src/options.h.in 2000/07/31 19:22:03 1.31 @@ -234,6 +234,7 @@ #define OSSP_PATCH_HASHFUNC #define OSSP_PATCH_UPDATECMERGE #define OSSP_PATCH_ADDFILEATTR +#define OSSP_PATCH_WILDPASSWD #define OSSP_PATCH_BUGFIX /* problematic changes, because they break "make check" */ #undef OSSP_PATCH_COSMETICS_HARD Index: ossp-pkg/cvs/src/server.c ============================================================ $ cvs diff -u -r1.28 -r1.29 server.c --- ossp-pkg/cvs/src/server.c 2000/07/29 15:14:26 1.28 +++ ossp-pkg/cvs/src/server.c 2000/07/31 19:22:03 1.29 @@ -5362,6 +5362,13 @@ found_it = 1; break; } +#ifdef OSSP_PATCH_WILDPASSWD + if (strncmp(linebuf, "*:", 2) == 0) { + found_it = 1; + namelen = 1; + break; + } +#endif } if (ferror (fp)) error (0, errno, "cannot read %s", filename); @@ -5405,10 +5412,14 @@ /* Okay, after this conditional chain, found_password and host_user_tmp will have useful values: */ +#ifdef OSSP_PATCH_WILDPASSWD + if (non_cvsuser_portion[strspn(non_cvsuser_portion, " \t")] == '\0') +#else if ((non_cvsuser_portion == NULL) || (strlen (non_cvsuser_portion) == 0) || ((strspn (non_cvsuser_portion, " \t")) == strlen (non_cvsuser_portion))) +#endif { found_password = NULL; host_user_tmp = NULL; @@ -5439,6 +5450,14 @@ *host_user_ptr = xstrdup (host_user_tmp); retval = 1; } +#ifdef OSSP_PATCH_WILDPASSWD + else if (strcmp(found_password, "*") == 0) + { + /* Give host_user_ptr permanent storage. */ + *host_user_ptr = xstrdup(host_user_tmp); + retval = -1; + } +#endif else { *host_user_ptr = NULL; @@ -5484,7 +5503,11 @@ /* host_user already set by reference, so just return. */ goto handle_return; } +#ifdef OSSP_PATCH_WILDPASSWD + else if (rc == -1 || system_auth) +#else else if (rc == 0 && system_auth) +#endif { /* No cvs password found, so try /etc/passwd. */ @@ -5526,15 +5549,30 @@ if (*found_passwd) { /* user exists and has a password */ +#ifdef OSSP_PATCH_WILDPASSWD + if (strcmp (found_passwd, crypt (password, found_passwd)) != 0) { + if (host_user != NULL) { + free (host_user); + host_user = NULL; + } + } + else if (host_user == NULL) { + host_user = xstrdup (username); + } +#else host_user = ((! strcmp (found_passwd, crypt (password, found_passwd))) ? xstrdup (username) : NULL); +#endif goto handle_return; } else if (password && *password) { /* user exists and has no system password, but we got one as parameter */ +#ifdef OSSP_PATCH_WILDPASSWD + if (host_user == NULL) +#endif host_user = xstrdup (username); goto handle_return; } @@ -5545,7 +5583,11 @@ goto handle_return; } } +#ifdef OSSP_PATCH_WILDPASSWD + else +#else else if (rc == 0) +#endif { /* Note that the message _does_ distinguish between the case in which we check for a system password and the case in which @@ -5566,6 +5608,7 @@ #endif exit (EXIT_FAILURE); } +#ifndef OSSP_PATCH_WILDPASSWD else { /* Something strange happened. We don't know what it was, but @@ -5573,6 +5616,7 @@ host_user = NULL; goto handle_return; } +#endif handle_return: if (host_user) From ossp-cvs-owner@ossp.org Wed Aug 2 10:52:22 2000 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id e728qLh00834; Wed, 2 Aug 2000 10:52:21 +0200 (CEST) Date: Wed, 2 Aug 2000 10:52:21 +0200 (CEST) Message-Id: <200008020852.e728qLh00834@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/pcre .configure Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 02-Aug-2000 10:52:21 Branch: HEAD Handle: 2000080209522100 Modified files: ossp-pkg/pcre .configure Log: Add -pedantic Summary: Revision Changes Path 1.2 +1 -1 ossp-pkg/pcre/.configure ____________________________________________________________________________ Index: ossp-pkg/pcre/.configure ============================================================ $ cvs diff -u -r1.1.1.1 -r1.2 .configure --- ossp-pkg/pcre/.configure 1999/08/26 08:15:20 1.1.1.1 +++ ossp-pkg/pcre/.configure 2000/08/02 08:52:21 1.2 @@ -1,6 +1,6 @@ #!/bin/sh CC="egcc" \ -CFLAGS="-pipe -O2 -Wall -Wshadow -Wpointer-arith -Wcast-align -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline" \ +CFLAGS="-pipe -O2 -Wall -pedantic -Wshadow -Wpointer-arith -Wcast-align -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline" \ ./configure \ --prefix=/sw/pkg/pcre \ --disable-shared \ From ossp-cvs-owner@ossp.org Wed Aug 2 11:46:13 2000 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id e729kB104817; Wed, 2 Aug 2000 11:46:11 +0200 (CEST) Date: Wed, 2 Aug 2000 11:46:11 +0200 (CEST) Message-Id: <200008020946.e729kB104817@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/pcre ChangeLog ChangeLog.OSSP LICENCE README conf... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 02-Aug-2000 11:46:11 Branch: HEAD Handle: 2000080210460603 Added files: ossp-pkg/pcre/pcre_test.d testinput5 testinput6 testoutput5 testoutput6 Modified files: ossp-pkg/pcre ChangeLog ChangeLog.OSSP LICENCE README configure configure.in pcre.3 pcre.c pcre.h pcre_get.c pcre_internal.h pcre_test.c pcreposix.3 pcreposix.c pgrep.1 pgrep.c shtool ossp-pkg/pcre/pcre_test.d testinput1 testinput2 testinput3 testinput4 testoutput1 testoutput2 testoutput3 testoutput4 Log: Upgrade to PCRE 3.3 and GNU shtool 1.5.1 Summary: Revision Changes Path 1.6 +32 -0 ossp-pkg/pcre/ChangeLog 1.14 +5 -0 ossp-pkg/pcre/ChangeLog.OSSP 1.4 +8 -6 ossp-pkg/pcre/LICENCE 1.4 +58 -27 ossp-pkg/pcre/README 1.9 +39 -21 ossp-pkg/pcre/configure 1.6 +14 -1 ossp-pkg/pcre/configure.in 1.4 +119 -11 ossp-pkg/pcre/pcre.3 1.5 +344 -26 ossp-pkg/pcre/pcre.c 1.6 +13 -10 ossp-pkg/pcre/pcre.h 1.2 +39 -1 ossp-pkg/pcre/pcre_get.c 1.5 +5 -1 ossp-pkg/pcre/pcre_internal.h 1.5 +163 -10 ossp-pkg/pcre/pcre_test.c 1.3 +21 -1 ossp-pkg/pcre/pcre_test.d/testinput1 1.4 +3 -3 ossp-pkg/pcre/pcre_test.d/testinput2 1.4 +15 -1 ossp-pkg/pcre/pcre_test.d/testinput3 1.2 +1 -0 ossp-pkg/pcre/pcre_test.d/testinput4 1.1 +118 -0 ossp-pkg/pcre/pcre_test.d/testinput5 1.1 +52 -0 ossp-pkg/pcre/pcre_test.d/testinput6 1.6 +43 -2 ossp-pkg/pcre/pcre_test.d/testoutput1 1.6 +5 -5 ossp-pkg/pcre/pcre_test.d/testoutput2 1.6 +26 -2 ossp-pkg/pcre/pcre_test.d/testoutput3 1.6 +2 -1 ossp-pkg/pcre/pcre_test.d/testoutput4 1.1 +242 -0 ossp-pkg/pcre/pcre_test.d/testoutput5 1.1 +185 -0 ossp-pkg/pcre/pcre_test.d/testoutput6 1.2 +9 -1 ossp-pkg/pcre/pcreposix.3 1.3 +4 -1 ossp-pkg/pcre/pcreposix.c 1.2 +7 -7 ossp-pkg/pcre/pgrep.1 1.3 +11 -8 ossp-pkg/pcre/pgrep.c 1.6 +3 -3 ossp-pkg/pcre/shtool ____________________________________________________________________________ Index: ossp-pkg/pcre/ChangeLog ============================================================ $ cvs diff -u -r1.5 -r1.6 ChangeLog --- ossp-pkg/pcre/ChangeLog 2000/05/16 18:47:31 1.5 +++ ossp-pkg/pcre/ChangeLog 2000/08/02 09:46:06 1.6 @@ -2,6 +2,38 @@ ------------------ +Version 3.3 01-Aug-00 +--------------------- + +1. If an octal character was given, but the value was greater than \377, it +was not getting masked to the least significant bits, as documented. This could +lead to crashes in some systems. + +2. Perl 5.6 (if not earlier versions) accepts classes like [a-\d] and treats +the hyphen as a literal. PCRE used to give an error; it now behaves like Perl. + +3. Added the functions pcre_free_substring() and pcre_free_substring_list(). +These just pass their arguments on to (pcre_free)(), but they are provided +because some uses of PCRE bind it to non-C systems that can call its functions, +but cannot call free() or pcre_free() directly. + +4. Add "make test" as a synonym for "make check". Corrected some comments in +the Makefile. + +5. Add $(DESTDIR)/ in front of all the paths in the "install" target in the +Makefile. + +6. Changed the name of pgrep to pcregrep, because Solaris has introduced a +command called pgrep for grepping around the active processes. + +7. Added the beginnings of support for UTF-8 character strings. + +8. Arranged for the Makefile to pass over the settings of CC, CFLAGS, and +RANLIB to ./ltconfig so that they are used by libtool. I think these are all +the relevant ones. (AR is not passed because ./ltconfig does its own figuring +out for the ar command.) + + Version 3.2 12-May-00 --------------------- Index: ossp-pkg/pcre/ChangeLog.OSSP ============================================================ $ cvs diff -u -r1.13 -r1.14 ChangeLog.OSSP --- ossp-pkg/pcre/ChangeLog.OSSP 2000/07/07 06:18:50 1.13 +++ ossp-pkg/pcre/ChangeLog.OSSP 2000/08/02 09:46:06 1.14 @@ -1,6 +1,11 @@ OSSP ChangeLog for PCRE ======================= + + Changes made to OSSP pcre 3.3-1 (07-Jul-2000 to 01-Aug-2000): + + *) Merged in changes between PCRE 3.2 to 3.3 + *) Upgraded GNU shtool from 1.5.0 to 1.5.1 Changes made to OSSP pcre 3.2-2 (16-May-2000 to 07-Jul-2000): Index: ossp-pkg/pcre/LICENCE ============================================================ $ cvs diff -u -r1.3 -r1.4 LICENCE --- ossp-pkg/pcre/LICENCE 2000/05/16 18:47:31 1.3 +++ ossp-pkg/pcre/LICENCE 2000/08/02 09:46:06 1.4 @@ -20,19 +20,21 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 2. The origin of this software must not be misrepresented, either by - explicit claim or by omission. In practice, this means you must put - a sentence like this + explicit claim or by omission. In practice, this means that if you use + PCRE in software which you distribute to others, commercially or + otherwise, you must put a sentence like this Regular expression support is provided by the PCRE library package, - which is open source software, copyright by the University of - Cambridge. + which is open source software, written by Philip Hazel, and copyright + by the University of Cambridge, England. somewhere reasonably visible in your documentation and in any relevant - files. A reference to the ftp site for the source should also be given + files or online help data or similar. A reference to the ftp site for + the source, that is, to ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/ - in the documentation. + should also be given in the documentation. 3. Altered versions must be plainly marked as such, and must not be misrepresented as being the original software. Index: ossp-pkg/pcre/README ============================================================ $ cvs diff -u -r1.3 -r1.4 README --- ossp-pkg/pcre/README 2000/02/02 17:18:46 1.3 +++ ossp-pkg/pcre/README 2000/08/02 09:46:06 1.4 @@ -7,7 +7,16 @@ Please read the NEWS file if you are upgrading from a previous release. +PCRE has its own native API, but a set of "wrapper" functions that are based on +the POSIX API are also supplied in the library libpcreposix. Note that this +just provides a POSIX calling interface to PCRE: the regular expressions +themselves still follow Perl syntax and semantics. The header file +for the POSIX-style functions is called pcreposix.h. The official POSIX name is +regex.h, but I didn't want to risk possible problems with existing files of +that name by distributing it that way. To use it with an existing program that +uses the POSIX API, it will have to be renamed or pointed at by a link. + Building PCRE on a Unix system ------------------------------ @@ -15,20 +24,29 @@ distribution directory. This is a standard GNU "autoconf" configuration script, for which generic instructions are supplied in INSTALL. On many systems just running "./configure" is sufficient, but the usual methods of changing standard -defaults are available. For example +defaults are available. For example, CFLAGS='-O2 -Wall' ./configure --prefix=/opt/local specifies that the C compiler should be run with the flags '-O2 -Wall' instead of the default, and that "make install" should install PCRE under /opt/local -instead of the default /usr/local. The "configure" script builds thre files: +instead of the default /usr/local. + +If you want to make use of the experimential, incomplete support for UTF-8 +character strings in PCRE, you must add --enable-utf8 to the "configure" +command. Without it, the code for handling UTF-8 is not included in the +library. (Even when included, it still has to be enabled by an option at run +time.) +The "configure" script builds four files: + . Makefile is built by copying Makefile.in and making substitutions. . config.h is built by copying config.in and making substitutions. . pcre-config is built by copying pcre-config.in and making substitutions. +. RunTest is a script for running tests Once "configure" has run, you can run "make". It builds two libraries called -libpcre and libpcreposix, a test program called pcretest, and the pgrep +libpcre and libpcreposix, a test program called pcretest, and the pcregrep command. You can use "make install" to copy these, and the public header file pcre.h, to appropriate live directories on your system, in the normal way. @@ -54,11 +72,11 @@ new and experimental and may not work on all systems. It relies on the "libtool" scripts - these are distributed with PCRE. It should build a "libtool" script and use this to compile and link shared libraries, which are -placed in a subdirectory called .libs. The programs pcretest and pgrep are +placed in a subdirectory called .libs. The programs pcretest and pcregrep are built to use these uninstalled libraries by means of wrapper scripts. When you -use "make install" to install shared libraries, pgrep and pcretest are +use "make install" to install shared libraries, pcregrep and pcretest are automatically re-built to use the newly installed libraries. However, only -pgrep is installed, as pcretest is really just a test program. +pcregrep is installed, as pcretest is really just a test program. To build PCRE using static libraries you must use --disable-shared when configuring it. For example @@ -82,8 +100,8 @@ ------------ To test PCRE on a Unix system, run the RunTest script in the pcre directory. -(This can also be run by "make runtest" or "make check".) For other systems, -see the instruction in NON-UNIX-USE. +(This can also be run by "make runtest", "make check", or "make test".) For +other systems, see the instruction in NON-UNIX-USE. The script runs the pcretest test program (which is documented in doc/pcretest.txt) on each of the testinput files (in the testdata directory) in @@ -97,12 +115,24 @@ The first and third test files can also be fed directly into the perltest script to check that Perl gives the same results. The third file requires the additional features of release 5.005, which is why it is kept separate from the -main test input, which needs only Perl 5.004. In the long run, when 5.005 is -widespread, these two test files may get amalgamated. +main test input, which needs only Perl 5.004. In the long run, when 5.005 (or +higher) is widespread, these two test files may get amalgamated. -The second set of tests check pcre_info(), pcre_study(), pcre_copy_substring(), -pcre_get_substring(), pcre_get_substring_list(), error detection and run-time -flags that are specific to PCRE, as well as the POSIX wrapper API. +The second set of tests check pcre_fullinfo(), pcre_info(), pcre_study(), +pcre_copy_substring(), pcre_get_substring(), pcre_get_substring_list(), error +detection, and run-time flags that are specific to PCRE, as well as the POSIX +wrapper API. It also uses the debugging flag to check some of the internals of +pcre_compile(). + +If you build PCRE with a locale setting that is not the standard C locale, the +character tables may be different (see next paragraph). In some cases, this may +cause failures in the second set of tests. For example, in a locale where the +isprint() function yields TRUE for characters in the range 128-255, the use of +[:isascii:] inside a character class defines a different set of characters, and +this shows up in this test as a difference in the compiled code, which is being +listed for checking. Where the comparison test output contains [\x00-\x7f] the +test will contain [\x00-\xff], and similarly in some other cases. This is not a +bug in PCRE. The fourth set of tests checks pcre_maketables(), the facility for building a set of character tables for a specific locale and using them instead of the @@ -117,14 +147,10 @@ in the comparison output, it means that locale is not available on your system, despite being listed by "locale". This does not mean that PCRE is broken. -PCRE has its own native API, but a set of "wrapper" functions that are based on -the POSIX API are also supplied in the library libpcreposix.a. Note that this -just provides a POSIX calling interface to PCRE: the regular expressions -themselves still follow Perl syntax and semantics. The header file -for the POSIX-style functions is called pcreposix.h. The official POSIX name is -regex.h, but I didn't want to risk possible problems with existing files of -that name by distributing it that way. To use it with an existing program that -uses the POSIX API, it will have to be renamed or pointed at by a link. +The fifth test checks the experimental, incomplete UTF-8 support. It is not run +automatically unless PCRE is built with UTF-8 support. This file can be fed +directly to the perltest8 script, which requires Perl 5.6 or higher. The sixth +file tests internal UTF-8 features of PCRE that are not relevant to Perl. Character tables @@ -197,7 +223,7 @@ NEWS important changes in this release NON-UNIX-USE notes on building PCRE on non-Unix systems README this file - RunTest a Unix shell script for running tests + RunTest.in template for a Unix shell script for running tests config.guess ) files used by libtool, config.sub ) used only when building a shared library configure a configuring shell script (built by autoconf) @@ -211,24 +237,29 @@ doc/pcreposix.txt plain text version doc/pcretest.txt documentation of test program doc/perltest.txt documentation of Perl test program - doc/pgrep.1 man page source for the pgrep utility - doc/pgrep.html HTML version - doc/pgrep.txt plain text version + doc/pcregrep.1 man page source for the pcregrep utility + doc/pcregrep.html HTML version + doc/pcregrep.txt plain text version install-sh a shell script for installing files ltconfig ) files used to build "libtool", ltmain.sh ) used only when building a shared library pcretest.c test program perltest Perl test program - pgrep.c source of a grep utility that uses PCRE + perltest8 Perl test program for UTF-8 tests + pcregrep.c source of a grep utility that uses PCRE pcre-config.in source of script which retains PCRE information testdata/testinput1 test data, compatible with Perl 5.004 and 5.005 testdata/testinput2 test data for error messages and non-Perl things testdata/testinput3 test data, compatible with Perl 5.005 testdata/testinput4 test data for locale-specific tests + testdata/testinput5 test data for UTF-8 tests compatible with Perl 5.6 + testdata/testinput6 test data for other UTF-8 tests testdata/testoutput1 test results corresponding to testinput1 testdata/testoutput2 test results corresponding to testinput2 testdata/testoutput3 test results corresponding to testinput3 testdata/testoutput4 test results corresponding to testinput4 + testdata/testoutput5 test results corresponding to testinput5 + testdata/testoutput6 test results corresponding to testinput6 (C) Auxiliary files for Win32 DLL @@ -236,4 +267,4 @@ pcre.def Philip Hazel -February 2000 +August 2000 Index: ossp-pkg/pcre/configure ============================================================ $ cvs diff -u -r1.8 -r1.9 configure --- ossp-pkg/pcre/configure 2000/07/07 06:18:50 1.8 +++ ossp-pkg/pcre/configure 2000/08/02 09:46:06 1.9 @@ -31,6 +31,8 @@ # Any additions from configure.in: ac_default_prefix=/usr/local ac_help="$ac_help + --enable-utf8 enable UTF8 support (incomplete)" +ac_help="$ac_help --enable-static build static libraries (default=yes)" ac_help="$ac_help --enable-shared build shared libraries (default=yes)" @@ -550,7 +552,7 @@ # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:554: checking for $ac_word" >&5 +echo "configure:556: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -580,7 +582,7 @@ # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:584: checking for $ac_word" >&5 +echo "configure:586: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -631,7 +633,7 @@ # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:635: checking for $ac_word" >&5 +echo "configure:637: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -663,7 +665,7 @@ fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:667: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:669: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -674,12 +676,12 @@ cat > conftest.$ac_ext << EOF -#line 678 "configure" +#line 680 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:683: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:685: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -705,12 +707,12 @@ { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:709: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:711: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:714: checking whether we are using GNU C" >&5 +echo "configure:716: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -719,7 +721,7 @@ yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:723: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:725: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -738,7 +740,7 @@ ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:742: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:744: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -770,7 +772,7 @@ fi echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:774: checking how to run the C preprocessor" >&5 +echo "configure:776: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -785,13 +787,13 @@ # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:795: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:797: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -802,13 +804,13 @@ rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:812: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:814: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -819,13 +821,13 @@ rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:829: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:831: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -850,7 +852,7 @@ echo "$ac_t""$CPP" 1>&6 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:854: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:856: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -877,6 +879,22 @@ fi +# Check whether --enable-utf8 or --disable-utf8 was given. +if test "${enable_utf8+set}" = set; then + enableval="$enable_utf8" + enable_utf8="$enableval" +else + enable_utf8=yes + +fi +if test ".$enable_utf8" = .yes; then + if test ".$CFLAGS" = .; then + CFLAGS="-DSUPPORT_UTF8" + else + CFLAGS="$CFLAGS -DSUPPORT_UTF8" + fi +fi + # Check whether --enable-static or --disable-static was given. if test "${enable_static+set}" = set; then enableval="$enable_static" @@ -908,12 +926,12 @@ for ac_func in memmove strerror do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:912: checking for $ac_func" >&5 +echo "configure:930: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:958: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else Index: ossp-pkg/pcre/configure.in ============================================================ $ cvs diff -u -r1.5 -r1.6 configure.in --- ossp-pkg/pcre/configure.in 2000/05/16 18:33:29 1.5 +++ ossp-pkg/pcre/configure.in 2000/08/02 09:46:06 1.6 @@ -3,7 +3,7 @@ dnl ## AC_PREREQ(2.12)dnl -AC_REVISION($Revision: 1.5 $) +AC_REVISION($Revision: 1.6 $) SHTOOL="./shtool" AC_SUBST(SHTOOL) @@ -28,6 +28,19 @@ AC_PROG_CC AC_PROG_CPP AC_SET_MAKE + +AC_ARG_ENABLE(utf8,dnl +[ --enable-utf8 enable UTF8 support (incomplete)], +enable_utf8="$enableval", +enable_utf8=yes +)dnl +if test ".$enable_utf8" = .yes; then + if test ".$CFLAGS" = .; then + CFLAGS="-DSUPPORT_UTF8" + else + CFLAGS="$CFLAGS -DSUPPORT_UTF8" + fi +fi AC_ARG_ENABLE(static,dnl [ --enable-static build static libraries (default=yes)], Index: ossp-pkg/pcre/pcre.3 ============================================================ $ cvs diff -u -r1.3 -r1.4 pcre.3 --- ossp-pkg/pcre/pcre.3 2000/05/16 18:47:31 1.3 +++ ossp-pkg/pcre/pcre.3 2000/08/02 09:46:06 1.4 @@ -44,6 +44,12 @@ .B int *\fIovector\fR, int \fIstringcount\fR, "const char ***\fIlistptr\fR);" .PP .br +.B void pcre_free_substring(const char *\fIstringptr\fR); +.PP +.br +.B void pcre_free_substring_list(const char **\fIstringptr\fR); +.PP +.br .B const unsigned char *pcre_maketables(void); .PP .br @@ -70,7 +76,9 @@ The PCRE library is a set of functions that implement regular expression pattern matching using the same syntax and semantics as Perl 5, with just a few differences (see below). The current implementation corresponds to Perl 5.005, -with some additional features from the Perl development release. +with some additional features from later versions. This includes some +experimental, incomplete support for UTF-8 encoded strings. Details of exactly +what is and what is not supported are given below. PCRE has its own native API, which is described in this document. There is also a set of wrapper functions that correspond to the POSIX regular expression API. @@ -84,13 +92,17 @@ use these to include support for different releases. The functions \fBpcre_compile()\fR, \fBpcre_study()\fR, and \fBpcre_exec()\fR -are used for compiling and matching regular expressions, while -\fBpcre_copy_substring()\fR, \fBpcre_get_substring()\fR, and +are used for compiling and matching regular expressions. + +The functions \fBpcre_copy_substring()\fR, \fBpcre_get_substring()\fR, and \fBpcre_get_substring_list()\fR are convenience functions for extracting -captured substrings from a matched subject string. The function -\fBpcre_maketables()\fR is used (optionally) to build a set of character tables -in the current locale for passing to \fBpcre_compile()\fR. +captured substrings from a matched subject string; \fBpcre_free_substring()\fR +and \fBpcre_free_substring_list()\fR are also provided, to free the memory used +for extracted strings. +The function \fBpcre_maketables()\fR is used (optionally) to build a set of +character tables in the current locale for passing to \fBpcre_compile()\fR. + The function \fBpcre_fullinfo()\fR is used to find out information about a compiled pattern; \fBpcre_info()\fR is an obsolete version which returns only some of the available information, but is retained for backwards compatibility. @@ -223,7 +235,15 @@ greedy by default, but become greedy if followed by "?". It is not compatible with Perl. It can also be set by a (?U) option setting within the pattern. + PCRE_UTF8 + +This option causes PCRE to regard both the pattern and the subject as strings +of UTF-8 characters instead of just byte strings. However, it is available only +if PCRE has been built to include UTF-8 support. If not, the use of this option +provokes an error. Support for UTF-8 is new, experimental, and incomplete. +Details of exactly what it entails are given below. + .SH STUDYING A PATTERN When a pattern is going to be used several times, it is worth spending more time analyzing it in order to speed up the time taken for matching. The @@ -558,7 +578,7 @@ value of zero extracts the substring that matched the entire pattern, while higher values extract the captured substrings. For \fBpcre_copy_substring()\fR, the string is placed in \fIbuffer\fR, whose length is given by -\fIbuffersize\fR, while for \fBpcre_get_substring()\fR a new block of store is +\fIbuffersize\fR, while for \fBpcre_get_substring()\fR a new block of memory is obtained via \fBpcre_malloc\fR, and its address is returned via \fIstringptr\fR. The yield of the function is the length of the string, not including the terminating zero, or one of @@ -590,6 +610,15 @@ inspecting the appropriate offset in \fIovector\fR, which is negative for unset substrings. +The two convenience functions \fBpcre_free_substring()\fR and +\fBpcre_free_substring_list()\fR can be used to free the memory returned by +a previous call of \fBpcre_get_substring()\fR or +\fBpcre_get_substring_list()\fR, respectively. They do nothing more than call +the function pointed to by \fBpcre_free\fR, which of course could be called +directly from a C program. However, PCRE is used in some situations where it is +linked via a special interface to another programming language which cannot use +\fBpcre_free\fR directly; it is for these cases that the functions are +provided. .SH LIMITATIONS @@ -691,8 +720,14 @@ described below. Regular expressions are also described in the Perl documentation and in a number of other books, some of which have copious examples. Jeffrey Friedl's "Mastering Regular Expressions", published by -O'Reilly (ISBN 1-56592-257), covers them in great detail. The description -here is intended as reference documentation. +O'Reilly (ISBN 1-56592-257), covers them in great detail. + +The description here is intended as reference documentation. The basic +operation of PCRE is on strings of bytes. However, there is the beginnings of +some support for UTF-8 character strings. To use this support you must +configure PCRE to include it, and then call \fBpcre_compile()\fR with the +PCRE_UTF8 option. How this affects the pattern matching is described in the +final section of this document. A regular expression is a pattern that is matched against a subject string from left to right. Most characters stand for themselves in a pattern, and match the @@ -1311,7 +1346,7 @@ (a|b\\1)+ -matches any number of "a"s and also "aba", "ababaa" etc. At each iteration of +matches any number of "a"s and also "aba", "ababbaa" etc. At each iteration of the subpattern, the back reference matches the character string corresponding to the previous iteration. In order for this to work, the pattern must be such that the first iteration does not need to match the back reference. This can be @@ -1685,6 +1720,77 @@ applied to a whole line of "a" characters, whereas the latter takes an appreciable time with strings longer than about 20 characters. + +.SH UTF-8 SUPPORT +Starting at release 3.3, PCRE has some support for character strings encoded +in the UTF-8 format. This is incomplete, and is regarded as experimental. In +order to use it, you must configure PCRE to include UTF-8 support in the code, +and, in addition, you must call \fBpcre_compile()\fR with the PCRE_UTF8 option +flag. When you do this, both the pattern and any subject strings that are +matched against it are treated as UTF-8 strings instead of just strings of +bytes, but only in the cases that are mentioned below. + +If you compile PCRE with UTF-8 support, but do not use it at run time, the +library will be a bit bigger, but the additional run time overhead is limited +to testing the PCRE_UTF8 flag in several places, so should not be very large. + +PCRE assumes that the strings it is given contain valid UTF-8 codes. It does +not diagnose invalid UTF-8 strings. If you pass invalid UTF-8 strings to PCRE, +the results are undefined. + +Running with PCRE_UTF8 set causes these changes in the way PCRE works: + +1. In a pattern, the escape sequence \\x{...}, where the contents of the braces +is a string of hexadecimal digits, is interpreted as a UTF-8 character whose +code number is the given hexadecimal number, for example: \\x{1234}. This +inserts from one to six literal bytes into the pattern, using the UTF-8 +encoding. If a non-hexadecimal digit appears between the braces, the item is +not recognized. + +2. The original hexadecimal escape sequence, \\xhh, generates a two-byte UTF-8 +character if its value is greater than 127. + +3. Repeat quantifiers are NOT correctly handled if they follow a multibyte +character. For example, \\x{100}* and \\xc3+ do not work. If you want to +repeat such characters, you must enclose them in non-capturing parentheses, +for example (?:\\x{100}), at present. + +4. The dot metacharacter matches one UTF-8 character instead of a single byte. + +5. Unlike literal UTF-8 characters, the dot metacharacter followed by a +repeat quantifier does operate correctly on UTF-8 characters instead of +single bytes. + +4. Although the \\x{...} escape is permitted in a character class, characters +whose values are greater than 255 cannot be included in a class. + +5. A class is matched against a UTF-8 character instead of just a single byte, +but it can match only characters whose values are less than 256. Characters +with greater values always fail to match a class. + +6. Repeated classes work correctly on multiple characters. + +7. Classes containing just a single character whose value is greater than 127 +(but less than 256), for example, [\\x80] or [^\\x{93}], do not work because +these are optimized into single byte matches. In the first case, of course, +the class brackets are just redundant. + +8. Lookbehind assertions move backwards in the subject by a fixed number of +characters instead of a fixed number of bytes. Simple cases have been tested +to work correctly, but there may be hidden gotchas herein. + +9. The character types such as \\d and \\w do not work correctly with UTF-8 +characters. They continue to test a single byte. + +10. Anything not explicitly mentioned here continues to work in bytes rather +than in characters. + +The following UTF-8 features of Perl 5.6 are not implemented: + +1. The escape sequence \\C to match a single byte. + +2. The use of Unicode tables and properties and escapes \\p, \\P, and \\X. + .SH AUTHOR Philip Hazel .br @@ -1696,6 +1802,8 @@ .br Phone: +44 1223 334714 -Last updated: 27 January 2000 +Last updated: 28 August 2000, +.br + the 250th anniversary of the death of J.S. Bach. .br Copyright (c) 1997-2000 University of Cambridge. Index: ossp-pkg/pcre/pcre.c ============================================================ $ cvs diff -u -r1.4 -r1.5 pcre.c --- ossp-pkg/pcre/pcre.c 2000/05/16 18:47:31 1.4 +++ ossp-pkg/pcre/pcre.c 2000/08/02 09:46:06 1.5 @@ -66,6 +66,16 @@ #define BRASTACK_SIZE 200 +/* The number of bytes in a literal character string above which we can't add +any more is different when UTF-8 characters may be encountered. */ + +#ifdef SUPPORT_UTF8 +#define MAXLIT 250 +#else +#define MAXLIT 255 +#endif + + /* Min and max values for the common repeats; for the maxima, 0 => infinity */ static const char rep_min[] = { 0, 0, 1, 1, 0, 0 }; @@ -176,6 +186,64 @@ +/************************************************* +* Macros and tables for character handling * +*************************************************/ + +/* When UTF-8 encoding is being used, a character is no longer just a single +byte. The macros for character handling generate simple sequences when used in +byte-mode, and more complicated ones for UTF-8 characters. */ + +#ifndef SUPPORT_UTF8 +#define GETCHARINC(c, eptr) c = *eptr++; +#define GETCHARLEN(c, eptr, len) c = *eptr; +#define BACKCHAR(eptr) + +#else /* SUPPORT_UTF8 */ + +/* Get the next UTF-8 character, advancing the pointer */ + +#define GETCHARINC(c, eptr) \ + c = *eptr++; \ + if (md->utf8 && (c & 0xc0) == 0xc0) \ + { \ + int a = utf8_table4[c & 0x3f]; /* Number of additional bytes */ \ + int s = 6 - a; /* Amount to shift next byte */ \ + c &= utf8_table3[a]; /* Low order bits from first byte */ \ + while (a-- > 0) \ + { \ + c |= (*eptr++ & 0x3f) << s; \ + s += 6; \ + } \ + } + +/* Get the next UTF-8 character, not advancing the pointer, setting length */ + +#define GETCHARLEN(c, eptr, len) \ + c = *eptr; \ + len = 1; \ + if (md->utf8 && (c & 0xc0) == 0xc0) \ + { \ + int i; \ + int a = utf8_table4[c & 0x3f]; /* Number of additional bytes */ \ + int s = 6 - a; /* Amount to shift next byte */ \ + c &= utf8_table3[a]; /* Low order bits from first byte */ \ + for (i = 1; i <= a; i++) \ + { \ + c |= (eptr[i] & 0x3f) << s; \ + s += 6; \ + } \ + len += a; \ + } + +/* If the pointer is not at the start of a character, move it back until +it is. */ + +#define BACKCHAR(eptr) while((*eptr & 0xc0) == 0x80) eptr--; + +#endif + + /************************************************* * Default character tables * @@ -190,8 +258,68 @@ #include "pcre_chartables.c" +#ifdef SUPPORT_UTF8 +/************************************************* +* Tables for UTF-8 support * +*************************************************/ + +/* These are the breakpoints for different numbers of bytes in a UTF-8 +character. */ + +static int utf8_table1[] = { 0x7f, 0x7ff, 0xffff, 0x1fffff, 0x3ffffff, 0x7fffffff}; +/* These are the indicator bits and the mask for the data bits to set in the +first byte of a character, indexed by the number of additional bytes. */ + +static int utf8_table2[] = { 0, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc}; +static int utf8_table3[] = { 0xff, 0x1f, 0x0f, 0x07, 0x03, 0x01}; + +/* Table of the number of extra characters, indexed by the first character +masked with 0x3f. The highest number for a valid UTF-8 character is in fact +0x3d. */ + +static uschar utf8_table4[] = { + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, + 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, + 3,3,3,3,3,3,3,3,4,4,4,4,5,5,5,5 }; + + /************************************************* +* Convert character value to UTF-8 * +*************************************************/ + +/* This function takes an integer value in the range 0 - 0x7fffffff +and encodes it as a UTF-8 character in 0 to 6 bytes. + +Arguments: + cvalue the character value + buffer pointer to buffer for result - at least 6 bytes long + +Returns: number of characters placed in the buffer +*/ + +static int +ord2utf8(int cvalue, uschar *buffer) +{ +register int i, j; +for (i = 0; i < sizeof(utf8_table1)/sizeof(int); i++) + if (cvalue <= utf8_table1[i]) break; +*buffer++ = utf8_table2[i] | (cvalue & utf8_table3[i]); +cvalue >>= 6 - i; +for (j = 0; j < i; j++) + { + *buffer++ = 0x80 | (cvalue & 0x3f); + cvalue >>= 6; + } +return i + 1; +} +#endif + + + +/************************************************* +>>>>>>> ../arc/pcre-3.3/pcre.c * Return version string * *************************************************/ @@ -349,9 +477,9 @@ /* This function is called when a \ has been encountered. It either returns a positive value for a simple escape such as \n, or a negative value which -encodes one of the more complicated things such as \d. On entry, ptr is -pointing at the \. On exit, it is on the final character of the escape -sequence. +encodes one of the more complicated things such as \d. When UTF-8 is enabled, +a positive value greater than 255 may be returned. On entry, ptr is pointing at +the \. On exit, it is on the final character of the escape sequence. Arguments: ptrptr points to the pattern position pointer @@ -373,7 +501,9 @@ const uschar *ptr = *ptrptr; int c, i; -c = *(++ptr) & 255; /* Ensure > 0 on signed-char systems */ +/* If backslash is at the end of the pattern, it's an error. */ + +c = *(++ptr); if (c == 0) *errorptr = ERR1; /* Digits or letters may have special meaning; all others are literals. */ @@ -433,18 +563,46 @@ } /* \0 always starts an octal number, but we may drop through to here with a - larger first octal digit */ + larger first octal digit. */ case '0': c -= '0'; while(i++ < 2 && (cd->ctypes[ptr[1]] & ctype_digit) != 0 && ptr[1] != '8' && ptr[1] != '9') c = c * 8 + *(++ptr) - '0'; + c &= 255; /* Take least significant 8 bits */ break; - /* Special escapes not starting with a digit are straightforward */ + /* \x is complicated when UTF-8 is enabled. \x{ddd} is a character number + which can be greater than 0xff, but only if the ddd are hex digits. */ case 'x': +#ifdef SUPPORT_UTF8 + if (ptr[1] == '{' && (options & PCRE_UTF8) != 0) + { + const uschar *pt = ptr + 2; + register int count = 0; + c = 0; + while ((cd->ctypes[*pt] & ctype_xdigit) != 0) + { + count++; + c = c * 16 + cd->lcc[*pt] - + (((cd->ctypes[*pt] & ctype_digit) != 0)? '0' : 'W'); + pt++; + } + if (*pt == '}') + { + if (c < 0 || count > 8) *errorptr = ERR34; + ptr = pt; + break; + } + /* If the sequence of hex digits does not end with '}', then we don't + recognize this construct; fall through to the normal \x handling. */ + } +#endif + + /* Read just a single hex char */ + c = 0; while (i++ < 2 && (cd->ctypes[ptr[1]] & ctype_xdigit) != 0) { @@ -454,6 +612,8 @@ } break; + /* Other special escapes not starting with a digit are straightforward */ + case 'c': c = *(++ptr); if (c == 0) @@ -591,12 +751,13 @@ Arguments: code points to the start of the pattern (the bracket) + options the compiling options Returns: the fixed length, or -1 if there is no fixed length */ static int -find_fixedlength(uschar *code) +find_fixedlength(uschar *code, int options) { int length = -1; @@ -617,7 +778,7 @@ case OP_BRA: case OP_ONCE: case OP_COND: - d = find_fixedlength(cc); + d = find_fixedlength(cc, options); if (d < 0) return -1; branchlength += d; do cc += (cc[1] << 8) + cc[2]; while (*cc == OP_ALT); @@ -671,10 +832,17 @@ cc++; break; - /* Handle char strings */ + /* Handle char strings. In UTF-8 mode we must count characters, not bytes. + This requires a scan of the string, unfortunately. We assume valid UTF-8 + strings, so all we do is reduce the length by one for byte whose bits are + 10xxxxxx. */ case OP_CHARS: branchlength += *(++cc); +#ifdef SUPPORT_UTF8 + for (d = 1; d <= *cc; d++) + if ((cc[d] & 0xc0) == 0x80) branchlength--; +#endif cc += *cc + 1; break; @@ -1053,8 +1221,18 @@ *errorptr = ERR7; goto FAILED; } + } + + /* Fall through if single character, but don't at present allow + chars > 255 in UTF-8 mode. */ + +#ifdef SUPPORT_UTF8 + if (c > 255) + { + *errorptr = ERR33; + goto FAILED; } - /* Fall through if single character */ +#endif } /* A single character may be followed by '-' to form a range. However, @@ -1074,17 +1252,29 @@ } /* The second part of a range can be a single-character escape, but - not any of the other escapes. */ + not any of the other escapes. Perl 5.6 treats a hyphen as a literal + in such circumstances. */ if (d == '\\') { + const uschar *oldptr = ptr; d = check_escape(&ptr, errorptr, *brackets, options, TRUE, cd); + +#ifdef SUPPORT_UTF8 + if (d > 255) + { + *errorptr = ERR33; + goto FAILED; + } +#endif + /* \b is backslash; any other special means the '-' was literal */ + if (d < 0) { if (d == -ESC_b) d = '\b'; else { - *errorptr = ERR7; - goto FAILED; + ptr = oldptr - 2; + goto SINGLE_CHARACTER; /* A few lines below */ } } } @@ -1112,6 +1302,8 @@ /* Handle a lone single character - we can get here for a normal non-escape char, or after \ that introduces a single character. */ + SINGLE_CHARACTER: + class [c/8] |= (1 << (c&7)); if ((options & PCRE_CASELESS) != 0) { @@ -1829,6 +2021,20 @@ tempptr = ptr; c = check_escape(&ptr, errorptr, *brackets, options, FALSE, cd); if (c < 0) { ptr = tempptr; break; } + + /* If a character is > 127 in UTF-8 mode, we have to turn it into + two or more characters in the UTF-8 encoding. */ + +#ifdef SUPPORT_UTF8 + if (c > 127 && (options & PCRE_UTF8) != 0) + { + uschar buffer[8]; + int len = ord2utf8(c, buffer); + for (c = 0; c < len; c++) *code++ = buffer[c]; + length += len; + continue; + } +#endif } /* Ordinary character or single-char escape */ @@ -1839,7 +2045,7 @@ /* This "while" is the end of the "do" above. */ - while (length < 255 && (cd->ctypes[c = *(++ptr)] & ctype_meta) == 0); + while (length < MAXLIT && (cd->ctypes[c = *(++ptr)] & ctype_meta) == 0); /* Update the last character and the count of literals */ @@ -1851,7 +2057,7 @@ the next state. */ previous[1] = length; - if (length < 255) ptr--; + if (length < MAXLIT) ptr--; break; } } /* end of big loop */ @@ -1989,7 +2195,7 @@ if (lookbehind) { *code = OP_END; - length = find_fixedlength(last_branch); + length = find_fixedlength(last_branch, options); DPRINTF(("fixed length = %d\n", length)); if (length < 0) { @@ -2280,6 +2486,16 @@ uschar *code_base, *code_end; #endif +/* Can't support UTF8 unless PCRE has been compiled to include the code. */ + +#ifndef SUPPORT_UTF8 +if ((options & PCRE_UTF8) != 0) + { + *errorptr = ERR32; + return NULL; + } +#endif + /* We can't pass back an error message if errorptr is NULL; I guess the best we can do is just return NULL. */ @@ -2775,6 +2991,16 @@ &compile_block); if (*errorptr != NULL) goto PCRE_ERROR_RETURN; if (c < 0) { ptr = saveptr; break; } + +#ifdef SUPPORT_UTF8 + if (c > 127 && (options & PCRE_UTF8) != 0) + { + int i; + for (i = 0; i < sizeof(utf8_table1)/sizeof(int); i++) + if (c <= utf8_table1[i]) break; + runlength += i; + } +#endif } /* Ordinary character or single-char escape */ @@ -2784,7 +3010,7 @@ /* This "while" is the end of the "do" above. */ - while (runlength < 255 && + while (runlength < MAXLIT && (compile_block.ctypes[c = *(++ptr)] & ctype_meta) == 0); ptr--; @@ -3429,10 +3655,21 @@ /* Move the subject pointer back. This occurs only at the start of each branch of a lookbehind assertion. If we are too close to the start to - move back, this match function fails. */ + move back, this match function fails. When working with UTF-8 we move + back a number of characters, not bytes. */ case OP_REVERSE: +#ifdef SUPPORT_UTF8 + c = (ecode[1] << 8) + ecode[2]; + for (i = 0; i < c; i++) + { + eptr--; + BACKCHAR(eptr) + } +#else eptr -= (ecode[1] << 8) + ecode[2]; +#endif + if (eptr < md->start_subject) return FALSE; ecode += 3; break; @@ -3752,6 +3989,10 @@ if ((ims & PCRE_DOTALL) == 0 && eptr < md->end_subject && *eptr == '\n') return FALSE; if (eptr++ >= md->end_subject) return FALSE; +#ifdef SUPPORT_UTF8 + if (md->utf8) + while (eptr < md->end_subject && (*eptr & 0xc0) == 0x80) eptr++; +#endif ecode++; break; @@ -3953,7 +4194,13 @@ for (i = 1; i <= min; i++) { if (eptr >= md->end_subject) return FALSE; - c = *eptr++; + GETCHARINC(c, eptr) /* Get character; increment eptr */ + +#ifdef SUPPORT_UTF8 + /* We do not yet support class members > 255 */ + if (c > 255) return FALSE; +#endif + if ((data[c/8] & (1 << (c&7))) != 0) continue; return FALSE; } @@ -3973,7 +4220,12 @@ if (match(eptr, ecode, offset_top, md, ims, eptrb, 0)) return TRUE; if (i >= max || eptr >= md->end_subject) return FALSE; - c = *eptr++; + GETCHARINC(c, eptr) /* Get character; increment eptr */ + +#ifdef SUPPORT_UTF8 + /* We do not yet support class members > 255 */ + if (c > 255) return FALSE; +#endif if ((data[c/8] & (1 << (c&7))) != 0) continue; return FALSE; } @@ -3985,17 +4237,29 @@ else { const uschar *pp = eptr; - for (i = min; i < max; eptr++, i++) + int len = 1; + for (i = min; i < max; i++) { if (eptr >= md->end_subject) break; - c = *eptr; - if ((data[c/8] & (1 << (c&7))) != 0) continue; - break; + GETCHARLEN(c, eptr, len) /* Get character, set length if UTF-8 */ + +#ifdef SUPPORT_UTF8 + /* We do not yet support class members > 255 */ + if (c > 255) break; +#endif + if ((data[c/8] & (1 << (c&7))) == 0) break; + eptr += len; } while (eptr >= pp) + { if (match(eptr--, ecode, offset_top, md, ims, eptrb, 0)) return TRUE; + +#ifdef SUPPORT_UTF8 + BACKCHAR(eptr) +#endif + } return FALSE; } } @@ -4315,13 +4579,29 @@ /* First, ensure the minimum number of matches are present. Use inline code for maximizing the speed, and do the type test once at the start - (i.e. keep it out of the loop). Also test that there are at least the - minimum number of characters before we start. */ + (i.e. keep it out of the loop). Also we can test that there are at least + the minimum number of bytes before we start, except when doing '.' in + UTF8 mode. Leave the test in in all cases; in the special case we have + to test after each character. */ if (min > md->end_subject - eptr) return FALSE; if (min > 0) switch(ctype) { case OP_ANY: +#ifdef SUPPORT_UTF8 + if (md->utf8) + { + for (i = 1; i <= min; i++) + { + if (eptr >= md->end_subject || + (*eptr++ == '\n' && (ims & PCRE_DOTALL) == 0)) + return FALSE; + while (eptr < md->end_subject && (*eptr & 0xc0) == 0x80) eptr++; + } + break; + } +#endif + /* Non-UTF8 can be faster */ if ((ims & PCRE_DOTALL) == 0) { for (i = 1; i <= min; i++) if (*eptr++ == '\n') return FALSE; } else eptr += min; @@ -4379,6 +4659,10 @@ { case OP_ANY: if ((ims & PCRE_DOTALL) == 0 && c == '\n') return FALSE; +#ifdef SUPPORT_UTF8 + if (md->utf8) + while (eptr < md->end_subject && (*eptr & 0xc0) == 0x80) eptr++; +#endif break; case OP_NOT_DIGIT: @@ -4418,6 +4702,33 @@ switch(ctype) { case OP_ANY: + + /* Special code is required for UTF8, but when the maximum is unlimited + we don't need it. */ + +#ifdef SUPPORT_UTF8 + if (md->utf8 && max < INT_MAX) + { + if ((ims & PCRE_DOTALL) == 0) + { + for (i = min; i < max; i++) + { + if (eptr >= md->end_subject || *eptr++ == '\n') break; + while (eptr < md->end_subject && (*eptr & 0xc0) == 0x80) eptr++; + } + } + else + { + for (i = min; i < max; i++) + { + eptr++; + while (eptr < md->end_subject && (*eptr & 0xc0) == 0x80) eptr++; + } + } + break; + } +#endif + /* Non-UTF8 can be faster */ if ((ims & PCRE_DOTALL) == 0) { for (i = min; i < max; i++) @@ -4490,8 +4801,14 @@ } while (eptr >= pp) + { if (match(eptr--, ecode, offset_top, md, ims, eptrb, 0)) return TRUE; +#ifdef SUPPORT_UTF8 + if (md->utf8) + while (eptr > pp && (*eptr & 0xc0) == 0x80) eptr--; +#endif + } return FALSE; } /* Control never gets here */ @@ -4572,6 +4889,7 @@ end_subject = match_block.end_subject; match_block.endonly = (re->options & PCRE_DOLLAR_ENDONLY) != 0; +match_block.utf8 = (re->options & PCRE_UTF8) != 0; match_block.notbol = (options & PCRE_NOTBOL) != 0; match_block.noteol = (options & PCRE_NOTEOL) != 0; Index: ossp-pkg/pcre/pcre.h ============================================================ $ cvs diff -u -r1.5 -r1.6 pcre.h --- ossp-pkg/pcre/pcre.h 2000/05/16 18:47:31 1.5 +++ ossp-pkg/pcre/pcre.h 2000/08/02 09:46:06 1.6 @@ -8,8 +8,8 @@ #define _PCRE_H #define PCRE_MAJOR 3 -#define PCRE_MINOR 2 -#define PCRE_DATE 12-May-2000 +#define PCRE_MINOR 3 +#define PCRE_DATE 01-Aug-2000 #define __PCRE_STRING(a) #a #define __PCRE_XSTRING(s) _STRING(s) @@ -53,6 +53,7 @@ #define PCRE_NOTEOL 0x0100 #define PCRE_UNGREEDY 0x0200 #define PCRE_NOTEMPTY 0x0400 +#define PCRE_UTF8 0x0800 /* Exec-time and get-time error codes */ @@ -91,14 +92,16 @@ /* Functions */ extern pcre *pcre_compile(const char *, int, const char **, int *, - const unsigned char *); -extern int pcre_copy_substring(const char *, int *, int, int, char *, int); -extern int pcre_exec(const pcre *, const pcre_extra *, const char *, - int, int, int, int *, int); -extern int pcre_get_substring(const char *, int *, int, int, const char **); -extern int pcre_get_substring_list(const char *, int *, int, const char ***); -extern int pcre_info(const pcre *, int *, int *); -extern int pcre_fullinfo(const pcre *, const pcre_extra *, int, void *); + const unsigned char *); +extern int pcre_copy_substring(const char *, int *, int, int, char *, int); +extern int pcre_exec(const pcre *, const pcre_extra *, const char *, + int, int, int, int *, int); +extern void pcre_free_substring(const char *); +extern void pcre_free_substring_list(const char **); +extern int pcre_get_substring(const char *, int *, int, int, const char **); +extern int pcre_get_substring_list(const char *, int *, int, const char ***); +extern int pcre_info(const pcre *, int *, int *); +extern int pcre_fullinfo(const pcre *, const pcre_extra *, int, void *); extern unsigned const char *pcre_maketables(void); extern pcre_extra *pcre_study(const pcre *, int, const char **); extern const char *pcre_version(void); Index: ossp-pkg/pcre/pcre_get.c ============================================================ $ cvs diff -u -r1.1.1.1 -r1.2 pcre_get.c --- ossp-pkg/pcre/pcre_get.c 1999/08/26 08:15:19 1.1.1.1 +++ ossp-pkg/pcre/pcre_get.c 2000/08/02 09:46:06 1.2 @@ -9,7 +9,7 @@ Written by: Philip Hazel - Copyright (c) 1997-1999 University of Cambridge + Copyright (c) 1997-2000 University of Cambridge ----------------------------------------------------------------------------- Permission is granted to anyone to use this software for any purpose on any @@ -144,6 +144,25 @@ /************************************************* +* Free store obtained by get_substring_list * +*************************************************/ + +/* This function exists for the benefit of people calling PCRE from non-C +programs that can call its functions, but not free() or (pcre_free)() directly. + +Argument: the result of a previous pcre_get_substring_list() +Returns: nothing +*/ + +void +pcre_free_substring_list(const char **pointer) +{ +(pcre_free)((void *)pointer); +} + + + +/************************************************* * Copy captured string to new store * *************************************************/ @@ -184,6 +203,25 @@ substring[yield] = 0; *stringptr = substring; return yield; +} + + + +/************************************************* +* Free store obtained by get_substring * +*************************************************/ + +/* This function exists for the benefit of people calling PCRE from non-C +programs that can call its functions, but not free() or (pcre_free)() directly. + +Argument: the result of a previous pcre_get_substring() +Returns: nothing +*/ + +void +pcre_free_substring(const char *pointer) +{ +(pcre_free)((void *)pointer); } /* End of get.c */ Index: ossp-pkg/pcre/pcre_internal.h ============================================================ $ cvs diff -u -r1.4 -r1.5 pcre_internal.h --- ossp-pkg/pcre/pcre_internal.h 2000/05/16 18:47:31 1.4 +++ ossp-pkg/pcre/pcre_internal.h 2000/08/02 09:46:06 1.5 @@ -105,7 +105,7 @@ #define PUBLIC_OPTIONS \ (PCRE_CASELESS|PCRE_EXTENDED|PCRE_ANCHORED|PCRE_MULTILINE| \ - PCRE_DOTALL|PCRE_DOLLAR_ENDONLY|PCRE_EXTRA|PCRE_UNGREEDY) + PCRE_DOTALL|PCRE_DOLLAR_ENDONLY|PCRE_EXTRA|PCRE_UNGREEDY|PCRE_UTF8) #define PUBLIC_EXEC_OPTIONS \ (PCRE_ANCHORED|PCRE_NOTBOL|PCRE_NOTEOL|PCRE_NOTEMPTY) @@ -274,6 +274,9 @@ #define ERR29 "(?p must be followed by )" #define ERR30 "unknown POSIX class name" #define ERR31 "POSIX collating elements are not supported" +#define ERR32 "this version of PCRE is not compiled with PCRE_UTF8 support" +#define ERR33 "characters with values > 255 are not yet supported in classes" +#define ERR34 "character value in \\x{...} sequence is too large" /* All character handling must be done as unsigned characters. Otherwise there are problems with top-bit-set characters and functions such as isspace(). @@ -330,6 +333,7 @@ BOOL offset_overflow; /* Set if too many extractions */ BOOL notbol; /* NOTBOL flag */ BOOL noteol; /* NOTEOL flag */ + BOOL utf8; /* UTF8 flag */ BOOL endonly; /* Dollar not before final \n */ BOOL notempty; /* Empty string match not wanted */ const uschar *start_pattern; /* For use when recursing */ Index: ossp-pkg/pcre/pcre_test.c ============================================================ $ cvs diff -u -r1.4 -r1.5 pcre_test.c --- ossp-pkg/pcre/pcre_test.c 2000/05/16 18:47:31 1.4 +++ ossp-pkg/pcre/pcre_test.c 2000/08/02 09:46:06 1.5 @@ -38,6 +38,113 @@ +static int utf8_table1[] = { + 0x0000007f, 0x000007ff, 0x0000ffff, 0x001fffff, 0x03ffffff, 0x7fffffff}; + +static int utf8_table2[] = { + 0, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc}; + +static int utf8_table3[] = { + 0xff, 0x1f, 0x0f, 0x07, 0x03, 0x01}; + + +/************************************************* +* Convert character value to UTF-8 * +*************************************************/ + +/* This function takes an integer value in the range 0 - 0x7fffffff +and encodes it as a UTF-8 character in 0 to 6 bytes. + +Arguments: + cvalue the character value + buffer pointer to buffer for result - at least 6 bytes long + +Returns: number of characters placed in the buffer + -1 if input character is negative + 0 if input character is positive but too big (only when + int is longer than 32 bits) +*/ + +static int +ord2utf8(int cvalue, unsigned char *buffer) +{ +register int i, j; +for (i = 0; i < sizeof(utf8_table1)/sizeof(int); i++) + if (cvalue <= utf8_table1[i]) break; +if (i >= sizeof(utf8_table1)/sizeof(int)) return 0; +if (cvalue < 0) return -1; +*buffer++ = utf8_table2[i] | (cvalue & utf8_table3[i]); +cvalue >>= 6 - i; +for (j = 0; j < i; j++) + { + *buffer++ = 0x80 | (cvalue & 0x3f); + cvalue >>= 6; + } +return i + 1; +} + + +/************************************************* +* Convert UTF-8 string to value * +*************************************************/ + +/* This function takes one or more bytes that represents a UTF-8 character, +and returns the value of the character. + +Argument: + buffer a pointer to the byte vector + vptr a pointer to an int to receive the value + +Returns: > 0 => the number of bytes consumed + -6 to 0 => malformed UTF-8 character at offset = (-return) +*/ + +static int +utf82ord(unsigned char *buffer, int *vptr) +{ +int c = *buffer++; +int d = c; +int i, j, s; + +for (i = -1; i < 6; i++) /* i is number of additional bytes */ + { + if ((d & 0x80) == 0) break; + d <<= 1; + } + +if (i == -1) { *vptr = c; return 1; } /* ascii character */ +if (i == 0 || i == 6) return 0; /* invalid UTF-8 */ + +/* i now has a value in the range 1-5 */ + +d = c & utf8_table3[i]; +s = 6 - i; + +for (j = 0; j < i; j++) + { + c = *buffer++; + if ((c & 0xc0) != 0x80) return -(j+1); + d |= (c & 0x3f) << s; + s += 6; + } + +/* Check that encoding was the correct unique one */ + +for (j = 0; j < sizeof(utf8_table1)/sizeof(int); j++) + if (d <= utf8_table1[j]) break; +if (j != i) return -(i+1); + +/* Valid value */ + +*vptr = d; +return i+1; +} + + + + + + /* Debugging function to print the internal form of the regex. This is the same code as contained in pcre.c under the DEBUG macro. */ @@ -265,14 +372,31 @@ -/* Character string printing function. */ +/* Character string printing function. A "normal" and a UTF-8 version. */ -static void pchars(unsigned char *p, int length) +static void pchars(unsigned char *p, int length, int utf8) { int c; while (length-- > 0) + { + if (utf8) + { + int rc = utf82ord(p, &c); + if (rc > 0) + { + length -= rc - 1; + p += rc; + if (c < 256 && isprint(c)) fprintf(outfile, "%c", c); + else fprintf(outfile, "\\x{%02x}", c); + continue; + } + } + + /* Not UTF-8, or malformed UTF-8 */ + if (isprint(c = *(p++))) fprintf(outfile, "%c", c); else fprintf(outfile, "\\x%02x", c); + } } @@ -403,6 +527,7 @@ int do_showinfo = showinfo; int do_showrest = 0; int do_posix = 0; + int utf8 = 0; int erroroffset, len, delimiter; if (infile == stdin) printf(" re> "); @@ -494,6 +619,7 @@ case 'S': do_study = 1; break; case 'U': options |= PCRE_UNGREEDY; break; case 'X': options |= PCRE_EXTRA; break; + case '8': options |= PCRE_UTF8; utf8 = 1; break; case 'L': ppp = pp; @@ -633,7 +759,7 @@ if (backrefmax > 0) fprintf(outfile, "Max back reference = %d\n", backrefmax); if (options == 0) fprintf(outfile, "No options\n"); - else fprintf(outfile, "Options:%s%s%s%s%s%s%s%s\n", + else fprintf(outfile, "Options:%s%s%s%s%s%s%s%s%s\n", ((options & PCRE_ANCHORED) != 0)? " anchored" : "", ((options & PCRE_CASELESS) != 0)? " caseless" : "", ((options & PCRE_EXTENDED) != 0)? " extended" : "", @@ -641,7 +767,8 @@ ((options & PCRE_DOTALL) != 0)? " dotall" : "", ((options & PCRE_DOLLAR_ENDONLY) != 0)? " dollar_endonly" : "", ((options & PCRE_EXTRA) != 0)? " extra" : "", - ((options & PCRE_UNGREEDY) != 0)? " ungreedy" : ""); + ((options & PCRE_UNGREEDY) != 0)? " ungreedy" : "", + ((options & PCRE_UTF8) != 0)? " utf8" : ""); if (((((real_pcre *)re)->options) & PCRE_ICHANGED) != 0) fprintf(outfile, "Case state changes\n"); @@ -796,6 +923,30 @@ break; case 'x': + + /* Handle \x{..} specially - new Perl thing for utf8 */ + + if (*p == '{') + { + unsigned char *pt = p; + c = 0; + while (isxdigit(*(++pt))) + c = c * 16 + tolower(*pt) - ((isdigit(*pt))? '0' : 'W'); + if (*pt == '}') + { + unsigned char utf8_buffer[8]; + int ii, utn; + utn = ord2utf8(c, utf8_buffer); + for (ii = 0; ii < utn - 1; ii++) *q++ = utf8_buffer[ii]; + c = utf8_buffer[ii]; /* Last byte */ + p = pt + 1; + break; + } + /* Not correct form; fall through */ + } + + /* Ordinary \x */ + c = 0; while (i++ < 2 && isxdigit(*p)) { @@ -876,12 +1027,12 @@ { fprintf(outfile, "%2d: ", (int)i); pchars(dbuffer + pmatch[i].rm_so, - pmatch[i].rm_eo - pmatch[i].rm_so); + pmatch[i].rm_eo - pmatch[i].rm_so, utf8); fprintf(outfile, "\n"); if (i == 0 && do_showrest) { fprintf(outfile, " 0+ "); - pchars(dbuffer + pmatch[i].rm_eo, len - pmatch[i].rm_eo); + pchars(dbuffer + pmatch[i].rm_eo, len - pmatch[i].rm_eo, utf8); fprintf(outfile, "\n"); } } @@ -931,14 +1082,14 @@ else { fprintf(outfile, "%2d: ", i/2); - pchars(bptr + offsets[i], offsets[i+1] - offsets[i]); + pchars(bptr + offsets[i], offsets[i+1] - offsets[i], utf8); fprintf(outfile, "\n"); if (i == 0) { if (do_showrest) { fprintf(outfile, " 0+ "); - pchars(bptr + offsets[i+1], len - offsets[i+1]); + pchars(bptr + offsets[i+1], len - offsets[i+1], utf8); fprintf(outfile, "\n"); } } @@ -971,7 +1122,8 @@ else { fprintf(outfile, "%2dG %s (%d)\n", i, substring, rc); - free((void *)substring); + /* free((void *)substring); */ + pcre_free_substring(substring); } } } @@ -989,7 +1141,8 @@ fprintf(outfile, "%2dL %s\n", i, stringlist[i]); if (stringlist[i] != NULL) fprintf(outfile, "string list not terminated by NULL\n"); - free((void *)stringlist); + /* free((void *)stringlist); */ + pcre_free_substring_list(stringlist); } } } Index: ossp-pkg/pcre/pcre_test.d/testinput1 ============================================================ $ cvs diff -u -r1.2 -r1.3 testinput1 --- ossp-pkg/pcre/pcre_test.d/testinput1 2000/02/02 17:18:46 1.2 +++ ossp-pkg/pcre/pcre_test.d/testinput1 2000/08/02 09:46:09 1.3 @@ -1898,4 +1898,24 @@ //g abc -/ End of test input / +/]{0,})>]{0,})>([\d]{0,}\.)(.*)((
([\w\W\s\d][^<>]{0,})|[\s]{0,}))<\/a><\/TD>]{0,})>([\w\W\s\d][^<>]{0,})<\/TD>]{0,})>([\w\W\s\d][^<>]{0,})<\/TD><\/TR>/is + 43.Word Processor
(N-1286)
Lega lstaff.comCA - Statewide + +/a[^a]b/ + acb + a\nb + +/a.b/ + acb + *** Failers + a\nb + +/a[^a]b/s + acb + a\nb + +/a.b/s + acb + a\nb + +/ End of testinput1 / Index: ossp-pkg/pcre/pcre_test.d/testinput2 ============================================================ $ cvs diff -u -r1.3 -r1.4 testinput2 --- ossp-pkg/pcre/pcre_test.d/testinput2 2000/02/02 17:18:46 1.3 +++ ossp-pkg/pcre/pcre_test.d/testinput2 2000/08/02 09:46:09 1.4 @@ -40,8 +40,6 @@ /[\B]/ -/[a-\w]/ - /[z-a]/ /^*/ @@ -706,5 +704,7 @@ *** Failers Ab AB + +/[\200-\410]/ -/ End of test input / +/ End of testinput2 / Index: ossp-pkg/pcre/pcre_test.d/testinput3 ============================================================ $ cvs diff -u -r1.3 -r1.4 testinput3 --- ossp-pkg/pcre/pcre_test.d/testinput3 2000/05/16 18:47:31 1.3 +++ ossp-pkg/pcre/pcre_test.d/testinput3 2000/08/02 09:46:09 1.4 @@ -1707,4 +1707,18 @@ /a*/g abbab -/ End of test input / +/^[a-\d]/ + abcde + -things + 0digit + *** Failers + bcdef + +/^[\d-a]/ + abcde + -things + 0digit + *** Failers + bcdef + +/ End of testinput3 / Index: ossp-pkg/pcre/pcre_test.d/testinput4 ============================================================ $ cvs diff -u -r1.1.1.1 -r1.2 testinput4 --- ossp-pkg/pcre/pcre_test.d/testinput4 1999/08/26 08:15:20 1.1.1.1 +++ ossp-pkg/pcre/pcre_test.d/testinput4 2000/08/02 09:46:09 1.2 @@ -62,3 +62,4 @@ *** Failers école +/ End of testinput4 / Index: ossp-pkg/pcre/pcre_test.d/testinput5 ============================================================ $ cvs update -p -r1.1 testinput5 /-- Because of problems with Perl 5.6 in handling UTF-8 vs non UTF-8 --/ /-- strings automatically, do not use the \x{} construct except with --/ /-- patterns that have the /8 option set, and don't use them without! --/ /a.b/8 acb a\x7fb a\x{100}b *** Failers a\nb /a(.{3})b/8 a\x{4000}xyb a\x{4000}\x7fyb a\x{4000}\x{100}yb *** Failers a\x{4000}b ac\ncb /a(.*?)(.)/ a\xc0\x88b /a(.*?)(.)/8 a\x{100}b /a(.*)(.)/ a\xc0\x88b /a(.*)(.)/8 a\x{100}b /a(.)(.)/ a\xc0\x92bcd /a(.)(.)/8 a\x{240}bcd /a(.?)(.)/ a\xc0\x92bcd /a(.?)(.)/8 a\x{240}bcd /a(.??)(.)/ a\xc0\x92bcd /a(.??)(.)/8 a\x{240}bcd /a(.{3})b/8 a\x{1234}xyb a\x{1234}\x{4321}yb a\x{1234}\x{4321}\x{3412}b *** Failers a\x{1234}b ac\ncb /a(.{3,})b/8 a\x{1234}xyb a\x{1234}\x{4321}yb a\x{1234}\x{4321}\x{3412}b axxxxbcdefghijb a\x{1234}\x{4321}\x{3412}\x{3421}b *** Failers a\x{1234}b /a(.{3,}?)b/8 a\x{1234}xyb a\x{1234}\x{4321}yb a\x{1234}\x{4321}\x{3412}b axxxxbcdefghijb a\x{1234}\x{4321}\x{3412}\x{3421}b *** Failers a\x{1234}b /a(.{3,5})b/8 a\x{1234}xyb a\x{1234}\x{4321}yb a\x{1234}\x{4321}\x{3412}b axxxxbcdefghijb a\x{1234}\x{4321}\x{3412}\x{3421}b axbxxbcdefghijb axxxxxbcdefghijb *** Failers a\x{1234}b axxxxxxbcdefghijb /a(.{3,5}?)b/8 a\x{1234}xyb a\x{1234}\x{4321}yb a\x{1234}\x{4321}\x{3412}b axxxxbcdefghijb a\x{1234}\x{4321}\x{3412}\x{3421}b axbxxbcdefghijb axxxxxbcdefghijb *** Failers a\x{1234}b axxxxxxbcdefghijb /^[a\x{c0}]/8 *** Failers \x{100} /(?<=aXb)cd/8 aXbcd /(?<=a\x{100}b)cd/8 a\x{100}bcd /(?<=a\x{100000}b)cd/8 a\x{100000}bcd /(?:\x{100}){3}b/8 \x{100}\x{100}\x{100}b *** Failers \x{100}\x{100}b / End of testinput5 / Index: ossp-pkg/pcre/pcre_test.d/testinput6 ============================================================ $ cvs update -p -r1.1 testinput6 /\x{100}/8DM /\x{1000}/8DM /\x{10000}/8DM /\x{100000}/8DM /\x{1000000}/8DM /\x{4000000}/8DM /\x{7fffFFFF}/8DM /[\x{ff}]/8DM /[\x{100}]/8DM /\x{ffffffff}/8 /\x{100000000}/8 /^\x{100}a\x{1234}/8 \x{100}a\x{1234}bcd /\x80/8D /\xff/8D /-- These tests are here rather than in testinput5 because Perl 5.6 has --/ /-- some problems with UTF-8 support, in the area of \x{..} where the --/ /-- value is < 255. It grumbles about invalid UTF-8 strings. --/ /^[a\x{c0}]b/8 \x{c0}b /^([a\x{c0}]*?)aa/8 a\x{c0}aaaa/ /^([a\x{c0}]*?)aa/8 a\x{c0}aaaa/ a\x{c0}a\x{c0}aaa/ /^([a\x{c0}]*)aa/8 a\x{c0}aaaa/ a\x{c0}a\x{c0}aaa/ /^([a\x{c0}]*)a\x{c0}/8 a\x{c0}aaaa/ a\x{c0}a\x{c0}aaa/ / End of testinput6 / Index: ossp-pkg/pcre/pcre_test.d/testoutput1 ============================================================ $ cvs diff -u -r1.5 -r1.6 testoutput1 --- ossp-pkg/pcre/pcre_test.d/testoutput1 2000/05/16 18:47:31 1.5 +++ ossp-pkg/pcre/pcre_test.d/testoutput1 2000/08/02 09:46:09 1.6 @@ -1,4 +1,4 @@ -PCRE version 3.2 12-May-2000 +PCRE version 3.3 01-Aug-2000 /the quick brown fox/ the quick brown fox @@ -2920,5 +2920,46 @@ 0: 0: -/ End of test input / +/]{0,})>]{0,})>([\d]{0,}\.)(.*)((
([\w\W\s\d][^<>]{0,})|[\s]{0,}))<\/a><\/TD>]{0,})>([\w\W\s\d][^<>]{0,})<\/TD>]{0,})>([\w\W\s\d][^<>]{0,})<\/TD><\/TR>/is + 43.Word Processor
(N-1286)
Lega lstaff.comCA - Statewide + 0: 43.Word Processor
(N-1286)
Lega lstaff.comCA - Statewide + 1: BGCOLOR='#DBE9E9' + 2: align=left valign=top + 3: 43. + 4: Word Processor
(N-1286) + 5: + 6: + 7: + 8: align=left valign=top + 9: Lega lstaff.com +10: align=left valign=top +11: CA - Statewide + +/a[^a]b/ + acb + 0: acb + a\nb + 0: a\x0ab + +/a.b/ + acb + 0: acb + *** Failers +No match + a\nb +No match + +/a[^a]b/s + acb + 0: acb + a\nb + 0: a\x0ab + +/a.b/s + acb + 0: acb + a\nb + 0: a\x0ab + +/ End of testinput1 / Index: ossp-pkg/pcre/pcre_test.d/testoutput2 ============================================================ $ cvs diff -u -r1.5 -r1.6 testoutput2 --- ossp-pkg/pcre/pcre_test.d/testoutput2 2000/05/16 18:47:31 1.5 +++ ossp-pkg/pcre/pcre_test.d/testoutput2 2000/08/02 09:46:09 1.6 @@ -1,4 +1,4 @@ -PCRE version 3.2 12-May-2000 +PCRE version 3.3 01-Aug-2000 /(a)b|/ Capturing subpattern count = 1 @@ -94,9 +94,6 @@ /[\B]/ Failed: invalid escape sequence in character class at offset 2 -/[a-\w]/ -Failed: invalid escape sequence in character class at offset 4 - /[z-a]/ Failed: range out of order in character class at offset 3 @@ -2063,8 +2060,11 @@ No match AB No match + +/[\200-\410]/ +Failed: range out of order in character class at offset 9 -/ End of test input / +/ End of testinput2 / Capturing subpattern count = 0 No options First char = ' ' Index: ossp-pkg/pcre/pcre_test.d/testoutput3 ============================================================ $ cvs diff -u -r1.5 -r1.6 testoutput3 --- ossp-pkg/pcre/pcre_test.d/testoutput3 2000/05/16 18:47:31 1.5 +++ ossp-pkg/pcre/pcre_test.d/testoutput3 2000/08/02 09:46:09 1.6 @@ -1,4 +1,4 @@ -PCRE version 3.2 12-May-2000 +PCRE version 3.3 01-Aug-2000 /(? 255 are not yet supported in classes at offset 7 /\x{ffffffff}/8 Failed: character value in \x{...} sequence is too large at offset 11 /\x{100000000}/8 Failed: character value in \x{...} sequence is too large at offset 12 /^\x{100}a\x{1234}/8 \x{100}a\x{1234}bcd 0: \x{100}a\x{1234} /\x80/8D ------------------------------------------------------------------ 0 7 Bra 0 3 2 \xc0\x84 7 7 Ket 10 End ------------------------------------------------------------------ Capturing subpattern count = 0 Options: utf8 First char = 192 Need char = 132 /\xff/8D ------------------------------------------------------------------ 0 7 Bra 0 3 2 \xdf\x87 7 7 Ket 10 End ------------------------------------------------------------------ Capturing subpattern count = 0 Options: utf8 First char = 223 Need char = 135 /-- These tests are here rather than in testinput5 because Perl 5.6 has --/ /-- some problems with UTF-8 support, in the area of \x{..} where the --/ No match /-- value is < 255. It grumbles about invalid UTF-8 strings. --/ No match /^[a\x{c0}]b/8 \x{c0}b 0: \x{c0}b /^([a\x{c0}]*?)aa/8 a\x{c0}aaaa/ 0: a\x{c0}aa 1: a\x{c0} /^([a\x{c0}]*?)aa/8 a\x{c0}aaaa/ 0: a\x{c0}aa 1: a\x{c0} a\x{c0}a\x{c0}aaa/ 0: a\x{c0}a\x{c0}aa 1: a\x{c0}a\x{c0} /^([a\x{c0}]*)aa/8 a\x{c0}aaaa/ 0: a\x{c0}aaaa 1: a\x{c0}aa a\x{c0}a\x{c0}aaa/ 0: a\x{c0}a\x{c0}aaa 1: a\x{c0}a\x{c0}a /^([a\x{c0}]*)a\x{c0}/8 a\x{c0}aaaa/ 0: a\x{c0} 1: a\x{c0}a\x{c0}aaa/ 0: a\x{c0}a\x{c0} 1: a\x{c0} / End of testinput6 / Index: ossp-pkg/pcre/pcreposix.3 ============================================================ $ cvs diff -u -r1.1.1.1 -r1.2 pcreposix.3 --- ossp-pkg/pcre/pcreposix.3 1999/08/26 08:15:19 1.1.1.1 +++ ossp-pkg/pcre/pcreposix.3 2000/08/02 09:46:06 1.2 @@ -77,6 +77,14 @@ The PCRE_MULTILINE option is set when the expression is passed for compilation to the native function. +In the absence of these flags, no options are passed to the native function. +This means the the regex is compiled with PCRE default semantics. In +particular, the way it handles newline characters in the subject string is the +Perl way, not the POSIX way. Note that setting PCRE_MULTILINE has only +\fIsome\fR of the effects specified for REG_NEWLINE. It does not affect the way +newlines are matched by . (they aren't) or a negative class such as [^a] (they +are). + The yield of \fBregcomp()\fR is zero on success, and non-zero otherwise. The \fIpreg\fR structure is filled in on success, and one member of the structure is publicized: \fIre_nsub\fR contains the number of capturing subpatterns in @@ -138,4 +146,4 @@ .br Phone: +44 1223 334714 -Copyright (c) 1997-1999 University of Cambridge. +Copyright (c) 1997-2000 University of Cambridge. Index: ossp-pkg/pcre/pcreposix.c ============================================================ $ cvs diff -u -r1.2 -r1.3 pcreposix.c --- ossp-pkg/pcre/pcreposix.c 2000/02/02 17:18:46 1.2 +++ ossp-pkg/pcre/pcreposix.c 2000/08/02 09:46:06 1.3 @@ -80,7 +80,10 @@ REG_BADPAT, /* "assertion expected after (?(" */ REG_BADPAT, /* "(?p must be followed by )" */ REG_ECTYPE, /* "unknown POSIX class name" */ - REG_BADPAT /* "POSIX collating elements are not supported" */ + REG_BADPAT, /* "POSIX collating elements are not supported" */ + REG_INVARG, /* "this version of PCRE is not compiled with PCRE_UTF8 support" */ + REG_BADPAT, /* "characters with values > 255 are not yet supported in classes" */ + REG_BADPAT /* "character value in \x{...} sequence is too large" */ }; /* Table of texts corresponding to POSIX error codes */ Index: ossp-pkg/pcre/pgrep.1 ============================================================ $ cvs diff -u -r1.1.1.1 -r1.2 pgrep.1 --- ossp-pkg/pcre/pgrep.1 1999/08/26 08:15:20 1.1.1.1 +++ ossp-pkg/pcre/pgrep.1 2000/08/02 09:46:06 1.2 @@ -1,20 +1,20 @@ -.TH PGREP 1 +.TH PCREGREP 1 .SH NAME -pgrep - a grep with Perl-compatible regular expressions. +pcregrep - a grep with Perl-compatible regular expressions. .SH SYNOPSIS -.B pgrep [-Vchilnsvx] pattern [file] ... +.B pcregrep [-Vchilnsvx] pattern [file] ... .SH DESCRIPTION -\fBpgrep\fR searches files for character patterns, in the same way as other +\fBpcregrep\fR searches files for character patterns, in the same way as other grep commands do, but it uses the PCRE regular expression library to support patterns that are compatible with the regular expressions of Perl 5. See \fBpcre(3)\fR for a full description of syntax and semantics. -If no files are specified, \fBpgrep\fR reads the standard input. By default, +If no files are specified, \fBpcregrep\fR reads the standard input. By default, each line that matches the pattern is copied to the standard output, and if there is more than one file, the file name is printed before each line of -output. However, there are options that can change how \fBpgrep\fR behaves. +output. However, there are options that can change how \fBpcregrep\fR behaves. Lines are limited to BUFSIZ characters. BUFSIZ is defined in \fB\fR. The newline character is removed from the end of each line before it is matched @@ -73,4 +73,4 @@ .SH AUTHOR Philip Hazel .br -Copyright (c) 1997-1999 University of Cambridge. +Copyright (c) 1997-2000 University of Cambridge. Index: ossp-pkg/pcre/pgrep.c ============================================================ $ cvs diff -u -r1.2 -r1.3 pgrep.c --- ossp-pkg/pcre/pgrep.c 2000/02/02 17:18:46 1.2 +++ ossp-pkg/pcre/pgrep.c 2000/08/02 09:46:06 1.3 @@ -1,7 +1,10 @@ /************************************************* -* PCRE grep program * +* pcregrep program * *************************************************/ +/* This is a grep program that uses the PCRE regular expression library to do +its pattern matching. */ + #include #include #include @@ -59,7 +62,7 @@ *************************************************/ static int -pgrep(FILE *in, char *name) +pcregrep(FILE *in, char *name) { int rc = 1; int linenumber = 0; @@ -119,7 +122,7 @@ static int usage(int rc) { -fprintf(stderr, "Usage: pgrep [-Vchilnsvx] pattern [file] ...\n"); +fprintf(stderr, "Usage: pcregrep [-Vchilnsvx] pattern [file] ...\n"); return rc; } @@ -165,7 +168,7 @@ break; default: - fprintf(stderr, "pgrep: unknown option %c\n", s[-1]); + fprintf(stderr, "pcregrep: unknown option %c\n", s[-1]); return usage(2); } } @@ -180,7 +183,7 @@ pattern = pcre_compile(argv[i++], options, &error, &errptr, NULL); if (pattern == NULL) { - fprintf(stderr, "pgrep: error in regex at offset %d: %s\n", errptr, error); + fprintf(stderr, "pcregrep: error in regex at offset %d: %s\n", errptr, error); return 2; } @@ -189,13 +192,13 @@ hints = pcre_study(pattern, 0, &error); if (error != NULL) { - fprintf(stderr, "pgrep: error while studing regex: %s\n", error); + fprintf(stderr, "pcregrep: error while studing regex: %s\n", error); return 2; } /* If there are no further arguments, do the business on stdin and exit */ -if (i >= argc) return pgrep(stdin, NULL); +if (i >= argc) return pcregrep(stdin, NULL); /* Otherwise, work through the remaining arguments as files. If there is only one, don't give its name on the output. */ @@ -213,7 +216,7 @@ } else { - int frc = pgrep(in, filenames? argv[i] : NULL); + int frc = pcregrep(in, filenames? argv[i] : NULL); if (frc == 0 && rc == 1) rc = 0; fclose(in); } Index: ossp-pkg/pcre/shtool ============================================================ $ cvs diff -u -r1.5 -r1.6 shtool --- ossp-pkg/pcre/shtool 2000/07/07 06:18:50 1.5 +++ ossp-pkg/pcre/shtool 2000/08/02 09:46:06 1.6 @@ -6,7 +6,7 @@ ## See http://www.gnu.org/software/shtool/ for more information. ## See ftp://ftp.gnu.org/gnu/shtool/ for latest version. ## -## Version: 1.5.0 (01-Jul-2000) +## Version: 1.5.1 (29-Jul-2000) ## Contents: 6/17 available modules ## @@ -65,7 +65,7 @@ exit 1 fi if [ ".$1" = ".-h" -o ".$1" = ".--help" ]; then - echo "This is GNU shtool, version 1.5.0 (01-Jul-2000)" + echo "This is GNU shtool, version 1.5.1 (29-Jul-2000)" echo "Copyright (c) 1994-2000 Ralf S. Engelschall " echo "Report bugs to " echo '' @@ -105,7 +105,7 @@ exit 0 fi if [ ".$1" = ".-v" -o ".$1" = ."--version" ]; then - echo "GNU shtool 1.5.0 (01-Jul-2000)" + echo "GNU shtool 1.5.1 (29-Jul-2000)" exit 0 fi if [ ".$1" = ".-r" -o ".$1" = ."--recreate" ]; then From ossp-cvs-owner@ossp.org Wed Aug 2 11:53:10 2000 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id e729r9C05325; Wed, 2 Aug 2000 11:53:09 +0200 (CEST) Date: Wed, 2 Aug 2000 11:53:09 +0200 (CEST) Message-Id: <200008020953.e729r9C05325@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/pcre pcre.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 02-Aug-2000 11:53:09 Branch: HEAD Handle: 2000080210530800 Modified files: ossp-pkg/pcre pcre.c Log: Remove left-over from merging Summary: Revision Changes Path 1.6 +0 -1 ossp-pkg/pcre/pcre.c ____________________________________________________________________________ Index: ossp-pkg/pcre/pcre.c ============================================================ $ cvs diff -u -r1.5 -r1.6 pcre.c --- ossp-pkg/pcre/pcre.c 2000/08/02 09:46:06 1.5 +++ ossp-pkg/pcre/pcre.c 2000/08/02 09:53:08 1.6 @@ -319,7 +319,6 @@ /************************************************* ->>>>>>> ../arc/pcre-3.3/pcre.c * Return version string * *************************************************/ From ossp-cvs-owner@ossp.org Fri Aug 4 11:52:29 2000 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id e749qSe13499; Fri, 4 Aug 2000 11:52:28 +0200 (CEST) Date: Fri, 4 Aug 2000 11:52:28 +0200 (CEST) Message-Id: <200008040952.e749qSe13499@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/cvs README.OSSP ossp-pkg/cvs/src main.c options.h... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 04-Aug-2000 11:52:28 Branch: HEAD Handle: 2000080410522601 Modified files: ossp-pkg/cvs README.OSSP ossp-pkg/cvs/src main.c options.h.in Log: Add new $CVSPID stuff Summary: Revision Changes Path 1.46 +7 -0 ossp-pkg/cvs/README.OSSP 1.23 +11 -0 ossp-pkg/cvs/src/main.c 1.32 +1 -0 ossp-pkg/cvs/src/options.h.in ____________________________________________________________________________ Index: ossp-pkg/cvs/README.OSSP ============================================================ $ cvs diff -u -r1.45 -r1.46 README.OSSP --- ossp-pkg/cvs/README.OSSP 2000/07/31 19:22:02 1.45 +++ ossp-pkg/cvs/README.OSSP 2000/08/04 09:52:26 1.46 @@ -350,6 +350,13 @@ CVS using their system passwords. [Larry Jones ] + OSSP_PATCH_CVSPID: + This provides an environment variable $CVSPID which contains the process + id of the parent CVS process. This is usually used inside scripts called + from *info files in order to have a unique session handle (for instance + for a common temporary directory "/tmp/cvs.foo.$CVSPID", etc). + [Origin: Ralf S. Engelschall] + OSSP_PATCH_BUGFIX: This enabled various bugfixes which are still not present in the official CVS version. Index: ossp-pkg/cvs/src/main.c ============================================================ $ cvs diff -u -r1.22 -r1.23 main.c --- ossp-pkg/cvs/src/main.c 2000/07/23 17:53:44 1.22 +++ ossp-pkg/cvs/src/main.c 2000/08/04 09:52:27 1.23 @@ -978,6 +978,17 @@ CVSUMASK_ENV, cp); } +#ifdef OSSP_PATCH_CVSPID + /* provide the process id of the parent CVS process to + sub-processes (usually scripts called from *info files) in order + to let them have a unique session handle */ + { + char pidbuf[64]; + sprintf(pidbuf, "CVSPID=%lu", (unsigned long)getpid()); + putenv(pidbuf); + } +#endif + #ifdef OSSP_PATCH_SETXID if ( strcmp(command_name, "kserver") != 0 && strcmp(command_name, "pserver") != 0 Index: ossp-pkg/cvs/src/options.h.in ============================================================ $ cvs diff -u -r1.31 -r1.32 options.h.in --- ossp-pkg/cvs/src/options.h.in 2000/07/31 19:22:03 1.31 +++ ossp-pkg/cvs/src/options.h.in 2000/08/04 09:52:27 1.32 @@ -235,6 +235,7 @@ #define OSSP_PATCH_UPDATECMERGE #define OSSP_PATCH_ADDFILEATTR #define OSSP_PATCH_WILDPASSWD +#define OSSP_PATCH_CVSPID #define OSSP_PATCH_BUGFIX /* problematic changes, because they break "make check" */ #undef OSSP_PATCH_COSMETICS_HARD From ossp-cvs-owner@ossp.org Fri Aug 4 23:49:44 2000 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id e74Lnh763733; Fri, 4 Aug 2000 23:49:43 +0200 (CEST) Date: Fri, 4 Aug 2000 23:49:43 +0200 (CEST) Message-Id: <200008042149.e74Lnh763733@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/cvs README.OSSP Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 04-Aug-2000 23:49:43 Branch: HEAD Handle: 2000080422494200 Modified files: ossp-pkg/cvs README.OSSP Log: Fix author Summary: Revision Changes Path 1.47 +1 -1 ossp-pkg/cvs/README.OSSP ____________________________________________________________________________ Index: ossp-pkg/cvs/README.OSSP ============================================================ $ cvs diff -u -r1.46 -r1.47 README.OSSP --- ossp-pkg/cvs/README.OSSP 2000/08/04 09:52:26 1.46 +++ ossp-pkg/cvs/README.OSSP 2000/08/04 21:49:42 1.47 @@ -355,7 +355,7 @@ id of the parent CVS process. This is usually used inside scripts called from *info files in order to have a unique session handle (for instance for a common temporary directory "/tmp/cvs.foo.$CVSPID", etc). - [Origin: Ralf S. Engelschall] + [Origin: Rich Salz ] OSSP_PATCH_BUGFIX: This enabled various bugfixes which are still not present in the From ossp-cvs-owner@ossp.org Thu Jan 18 16:31:32 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f0IFVVc61872; Thu, 18 Jan 2001 16:31:31 +0100 (CET) Date: Thu, 18 Jan 2001 16:31:31 +0100 (CET) Message-Id: <200101181531.f0IFVVc61872@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/petidomo petidomo-approve petidomo-kickout Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 18-Jan-2001 16:31:31 Branch: HEAD Handle: 2001011815313000 Added files: ossp-pkg/petidomo petidomo-approve petidomo-kickout Log: Add old RSE admin scripts Summary: Revision Changes Path 1.1 +76 -0 ossp-pkg/petidomo/petidomo-approve 1.1 +75 -0 ossp-pkg/petidomo/petidomo-kickout ____________________________________________________________________________ Index: ossp-pkg/petidomo/petidomo-approve ============================================================ $ cvs update -p -r1.1 petidomo-approve : eval 'exec perl -S $0 ${1+"$@"}' if $running_under_some_shell; ## ## petidomo-approve -- Petidomo approval tool ## Copyright (c) 2000 Ralf S. Engelschall ## # locate the file with the approval passwords my $config = "$ENV{HOME}/.petidomo"; # locate the Sendmail program my $sendmail = "sendmail"; foreach my $dir (split(/:/, "$ENV{PATH}:/bin:/sbin:/usr/bin:/usr/sbin:/lib:/usr/lib")) { if (-x "$dir/sendmail") { $sendmail = "$dir/sendmail"; last; } } # suck in the whole mail my $mail = ''; $mail .= $_ while (); # dispatch over the two mail types which need approval... if ($mail =~ m|^Subject:\s+Petidomo:\s+APPROVE\s+(\S+):|mi) { # approve a request my $list = $1; my $replyto = 'petidomo'; $replyto = $1 if ($mail =~ m|^Reply-to:\s+(\S+)|mi); my $password = 'petidomo'; open(FP, "<$config"); while () { next if (m|^\s*#.*| or m|^\s*$|); $password = $1 if (m|^\s*(?:$list)\s+(\S+)|); } close(FP); $mail =~ s|^.+?\n(password\s+.+?)\n\n.*|$1|s; $mail =~ s||$password|s; open(SM, "|$sendmail $replyto") || die "cannot spawn $sendmail"; print SM "To: $replyto\n\n"; print SM $mail; close(SM); print STDERR "petidomo-approve: sent approved mail back to $replyto\n"; sleep(1); exit(0); } elsif ($mail =~ m|^Subject:\s+Petidomo:\s+BOUNCE|mi) { # approve a posting my $list = 'petidomo'; $list = $1 if ($mail =~ m|^Subject:\s+Petidomo:\s+BOUNCE\s+(\S+):|m); my $replyto = $list; my $password = 'petidomo'; open(FP, "<$config"); while () { next if (m|^\s*#.*| or m|^\s*$|); $password = $1 if (m|^\s*(?:$list)\s+(\S+)|); } close(FP); $mail =~ s|^.+?\n\n||s; $mail =~ s|^.+?\n>?From .+?\n||s; $mail = "Approved: $password\n" . $mail; # best #$mail =~ s|^(.+?\n\n)(.*)$|$1Approved $password\n$2|s; # not good open(SM, "|$sendmail $replyto") || die "cannot spawn $sendmail"; print SM $mail; close(SM); print STDERR "petidomo-approve: sent approved mail back to $replyto\n"; sleep(1); exit(0); } else { print STDERR "petidomo-approve: unrecognized mail type\n"; sleep(1); exit(1); } Index: ossp-pkg/petidomo/petidomo-kickout ============================================================ $ cvs update -p -r1.1 petidomo-kickout : eval 'exec perl -S $0 ${1+"$@"}' if $running_under_some_shell; ## ## petidomo-kickout -- Petidomo kickout tool ## Copyright (c) 2000 Ralf S. Engelschall ## my $pattern = $ARGV[0] || die "Usage: petidomo-kickout "; # locate the file with the approval passwords my $config = "$ENV{HOME}/.petidomo"; # locate the Sendmail program my $sendmail = "sendmail"; foreach my $dir (split(/:/, "$ENV{PATH}:/bin:/sbin:/usr/bin:/usr/sbin:/lib:/usr/lib")) { if (-x "$dir/sendmail") { $sendmail = "$dir/sendmail"; last; } } # locate the Petidomo basedir my $basedir = `petidomo --version 2>&1`; $basedir =~ s|^.+\((\S+)\).*$|$1|s; # read config my $list = {}; open(FP, "<$config") || die "No ~/.petidomo file found"; while () { next if (m|^\s*#.*| or m|^\s*$|); if (m|^\s*(\S+)\s+(\S+)|) { my ($l, $pw) = ($1, $2); $l =~ s|@[^@]+$||; if (-f "$basedir/$l.list") { $list->{$l} = {}; $list->{$l}->{PASSWORD} = $pw; $list->{$l}->{MEMBERS} = []; open(LST, "<$basedir/$l.list"); while () { s|\n$||s; push(@{$list->{$l}->{MEMBERS}}, $_); } close(LST); } } } close(FP); # iterate over all mailing lists foreach my $l (keys(%{$list})) { foreach my $m (@{$list->{$l}->{MEMBERS}}) { if ($m =~ m|$pattern|) { print "petidomo-kickout: $l: <$m> Kickout? [Y/n] "; my $yn = ; $yn =~ s|\n$||s; $yn = "y" if ($yn eq ''); $yn = lc($yn); if ($yn eq 'y') { open(SM, "|$sendmail petidomo") || die "cannot spawn $sendmail"; print SM "To: petidomo\n" . "\n" . "password ".$list->{$l}->{PASSWORD}."\n" . "unsubscribe $l $m\n"; "password ".$list->{petidomo}->{PASSWORD}."\n" . "subscribe bounces $m\n"; close(SM); print "petidomo-kickout: kicked out <$m>\n"; } } } } sleep(1); exit(0); From ossp-cvs-owner@ossp.org Thu Jan 18 16:43:35 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f0IFhYo68283; Thu, 18 Jan 2001 16:43:34 +0100 (CET) Date: Thu, 18 Jan 2001 16:43:34 +0100 (CET) Message-Id: <200101181543.f0IFhYo68283@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/petidomo README Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 18-Jan-2001 16:43:34 Branch: HEAD Handle: 2001011815433400 Modified files: ossp-pkg/petidomo README Log: *** empty log message *** Summary: Revision Changes Path 1.2 +2 -0 ossp-pkg/petidomo/README ____________________________________________________________________________ Index: ossp-pkg/petidomo/README ============================================================ $ cvs diff -u -r1.1.1.1 -r1.2 README --- ossp-pkg/petidomo/README 2000/12/13 13:19:04 1.1.1.1 +++ ossp-pkg/petidomo/README 2001/01/18 15:43:34 1.2 @@ -88,3 +88,5 @@ Peter Simons + + From ossp-cvs-owner@ossp.org Fri Jan 26 11:41:41 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f0QAfeQ49664; Fri, 26 Jan 2001 11:41:40 +0100 (CET) Date: Fri, 26 Jan 2001 11:41:40 +0100 (CET) Message-Id: <200101261041.f0QAfeQ49664@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/sfio Makefile.in Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 26-Jan-2001 11:41:40 Branch: HEAD Handle: 2001012610413900 Modified files: ossp-pkg/sfio Makefile.in Log: Add DESTDIR support Summary: Revision Changes Path 1.9 +16 -14 ossp-pkg/sfio/Makefile.in ____________________________________________________________________________ Index: ossp-pkg/sfio/Makefile.in ============================================================ $ cvs diff -u -r1.8 -r1.9 Makefile.in --- ossp-pkg/sfio/Makefile.in 1999/11/12 15:33:09 1.8 +++ ossp-pkg/sfio/Makefile.in 2001/01/26 10:41:39 1.9 @@ -26,6 +26,8 @@ D_STDIO_S = @D_STDIO_S@ D_STDIO_B = @D_STDIO_B@ +DESTDIR = + prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ @@ -110,25 +112,25 @@ cd sfio_t && $(MAKE) $(MFLAGS) test && cd .. install: all - $(MKDIR) $(bindir) - $(MKDIR) $(includedir) - $(MKDIR) $(libdir) - $(MKDIR) $(mandir)/man3 - $(INSTALL) -c -m 755 sfio-config $(bindir)/sfio-config - @echo "$(INSTALL) -c -m 644 sfio/sfio.h $(includedir)/sfio.h"; \ + $(MKDIR) $(DESTDIR)$(bindir) + $(MKDIR) $(DESTDIR)$(includedir) + $(MKDIR) $(DESTDIR)$(libdir) + $(MKDIR) $(DESTDIR)$(mandir)/man3 + $(INSTALL) -c -m 755 sfio-config $(DESTDIR)$(bindir)/sfio-config + @echo "$(INSTALL) -c -m 644 sfio/sfio.h $(DESTDIR)$(includedir)/sfio.h"; \ sed -e 's;cfg_common\.h;sfio_c.h;' .tmp; \ - $(INSTALL) -c -m 644 .tmp $(includedir)/sfio.h; rm -f .tmp - $(INSTALL) -c -m 644 sfio_c/cfg_common.h $(includedir)/sfio_c.h - $(INSTALL) -c -m 644 sfio/sfio_t.h $(includedir)/sfio_t.h - @$(LIBTOOL) --mode=install $(INSTALL) -c -m 644 libsfio.la $(libdir)/libsfio.la + $(INSTALL) -c -m 644 .tmp $(DESTDIR)$(includedir)/sfio.h; rm -f .tmp + $(INSTALL) -c -m 644 sfio_c/cfg_common.h $(DESTDIR)$(includedir)/sfio_c.h + $(INSTALL) -c -m 644 sfio/sfio_t.h $(DESTDIR)$(includedir)/sfio_t.h + @$(LIBTOOL) --mode=install $(INSTALL) -c -m 644 libsfio.la $(DESTDIR)$(libdir)/libsfio.la @if [ ".$(STDIO_SRC)" = .yes ]; then \ - echo "$(INSTALL) -c -m 644 stdio_s/stdio.h $(includedir)/stdio.h"; \ - $(INSTALL) -c -m 644 stdio_s/stdio.h $(includedir)/stdio.h; \ + echo "$(INSTALL) -c -m 644 stdio_s/stdio.h $(DESTDIR)$(includedir)/stdio.h"; \ + $(INSTALL) -c -m 644 stdio_s/stdio.h $(DESTDIR)$(includedir)/stdio.h; \ fi @if [ ".$(STDIO_BIN)" = .yes ]; then \ - $(LIBTOOL) --mode=install $(INSTALL) -c -m 644 libstdio.la $(libdir)/libstdio.la; \ + $(LIBTOOL) --mode=install $(INSTALL) -c -m 644 libstdio.la $(DESTDIR)$(libdir)/libstdio.la; \ fi - $(INSTALL) -c -m 644 sfio.3 $(mandir)/man3/sfio.3 + $(INSTALL) -c -m 644 sfio.3 $(DESTDIR)$(mandir)/man3/sfio.3 clean: subdirs_clean $(RM) libsfio.la libstdio.la From ossp-cvs-owner@ossp.org Fri Jan 26 11:59:25 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f0QAxNn51269; Fri, 26 Jan 2001 11:59:23 +0100 (CET) Date: Fri, 26 Jan 2001 11:59:23 +0100 (CET) Message-Id: <200101261059.f0QAxNn51269@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/sfio/sfio sfputr.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 26-Jan-2001 11:59:23 Branch: HEAD Handle: 2001012610592300 Modified files: ossp-pkg/sfio/sfio sfputr.c Log: Bugfix from Sendmail 8.11.2 README Summary: Revision Changes Path 1.2 +59 -38 ossp-pkg/sfio/sfio/sfputr.c ____________________________________________________________________________ Index: ossp-pkg/sfio/sfio/sfputr.c ============================================================ $ cvs diff -u -r1.1.1.2 -r1.2 sfputr.c --- ossp-pkg/sfio/sfio/sfputr.c 1997/10/14 14:38:48 1.1.1.2 +++ ossp-pkg/sfio/sfio/sfputr.c 2001/01/26 10:59:23 1.2 @@ -24,6 +24,8 @@ for(w = 0; (*s || rc >= 0); ) { SFWPEEK(f,ps,p); + if(p == -1) + return -1; if(p == 0 || (f->flags&SF_WHOLE) ) { n = strlen(s); if(p >= (n + (rc < 0 ? 0 : 1)) ) From ossp-cvs-owner@ossp.org Mon Jan 29 20:53:43 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f0TJrgI49082; Mon, 29 Jan 2001 20:53:42 +0100 (CET) Date: Mon, 29 Jan 2001 20:53:42 +0100 (CET) Message-Id: <200101291953.f0TJrgI49082@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/mm PORTING Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 29-Jan-2001 20:53:42 Branch: HEAD Handle: 2001012919534100 Modified files: ossp-pkg/mm PORTING Log: *** empty log message *** Summary: Revision Changes Path 1.23 +1 -0 ossp-pkg/mm/PORTING ____________________________________________________________________________ Index: ossp-pkg/mm/PORTING ============================================================ $ cvs diff -u -r1.22 -r1.23 PORTING --- ossp-pkg/mm/PORTING 2001/01/01 12:52:56 1.22 +++ ossp-pkg/mm/PORTING 2001/01/29 19:53:41 1.23 @@ -69,6 +69,7 @@ i686-debian-linux-gnu2.2glibc2.1 i686-gnu-linux-gnu2.0glibc1 i686-gnu-linux-gnu2.2glibc2.1 + i686-gnu-linux-gnu2.4glibc2.1 i686-pc-cygwin i686-pc-freebsd3.1 i686-pc-freebsd3.2 From ossp-cvs-owner@ossp.org Mon Jan 29 20:54:41 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f0TJsfh49189; Mon, 29 Jan 2001 20:54:41 +0100 (CET) Date: Mon, 29 Jan 2001 20:54:41 +0100 (CET) Message-Id: <200101291954.f0TJsfh49189@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/mm ChangeLog Makefile.in Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 29-Jan-2001 20:54:40 Branch: HEAD Handle: 2001012919544000 Modified files: ossp-pkg/mm ChangeLog Makefile.in Log: *** empty log message *** Summary: Revision Changes Path 1.19 +5 -1 ossp-pkg/mm/ChangeLog 1.26 +12 -10 ossp-pkg/mm/Makefile.in ____________________________________________________________________________ Index: ossp-pkg/mm/ChangeLog ============================================================ $ cvs diff -u -r1.18 -r1.19 ChangeLog --- ossp-pkg/mm/ChangeLog 2000/12/03 19:56:39 1.18 +++ ossp-pkg/mm/ChangeLog 2001/01/29 19:54:40 1.19 @@ -14,7 +14,11 @@ | |_| | __|_(_)_|__________________________________________________________ - Changes between 1.1.3 and 1.1.4 (01-Jul-2000 to xx-Dec-2000) + Changes between 1.1.3 and 1.1.4 (01-Jul-2000 to xx-Jan-2001) + + *) Added $(DESTDIR) support to Makefile.in. This makes life easier + for RPM package building. + [Ralf S. Engelschall] *) Fixed typo in mm.h: (still unused) definition of SIZEOF_mem_core_fd lacked a closing parenthesis. Index: ossp-pkg/mm/Makefile.in ============================================================ $ cvs diff -u -r1.25 -r1.26 Makefile.in --- ossp-pkg/mm/Makefile.in 2000/07/01 14:17:42 1.25 +++ ossp-pkg/mm/Makefile.in 2001/01/29 19:54:40 1.26 @@ -44,6 +44,8 @@ @SET_MAKE@ TOP = . + +DESTDIR = prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ @@ -157,16 +159,16 @@ shtoolize -o shtool version echo mkdir install fixperm tarball install: all - $(SHTOOL) mkdir -f -p -m 755 $(bindir) - $(SHTOOL) mkdir -f -p -m 755 $(includedir) - $(SHTOOL) mkdir -f -p -m 755 $(libdir) - $(SHTOOL) mkdir -f -p -m 755 $(mandir)/man1 - $(SHTOOL) mkdir -f -p -m 755 $(mandir)/man3 - $(SHTOOL) install -c -m 755 mm-config $(bindir)/mm-config - $(SHTOOL) install -c -m 644 mm-config.1 $(mandir)/man1/mm-config.1 - $(SHTOOL) install -c -m 644 mm.3 $(mandir)/man3/mm.3 - $(SHTOOL) install -c -m 644 mm.h $(includedir)/mm.h - @$(LIBTOOL) --mode=install $(SHTOOL) install -c -m 644 libmm.la $(libdir)/libmm.la + $(SHTOOL) mkdir -f -p -m 755 $(DESTDIR)$(bindir) + $(SHTOOL) mkdir -f -p -m 755 $(DESTDIR)$(includedir) + $(SHTOOL) mkdir -f -p -m 755 $(DESTDIR)$(libdir) + $(SHTOOL) mkdir -f -p -m 755 $(DESTDIR)$(mandir)/man1 + $(SHTOOL) mkdir -f -p -m 755 $(DESTDIR)$(mandir)/man3 + $(SHTOOL) install -c -m 755 mm-config $(DESTDIR)$(bindir)/mm-config + $(SHTOOL) install -c -m 644 mm-config.1 $(DESTDIR)$(mandir)/man1/mm-config.1 + $(SHTOOL) install -c -m 644 mm.3 $(DESTDIR)$(mandir)/man3/mm.3 + $(SHTOOL) install -c -m 644 mm.h $(DESTDIR)$(includedir)/mm.h + @$(LIBTOOL) --mode=install $(SHTOOL) install -c -m 644 libmm.la $(DESTDIR)$(libdir)/libmm.la clean: $(RM) mm_test mm_test.o mm_test.lo From ossp-cvs-owner@ossp.org Mon Jan 29 21:00:44 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f0TK0ht49756; Mon, 29 Jan 2001 21:00:43 +0100 (CET) Date: Mon, 29 Jan 2001 21:00:43 +0100 (CET) Message-Id: <200101292000.f0TK0ht49756@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/mm ChangeLog mm_core.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 29-Jan-2001 21:00:43 Branch: HEAD Handle: 2001012920004300 Modified files: ossp-pkg/mm ChangeLog mm_core.c Log: *** empty log message *** Summary: Revision Changes Path 1.20 +3 -0 ossp-pkg/mm/ChangeLog 1.11 +7 -7 ossp-pkg/mm/mm_core.c ____________________________________________________________________________ Index: ossp-pkg/mm/ChangeLog ============================================================ $ cvs diff -u -r1.19 -r1.20 ChangeLog --- ossp-pkg/mm/ChangeLog 2001/01/29 19:54:40 1.19 +++ ossp-pkg/mm/ChangeLog 2001/01/29 20:00:43 1.20 @@ -16,6 +16,9 @@ Changes between 1.1.3 and 1.1.4 (01-Jul-2000 to xx-Jan-2001) + *) Fixed initializations of fdxxx variables in mm_core.c + [Ralf S. Engelschall] + *) Added $(DESTDIR) support to Makefile.in. This makes life easier for RPM package building. [Ralf S. Engelschall] Index: ossp-pkg/mm/mm_core.c ============================================================ $ cvs diff -u -r1.10 -r1.11 mm_core.c --- ossp-pkg/mm/mm_core.c 2000/03/17 16:54:08 1.10 +++ ossp-pkg/mm/mm_core.c 2001/01/29 20:00:43 1.11 @@ -185,10 +185,10 @@ { mem_core *mc; void *area = ((void *)-1); - int fdmem = 0; - int fdsem = 0; + int fdmem = -1; + int fdsem = -1; #if defined(MM_SEMT_IPCSEM) - int fdsem_rd = 0; + int fdsem_rd = -1; #endif #if defined(MM_SHMT_MMPOSX) || defined(MM_SHMT_MMFILE) char *fnmem; @@ -317,15 +317,15 @@ fdsem = semget(IPC_PRIVATE, 1, IPC_CREAT|IPC_EXCL|S_IRUSR|S_IWUSR); if (fdsem == -1 && errno == EEXIST) fdsem = semget(IPC_PRIVATE, 1, IPC_EXCL|S_IRUSR|S_IWUSR); - if (fdsem == -1) - FAIL(MM_ERR_CORE|MM_ERR_SYSTEM, "failed to acquire semaphore"); + if (fdsem == -1) + FAIL(MM_ERR_CORE|MM_ERR_SYSTEM, "failed to acquire semaphore"); mm_core_semctlarg.val = 0; semctl(fdsem, 0, SETVAL, mm_core_semctlarg); fdsem_rd = semget(IPC_PRIVATE, 1, IPC_CREAT|IPC_EXCL|S_IRUSR|S_IWUSR); if (fdsem_rd == -1 && errno == EEXIST) fdsem_rd = semget(IPC_PRIVATE, 1, IPC_EXCL|S_IRUSR|S_IWUSR); - if (fdsem_rd == -1) - FAIL(MM_ERR_CORE|MM_ERR_SYSTEM, "failed to acquire semaphore"); + if (fdsem_rd == -1) + FAIL(MM_ERR_CORE|MM_ERR_SYSTEM, "failed to acquire semaphore"); mm_core_semctlarg.val = 0; semctl(fdsem_rd, 0, SETVAL, mm_core_semctlarg); #endif /* MM_SEMT_IPCSEM */ From ossp-cvs-owner@ossp.org Mon Jan 29 21:01:42 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f0TK1fb49859; Mon, 29 Jan 2001 21:01:41 +0100 (CET) Date: Mon, 29 Jan 2001 21:01:41 +0100 (CET) Message-Id: <200101292001.f0TK1fb49859@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/mm ChangeLog Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 29-Jan-2001 21:01:41 Branch: HEAD Handle: 2001012920014100 Modified files: ossp-pkg/mm ChangeLog Log: *** empty log message *** Summary: Revision Changes Path 1.21 +1 -1 ossp-pkg/mm/ChangeLog ____________________________________________________________________________ Index: ossp-pkg/mm/ChangeLog ============================================================ $ cvs diff -u -r1.20 -r1.21 ChangeLog --- ossp-pkg/mm/ChangeLog 2001/01/29 20:00:43 1.20 +++ ossp-pkg/mm/ChangeLog 2001/01/29 20:01:41 1.21 @@ -21,7 +21,7 @@ *) Added $(DESTDIR) support to Makefile.in. This makes life easier for RPM package building. - [Ralf S. Engelschall] + [Brad , Ralf S. Engelschall] *) Fixed typo in mm.h: (still unused) definition of SIZEOF_mem_core_fd lacked a closing parenthesis. From ossp-cvs-owner@ossp.org Mon Jan 29 21:04:56 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f0TK4tt50116; Mon, 29 Jan 2001 21:04:55 +0100 (CET) Date: Mon, 29 Jan 2001 21:04:55 +0100 (CET) Message-Id: <200101292004.f0TK4tt50116@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/mm ChangeLog THANKS Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 29-Jan-2001 21:04:55 Branch: HEAD Handle: 2001012920045400 Modified files: ossp-pkg/mm ChangeLog THANKS Log: *** empty log message *** Summary: Revision Changes Path 1.22 +1 -1 ossp-pkg/mm/ChangeLog 1.10 +1 -0 ossp-pkg/mm/THANKS ____________________________________________________________________________ Index: ossp-pkg/mm/ChangeLog ============================================================ $ cvs diff -u -r1.21 -r1.22 ChangeLog --- ossp-pkg/mm/ChangeLog 2001/01/29 20:01:41 1.21 +++ ossp-pkg/mm/ChangeLog 2001/01/29 20:04:54 1.22 @@ -17,7 +17,7 @@ Changes between 1.1.3 and 1.1.4 (01-Jul-2000 to xx-Jan-2001) *) Fixed initializations of fdxxx variables in mm_core.c - [Ralf S. Engelschall] + [Alexander Farber ] *) Added $(DESTDIR) support to Makefile.in. This makes life easier for RPM package building. Index: ossp-pkg/mm/THANKS ============================================================ $ cvs diff -u -r1.9 -r1.10 THANKS --- ossp-pkg/mm/THANKS 2000/10/31 07:06:54 1.9 +++ ossp-pkg/mm/THANKS 2001/01/29 20:04:54 1.10 @@ -23,6 +23,7 @@ o Eric Cholet o Alexander Demenchuk o Jason Dillon + o Alexander Farber o Joe France o Richard Furda o Dean Gaudet From ossp-cvs-owner@ossp.org Mon Jan 29 21:23:48 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f0TKNl051603; Mon, 29 Jan 2001 21:23:47 +0100 (CET) Date: Mon, 29 Jan 2001 21:23:47 +0100 (CET) Message-Id: <200101292023.f0TKNl051603@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/mm ChangeLog aclocal.m4 configure configure.in Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 29-Jan-2001 21:23:47 Branch: HEAD Handle: 2001012920234700 Modified files: ossp-pkg/mm ChangeLog aclocal.m4 configure configure.in Log: *** empty log message *** Summary: Revision Changes Path 1.23 +5 -0 ossp-pkg/mm/ChangeLog 1.21 +23 -12 ossp-pkg/mm/aclocal.m4 1.35 +96 -75 ossp-pkg/mm/configure 1.18 +1 -0 ossp-pkg/mm/configure.in ____________________________________________________________________________ Index: ossp-pkg/mm/ChangeLog ============================================================ $ cvs diff -u -r1.22 -r1.23 ChangeLog --- ossp-pkg/mm/ChangeLog 2001/01/29 20:04:54 1.22 +++ ossp-pkg/mm/ChangeLog 2001/01/29 20:23:47 1.23 @@ -16,6 +16,11 @@ Changes between 1.1.3 and 1.1.4 (01-Jul-2000 to xx-Jan-2001) + *) From Apache 2.0's MM patch set: + Make Autoconf test for maximum shared memory size support BEOS and + make decision cacheable. + [The Apache Software Foundation] + *) Fixed initializations of fdxxx variables in mm_core.c [Alexander Farber ] Index: ossp-pkg/mm/aclocal.m4 ============================================================ $ cvs diff -u -r1.20 -r1.21 aclocal.m4 --- ossp-pkg/mm/aclocal.m4 2000/10/31 07:06:54 1.20 +++ ossp-pkg/mm/aclocal.m4 2001/01/29 20:23:47 1.21 @@ -242,6 +242,7 @@ define(AC_CHECK_MAXSEGSIZE,[dnl AC_MSG_CHECKING(for shared memory maximum segment size) +AC_CACHE_VAL(ac_cv_maxsegsize,[ OCFLAGS="$CFLAGS" case "$1" in MM_SHMT_MM* ) CFLAGS="-DTEST_MMAP $CFLAGS" ;; @@ -286,6 +287,9 @@ #if !defined(MAP_FAILED) #define MAP_FAILED ((void *)-1) #endif +#ifdef MM_OS_BEOS +#include +#endif int testit(int size) { @@ -317,6 +321,14 @@ shmdt(segment); shmctl(fd, IPC_RMID, NULL); #endif +#ifdef TEST_BEOS + area_id id; + id = create_area("mm_test", (void*)&segment, B_ANY_ADDRESS, size, + B_LAZY_LOCK, B_READ_AREA|B_WRITE_AREA); + if (id < 0) + return 0; + delete_area(id); +#endif return 1; } @@ -371,9 +383,15 @@ } >> changequote([, ])dnl -,[ -MM_SHM_MAXSEGSIZE="`cat conftestval`" -msg="$MM_SHM_MAXSEGSIZE" +,[ac_cv_maxsegsize="`cat conftestval`" +], +ac_cv_maxsegsize=0 +, +ac_cv_maxsegsize=0 +) +CFLAGS="$OCFLAGS" +]) +msg="$ac_cv_maxsegsize" if test $msg -eq 67108864; then msg="64MB (soft limit)" elif test $msg -gt 1048576; then @@ -384,17 +402,10 @@ msg="`expr $msg / 1024`" msg="${msg}KB" else - MM_SHM_MAXSEGSIZE=0 + ac_cv_maxsegsize=0 msg=unknown fi -], -MM_SHM_MAXSEGSIZE=0 -msg=unknown -, -MM_SHM_MAXSEGSIZE=0 -msg=unknown -)dnl -CFLAGS="$OCFLAGS" +MM_SHM_MAXSEGSIZE=$ac_cv_maxsegsize test ".$msg" = .unknown && AC_MSG_ERROR([Unable to determine maximum shared memory segment size]) AC_MSG_RESULT([$msg]) AC_DEFINE_UNQUOTED(MM_SHM_MAXSEGSIZE, $MM_SHM_MAXSEGSIZE) Index: ossp-pkg/mm/configure ============================================================ $ cvs diff -u -r1.34 -r1.35 configure --- ossp-pkg/mm/configure 2000/10/31 07:06:54 1.34 +++ ossp-pkg/mm/configure 2001/01/29 20:23:47 1.35 @@ -1389,6 +1389,10 @@ #define MM_OS_BS2000 1 EOF ;; + *-*-beos* ) cat >> confdefs.h <<\EOF +#define MM_OS_BEOS 1 +EOF + ;; esac @@ -1400,17 +1404,17 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1404: checking for $ac_hdr" >&5 +echo "configure:1408: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1414: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1418: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1439,12 +1443,12 @@ for ac_func in getpagesize sysconf do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1443: checking for $ac_func" >&5 +echo "configure:1447: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1475: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1492,12 +1496,12 @@ done echo $ac_n "checking for _SC_PAGESIZE in unistd.h""... $ac_c" 1>&6 -echo "configure:1496: checking for _SC_PAGESIZE in unistd.h" >&5 +echo "configure:1500: checking for _SC_PAGESIZE in unistd.h" >&5 if eval "test \"`echo '$''{'ac_cv_define__SC_PAGESIZE'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -1528,12 +1532,12 @@ fi echo $ac_n "checking for B_PAGE_SIZE in kernel/OS.h""... $ac_c" 1>&6 -echo "configure:1532: checking for B_PAGE_SIZE in kernel/OS.h" >&5 +echo "configure:1536: checking for B_PAGE_SIZE in kernel/OS.h" >&5 if eval "test \"`echo '$''{'ac_cv_define_B_PAGE_SIZE'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -1697,17 +1701,17 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1701: checking for $ac_hdr" >&5 +echo "configure:1705: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1711: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1715: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1734,12 +1738,12 @@ done echo $ac_n "checking for MAP_ANON in sys/mman.h""... $ac_c" 1>&6 -echo "configure:1738: checking for MAP_ANON in sys/mman.h" >&5 +echo "configure:1742: checking for MAP_ANON in sys/mman.h" >&5 if eval "test \"`echo '$''{'ac_cv_define_MAP_ANON'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -1772,12 +1776,12 @@ for ac_func in mmap munmap shm_open shm_unlink do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1776: checking for $ac_func" >&5 +echo "configure:1780: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1808: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1827,7 +1831,7 @@ ac_safe=`echo "/dev/zero" | sed 'y%./+-%__p_%'` echo $ac_n "checking for /dev/zero""... $ac_c" 1>&6 -echo "configure:1831: checking for /dev/zero" >&5 +echo "configure:1835: checking for /dev/zero" >&5 if eval "test \"`echo '$''{'ac_cv_file_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1851,17 +1855,17 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1855: checking for $ac_hdr" >&5 +echo "configure:1859: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1865: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1869: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1890,12 +1894,12 @@ for ac_func in shmget shmat shmdt shmctl do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1894: checking for $ac_func" >&5 +echo "configure:1898: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1926: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1946,17 +1950,17 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1950: checking for $ac_hdr" >&5 +echo "configure:1954: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1960: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1964: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1985,12 +1989,12 @@ for ac_func in create_area do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1989: checking for $ac_func" >&5 +echo "configure:1993: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2021: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2335,7 +2339,11 @@ echo $ac_n "checking for shared memory maximum segment size""... $ac_c" 1>&6 -echo "configure:2339: checking for shared memory maximum segment size" >&5 +echo "configure:2343: checking for shared memory maximum segment size" >&5 +if eval "test \"`echo '$''{'ac_cv_maxsegsize'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + OCFLAGS="$CFLAGS" case "$ac_decision" in MM_SHMT_MM* ) CFLAGS="-DTEST_MMAP $CFLAGS" ;; @@ -2343,12 +2351,11 @@ esac cross_compile=no if test "$cross_compiling" = yes; then - MM_SHM_MAXSEGSIZE=0 -msg=unknown + ac_cv_maxsegsize=0 else cat > conftest.$ac_ext < @@ -2386,6 +2393,9 @@ #if !defined(MAP_FAILED) #define MAP_FAILED ((void *)-1) #endif +#ifdef MM_OS_BEOS +#include +#endif int testit(int size) { @@ -2417,6 +2427,14 @@ shmdt(segment); shmctl(fd, IPC_RMID, NULL); #endif +#ifdef TEST_BEOS + area_id id; + id = create_area("mm_test", (void*)&segment, B_ANY_ADDRESS, size, + B_LAZY_LOCK, B_READ_AREA|B_WRITE_AREA); + if (id < 0) + return 0; + delete_area(id); +#endif return 1; } @@ -2472,11 +2490,25 @@ EOF -if { (eval echo configure:2476: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2494: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then - -MM_SHM_MAXSEGSIZE="`cat conftestval`" -msg="$MM_SHM_MAXSEGSIZE" + ac_cv_maxsegsize="`cat conftestval`" + +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ac_cv_maxsegsize=0 + +fi +rm -fr conftest* +fi + +CFLAGS="$OCFLAGS" + +fi + +msg="$ac_cv_maxsegsize" if test $msg -eq 67108864; then msg="64MB (soft limit)" elif test $msg -gt 1048576; then @@ -2487,21 +2519,10 @@ msg="`expr $msg / 1024`" msg="${msg}KB" else - MM_SHM_MAXSEGSIZE=0 + ac_cv_maxsegsize=0 msg=unknown -fi - -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - MM_SHM_MAXSEGSIZE=0 -msg=unknown - -fi -rm -fr conftest* fi -CFLAGS="$OCFLAGS" +MM_SHM_MAXSEGSIZE=$ac_cv_maxsegsize test ".$msg" = .unknown && { echo "configure: error: Unable to determine maximum shared memory segment size" 1>&2; exit 1; } echo "$ac_t""$msg" 1>&6 cat >> confdefs.h <&6 -echo "configure:2523: checking for $ac_hdr" >&5 +echo "configure:2544: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2533: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2554: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2558,12 +2579,12 @@ for ac_func in semget semctl do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2562: checking for $ac_func" >&5 +echo "configure:2583: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2611: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2611,12 +2632,12 @@ done echo $ac_n "checking for LOCK_EX in sys/file.h""... $ac_c" 1>&6 -echo "configure:2615: checking for LOCK_EX in sys/file.h" >&5 +echo "configure:2636: checking for LOCK_EX in sys/file.h" >&5 if eval "test \"`echo '$''{'ac_cv_define_LOCK_EX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -2647,12 +2668,12 @@ fi echo $ac_n "checking for F_SETLK in fcntl.h""... $ac_c" 1>&6 -echo "configure:2651: checking for F_SETLK in fcntl.h" >&5 +echo "configure:2672: checking for F_SETLK in fcntl.h" >&5 if eval "test \"`echo '$''{'ac_cv_define_F_SETLK'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -2683,12 +2704,12 @@ fi echo $ac_n "checking for IPC_PRIVATE in sys/ipc.h""... $ac_c" 1>&6 -echo "configure:2687: checking for IPC_PRIVATE in sys/ipc.h" >&5 +echo "configure:2708: checking for IPC_PRIVATE in sys/ipc.h" >&5 if eval "test \"`echo '$''{'ac_cv_define_IPC_PRIVATE'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -2719,12 +2740,12 @@ fi echo $ac_n "checking for SEM_UNDO in sys/sem.h""... $ac_c" 1>&6 -echo "configure:2723: checking for SEM_UNDO in sys/sem.h" >&5 +echo "configure:2744: checking for SEM_UNDO in sys/sem.h" >&5 if eval "test \"`echo '$''{'ac_cv_define_SEM_UNDO'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -2758,17 +2779,17 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2762: checking for $ac_hdr" >&5 +echo "configure:2783: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2772: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2793: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2797,12 +2818,12 @@ for ac_func in create_sem do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2801: checking for $ac_func" >&5 +echo "configure:2822: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2850: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2851,9 +2872,9 @@ echo $ac_n "checking whether union semun is defined in sys/sem.h""... $ac_c" 1>&6 -echo "configure:2855: checking whether union semun is defined in sys/sem.h" >&5 +echo "configure:2876: checking whether union semun is defined in sys/sem.h" >&5 cat > conftest.$ac_ext < @@ -2867,7 +2888,7 @@ ; return 0; } EOF -if { (eval echo configure:2871: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2892: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define HAVE_UNION_SEMUN 1 Index: ossp-pkg/mm/configure.in ============================================================ $ cvs diff -u -r1.17 -r1.18 configure.in --- ossp-pkg/mm/configure.in 2000/05/01 17:15:15 1.17 +++ ossp-pkg/mm/configure.in 2001/01/29 20:23:47 1.18 @@ -83,6 +83,7 @@ case $PLATFORM in *-*-sunos* ) AC_DEFINE(MM_OS_SUNOS) ;; BS2000-*-* ) AC_DEFINE(MM_OS_BS2000) ;; + *-*-beos* ) AC_DEFINE(MM_OS_BEOS) ;; esac dnl # From ossp-cvs-owner@ossp.org Mon Jan 29 21:25:51 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f0TKPoS51783; Mon, 29 Jan 2001 21:25:50 +0100 (CET) Date: Mon, 29 Jan 2001 21:25:50 +0100 (CET) Message-Id: <200101292025.f0TKPoS51783@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/mm ChangeLog shtool Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 29-Jan-2001 21:25:49 Branch: HEAD Handle: 2001012920254900 Modified files: ossp-pkg/mm ChangeLog shtool Log: *** empty log message *** Summary: Revision Changes Path 1.24 +3 -0 ossp-pkg/mm/ChangeLog 1.22 +57 -36 ossp-pkg/mm/shtool ____________________________________________________________________________ Index: ossp-pkg/mm/ChangeLog ============================================================ $ cvs diff -u -r1.23 -r1.24 ChangeLog --- ossp-pkg/mm/ChangeLog 2001/01/29 20:23:47 1.23 +++ ossp-pkg/mm/ChangeLog 2001/01/29 20:25:49 1.24 @@ -16,6 +16,9 @@ Changes between 1.1.3 and 1.1.4 (01-Jul-2000 to xx-Jan-2001) + *) Upgraded to GNU shtool 1.5.2 + [Ralf S. Engelschall] + *) From Apache 2.0's MM patch set: Make Autoconf test for maximum shared memory size support BEOS and make decision cacheable. Index: ossp-pkg/mm/shtool ============================================================ $ cvs diff -u -r1.21 -r1.22 shtool --- ossp-pkg/mm/shtool 2000/07/01 14:17:42 1.21 +++ ossp-pkg/mm/shtool 2001/01/29 20:25:49 1.22 @@ -1,12 +1,12 @@ #!/bin/sh ## ## GNU shtool -- The GNU Portable Shell Tool -## Copyright (c) 1994-2000 Ralf S. Engelschall +## Copyright (c) 1994-2001 Ralf S. Engelschall ## ## See http://www.gnu.org/software/shtool/ for more information. ## See ftp://ftp.gnu.org/gnu/shtool/ for latest version. ## -## Version: 1.5.0 (01-Jul-2000) +## Version: 1.5.2 (05-Oct-2000) ## Contents: 6/17 available modules ## @@ -65,8 +65,8 @@ exit 1 fi if [ ".$1" = ".-h" -o ".$1" = ".--help" ]; then - echo "This is GNU shtool, version 1.5.0 (01-Jul-2000)" - echo "Copyright (c) 1994-2000 Ralf S. Engelschall " + echo "This is GNU shtool, version 1.5.2 (05-Oct-2000)" + echo "Copyright (c) 1994-2001 Ralf S. Engelschall " echo "Report bugs to " echo '' echo "Usage: shtool [] [ [] []]" @@ -80,7 +80,7 @@ echo 'Available [] []:' echo ' echo [-n] [-e] [ ...]' echo ' install [-v] [-t] [-c] [-C] [-s] [-m] [-o] [-g]' - echo ' [-e] [ ...] ' + echo ' [-e] [ ...] ' echo ' mkdir [-t] [-f] [-p] [-m]
[ ...]' echo ' fixperm [-v] [-t] [ ...]' echo ' tarball [-t] [-v] [-o ] [-c ] [-d ] [-u' @@ -105,7 +105,7 @@ exit 0 fi if [ ".$1" = ".-v" -o ".$1" = ."--version" ]; then - echo "GNU shtool 1.5.0 (01-Jul-2000)" + echo "GNU shtool 1.5.2 (05-Oct-2000)" exit 0 fi if [ ".$1" = ".-r" -o ".$1" = ."--recreate" ]; then @@ -147,15 +147,15 @@ ;; install ) str_tool="install" - str_usage="[-v] [-t] [-c] [-C] [-s] [-m] [-o] [-g] [-e] [ ...] " + str_usage="[-v] [-t] [-c] [-C] [-s] [-m] [-o] [-g] [-e] [ ...] " arg_spec="2+" - opt_spec="v.t.c.C.s.m:o:g:e:" + opt_spec="v.t.c.C.s.m:o:g:e+" opt_v=no opt_t=no opt_c=no opt_C=no opt_s=no - opt_m="" + opt_m="0755" opt_o="" opt_g="" opt_e="" @@ -353,6 +353,7 @@ tmpfile="$tmpdir/.shtool.$$" rm -f $tmpfile >/dev/null 2>&1 touch $tmpfile + chmod 600 $tmpfile fi ## @@ -364,7 +365,7 @@ echo ) ## ## echo -- Print string with optional construct expansion - ## Copyright (c) 1998-2000 Ralf S. Engelschall + ## Copyright (c) 1998-2001 Ralf S. Engelschall ## Originally written for WML as buildinfo ## @@ -587,7 +588,7 @@ install ) ## ## install -- Install a program, script or datafile - ## Copyright (c) 1997-2000 Ralf S. Engelschall + ## Copyright (c) 1997-2001 Ralf S. Engelschall ## Originally written for shtool ## @@ -617,19 +618,13 @@ for src in $srcs; do dst=$dstpath - # If destination is a directory, append the input filename + # if destination is a directory, append the input filename if [ $dstisdir = 1 ]; then dstfile=`echo "$src" | sed -e 's;.*/\([^/]*\)$;\1;'` dst="$dst/$dstfile" fi - - # Add a possible extension to src and dst - if [ ".$opt_e" != . ]; then - src="$src$opt_e" - dst="$dst$opt_e" - fi - # Check for correct arguments + # check for correct arguments if [ ".$src" = ".$dst" ]; then echo "$msgprefix:Warning: source and destination are the same - skipped" 1>&2 continue @@ -639,18 +634,18 @@ continue fi - # Make a temp file name in the destination directory + # make a temp file name in the destination directory dsttmp=`echo $dst |\ sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;' -e 's;^$;.;' \ -e "s;\$;/#INST@$$#;"` - # Verbosity + # verbosity if [ ".$opt_v" = .yes ]; then echo "$src -> $dst" 1>&2 fi - # Copy or move the file name to the temp name - # (because we might be not allowed to change the source) + # copy or move the file name to the temp name + # (because we might be not allowed to change the source) if [ ".$opt_C" = .yes ]; then opt_c=yes fi @@ -666,8 +661,16 @@ mv $src $dsttmp || exit $? fi - # Adjust the target file - # (we do chmod last to preserve setuid bits) + # adjust the target file + if [ ".$opt_e" != . ]; then + sed='sed' + for e in $opt_e; do + sed="$sed -e '$e'" + done + cp $dsttmp $dsttmp.old + eval "$sed <$dsttmp.old >$dsttmp" || exit $? + rm -f $dsttmp.old + fi if [ ".$opt_s" = .yes ]; then if [ ".$opt_t" = .yes ]; then echo "strip $dsttmp" 1>&2 @@ -686,14 +689,14 @@ fi chgrp $opt_g $dsttmp || exit $? fi - if [ ".$opt_m" != . ]; then + if [ ".$opt_m" != ".-" ]; then if [ ".$opt_t" = .yes ]; then echo "chmod $opt_m $dsttmp" 1>&2 fi chmod $opt_m $dsttmp || exit $? fi - # Determine whether to do a quick install + # determine whether to do a quick install # (has to be done _after_ the strip was already done) quick=no if [ ".$opt_C" = .yes ]; then @@ -704,7 +707,7 @@ fi fi - # Finally install the file to the real destination + # finally, install the file to the real destination if [ $quick = yes ]; then if [ ".$opt_t" = .yes ]; then echo "rm -f $dsttmp" 1>&2 @@ -722,7 +725,7 @@ mkdir ) ## ## mkdir -- Make one or more directories - ## Copyright (c) 1996-2000 Ralf S. Engelschall + ## Copyright (c) 1996-2001 Ralf S. Engelschall ## Originally written for public domain by Noah Friedman ## Cleaned up and enhanced for shtool ## @@ -731,7 +734,7 @@ for p in ${1+"$@"}; do # if the directory already exists... if [ -d "$p" ]; then - if [ ".$opt_f" = .no ] && [ ".$opt_p" = .no ]; then + if [ ".$opt_f" = .no -a ".$opt_p" = .no ]; then echo "$msgprefix:Error: directory already exists: $p" 1>&2 errstatus=1 break @@ -781,7 +784,7 @@ fixperm ) ## ## fixperm -- Fix file permissions inside a source tree - ## Copyright (c) 1996-2000 Ralf S. Engelschall + ## Copyright (c) 1996-2001 Ralf S. Engelschall ## Originally written for ePerl ## @@ -837,7 +840,7 @@ tarball ) ## ## tarball -- Roll distribution tarballs - ## Copyright (c) 1999-2000 Ralf S. Engelschall + ## Copyright (c) 1999-2001 Ralf S. Engelschall ## Originally written for shtool ## @@ -863,7 +866,7 @@ for tool in `echo $tools | sed -e 's/,/ /g'`; do # iterate over paths for path in $paths; do - if [ $minusx "$path/$tool" ] && [ ! -d "$path/$tool" ]; then + if [ $minusx "$path/$tool" -a ! -d "$path/$tool" ]; then eval "prg_${prg}=\"$path/$tool\"" break fi @@ -889,7 +892,7 @@ if [ ".$opt_t" = .yes ]; then echo "(cd $src && $prg_find . -type f -depth -print) | sed -e 's:^\\.\$::' -e 's:^\\./::' | cat $exclude >>$tmpfile.lst" 1>&2 fi - (cd $src && find . -type f -depth -print) |\ + (cd $src && $prg_find . -type f -depth -print) |\ sed -e 's:^\.$::' -e 's:^\./::' | eval cat $exclude >>$tmpfile.lst else if [ ".$opt_t" = .yes ]; then @@ -1000,7 +1003,7 @@ version ) ## ## version -- Maintain a version information file - ## Copyright (c) 1994-2000 Ralf S. Engelschall + ## Copyright (c) 1994-2001 Ralf S. Engelschall ## Originally written for ePerl, rewritten from scratch for shtool ## @@ -1084,7 +1087,8 @@ s ) typnum=15; levnum=255 ;; # snapshots are special esac hex=`echo "$ver:$rev:$typnum:$levnum" |\ - awk -F: '{ printf("0x%X%02X%1X%02X", $1, $2, $3, $4); }'` + awk -F: '{ printf("0x%x%02x%1x%02x", $1, $2, $3, $4); }' |\ + tr 'abcdef' 'ABCDEF'` ltv=`echo "$ver:$rev:$typnum:$levnum" |\ awk -F: '{ printf("%d:%d", $1*10 + $2, $3*10 + $4); }'` @@ -1248,6 +1252,23 @@ echo >>$file "};" echo >>$file "" echo >>$file "1;" + echo >>$file "" + ;; + python ) + echo >>$file "##" + echo >>$file "## ${file} -- Version Information for ${name} (syntax: Python)" + echo >>$file "## [automatically generated and maintained by GNU shtool]" + echo >>$file "##" + echo >>$file "" + echo >>$file "class ${prefix}version:" + echo >>$file " v_hex = ${vHex}" + echo >>$file " v_short = \"${vShort}\"" + echo >>$file " v_long = \"${vLong}\"" + echo >>$file " v_tex = \"${vTeX}\"" + echo >>$file " v_gnu = \"${vGNU}\"" + echo >>$file " v_web = \"${vWeb}\"" + echo >>$file " v_sccs = \"${vSCCS}\"" + echo >>$file " v_rcs = \"${vRCS}\"" echo >>$file "" ;; * ) echo "$msgprefix:Error: invalid argument to option \`-l': \`$opt_l'" 1>&2 From ossp-cvs-owner@ossp.org Mon Jan 29 21:27:25 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f0TKROi52038; Mon, 29 Jan 2001 21:27:24 +0100 (CET) Date: Mon, 29 Jan 2001 21:27:24 +0100 (CET) Message-Id: <200101292027.f0TKROi52038@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/mm ChangeLog LICENSE Makefile.in README aclocal.m... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 29-Jan-2001 21:27:24 Branch: HEAD Handle: 2001012920272200 Modified files: ossp-pkg/mm ChangeLog LICENSE Makefile.in README aclocal.m4 configure configure.in fbtool mm-config.1 mm-config.in mm-config.pod mm.3 mm.h mm.pod mm_alloc.c mm_conf.h.in mm_core.c mm_global.c mm_lib.c mm_test.c Log: *** empty log message *** Summary: Revision Changes Path 1.25 +3 -0 ossp-pkg/mm/ChangeLog 1.3 +1 -1 ossp-pkg/mm/LICENSE 1.27 +1 -1 ossp-pkg/mm/Makefile.in 1.67 +1 -1 ossp-pkg/mm/README 1.22 +1 -1 ossp-pkg/mm/aclocal.m4 1.36 +2 -2 ossp-pkg/mm/configure 1.19 +1 -1 ossp-pkg/mm/configure.in 1.7 +1 -1 ossp-pkg/mm/fbtool 1.15 +127 -194 ossp-pkg/mm/mm-config.1 1.7 +1 -1 ossp-pkg/mm/mm-config.in 1.4 +1 -1 ossp-pkg/mm/mm-config.pod 1.35 +234 -361 ossp-pkg/mm/mm.3 1.21 +1 -1 ossp-pkg/mm/mm.h 1.17 +1 -1 ossp-pkg/mm/mm.pod 1.15 +1 -1 ossp-pkg/mm/mm_alloc.c 1.5 +1 -1 ossp-pkg/mm/mm_conf.h.in 1.12 +1 -1 ossp-pkg/mm/mm_core.c 1.9 +1 -1 ossp-pkg/mm/mm_global.c 1.5 +1 -1 ossp-pkg/mm/mm_lib.c 1.8 +1 -1 ossp-pkg/mm/mm_test.c ____________________________________________________________________________ Index: ossp-pkg/mm/ChangeLog ============================================================ $ cvs diff -u -r1.24 -r1.25 ChangeLog --- ossp-pkg/mm/ChangeLog 2001/01/29 20:25:49 1.24 +++ ossp-pkg/mm/ChangeLog 2001/01/29 20:27:22 1.25 @@ -16,6 +16,9 @@ Changes between 1.1.3 and 1.1.4 (01-Jul-2000 to xx-Jan-2001) + *) Adjusted year in copyright messages for 2001. + [Ralf S. Engelschall] + *) Upgraded to GNU shtool 1.5.2 [Ralf S. Engelschall] Index: ossp-pkg/mm/LICENSE ============================================================ $ cvs diff -u -r1.2 -r1.3 LICENSE --- ossp-pkg/mm/LICENSE 2000/01/09 20:19:39 1.2 +++ ossp-pkg/mm/LICENSE 2001/01/29 20:27:22 1.3 @@ -1,6 +1,6 @@ ==================================================================== - Copyright (c) 1999-2000 Ralf S. Engelschall. All rights reserved. + Copyright (c) 1999-2001 Ralf S. Engelschall. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions Index: ossp-pkg/mm/Makefile.in ============================================================ $ cvs diff -u -r1.26 -r1.27 Makefile.in --- ossp-pkg/mm/Makefile.in 2001/01/29 19:54:40 1.26 +++ ossp-pkg/mm/Makefile.in 2001/01/29 20:27:22 1.27 @@ -1,5 +1,5 @@ ## ==================================================================== -## Copyright (c) 1999-2000 Ralf S. Engelschall. All rights reserved. +## Copyright (c) 1999-2001 Ralf S. Engelschall. All rights reserved. ## ## Redistribution and use in source and binary forms, with or without ## modification, are permitted provided that the following conditions Index: ossp-pkg/mm/README ============================================================ $ cvs diff -u -r1.66 -r1.67 README --- ossp-pkg/mm/README 2000/07/01 14:17:42 1.66 +++ ossp-pkg/mm/README 2001/01/29 20:27:22 1.67 @@ -5,7 +5,7 @@ |_| |_|_| |_| MM - Shared Memory Library - Copyright (c) 1999-2000 Ralf S. Engelschall, All rights reserved. + Copyright (c) 1999-2001 Ralf S. Engelschall, All rights reserved. Version 1.1.3 (01-Jul-2000) The MM library is a 2-layer abstraction library which simplifies the usage Index: ossp-pkg/mm/aclocal.m4 ============================================================ $ cvs diff -u -r1.21 -r1.22 aclocal.m4 --- ossp-pkg/mm/aclocal.m4 2001/01/29 20:23:47 1.21 +++ ossp-pkg/mm/aclocal.m4 2001/01/29 20:27:22 1.22 @@ -1,5 +1,5 @@ ## ==================================================================== -## Copyright (c) 1999-2000 Ralf S. Engelschall. All rights reserved. +## Copyright (c) 1999-2001 Ralf S. Engelschall. All rights reserved. ## ## Redistribution and use in source and binary forms, with or without ## modification, are permitted provided that the following conditions Index: ossp-pkg/mm/configure ============================================================ $ cvs diff -u -r1.35 -r1.36 configure --- ossp-pkg/mm/configure 2001/01/29 20:23:47 1.35 +++ ossp-pkg/mm/configure 2001/01/29 20:27:22 1.36 @@ -23,11 +23,11 @@ echo "Configuring ${T_MD}MM${T_ME} (Shared Memory Library), Version ${T_MD}${MM_VERSION_STR}${T_ME}" -echo "Copyright (c) 1999-2000 Ralf S. Engelschall, All Rights Reserved." +echo "Copyright (c) 1999-2001 Ralf S. Engelschall, All Rights Reserved." echo "Platform: ${T_MD}${PLATFORM}${T_ME}" ## ==================================================================== -## Copyright (c) 1999-2000 Ralf S. Engelschall. All rights reserved. +## Copyright (c) 1999-2001 Ralf S. Engelschall. All rights reserved. ## ## Redistribution and use in source and binary forms, with or without ## modification, are permitted provided that the following conditions Index: ossp-pkg/mm/configure.in ============================================================ $ cvs diff -u -r1.18 -r1.19 configure.in --- ossp-pkg/mm/configure.in 2001/01/29 20:23:47 1.18 +++ ossp-pkg/mm/configure.in 2001/01/29 20:27:22 1.19 @@ -22,7 +22,7 @@ dnl # friendly header ;-) echo "Configuring ${T_MD}MM${T_ME} (Shared Memory Library), Version ${T_MD}${MM_VERSION_STR}${T_ME}" -echo "Copyright (c) 1999-2000 Ralf S. Engelschall, All Rights Reserved." +echo "Copyright (c) 1999-2001 Ralf S. Engelschall, All Rights Reserved." echo "Platform: ${T_MD}${PLATFORM}${T_ME}" dnl # autoconf initialization Index: ossp-pkg/mm/fbtool ============================================================ $ cvs diff -u -r1.6 -r1.7 fbtool --- ossp-pkg/mm/fbtool 2000/01/09 20:19:40 1.6 +++ ossp-pkg/mm/fbtool 2001/01/29 20:27:22 1.7 @@ -1,7 +1,7 @@ #!/bin/sh ## ## fbtool -- MM library feedback tool -## Copyright (c) 1999-2000 Ralf S. Engelschall, All Rights Reserved. +## Copyright (c) 1999-2001 Ralf S. Engelschall, All Rights Reserved. ## if [ ! -f .fbtool ]; then Index: ossp-pkg/mm/mm-config.1 ============================================================ $ cvs diff -u -r1.14 -r1.15 mm-config.1 --- ossp-pkg/mm/mm-config.1 2000/06/20 07:02:06 1.14 +++ ossp-pkg/mm/mm-config.1 2001/01/29 20:27:22 1.15 @@ -1,12 +1,9 @@ -.rn '' }` -''' $RCSfile: mm-config.1,v $$Revision: 1.14 $$Date: 2000/06/20 07:02:06 $ -''' -''' $Log: mm-config.1,v $ -''' Revision 1.14 2000/06/20 07:02:06 rse -''' *** empty log message *** -''' -''' -.de Sh +.\" Automatically generated by Pod::Man version 1.02 +.\" Mon Jan 29 21:26:47 2001 +.\" +.\" Standard preamble: +.\" ====================================================================== +.de Sh \" Subsection heading .br .if t .Sp .ne 5 @@ -14,150 +11,106 @@ \fB\\$1\fR .PP .. -.de Sp +.de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. -.de Ip +.de Ip \" List item .br .ie \\n(.$>=3 .ne \\$3 .el .ne 3 .IP "\\$1" \\$2 .. -.de Vb +.de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. -.de Ve +.de Ve \" End verbatim text .ft R .fi .. -''' -''' -''' Set up \*(-- to give an unbreakable dash; -''' string Tr holds user defined translation string. -''' Bell System Logo is used as a dummy character. -''' +.\" Set up some character translations and predefined strings. \*(-- will +.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left +.\" double quote, and \*(R" will give a right double quote. | will give a +.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used +.\" to do unbreakable dashes and therefore won't be available. \*(C` and +.\" \*(C' expand to `' in nroff, nothing in troff, for use with C<> .tr \(*W-|\(bv\*(Tr +.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)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch -.if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch -.ds L" "" -.ds R" "" -''' \*(M", \*(S", \*(N" and \*(T" are the equivalent of -''' \*(L" and \*(R", except that they are used on ".xx" lines, -''' such as .IP and .SH, which do another additional levels of -''' double-quote interpretation -.ds M" """ -.ds S" """ -.ds N" """"" -.ds T" """"" -.ds L' ' -.ds R' ' -.ds M' ' -.ds S' ' -.ds N' ' -.ds T' ' +. ds -- \(*W- +. ds PI pi +. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch +. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch +. ds L" "" +. ds R" "" +. ds C` ` +. ds C' ' 'br\} .el\{\ -.ds -- \(em\| -.tr \*(Tr -.ds L" `` -.ds R" '' -.ds M" `` -.ds S" '' -.ds N" `` -.ds T" '' -.ds L' ` -.ds R' ' -.ds M' ` -.ds S' ' -.ds N' ` -.ds T' ' -.ds PI \(*p +. ds -- \|\(em\| +. ds PI \(*p +. ds L" `` +. ds R" '' 'br\} -.\" If the F register is turned on, we'll generate -.\" index entries out stderr for the following things: -.\" TH Title -.\" SH Header -.\" Sh Subsection -.\" Ip Item -.\" X<> Xref (embedded -.\" Of course, you have to process the output yourself -.\" in some meaninful fashion. -.if \nF \{ -.de IX -.tm Index:\\$1\t\\n%\t"\\$2" -.. -.nr % 0 -.rr F -.\} -.TH MM-CONFIG 1 "20-Jun-2000" "MM 1.1.3" "Shared Memory Library" -.UC -.if n .hy 0 +.\" +.\" If the F register is turned on, we'll generate index entries on stderr +.\" for titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and +.\" index entries marked with X<> in POD. Of course, you'll have to process +.\" the output yourself in some meaningful fashion. +.if \nF \{\ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" +. . +. nr % 0 +. rr F +.\} +.\" +.\" For nroff, turn off justification. Always turn off hyphenation; it +.\" makes way too many mistakes in technical documents. +.hy 0 .if n .na -.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' -.de CQ \" put $1 in typewriter font -.ft CW -'if n "\c -'if t \\&\\$1\c -'if n \\&\\$1\c -'if n \&" -\\&\\$2 \\$3 \\$4 \\$5 \\$6 \\$7 -'.ft R -.. -.\" @(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2 -. \" AM - accent mark definitions +.\" +.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). +.\" Fear. Run. Save yourself. No user-serviceable parts. .bd B 3 -. \" fudge factors for nroff and troff +. \" fudge factors for nroff and troff .if n \{\ -. ds #H 0 -. ds #V .8m -. ds #F .3m -. ds #[ \f1 -. ds #] \fP +. 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 #[ \& -. ds #] \& +. ds #H ((1u-(\\\\n(.fu%2u))*.13m) +. ds #V .6m +. ds #F 0 +. ds #[ \& +. ds #] \& .\} -. \" simple accents for nroff and troff +. \" simple accents for nroff and troff .if n \{\ -. ds ' \& -. ds ` \& -. ds ^ \& -. ds , \& -. ds ~ ~ -. ds ? ? -. ds ! ! -. ds / -. ds q +. ds ' \& +. ds ` \& +. ds ^ \& +. ds , \& +. ds ~ ~ +. ds / .\} .if t \{\ -. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" -. 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 ? \s-2c\h'-\w'c'u*7/10'\u\h'\*(#H'\zi\d\s+2\h'\w'c'u*8/10' -. ds ! \s-2\(or\s+2\h'-\w'\(or'u'\v'-.8m'.\v'.8m' -. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' -. ds q o\h'-\w'o'u*8/10'\s-4\v'.4m'\z\(*i\v'-.4m'\s+4\h'\w'o'u*8/10' +. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" +. 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' .\} -. \" troff and (daisy-wheel) nroff accents +. \" 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 v \\k:\h'-(\\n(.wu*9/10-\*(#H)'\v'-\*(#V'\*(#[\s-4v\s0\v'\*(#V'\h'|\\n:u'\*(#] -.ds _ \\k:\h'-(\\n(.wu*9/10-\*(#H+(\*(#F*2/3))'\v'-.4m'\z\(hy\v'.4m'\h'|\\n:u' -.ds . \\k:\h'-(\\n(.wu*8/10)'\v'\*(#V*4/10'\z.\v'-\*(#V*4/10'\h'|\\n:u' -.ds 3 \*(#[\v'.2m'\s-2\&3\s0\v'-.2m'\*(#] .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' @@ -165,73 +118,80 @@ .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 -.ds oe o\h'-(\w'o'u*4/10)'e -.ds Oe O\h'-(\w'O'u*4/10)'E -. \" corrections for vroff +. \" 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' -. \" for low resolution devices (crt and lpr) +. \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ -. ds : e -. ds 8 ss -. ds v \h'-1'\o'\(aa\(ga' -. ds _ \h'-1'^ -. ds . \h'-1'. -. ds 3 3 -. 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 -. ds oe oe -. ds Oe OE +. 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 +.\" ====================================================================== +.\" +.IX Title "MM-CONFIG 1" +.TH MM-CONFIG 1 "01-Jul-2000" "MM 1.1.3" "Shared Memory Library" +.UC .SH "NAME" -\fBmm-config\fR \- MM library configuration/build utility +\&\fBmm-config\fR \- \s-1MM\s0 library configuration/build utility .SH "VERSION" -MM 1.1.3 (20-Jun-2000) +.IX Header "VERSION" +\&\s-1MM\s0 \s-11.1.3 (01-Jul-2000)\s0 .SH "SYNOPSIS" -\fBmm-config\fR -[\fB--help\fR] -[\fB--version\fR] -[\fB--cflags\fR] -[\fB--ldflags\fR] -[\fB--libs\fR] +.IX Header "SYNOPSIS" +\&\fBmm-config\fR +[\fB\*(--help\fR] +[\fB\*(--version\fR] +[\fB\*(--cflags\fR] +[\fB\*(--ldflags\fR] +[\fB\*(--libs\fR] .SH "DESCRIPTION" +.IX Header "DESCRIPTION" The \fBmm-config\fR program is a little helper utility for easy configuring and building applications based on the \fImm\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 \fImm\fR\|(3) library. .SH "OPTIONS" -\fBmm-config\fR accepts the following options: -.Ip "\fB--help\fR" 4 +.IX Header "OPTIONS" +\&\fBmm-config\fR accepts the following options: +.Ip "\fB\*(--help\fR" 4 +.IX Item "help" Prints the short usage information. -.Ip "\fB--version\fR" 4 +.Ip "\fB\*(--version\fR" 4 +.IX Item "version" Prints the version number and date of the installed \fImm\fR\|(3) library. -.Ip "\fB--cflags\fR" 4 +.Ip "\fB\*(--cflags\fR" 4 +.IX Item "cflags" Prints the C compiler flags which are needed to compile the \fImm\fR\|(3)\-based -application. The output is usually added to the \f(CWCFLAGS\fR variable of the -applications \f(CWMakefile\fR. -.Ip "\fB--ldflags\fR" 4 -Prints the linker flags (\f(CW-L\fR) which are needed to link the application with -the \fImm\fR\|(3) library. The output is usually added to the \f(CWLDFLAGS\fR variable of -the applications \f(CWMakefile\fR. -.Ip "\fB--libs\fR" 4 -Prints the library flags (\f(CW-l\fR) which are needed to link the application with -the \fImm\fR\|(3) library. The output is usually added to the \f(CWLIBS\fR variable of the -applications \f(CWMakefile\fR. +application. The output is usually added to the \f(CW\*(C`CFLAGS\*(C'\fR variable of the +applications \f(CW\*(C`Makefile\*(C'\fR. +.Ip "\fB\*(--ldflags\fR" 4 +.IX Item "ldflags" +Prints the linker flags (\f(CW\*(C`\-L\*(C'\fR) which are needed to link the application with +the \fImm\fR\|(3) library. The output is usually added to the \f(CW\*(C`LDFLAGS\*(C'\fR variable of +the applications \f(CW\*(C`Makefile\*(C'\fR. +.Ip "\fB\*(--libs\fR" 4 +.IX Item "libs" +Prints the library flags (\f(CW\*(C`\-l\*(C'\fR) which are needed to link the application with +the \fImm\fR\|(3) library. The output is usually added to the \f(CW\*(C`LIBS\*(C'\fR variable of the +applications \f(CW\*(C`Makefile\*(C'\fR. .SH "EXAMPLE" -.PP -.Vb 10 +.IX Header "EXAMPLE" +.Vb 4 \& CC=cc \& CFLAGS=-O `mm-config --cflags` \& LDFLAGS=`mm-config --ldflags` \& LIBS=-lm `mm-config --libs` -\& +.Ve +.Vb 5 \& all: foo \& foo: foo.o \& $(CC) $(LDFLAGS) -o foo foo.o $(LIBS) @@ -239,42 +199,12 @@ \& $(CC) $(CFLAGS) -c foo.c .Ve .SH "SEE ALSO" -\fImm\fR\|(3). +.IX Header "SEE ALSO" +\&\fImm\fR\|(3). .SH "AUTHOR" -.PP +.IX Header "AUTHOR" .Vb 3 \& Ralf S. Engelschall \& rse@engelschall.com \& www.engelschall.com .Ve - -.rn }` '' -.IX Title "MM-CONFIG 1" -.IX Name "B - MM library configuration/build utility" - -.IX Header "NAME" - -.IX Header "VERSION" - -.IX Header "SYNOPSIS" - -.IX Header "DESCRIPTION" - -.IX Header "OPTIONS" - -.IX Item "\fB--help\fR" - -.IX Item "\fB--version\fR" - -.IX Item "\fB--cflags\fR" - -.IX Item "\fB--ldflags\fR" - -.IX Item "\fB--libs\fR" - -.IX Header "EXAMPLE" - -.IX Header "SEE ALSO" - -.IX Header "AUTHOR" - Index: ossp-pkg/mm/mm-config.in ============================================================ $ cvs diff -u -r1.6 -r1.7 mm-config.in --- ossp-pkg/mm/mm-config.in 2000/01/09 20:19:40 1.6 +++ ossp-pkg/mm/mm-config.in 2001/01/29 20:27:22 1.7 @@ -3,7 +3,7 @@ ## mm-config -- MM library build configuration utility ## ## ==================================================================== -## Copyright (c) 1999-2000 Ralf S. Engelschall. All rights reserved. +## Copyright (c) 1999-2001 Ralf S. Engelschall. All rights reserved. ## ## Redistribution and use in source and binary forms, with or without ## modification, are permitted provided that the following conditions Index: ossp-pkg/mm/mm-config.pod ============================================================ $ cvs diff -u -r1.3 -r1.4 mm-config.pod --- ossp-pkg/mm/mm-config.pod 2000/01/09 20:19:40 1.3 +++ ossp-pkg/mm/mm-config.pod 2001/01/29 20:27:22 1.4 @@ -1,5 +1,5 @@ ## ==================================================================== -## Copyright (c) 1999-2000 Ralf S. Engelschall. All rights reserved. +## Copyright (c) 1999-2001 Ralf S. Engelschall. All rights reserved. ## ## Redistribution and use in source and binary forms, with or without ## modification, are permitted provided that the following conditions Index: ossp-pkg/mm/mm.3 ============================================================ $ cvs diff -u -r1.34 -r1.35 mm.3 --- ossp-pkg/mm/mm.3 2000/06/20 07:02:06 1.34 +++ ossp-pkg/mm/mm.3 2001/01/29 20:27:22 1.35 @@ -1,9 +1,9 @@ -.rn '' }` -''' $RCSfile$$Revision$$Date$ -''' -''' $Log$ -''' -.de Sh +.\" Automatically generated by Pod::Man version 1.02 +.\" Mon Jan 29 21:26:46 2001 +.\" +.\" Standard preamble: +.\" ====================================================================== +.de Sh \" Subsection heading .br .if t .Sp .ne 5 @@ -11,150 +11,106 @@ \fB\\$1\fR .PP .. -.de Sp +.de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. -.de Ip +.de Ip \" List item .br .ie \\n(.$>=3 .ne \\$3 .el .ne 3 .IP "\\$1" \\$2 .. -.de Vb +.de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. -.de Ve +.de Ve \" End verbatim text .ft R .fi .. -''' -''' -''' Set up \*(-- to give an unbreakable dash; -''' string Tr holds user defined translation string. -''' Bell System Logo is used as a dummy character. -''' +.\" Set up some character translations and predefined strings. \*(-- will +.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left +.\" double quote, and \*(R" will give a right double quote. | will give a +.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used +.\" to do unbreakable dashes and therefore won't be available. \*(C` and +.\" \*(C' expand to `' in nroff, nothing in troff, for use with C<> .tr \(*W-|\(bv\*(Tr +.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)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch -.if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch -.ds L" "" -.ds R" "" -''' \*(M", \*(S", \*(N" and \*(T" are the equivalent of -''' \*(L" and \*(R", except that they are used on ".xx" lines, -''' such as .IP and .SH, which do another additional levels of -''' double-quote interpretation -.ds M" """ -.ds S" """ -.ds N" """"" -.ds T" """"" -.ds L' ' -.ds R' ' -.ds M' ' -.ds S' ' -.ds N' ' -.ds T' ' +. ds -- \(*W- +. ds PI pi +. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch +. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch +. ds L" "" +. ds R" "" +. ds C` ` +. ds C' ' 'br\} .el\{\ -.ds -- \(em\| -.tr \*(Tr -.ds L" `` -.ds R" '' -.ds M" `` -.ds S" '' -.ds N" `` -.ds T" '' -.ds L' ` -.ds R' ' -.ds M' ` -.ds S' ' -.ds N' ` -.ds T' ' -.ds PI \(*p +. ds -- \|\(em\| +. ds PI \(*p +. ds L" `` +. ds R" '' 'br\} -.\" If the F register is turned on, we'll generate -.\" index entries out stderr for the following things: -.\" TH Title -.\" SH Header -.\" Sh Subsection -.\" Ip Item -.\" X<> Xref (embedded -.\" Of course, you have to process the output yourself -.\" in some meaninful fashion. -.if \nF \{ -.de IX -.tm Index:\\$1\t\\n%\t"\\$2" -.. -.nr % 0 -.rr F +.\" +.\" If the F register is turned on, we'll generate index entries on stderr +.\" for titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and +.\" index entries marked with X<> in POD. Of course, you'll have to process +.\" the output yourself in some meaningful fashion. +.if \nF \{\ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" +. . +. nr % 0 +. rr F .\} -.TH mm 3 "20-Jun-2000" "MM 1.1.3" "Shared Memory Library" -.UC -.if n .hy 0 +.\" +.\" For nroff, turn off justification. Always turn off hyphenation; it +.\" makes way too many mistakes in technical documents. +.hy 0 .if n .na -.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' -.de CQ \" put $1 in typewriter font -.ft CW -'if n "\c -'if t \\&\\$1\c -'if n \\&\\$1\c -'if n \&" -\\&\\$2 \\$3 \\$4 \\$5 \\$6 \\$7 -'.ft R -.. -.\" @(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2 -. \" AM - accent mark definitions +.\" +.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). +.\" Fear. Run. Save yourself. No user-serviceable parts. .bd B 3 -. \" fudge factors for nroff and troff +. \" fudge factors for nroff and troff .if n \{\ -. ds #H 0 -. ds #V .8m -. ds #F .3m -. ds #[ \f1 -. ds #] \fP +. 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 #[ \& -. ds #] \& +. ds #H ((1u-(\\\\n(.fu%2u))*.13m) +. ds #V .6m +. ds #F 0 +. ds #[ \& +. ds #] \& .\} -. \" simple accents for nroff and troff +. \" simple accents for nroff and troff .if n \{\ -. ds ' \& -. ds ` \& -. ds ^ \& -. ds , \& -. ds ~ ~ -. ds ? ? -. ds ! ! -. ds / -. ds q +. ds ' \& +. ds ` \& +. ds ^ \& +. ds , \& +. ds ~ ~ +. ds / .\} .if t \{\ -. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" -. 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 ? \s-2c\h'-\w'c'u*7/10'\u\h'\*(#H'\zi\d\s+2\h'\w'c'u*8/10' -. ds ! \s-2\(or\s+2\h'-\w'\(or'u'\v'-.8m'.\v'.8m' -. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' -. ds q o\h'-\w'o'u*8/10'\s-4\v'.4m'\z\(*i\v'-.4m'\s+4\h'\w'o'u*8/10' +. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" +. 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' .\} -. \" troff and (daisy-wheel) nroff accents +. \" 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 v \\k:\h'-(\\n(.wu*9/10-\*(#H)'\v'-\*(#V'\*(#[\s-4v\s0\v'\*(#V'\h'|\\n:u'\*(#] -.ds _ \\k:\h'-(\\n(.wu*9/10-\*(#H+(\*(#F*2/3))'\v'-.4m'\z\(hy\v'.4m'\h'|\\n:u' -.ds . \\k:\h'-(\\n(.wu*8/10)'\v'\*(#V*4/10'\z.\v'-\*(#V*4/10'\h'|\\n:u' -.ds 3 \*(#[\v'.2m'\s-2\&3\s0\v'-.2m'\*(#] .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' @@ -162,41 +118,39 @@ .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 -.ds oe o\h'-(\w'o'u*4/10)'e -.ds Oe O\h'-(\w'O'u*4/10)'E -. \" corrections for vroff +. \" 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' -. \" for low resolution devices (crt and lpr) +. \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ -. ds : e -. ds 8 ss -. ds v \h'-1'\o'\(aa\(ga' -. ds _ \h'-1'^ -. ds . \h'-1'. -. ds 3 3 -. 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 -. ds oe oe -. ds Oe OE +. 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 +.\" ====================================================================== +.\" +.IX Title "mm 3" +.TH mm 3 "01-Jul-2000" "MM 1.1.3" "Shared Memory Library" +.UC .SH "NAME" -\fBMM \- Shared Memory Library\fR +\&\fB\s-1MM\s0 \- Shared Memory Library\fR .SH "VERSION" -MM 1.1.3 (20-Jun-2000) +.IX Header "VERSION" +\&\s-1MM\s0 \s-11.1.3 (01-Jul-2000)\s0 .SH "SYNOPSIS" -.PP +.IX Header "SYNOPSIS" .Vb 1 \& #include "mm.h" .Ve -\fB Global Malloc-Replacement API\fR +\&\fB Global Malloc-Replacement \s-1API\s0\fR .PP .Vb 14 \& int \fBMM_create\fR(size_t size, const char *file); @@ -214,7 +168,7 @@ \& size_t \fBMM_available\fR(void); \& char *\fBMM_error\fR(void); .Ve -\fB Standard Malloc-Style API\fR +\&\fB Standard Malloc-Style \s-1API\s0\fR .PP .Vb 15 \& MM *\fBmm_create\fR(size_t size, char *file); @@ -233,7 +187,7 @@ \& char *\fBmm_error\fR(void); \& void \fBmm_display_info\fR(MM *mm); .Ve -\fB Low-level Shared Memory API\fR +\&\fB Low-level Shared Memory \s-1API\s0\fR .PP .Vb 9 \& void *\fBmm_core_create\fR(size_t size, char *file); @@ -246,7 +200,7 @@ \& size_t \fBmm_core_align2page\fR(size_t size); \& size_t \fBmm_core_align2click\fR(size_t size); .Ve -\fB Internal Library API\fR +\&\fB Internal Library \s-1API\s0\fR .PP .Vb 3 \& void \fBmm_lib_error_set\fR(unsigned int, const char *str); @@ -254,47 +208,53 @@ \& int \fBmm_lib_version\fR(void); .Ve .SH "DESCRIPTION" -The \fBMM\fR library is a 2-layer abstraction library which simplifies the usage +.IX Header "DESCRIPTION" +The \fB\s-1MM\s0\fR library is a 2\-layer abstraction library which simplifies the usage of shared memory between forked (and this way strongly related) processes under Unix platforms. On the first (lower) layer it hides all platform dependent implementation details (allocation and locking) when dealing with shared memory segments and on the second (higher) layer it provides a -high-level \fImalloc\fR\|(3)\-style API for a convenient and well known way to work +high-level \fImalloc\fR\|(3)\-style \s-1API\s0 for a convenient and well known way to work with data-structures inside those shared memory segments. .PP -The abbreviation \fBMM\fR is historically and originally comes from the phrase -``\fImemory mapped\fR'\*(R' as used by the POSIX.1 \fImmap\fR\|(2) function. Because this +The abbreviation \fB\s-1MM\s0\fR is historically and originally comes from the phrase +``\fImemory mapped\fR'' as used by the \s-1POSIX\s0.1 \fImmap\fR\|(2) function. Because this facility is internally used by this library on most platforms to establish the shared memory segments. .Sh "\s-1LIBRARY\s0 \s-1STRUCTURE\s0" +.IX Subsection "LIBRARY STRUCTURE" This library is structured into three main APIs which are internally based on each other: .Ip "\fBGlobal Malloc-Replacement \s-1API\s0\fR" 4 +.IX Item "Global Malloc-Replacement API" This is the most high-level \s-1API\s0 which directly can be used as replacement \s-1API\s0 for the \s-1POSIX\s0.1 memory allocation \s-1API\s0 (\fImalloc\fR\|(2) and friends). This is useful when converting \fIheap\fR based data structures to \fIshared memory\fR based data structures without the need to change the code dramatically. All which is needed is to prefix the \s-1POSIX\s0.1 memory allocation functions with -`\f(CWMM_\fR\*(R', i.e. `\f(CWmalloc\fR\*(R' becomes `\f(CWMM_malloc\fR\*(R', `\f(CWstrdup\fR\*(R' becomes -`\f(CWMM_strdup\fR\*(R', etc. This \s-1API\s0 internally uses just a global `\f(CWMM *\fR\*(R' pool for -calling the corresponding functions (those with prefix `\f(CWmm_\fR') of the -\fIStandard Malloc-Style \s-1API\s0\fR. +`\f(CW\*(C`MM_\*(C'\fR', i.e. `\f(CW\*(C`malloc\*(C'\fR' becomes `\f(CW\*(C`MM_malloc\*(C'\fR', `\f(CW\*(C`strdup\*(C'\fR' becomes +`\f(CW\*(C`MM_strdup\*(C'\fR', etc. This \s-1API\s0 internally uses just a global `\f(CW\*(C`MM *\*(C'\fR' pool for +calling the corresponding functions (those with prefix `\f(CW\*(C`mm_\*(C'\fR') of the +\&\fIStandard Malloc-Style \s-1API\s0\fR. .Ip "\fBStandard Malloc-Style \s-1API\s0\fR" 4 +.IX Item "Standard Malloc-Style API" This is the standard high-level memory allocation \s-1API\s0. Its interface is -similar to the \fIGlobal Malloc-Replacement \s-1API\s0\fR but it uses an explicit `\f(CWMM *\fR\*(R' +similar to the \fIGlobal Malloc-Replacement \s-1API\s0\fR but it uses an explicit `\f(CW\*(C`MM *\*(C'\fR' pool to operate on. That is why every function of this \s-1API\s0 has an argument of -type `\f(CWMM *\fR\*(R' as its first argument. This \s-1API\s0 provides a comfortable way to +type `\f(CW\*(C`MM *\*(C'\fR' as its first argument. This \s-1API\s0 provides a comfortable way to work with small dynamically allocated shared memory chunks inside large statically allocated shared memory segments. It is internally based on the -\fILow-Level Shared Memory \s-1API\s0\fR for creating the underlaying shared memory +\&\fILow-Level Shared Memory \s-1API\s0\fR for creating the underlaying shared memory segment. .Ip "\fBLow-Level Shared Memory \s-1API\s0\fR" 4 +.IX Item "Low-Level Shared Memory API" This is the basis of the whole \fB\s-1MM\s0\fR library. It provides low-level functions for creating shared memory segments with mutual exclusion (in short \fImutex\fR) capabilities in a portable way. Internally the shared memory and mutex facility is implemented in various platform-dependent ways. A list of implementation variants follows under the next topic. .Sh "\s-1SHARED\s0 \s-1MEMORY\s0 \s-1IMPLEMENTATION\s0" +.IX Subsection "SHARED MEMORY IMPLEMENTATION" Internally the shared memory facility is implemented in various platform-dependent ways. Each way has its own advantages and disadvantages (in addition to the fact that some variants aren't available at all on some @@ -303,48 +263,59 @@ background reasons with their advantages and disadvantages and in an ascending order, i.e. the \fB\s-1MM\s0\fR configuration mechanism chooses the last available one in the list as the preferred variant. -.Ip "Classical mmap(2) on temporary file (\s-1MMFILE\s0)" 4 -\fIAdvantage:\fR maximum portable. -\fIDisadvantage:\fR needs a temporary file on the filesystem. -.Ip "mmap(2) via \s-1POSIX\s0.1 shm_open(3) on temporary file (\s-1MMPOSX\s0)" 4 -\fIAdvantage:\fR standardized by \s-1POSIX\s0.1 and theoretically portable. -\fIDisadvantage:\fR needs a temporary file on the filesystem and is +.Ip "Classical \fImmap\fR\|(2) on temporary file (\s-1MMFILE\s0)" 4 +.IX Item "Classical mmap on temporary file (MMFILE)" +\&\fIAdvantage:\fR maximum portable. +\&\fIDisadvantage:\fR needs a temporary file on the filesystem. +.Ip "\fImmap\fR\|(2) via \s-1POSIX\s0.1 \fIshm_open\fR\|(3) on temporary file (\s-1MMPOSX\s0)" 4 +.IX Item "mmap via POSIX.1 shm_open on temporary file (MMPOSX)" +\&\fIAdvantage:\fR standardized by \s-1POSIX\s0.1 and theoretically portable. +\&\fIDisadvantage:\fR needs a temporary file on the filesystem and is is usually not available on existing Unix platform. -.Ip "\s-1SVR4-\s0style mmap(2) on \f(CW/dev/zero\fR device (\s-1MMZERO\s0)" 4 -\fIAdvantage:\fR widely available and mostly portable on \s-1SVR4\s0 platforms. -\fIDisadvantage:\fR needs the \f(CW/dev/zero\fR device and a \fImmap\fR\|(2) +.Ip "SVR4\-style \fImmap\fR\|(2) on \f(CW\*(C`/dev/zero\*(C'\fR device (\s-1MMZERO\s0)" 4 +.IX Item "SVR4-style mmap on /dev/zero device (MMZERO)" +\&\fIAdvantage:\fR widely available and mostly portable on \s-1SVR4\s0 platforms. +\&\fIDisadvantage:\fR needs the \f(CW\*(C`/dev/zero\*(C'\fR device and a \fImmap\fR\|(2) which supports memory mapping through this device. -.Ip "SysV \s-1IPC\s0 shmget(2) (\s-1IPCSHM\s0)" 4 -\fIAdvantage:\fR does not need a temporary file or external device. -\fIDisadvantage:\fR although available on mostly all modern Unix platforms, it has +.Ip "SysV \s-1IPC\s0 \fIshmget\fR\|(2) (\s-1IPCSHM\s0)" 4 +.IX Item "SysV IPC shmget (IPCSHM)" +\&\fIAdvantage:\fR does not need a temporary file or external device. +\&\fIDisadvantage:\fR although available on mostly all modern Unix platforms, it has strong restrictions like the maximum size of a single shared memory segment (can be as small as 100KB, but depends on the platform). -.Ip "4.4BSD\-style mmap(2) via \f(CWMAP_ANON\fR facility (\s-1MMANON\s0)" 4 -\fIAdvantage:\fR does not need a temporary file or external device. -\fIDisadvantage:\fR usually only available on \s-1BSD\s0 platforms and derivatives. +.Ip "4.4BSD-style \fImmap\fR\|(2) via \f(CW\*(C`MAP_ANON\*(C'\fR facility (\s-1MMANON\s0)" 4 +.IX Item "4.4BSD-style mmap via MAP_ANON facility (MMANON)" +\&\fIAdvantage:\fR does not need a temporary file or external device. +\&\fIDisadvantage:\fR usually only available on \s-1BSD\s0 platforms and derivatives. .Sh "\s-1LOCKING\s0 \s-1IMPLEMENTATION\s0" +.IX Subsection "LOCKING IMPLEMENTATION" As for the shared memory facility, internally the locking facility is implemented in various platform-dependent ways. They are again listed in ascending order, i.e. the \fB\s-1MM\s0\fR configuration mechanism chooses the last available one in the list as the preferred variant. The list of implemented variants is: -.Ip "4.2BSD\-style flock(2) on temporary file (\s-1FLOCK\s0)" 4 -\fIAdvantage:\fR exists on a lot of platforms, especially on older Unix +.Ip "4.2BSD-style \fIflock\fR\|(2) on temporary file (\s-1FLOCK\s0)" 4 +.IX Item "4.2BSD-style flock on temporary file (FLOCK)" +\&\fIAdvantage:\fR exists on a lot of platforms, especially on older Unix derivates. \fIDisadvantage:\fR needs a temporary file on the filesystem and has to re-open file-descriptors to it in \fIeach\fR\|(!) \fIfork\fR\|(2)'ed child process. -.Ip "SysV \s-1IPC\s0 semget(2) (\s-1IPCSEM\s0)" 4 -\fIAdvantage:\fR exists on a lot of platforms and does not need a temporary file. -\fIDisadvantage:\fR an unmeant termination of the application leads to a -semaphore leak because the facility does not allow a ``remove in advance'\*(R' +.Ip "SysV \s-1IPC\s0 \fIsemget\fR\|(2) (\s-1IPCSEM\s0)" 4 +.IX Item "SysV IPC semget (IPCSEM)" +\&\fIAdvantage:\fR exists on a lot of platforms and does not need a temporary file. +\&\fIDisadvantage:\fR an unmeant termination of the application leads to a +semaphore leak because the facility does not allow a ``remove in advance'' trick (as the \s-1IPC\s0 shared memory facility does) for safe cleanups. -.Ip "\s-1SVR4-\s0style fcntl(2) on temporary file (\s-1FCNTL\s0)" 4 -\fIAdvantage:\fR exists on a lot of platforms and is also the most powerful +.Ip "SVR4\-style \fIfcntl\fR\|(2) on temporary file (\s-1FCNTL\s0)" 4 +.IX Item "SVR4-style fcntl on temporary file (FCNTL)" +\&\fIAdvantage:\fR exists on a lot of platforms and is also the most powerful variant (although not always the fastest one). \fIDisadvantage:\fR needs a temporary file. .Sh "\s-1MEMORY\s0 \s-1ALLOCATION\s0 \s-1STRATEGY\s0" +.IX Subsection "MEMORY ALLOCATION STRATEGY" The memory allocation strategy the \fIStandard Malloc-Style \s-1API\s0\fR functions use internally is the following: .Ip "\fBAllocation\fR" 4 +.IX Item "Allocation" If a chunk of memory has to be allocated, the internal list of free chunks is searched for a minimal-size chunk which is larger or equal than the size of the to be allocated chunk (a \fIbest fit\fR strategy). @@ -359,6 +330,7 @@ created from the spare area of the shared memory segment until the segment is full (in which case an \fIout of memory\fR error occurs). .Ip "\fBDeallocation\fR" 4 +.IX Item "Deallocation" If a chunk of memory has to be deallocated, it is inserted in sorted manner into the internal list of free chunks. The insertion operation automatically merges the chunk with a previous and/or a next free chunk if possible, i.e. @@ -378,175 +350,217 @@ segments are usually a lot smaller than heaps and the fact that we always defragment by merging the free chunks if possible). .SH "API FUNCTIONS" -In the following, all API functions are described in detail The order . -directly follows the one in the \fBSYNOPSIS\fR section above . +.IX Header "API FUNCTIONS" +In the following, all \s-1API\s0 functions are described in detail The order . +directly follows the one in the \fB\s-1SYNOPSIS\s0\fR section above . .Sh "Global Malloc-Replacement \s-1API\s0" +.IX Subsection "Global Malloc-Replacement API" .Ip "int \fBMM_create\fR(size_t \fIsize\fR, const char *\fIfile\fR);" 4 +.IX Item "int MM_create(size_t size, const char *file);" This initializes the global shared memory pool with \fIsize\fR and \fIfile\fR and has to be called \fIbefore\fR any \fIfork\fR\|(2) operations are performed by the application. .Ip "int \fBMM_permission\fR(mode_t \fImode\fR, uid_t \fIowner\fR, gid_t \fIgroup\fR);" 4 +.IX Item "int MM_permission(mode_t mode, uid_t owner, gid_t group);" This sets the filesystem \fImode\fR, \fIowner\fR and \fIgroup\fR for the global shared memory pool (has effects only if the underlaying shared memory segment implementation is actually based on external auxiliary files). The arguments are directly passed through to \fIchmod\fR\|(2) and \fIchown\fR\|(2). .Ip "void \fBMM_destroy\fR(void);" 4 +.IX Item "void MM_destroy(void);" This destroys the global shared memory pool and should be called \fIafter\fR all child processes were killed. .Ip "int \fBMM_lock\fR(mm_lock_mode \fImode\fR);" 4 +.IX Item "int MM_lock(mm_lock_mode mode);" This locks the global shared memory pool for the current process in order to -perform either shared/read-only (\fImode\fR is \f(CWMM_LOCK_RD\fR) or -exclusive/read-write (\fImode\fR is \f(CWMM_LOCK_RW\fR) critical operations inside the +perform either shared/read-only (\fImode\fR is \f(CW\*(C`MM_LOCK_RD\*(C'\fR) or +exclusive/read-write (\fImode\fR is \f(CW\*(C`MM_LOCK_RW\*(C'\fR) critical operations inside the global shared memory pool. .Ip "int \fBMM_unlock\fR(void);" 4 +.IX Item "int MM_unlock(void);" This unlocks the global shared memory pool for the current process after the critical operations were performed inside the global shared memory pool. .Ip "void *\fBMM_malloc\fR(size_t \fIsize\fR);" 4 +.IX Item "void *MM_malloc(size_t size);" Identical to the \s-1POSIX\s0.1 \fImalloc\fR\|(3) function but instead of allocating memory from the \fIheap\fR it allocates it from the global shared memory pool. .Ip "void \fBMM_free\fR(void *\fIptr\fR);" 4 +.IX Item "void MM_free(void *ptr);" Identical to the \s-1POSIX\s0.1 \fIfree\fR\|(3) function but instead of deallocating memory in the \fIheap\fR it deallocates it in the global shared memory pool. .Ip "void *\fBMM_realloc\fR(void *\fIptr\fR, size_t \fIsize\fR);" 4 +.IX Item "void *MM_realloc(void *ptr, size_t size);" Identical to the \s-1POSIX\s0.1 \fIrealloc\fR\|(3) function but instead of reallocating memory in the \fIheap\fR it reallocates it inside the global shared memory pool. .Ip "void *\fBMM_calloc\fR(size_t \fInumber\fR, size_t \fIsize\fR);" 4 +.IX Item "void *MM_calloc(size_t number, size_t size);" Identical to the \s-1POSIX\s0.1 \fIcalloc\fR\|(3) function but instead of allocating and initializing memory from the \fIheap\fR it allocates and initializes it from the global shared memory pool. .Ip "char *\fBMM_strdup\fR(const char *\fIstr\fR);" 4 +.IX Item "char *MM_strdup(const char *str);" Identical to the \s-1POSIX\s0.1 \fIstrdup\fR\|(3) function but instead of creating the string copy in the \fIheap\fR it creates it in the global shared memory pool. .Ip "size_t \fBMM_sizeof\fR(const void *\fIptr\fR);" 4 +.IX Item "size_t MM_sizeof(const void *ptr);" This function returns the size in bytes of the chunk starting at \fIptr\fR when -\fIptr\fR was previously allocated with \fIMM_malloc\fR\|(3). The result is undefined +\&\fIptr\fR was previously allocated with \fIMM_malloc\fR\|(3). The result is undefined if \fIptr\fR was not previously allocated with \fIMM_malloc\fR\|(3). .Ip "size_t \fBMM_maxsize\fR(void);" 4 +.IX Item "size_t MM_maxsize(void);" This function returns the maximum size which is allowed as the first argument to the \fIMM_create\fR\|(3) function. .Ip "size_t \fBMM_available\fR(void);" 4 +.IX Item "size_t MM_available(void);" Returns the amount in bytes of still available (free) memory in the global shared memory pool. .Ip "char *\fBMM_error\fR(void);" 4 +.IX Item "char *MM_error(void);" Returns the last error message which occurred inside the \fB\s-1MM\s0\fR library. .Sh "Standard Malloc-Style \s-1API\s0" +.IX Subsection "Standard Malloc-Style API" .Ip "\s-1MM\s0 *\fBmm_create\fR(size_t \fIsize\fR, const char *\fIfile\fR);" 4 +.IX Item "MM *mm_create(size_t size, const char *file);" This creates a shared memory pool which has space for approximately a total of -\fIsize\fR bytes with the help of \fIfile\fR. Here \fIfile\fR is a filesystem path to a +\&\fIsize\fR bytes with the help of \fIfile\fR. Here \fIfile\fR is a filesystem path to a file which need not to exist (and perhaps is never created because this depends on the platform and chosen shared memory and mutex implementation). -The return value is a pointer to a \f(CWMM\fR structure which should be treated as +The return value is a pointer to a \f(CW\*(C`MM\*(C'\fR structure which should be treated as opaque by the application. It describes the internals of the created shared -memory pool. In case of an error \f(CWNULL\fR is returned. A \fIsize\fR of 0 means to +memory pool. In case of an error \f(CW\*(C`NULL\*(C'\fR is returned. A \fIsize\fR of 0 means to allocate the maximum allowed size which is platform dependent and is between a few \s-1KB\s0 and the soft limit of 64MB. .Ip "int \fBmm_permission\fR(\s-1MM\s0 *\fImm\fR, mode_t \fImode\fR, uid_t \fIowner\fR, gid_t \fIgroup\fR);" 4 +.IX Item "int mm_permission(MM *mm, mode_t mode, uid_t owner, gid_t group);" This sets the filesystem \fImode\fR, \fIowner\fR and \fIgroup\fR for the shared memory pool \fImm\fR (has effects only when the underlaying shared memory segment implementation is actually based on external auxiliary files). The arguments are directly passed through to \fIchmod\fR\|(2) and \fIchown\fR\|(2). .Ip "void \fBmm_destroy\fR(\s-1MM\s0 *\fImm\fR);" 4 +.IX Item "void mm_destroy(MM *mm);" This destroys the complete shared memory pool \fImm\fR and with it all chunks which were allocated in this pool. Additionally any created files on the filesystem corresponding the to shared memory pool are unlinked. .Ip "int \fBmm_lock\fR(\s-1MM\s0 *\fImm\fR, mm_lock_mode \fImode\fR);" 4 +.IX Item "int mm_lock(MM *mm, mm_lock_mode mode);" This locks the shared memory pool \fImm\fR for the current process in order to -perform either shared/read-only (\fImode\fR is \f(CWMM_LOCK_RD\fR) or -exclusive/read-write (\fImode\fR is \f(CWMM_LOCK_RW\fR) critical operations inside the +perform either shared/read-only (\fImode\fR is \f(CW\*(C`MM_LOCK_RD\*(C'\fR) or +exclusive/read-write (\fImode\fR is \f(CW\*(C`MM_LOCK_RW\*(C'\fR) critical operations inside the global shared memory pool. .Ip "int \fBmm_unlock\fR(\s-1MM\s0 *\fImm\fR);" 4 +.IX Item "int mm_unlock(MM *mm);" This unlocks the shared memory pool \fImm\fR for the current process after critical operations were performed inside the global shared memory pool. .Ip "void *\fBmm_malloc\fR(\s-1MM\s0 *\fImm\fR, size_t \fIsize\fR);" 4 +.IX Item "void *mm_malloc(MM *mm, size_t size);" This function allocates \fIsize\fR bytes from the shared memory pool \fImm\fR and -returns either a (virtual memory word aligned) pointer to it or \f(CWNULL\fR in +returns either a (virtual memory word aligned) pointer to it or \f(CW\*(C`NULL\*(C'\fR in case of an error (out of memory). It behaves like the \s-1POSIX\s0.1 \fImalloc\fR\|(3) function but instead of allocating memory from the \fIheap\fR it allocates it from the shared memory segment underlaying \fImm\fR. .Ip "void \fBmm_free\fR(\s-1MM\s0 *\fImm\fR, void *\fIptr\fR);" 4 +.IX Item "void mm_free(MM *mm, void *ptr);" This deallocates the chunk starting at \fIptr\fR in the shared memory pool \fImm\fR. It behaves like the \s-1POSIX\s0.1 \fIfree\fR\|(3) function but instead of deallocating memory from the \fIheap\fR it deallocates it from the shared memory segment underlaying \fImm\fR. .Ip "void *\fBmm_realloc\fR(\s-1MM\s0 *\fImm\fR, void *\fIptr\fR, size_t \fIsize\fR);" 4 +.IX Item "void *mm_realloc(MM *mm, void *ptr, size_t size);" This function reallocates the chunk starting at \fIptr\fR inside the shared memory pool \fImm\fR with the new size of \fIsize\fR bytes. It behaves like the -\s-1POSIX\s0.1 \fIrealloc\fR\|(3) function but instead of reallocating memory in the -\fIheap\fR it reallocates it in the shared memory segment underlaying \fImm\fR. +\&\s-1POSIX\s0.1 \fIrealloc\fR\|(3) function but instead of reallocating memory in the +\&\fIheap\fR it reallocates it in the shared memory segment underlaying \fImm\fR. .Ip "void *\fBmm_calloc\fR(\s-1MM\s0 *\fImm\fR, size_t \fInumber\fR, size_t \fIsize\fR);" 4 +.IX Item "void *mm_calloc(MM *mm, size_t number, size_t size);" This is similar to \fImm_malloc\fR\|(3), but additionally clears the chunk. It behaves like the \s-1POSIX\s0.1 \fIcalloc\fR\|(3) function. It allocates space for \fInumber\fR objects, each \fIsize\fR bytes in length from the shared memory pool \fImm\fR. The result is identical to calling \fImm_malloc\fR\|(3) with an argument of ``\fInumber\fR * -\fIsize\fR'\*(R', with the exception that the allocated memory is initialized to nul +\&\fIsize\fR'', with the exception that the allocated memory is initialized to nul bytes. .Ip "char *\fBmm_strdup\fR(\s-1MM\s0 *\fImm\fR, const char *\fIstr\fR);" 4 +.IX Item "char *mm_strdup(MM *mm, const char *str);" This function behaves like the \s-1POSIX\s0.1 \fIstrdup\fR\|(3) function. It allocates sufficient memory inside the shared memory pool \fImm\fR for a copy of the string -\fIstr\fR, does the copy, and returns a pointer to it. The pointer may +\&\fIstr\fR, does the copy, and returns a pointer to it. The pointer may subsequently be used as an argument to the function \fImm_free\fR\|(3). If -insufficient shared memory is available, \f(CWNULL\fR is returned. +insufficient shared memory is available, \f(CW\*(C`NULL\*(C'\fR is returned. .Ip "size_t \fBmm_sizeof\fR(const void *\fIptr\fR);" 4 +.IX Item "size_t mm_sizeof(const void *ptr);" This function returns the size in bytes of the chunk starting at \fIptr\fR when -\fIptr\fR was previously allocated with \fImm_malloc\fR\|(3). The result is undefined +\&\fIptr\fR was previously allocated with \fImm_malloc\fR\|(3). The result is undefined when \fIptr\fR was not previously allocated with \fImm_malloc\fR\|(3). .Ip "size_t \fBmm_maxsize\fR(void);" 4 +.IX Item "size_t mm_maxsize(void);" This function returns the maximum size which is allowed as the first argument to the \fImm_create\fR\|(3) function. .Ip "size_t \fBmm_available\fR(\s-1MM\s0 *\fImm\fR);" 4 +.IX Item "size_t mm_available(MM *mm);" Returns the amount in bytes of still available (free) memory in the shared memory pool \fImm\fR. .Ip "char *\fBmm_error\fR(void);" 4 +.IX Item "char *mm_error(void);" Returns the last error message which occurred inside the \fB\s-1MM\s0\fR library. .Ip "void \fBmm_display_info\fR(\s-1MM\s0 *\fImm\fR);" 4 +.IX Item "void mm_display_info(MM *mm);" This is debugging function which displays a summary page for the shared memory pool \fImm\fR describing various internal sizes and counters. .Sh "Low-Level Shared Memory \s-1API\s0" +.IX Subsection "Low-Level Shared Memory API" .Ip "void *\fBmm_core_create\fR(size_t \fIsize\fR, const char *\fIfile\fR);" 4 +.IX Item "void *mm_core_create(size_t size, const char *file);" This creates a shared memory area which is at least \fIsize\fR bytes in size with the help of \fIfile\fR. The value \fIsize\fR has to be greater than 0 and less or equal the value returned by \fImm_core_maxsegsize\fR\|(3). Here \fIfile\fR is a filesystem path to a file which need not to exist (and perhaps is never created because this depends on the platform and chosen shared memory and mutex implementation). The return value is either a (virtual memory word -aligned) pointer to the shared memory segment or \f(CWNULL\fR in case of an error. +aligned) pointer to the shared memory segment or \f(CW\*(C`NULL\*(C'\fR in case of an error. The application is guaranteed to be able to access the shared memory segment from byte 0 to byte \fIsize\fR\-1 starting at the returned address. .Ip "int \fBmm_core_permission\fR(void *\fIcore\fR, mode_t \fImode\fR, uid_t \fIowner\fR, gid_t \fIgroup\fR);" 4 +.IX Item "int mm_core_permission(void *core, mode_t mode, uid_t owner, gid_t group);" This sets the filesystem \fImode\fR, \fIowner\fR and \fIgroup\fR for the shared memory segment \fIcode\fR (has effects only when the underlaying shared memory segment implementation is actually based on external auxiliary files). The arguments are directly passed through to \fIchmod\fR\|(2) and \fIchown\fR\|(2). .Ip "void \fBmm_core_delete\fR(void *\fIcore\fR);" 4 +.IX Item "void mm_core_delete(void *core);" This deletes a shared memory segment \fIcore\fR (as previously returned by a -\fImm_core_create\fR\|(3) call). After this operation, accessing the segment starting +\&\fImm_core_create\fR\|(3) call). After this operation, accessing the segment starting at \fIcore\fR is no longer allowed and will usually lead to a segmentation fault. .Ip "int \fBmm_core_lock\fR(const void *\fIcore\fR, mm_lock_mode \fImode\fR);" 4 +.IX Item "int mm_core_lock(const void *core, mm_lock_mode mode);" This function acquires an advisory lock for the current process on the shared -memory segment \fIcore\fR for either shared/read-only (\fImode\fR is \f(CWMM_LOCK_RD\fR) -or exclusive/read-write (\fImode\fR is \f(CWMM_LOCK_RW\fR) critical operations between -\fIfork\fR\|(2)'ed child processes. +memory segment \fIcore\fR for either shared/read-only (\fImode\fR is \f(CW\*(C`MM_LOCK_RD\*(C'\fR) +or exclusive/read-write (\fImode\fR is \f(CW\*(C`MM_LOCK_RW\*(C'\fR) critical operations between +\&\fIfork\fR\|(2)'ed child processes. .Ip "int \fBmm_core_unlock\fR(const void *\fIcore\fR);" 4 +.IX Item "int mm_core_unlock(const void *core);" This function releases a previously acquired advisory lock for the current process on the shared memory segment \fIcore\fR. .Ip "size_t \fBmm_core_size\fR(const void *\fIcore\fR);" 4 +.IX Item "size_t mm_core_size(const void *core);" This returns the size in bytes of \fIcore\fR. This size is exactly the size which was used for creating the shared memory area via \fImm_core_create\fR\|(3). The function is provided just for convenience reasons to not require the application to remember the memory size behind \fIcore\fR itself. .Ip "size_t \fBmm_core_maxsegsize\fR(void);" 4 +.IX Item "size_t mm_core_maxsegsize(void);" This returns the number of bytes of a maximum-size shared memory segment which is allowed to allocate via the \s-1MM\s0 library. It is between a few \s-1KB\s0 and the soft limit of 64MB. .Ip "size_t \fBmm_core_align2page\fR(size_t \fIsize\fR);" 4 +.IX Item "size_t mm_core_align2page(size_t size);" This is just a utility function which can be used to align the number \fIsize\fR to the next virtual memory \fIpage\fR boundary used by the underlaying platform. The memory page boundary under Unix platforms is usually somewhere between 2048 and 16384 bytes. You do not have to align the \fIsize\fR arguments of other -\fB\s-1MM\s0\fR library functions yourself, because this is already done internally. +\&\fB\s-1MM\s0\fR library functions yourself, because this is already done internally. This function is exported by the \fB\s-1MM\s0\fR library just for convenience reasons in case an application wants to perform similar calculations for other purposes. .Ip "size_t \fBmm_core_align2word\fR(size_t \fIsize\fR);" 4 +.IX Item "size_t mm_core_align2word(size_t size);" This is another utility function which can be used to align the number \fIsize\fR to the next virtual memory \fIword\fR boundary used by the underlaying platform. The memory word boundary under Unix platforms is usually somewhere between 4 @@ -555,204 +569,63 @@ function is exported by the \fB\s-1MM\s0\fR library just for convenience reasons in case an application wants to perform simular calculations for other purposes. .Sh "Low-Level Shared Memory \s-1API\s0" +.IX Subsection "Low-Level Shared Memory API" .Ip "void \fBmm_lib_error_set\fR(unsigned int, const char *str);" 4 +.IX Item "void mm_lib_error_set(unsigned int, const char *str);" This is a function which is used internally by the various \s-1MM\s0 function to set an error string. It's usually not called directly from applications. .Ip "char *\fBmm_lib_error_get\fR(void);" 4 +.IX Item "char *mm_lib_error_get(void);" This is a function which is used internally by \fIMM_error\fR\|(3) and \fImm_error\fR\|(3) functions to get the current error string. It is usually not called directly from applications. .Ip "int \fBmm_lib_version\fR(void);" 4 -This function returns a hex-value ``0x\fIV\fR\fI\s-1RR\s0\fR\fIT\fR\fI\s-1LL\s0\fR'\*(R' which describes the +.IX Item "int mm_lib_version(void);" +This function returns a hex-value ``0x\fIV\fR\fI\s-1RR\s0\fR\fIT\fR\fI\s-1LL\s0\fR'' which describes the current \fB\s-1MM\s0\fR library version. \fIV\fR is the version, \fI\s-1RR\s0\fR the revisions, \fI\s-1LL\s0\fR the level and \fIT\fR the type of the level (alphalevel=0, betalevel=1, patchlevel=2, etc). For instance \fB\s-1MM\s0\fR version 1.0.4 is encoded as 0x100204. The reason for this unusual mapping is that this way the version number is steadily \fIincreasing\fR. .SH "RESTRICTIONS" +.IX Header "RESTRICTIONS" The maximum size of a continuous shared memory segment one can allocate depends on the underlaying platform. This cannot be changed, of course. But -currently the high-level \fImalloc\fR\|(3)\-style API just uses a single shared memory -segment as the underlaying data structure for an \f(CWMM\fR object which means that -the maximum amount of memory an \f(CWMM\fR object represents also depends on the +currently the high-level \fImalloc\fR\|(3)\-style \s-1API\s0 just uses a single shared memory +segment as the underlaying data structure for an \f(CW\*(C`MM\*(C'\fR object which means that +the maximum amount of memory an \f(CW\*(C`MM\*(C'\fR object represents also depends on the platform. .PP This could be changed in later versions by allowing at least the -high-level \fImalloc\fR\|(3)\-style API to internally use multiple shared memory -segments to form the \f(CWMM\fR object. This way \f(CWMM\fR objects could have +high-level \fImalloc\fR\|(3)\-style \s-1API\s0 to internally use multiple shared memory +segments to form the \f(CW\*(C`MM\*(C'\fR object. This way \f(CW\*(C`MM\*(C'\fR objects could have arbitrary sizes, although the maximum size of an allocatable continous chunk still is bounded by the maximum size of a shared memory segment. .SH "SEE ALSO" -mm-\fIconfig\fR\|(1). +.IX Header "SEE ALSO" +\&\fImm-config\fR\|(1). .PP -\fImalloc\fR\|(3), \fIcalloc\fR\|(3), \fIrealloc\fR\|(3), \fIstrdup\fR\|(3), \fIfree\fR\|(3), \fImmap\fR\|(2), \fIshmget\fR\|(2), -\fIshmctl\fR\|(2), \fIflock\fR\|(2), \fIfcntl\fR\|(2), \fIsemget\fR\|(2), \fIsemctl\fR\|(2), \fIsemop\fR\|(2). +\&\fImalloc\fR\|(3), \fIcalloc\fR\|(3), \fIrealloc\fR\|(3), \fIstrdup\fR\|(3), \fIfree\fR\|(3), \fImmap\fR\|(2), \fIshmget\fR\|(2), +\&\fIshmctl\fR\|(2), \fIflock\fR\|(2), \fIfcntl\fR\|(2), \fIsemget\fR\|(2), \fIsemctl\fR\|(2), \fIsemop\fR\|(2). .SH "HOME" +.IX Header "HOME" http://www.engelschall.com/sw/mm/ .SH "HISTORY" +.IX Header "HISTORY" This library was originally written in January 1999 by \fIRalf S. -Engelschall\fR for use in the \fBExtended API\fR (EAPI) -of the \fBApache\fR HTTP server project (see http://www.apache.org/), which +Engelschall\fR for use in the \fBExtended \s-1API\s0\fR (\s-1EAPI\s0) +of the \fBApache\fR \s-1HTTP\s0 server project (see http://www.apache.org/), which was originally invented for \fBmod_ssl\fR (see http://www.modssl.org/). .PP -Its base idea (a malloc-style API for handling shared memory) was originally +Its base idea (a malloc-style \s-1API\s0 for handling shared memory) was originally derived from the non-publically available \fImm_malloc\fR library written in October 1997 by \fICharles Randall\fR for MatchLogic, Inc. .SH "AUTHOR" -.PP +.IX Header "AUTHOR" .Vb 3 \& Ralf S. Engelschall \& rse@engelschall.com \& www.engelschall.com .Ve - -.rn }` '' -.IX Title "mm 3" -.IX Name "B" - -.IX Header "NAME" - -.IX Header "VERSION" - -.IX Header "SYNOPSIS" - -.IX Header "DESCRIPTION" - -.IX Subsection "\s-1LIBRARY\s0 \s-1STRUCTURE\s0" - -.IX Item "\fBGlobal Malloc-Replacement \s-1API\s0\fR" - -.IX Item "\fBStandard Malloc-Style \s-1API\s0\fR" - -.IX Item "\fBLow-Level Shared Memory \s-1API\s0\fR" - -.IX Subsection "\s-1SHARED\s0 \s-1MEMORY\s0 \s-1IMPLEMENTATION\s0" - -.IX Item "Classical mmap(2) on temporary file (\s-1MMFILE\s0)" - -.IX Item "mmap(2) via \s-1POSIX\s0.1 shm_open(3) on temporary file (\s-1MMPOSX\s0)" - -.IX Item "\s-1SVR4-\s0style mmap(2) on \f(CW/dev/zero\fR device (\s-1MMZERO\s0)" - -.IX Item "SysV \s-1IPC\s0 shmget(2) (\s-1IPCSHM\s0)" - -.IX Item "4.4BSD\-style mmap(2) via \f(CWMAP_ANON\fR facility (\s-1MMANON\s0)" - -.IX Subsection "\s-1LOCKING\s0 \s-1IMPLEMENTATION\s0" - -.IX Item "4.2BSD\-style flock(2) on temporary file (\s-1FLOCK\s0)" - -.IX Item "SysV \s-1IPC\s0 semget(2) (\s-1IPCSEM\s0)" - -.IX Item "\s-1SVR4-\s0style fcntl(2) on temporary file (\s-1FCNTL\s0)" - -.IX Subsection "\s-1MEMORY\s0 \s-1ALLOCATION\s0 \s-1STRATEGY\s0" - -.IX Item "\fBAllocation\fR" - -.IX Item "\fBDeallocation\fR" - -.IX Header "API FUNCTIONS" - -.IX Subsection "Global Malloc-Replacement \s-1API\s0" - -.IX Item "int \fBMM_create\fR(size_t \fIsize\fR, const char *\fIfile\fR);" - -.IX Item "int \fBMM_permission\fR(mode_t \fImode\fR, uid_t \fIowner\fR, gid_t \fIgroup\fR);" - -.IX Item "void \fBMM_destroy\fR(void);" - -.IX Item "int \fBMM_lock\fR(mm_lock_mode \fImode\fR);" - -.IX Item "int \fBMM_unlock\fR(void);" - -.IX Item "void *\fBMM_malloc\fR(size_t \fIsize\fR);" - -.IX Item "void \fBMM_free\fR(void *\fIptr\fR);" - -.IX Item "void *\fBMM_realloc\fR(void *\fIptr\fR, size_t \fIsize\fR);" - -.IX Item "void *\fBMM_calloc\fR(size_t \fInumber\fR, size_t \fIsize\fR);" - -.IX Item "char *\fBMM_strdup\fR(const char *\fIstr\fR);" - -.IX Item "size_t \fBMM_sizeof\fR(const void *\fIptr\fR);" - -.IX Item "size_t \fBMM_maxsize\fR(void);" - -.IX Item "size_t \fBMM_available\fR(void);" - -.IX Item "char *\fBMM_error\fR(void);" - -.IX Subsection "Standard Malloc-Style \s-1API\s0" - -.IX Item "\s-1MM\s0 *\fBmm_create\fR(size_t \fIsize\fR, const char *\fIfile\fR);" - -.IX Item "int \fBmm_permission\fR(\s-1MM\s0 *\fImm\fR, mode_t \fImode\fR, uid_t \fIowner\fR, gid_t \fIgroup\fR);" - -.IX Item "void \fBmm_destroy\fR(\s-1MM\s0 *\fImm\fR);" - -.IX Item "int \fBmm_lock\fR(\s-1MM\s0 *\fImm\fR, mm_lock_mode \fImode\fR);" - -.IX Item "int \fBmm_unlock\fR(\s-1MM\s0 *\fImm\fR);" - -.IX Item "void *\fBmm_malloc\fR(\s-1MM\s0 *\fImm\fR, size_t \fIsize\fR);" - -.IX Item "void \fBmm_free\fR(\s-1MM\s0 *\fImm\fR, void *\fIptr\fR);" - -.IX Item "void *\fBmm_realloc\fR(\s-1MM\s0 *\fImm\fR, void *\fIptr\fR, size_t \fIsize\fR);" - -.IX Item "void *\fBmm_calloc\fR(\s-1MM\s0 *\fImm\fR, size_t \fInumber\fR, size_t \fIsize\fR);" - -.IX Item "char *\fBmm_strdup\fR(\s-1MM\s0 *\fImm\fR, const char *\fIstr\fR);" - -.IX Item "size_t \fBmm_sizeof\fR(const void *\fIptr\fR);" - -.IX Item "size_t \fBmm_maxsize\fR(void);" - -.IX Item "size_t \fBmm_available\fR(\s-1MM\s0 *\fImm\fR);" - -.IX Item "char *\fBmm_error\fR(void);" - -.IX Item "void \fBmm_display_info\fR(\s-1MM\s0 *\fImm\fR);" - -.IX Subsection "Low-Level Shared Memory \s-1API\s0" - -.IX Item "void *\fBmm_core_create\fR(size_t \fIsize\fR, const char *\fIfile\fR);" - -.IX Item "int \fBmm_core_permission\fR(void *\fIcore\fR, mode_t \fImode\fR, uid_t \fIowner\fR, gid_t \fIgroup\fR);" - -.IX Item "void \fBmm_core_delete\fR(void *\fIcore\fR);" - -.IX Item "int \fBmm_core_lock\fR(const void *\fIcore\fR, mm_lock_mode \fImode\fR);" - -.IX Item "int \fBmm_core_unlock\fR(const void *\fIcore\fR);" - -.IX Item "size_t \fBmm_core_size\fR(const void *\fIcore\fR);" - -.IX Item "size_t \fBmm_core_maxsegsize\fR(void);" - -.IX Item "size_t \fBmm_core_align2page\fR(size_t \fIsize\fR);" - -.IX Item "size_t \fBmm_core_align2word\fR(size_t \fIsize\fR);" - -.IX Subsection "Low-Level Shared Memory \s-1API\s0" - -.IX Item "void \fBmm_lib_error_set\fR(unsigned int, const char *str);" - -.IX Item "char *\fBmm_lib_error_get\fR(void);" - -.IX Item "int \fBmm_lib_version\fR(void);" - -.IX Header "RESTRICTIONS" - -.IX Header "SEE ALSO" - -.IX Header "HOME" - -.IX Header "HISTORY" - -.IX Header "AUTHOR" - Index: ossp-pkg/mm/mm.h ============================================================ $ cvs diff -u -r1.20 -r1.21 mm.h --- ossp-pkg/mm/mm.h 2000/12/03 19:56:39 1.20 +++ ossp-pkg/mm/mm.h 2001/01/29 20:27:22 1.21 @@ -1,5 +1,5 @@ /* ==================================================================== - * Copyright (c) 1999-2000 Ralf S. Engelschall. All rights reserved. + * Copyright (c) 1999-2001 Ralf S. Engelschall. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Index: ossp-pkg/mm/mm.pod ============================================================ $ cvs diff -u -r1.16 -r1.17 mm.pod --- ossp-pkg/mm/mm.pod 2000/06/20 06:59:36 1.16 +++ ossp-pkg/mm/mm.pod 2001/01/29 20:27:22 1.17 @@ -1,5 +1,5 @@ ## ==================================================================== -## Copyright (c) 1999-2000 Ralf S. Engelschall. All rights reserved. +## Copyright (c) 1999-2001 Ralf S. Engelschall. All rights reserved. ## ## Redistribution and use in source and binary forms, with or without ## modification, are permitted provided that the following conditions Index: ossp-pkg/mm/mm_alloc.c ============================================================ $ cvs diff -u -r1.14 -r1.15 mm_alloc.c --- ossp-pkg/mm/mm_alloc.c 2000/06/20 06:59:36 1.14 +++ ossp-pkg/mm/mm_alloc.c 2001/01/29 20:27:22 1.15 @@ -1,5 +1,5 @@ /* ==================================================================== - * Copyright (c) 1999-2000 Ralf S. Engelschall. All rights reserved. + * Copyright (c) 1999-2001 Ralf S. Engelschall. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Index: ossp-pkg/mm/mm_conf.h.in ============================================================ $ cvs diff -u -r1.4 -r1.5 mm_conf.h.in --- ossp-pkg/mm/mm_conf.h.in 2000/04/30 18:33:07 1.4 +++ ossp-pkg/mm/mm_conf.h.in 2001/01/29 20:27:22 1.5 @@ -1,5 +1,5 @@ /* ==================================================================== - * Copyright (c) 1999-2000 Ralf S. Engelschall. All rights reserved. + * Copyright (c) 1999-2001 Ralf S. Engelschall. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Index: ossp-pkg/mm/mm_core.c ============================================================ $ cvs diff -u -r1.11 -r1.12 mm_core.c --- ossp-pkg/mm/mm_core.c 2001/01/29 20:00:43 1.11 +++ ossp-pkg/mm/mm_core.c 2001/01/29 20:27:22 1.12 @@ -1,5 +1,5 @@ /* ==================================================================== - * Copyright (c) 1999-2000 Ralf S. Engelschall. All rights reserved. + * Copyright (c) 1999-2001 Ralf S. Engelschall. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Index: ossp-pkg/mm/mm_global.c ============================================================ $ cvs diff -u -r1.8 -r1.9 mm_global.c --- ossp-pkg/mm/mm_global.c 2000/01/09 20:19:40 1.8 +++ ossp-pkg/mm/mm_global.c 2001/01/29 20:27:22 1.9 @@ -1,5 +1,5 @@ /* ==================================================================== - * Copyright (c) 1999-2000 Ralf S. Engelschall. All rights reserved. + * Copyright (c) 1999-2001 Ralf S. Engelschall. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Index: ossp-pkg/mm/mm_lib.c ============================================================ $ cvs diff -u -r1.4 -r1.5 mm_lib.c --- ossp-pkg/mm/mm_lib.c 2000/07/01 14:17:42 1.4 +++ ossp-pkg/mm/mm_lib.c 2001/01/29 20:27:22 1.5 @@ -1,5 +1,5 @@ /* ==================================================================== - * Copyright (c) 1999-2000 Ralf S. Engelschall. All rights reserved. + * Copyright (c) 1999-2001 Ralf S. Engelschall. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Index: ossp-pkg/mm/mm_test.c ============================================================ $ cvs diff -u -r1.7 -r1.8 mm_test.c --- ossp-pkg/mm/mm_test.c 2000/06/20 06:59:36 1.7 +++ ossp-pkg/mm/mm_test.c 2001/01/29 20:27:22 1.8 @@ -1,5 +1,5 @@ /* ==================================================================== - * Copyright (c) 1999-2000 Ralf S. Engelschall. All rights reserved. + * Copyright (c) 1999-2001 Ralf S. Engelschall. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions From ossp-cvs-owner@ossp.org Mon Jan 29 21:28:34 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f0TKSXk52168; Mon, 29 Jan 2001 21:28:33 +0100 (CET) Date: Mon, 29 Jan 2001 21:28:33 +0100 (CET) Message-Id: <200101292028.f0TKSXk52168@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/mm README mm-config.1 mm.3 mm_vers.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 29-Jan-2001 21:28:33 Branch: HEAD Handle: 2001012920283300 Modified files: ossp-pkg/mm README mm-config.1 mm.3 mm_vers.c Log: *** empty log message *** Summary: Revision Changes Path 1.68 +1 -1 ossp-pkg/mm/README 1.16 +3 -3 ossp-pkg/mm/mm-config.1 1.36 +3 -3 ossp-pkg/mm/mm.3 1.37 +9 -9 ossp-pkg/mm/mm_vers.c ____________________________________________________________________________ Index: ossp-pkg/mm/README ============================================================ $ cvs diff -u -r1.67 -r1.68 README --- ossp-pkg/mm/README 2001/01/29 20:27:22 1.67 +++ ossp-pkg/mm/README 2001/01/29 20:28:33 1.68 @@ -6,7 +6,7 @@ MM - Shared Memory Library Copyright (c) 1999-2001 Ralf S. Engelschall, All rights reserved. - Version 1.1.3 (01-Jul-2000) + Version 1.1.4 (29-Jan-2001) The MM library is a 2-layer abstraction library which simplifies the usage of shared memory between forked (and this way strongly related) processes Index: ossp-pkg/mm/mm-config.1 ============================================================ $ cvs diff -u -r1.15 -r1.16 mm-config.1 --- ossp-pkg/mm/mm-config.1 2001/01/29 20:27:22 1.15 +++ ossp-pkg/mm/mm-config.1 2001/01/29 20:28:33 1.16 @@ -1,5 +1,5 @@ .\" Automatically generated by Pod::Man version 1.02 -.\" Mon Jan 29 21:26:47 2001 +.\" Mon Jan 29 21:28:19 2001 .\" .\" Standard preamble: .\" ====================================================================== @@ -138,13 +138,13 @@ .\" ====================================================================== .\" .IX Title "MM-CONFIG 1" -.TH MM-CONFIG 1 "01-Jul-2000" "MM 1.1.3" "Shared Memory Library" +.TH MM-CONFIG 1 "29-Jan-2001" "MM 1.1.4" "Shared Memory Library" .UC .SH "NAME" \&\fBmm-config\fR \- \s-1MM\s0 library configuration/build utility .SH "VERSION" .IX Header "VERSION" -\&\s-1MM\s0 \s-11.1.3 (01-Jul-2000)\s0 +\&\s-1MM\s0 \s-11.1.4 (29-Jan-2001)\s0 .SH "SYNOPSIS" .IX Header "SYNOPSIS" \&\fBmm-config\fR Index: ossp-pkg/mm/mm.3 ============================================================ $ cvs diff -u -r1.35 -r1.36 mm.3 --- ossp-pkg/mm/mm.3 2001/01/29 20:27:22 1.35 +++ ossp-pkg/mm/mm.3 2001/01/29 20:28:33 1.36 @@ -1,5 +1,5 @@ .\" Automatically generated by Pod::Man version 1.02 -.\" Mon Jan 29 21:26:46 2001 +.\" Mon Jan 29 21:28:19 2001 .\" .\" Standard preamble: .\" ====================================================================== @@ -138,13 +138,13 @@ .\" ====================================================================== .\" .IX Title "mm 3" -.TH mm 3 "01-Jul-2000" "MM 1.1.3" "Shared Memory Library" +.TH mm 3 "29-Jan-2001" "MM 1.1.4" "Shared Memory Library" .UC .SH "NAME" \&\fB\s-1MM\s0 \- Shared Memory Library\fR .SH "VERSION" .IX Header "VERSION" -\&\s-1MM\s0 \s-11.1.3 (01-Jul-2000)\s0 +\&\s-1MM\s0 \s-11.1.4 (29-Jan-2001)\s0 .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 Index: ossp-pkg/mm/mm_vers.c ============================================================ $ cvs diff -u -r1.36 -r1.37 mm_vers.c --- ossp-pkg/mm/mm_vers.c 2000/07/01 14:17:42 1.36 +++ ossp-pkg/mm/mm_vers.c 2001/01/29 20:28:33 1.37 @@ -8,7 +8,7 @@ #ifndef _MM_VERS_C_ #define _MM_VERS_C_ -#define MM_VERSION 0x101203 +#define MM_VERSION 0x101204 typedef struct { const int v_hex; @@ -32,14 +32,14 @@ #undef _MM_VERS_C_AS_HEADER_ mm_version_t mm_version = { - 0x101203, - "1.1.3", - "1.1.3 (01-Jul-2000)", - "This is MM, Version 1.1.3 (01-Jul-2000)", - "MM 1.1.3 (01-Jul-2000)", - "MM/1.1.3", - "@(#)MM 1.1.3 (01-Jul-2000)", - "$Id: MM 1.1.3 (01-Jul-2000) $" + 0x101204, + "1.1.4", + "1.1.4 (29-Jan-2001)", + "This is MM, Version 1.1.4 (29-Jan-2001)", + "MM 1.1.4 (29-Jan-2001)", + "MM/1.1.4", + "@(#)MM 1.1.4 (29-Jan-2001)", + "$Id: MM 1.1.4 (29-Jan-2001) $" }; #endif /* _MM_VERS_C_AS_HEADER_ */ From ossp-cvs-owner@ossp.org Mon Jan 29 21:31:51 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f0TKVpH52452; Mon, 29 Jan 2001 21:31:51 +0100 (CET) Date: Mon, 29 Jan 2001 21:31:51 +0100 (CET) Message-Id: <200101292031.f0TKVpH52452@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/mm ChangeLog mm.h Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 29-Jan-2001 21:31:50 Branch: HEAD Handle: 2001012920315000 Modified files: ossp-pkg/mm ChangeLog mm.h Log: *** empty log message *** Summary: Revision Changes Path 1.26 +4 -0 ossp-pkg/mm/ChangeLog 1.22 +31 -31 ossp-pkg/mm/mm.h ____________________________________________________________________________ Index: ossp-pkg/mm/ChangeLog ============================================================ $ cvs diff -u -r1.25 -r1.26 ChangeLog --- ossp-pkg/mm/ChangeLog 2001/01/29 20:27:22 1.25 +++ ossp-pkg/mm/ChangeLog 2001/01/29 20:31:50 1.26 @@ -16,6 +16,10 @@ Changes between 1.1.3 and 1.1.4 (01-Jul-2000 to xx-Jan-2001) + *) Removed variables from ANSI C function prototypes in mm.h + to avoid any potential conflicts in advance. + [Ralf S. Engelschall] + *) Adjusted year in copyright messages for 2001. [Ralf S. Engelschall] Index: ossp-pkg/mm/mm.h ============================================================ $ cvs diff -u -r1.21 -r1.22 mm.h --- ossp-pkg/mm/mm.h 2001/01/29 20:27:22 1.21 +++ ossp-pkg/mm/mm.h 2001/01/29 20:31:50 1.22 @@ -323,51 +323,51 @@ #endif /* Global Malloc-Replacement API */ -int MM_create(size_t size, const char *file); -int MM_permission(mode_t mode, uid_t owner, gid_t group); +int MM_create(size_t, const char *); +int MM_permission(mode_t, uid_t, gid_t); void MM_destroy(void); -int MM_lock(mm_lock_mode mode); +int MM_lock(mm_lock_mode); int MM_unlock(void); -void *MM_malloc(size_t size); -void *MM_realloc(void *ptr, size_t size); -void MM_free(void *ptr); -void *MM_calloc(size_t number, size_t size); -char *MM_strdup(const char *str); -size_t MM_sizeof(const void *ptr); +void *MM_malloc(size_t); +void *MM_realloc(void *, size_t); +void MM_free(void *); +void *MM_calloc(size_t, size_t); +char *MM_strdup(const char *); +size_t MM_sizeof(const void *); size_t MM_maxsize(void); size_t MM_available(void); char *MM_error(void); /* Standard Malloc-Style API */ -MM *mm_create(size_t size, const char *file); -int mm_permission(MM *mm, mode_t mode, uid_t owner, gid_t group); -void mm_destroy(MM *mm); -int mm_lock(MM *mm, mm_lock_mode mode); -int mm_unlock(MM *mm); -void *mm_malloc(MM *mm, size_t size); -void *mm_realloc(MM *mm, void *ptr, size_t size); -void mm_free(MM *mm, void *ptr); -void *mm_calloc(MM *mm, size_t number, size_t size); -char *mm_strdup(MM *mm, const char *str); -size_t mm_sizeof(MM *mm, const void *ptr); +MM *mm_create(size_t, const char *); +int mm_permission(MM *, mode_t, uid_t, gid_t); +void mm_destroy(MM *); +int mm_lock(MM *, mm_lock_mode); +int mm_unlock(MM *); +void *mm_malloc(MM *, size_t); +void *mm_realloc(MM *, void *, size_t); +void mm_free(MM *, void *); +void *mm_calloc(MM *, size_t, size_t); +char *mm_strdup(MM *, const char *); +size_t mm_sizeof(MM *, const void *); size_t mm_maxsize(void); -size_t mm_available(MM *mm); +size_t mm_available(MM *); char *mm_error(void); -void mm_display_info(MM *mm); +void mm_display_info(MM *); /* Low-Level Shared Memory API */ -void *mm_core_create(size_t size, const char *file); -int mm_core_permission(void *core, mode_t mode, uid_t owner, gid_t group); -void mm_core_delete(void *core); -size_t mm_core_size(const void *core); -int mm_core_lock(const void *core, mm_lock_mode mode); -int mm_core_unlock(const void *core); +void *mm_core_create(size_t, const char *); +int mm_core_permission(void *, mode_t, uid_t, gid_t); +void mm_core_delete(void *); +size_t mm_core_size(const void *); +int mm_core_lock(const void *, mm_lock_mode); +int mm_core_unlock(const void *); size_t mm_core_maxsegsize(void); -size_t mm_core_align2page(size_t size); -size_t mm_core_align2word(size_t size); +size_t mm_core_align2page(size_t); +size_t mm_core_align2word(size_t); /* Internal Library API */ -void mm_lib_error_set(unsigned int, const char *str); +void mm_lib_error_set(unsigned int, const char *); char *mm_lib_error_get(void); int mm_lib_version(void); From ossp-cvs-owner@ossp.org Mon Feb 5 14:58:22 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f15DwL328659; Mon, 5 Feb 2001 14:58:21 +0100 (CET) Date: Mon, 5 Feb 2001 14:58:21 +0100 (CET) Message-Id: <200102051358.f15DwL328659@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/sfio configure Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 05-Feb-2001 14:58:16 Branch: HEAD Handle: 2001020513581500 Modified files: ossp-pkg/sfio configure Log: Update to Autoconf 2.13 Summary: Revision Changes Path 1.12 +78 -121 ossp-pkg/sfio/configure ____________________________________________________________________________ Index: ossp-pkg/sfio/configure ============================================================ $ cvs diff -u -r1.11 -r1.12 configure --- ossp-pkg/sfio/configure 1999/11/12 15:18:33 1.11 +++ ossp-pkg/sfio/configure 2001/02/05 13:58:15 1.12 @@ -1,6 +1,6 @@ #! /bin/sh -# From configure.in Revision: 1.8 +# From configure.in Revision: 1.9 SHTOOL="./etc/shtool" @@ -112,7 +112,7 @@ # Guess values for system-dependent variables and create Makefiles. -# Generated automatically using autoconf version 2.13.1 +# Generated automatically using autoconf version 2.13 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. # # This configure script is free software; the Free Software Foundation @@ -459,7 +459,7 @@ verbose=yes ;; -version | --version | --versio | --versi | --vers) - echo "configure generated by autoconf version 2.13.1" + echo "configure generated by autoconf version 2.13" exit 0 ;; -with-* | --with-*) @@ -619,7 +619,7 @@ if test -r "$cache_file"; then echo "loading cache $cache_file" - test -f "$cache_file" && . $cache_file + . $cache_file else echo "creating cache $cache_file" > $cache_file @@ -666,9 +666,9 @@ if test -z "$ac_aux_dir"; then { echo "configure: error: can not find install-sh or install.sh in etc $srcdir/etc" 1>&2; exit 1; } fi -ac_config_guess="$SHELL $ac_aux_dir/config.guess" -ac_config_sub="$SHELL $ac_aux_dir/config.sub" -ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. +ac_config_guess=$ac_aux_dir/config.guess +ac_config_sub=$ac_aux_dir/config.sub +ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. @@ -676,7 +676,7 @@ set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:679: checking for $ac_word" >&5 -if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CC"; then @@ -706,7 +706,7 @@ set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:709: checking for $ac_word" >&5 -if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CC"; then @@ -752,12 +752,12 @@ if test -z "$CC"; then case "`uname -s`" in - *win32* | *WIN32* | *CYGWIN*) + *win32* | *WIN32*) # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:760: checking for $ac_word" >&5 -if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CC"; then @@ -787,8 +787,8 @@ test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } fi -echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:792: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works" >&5 +echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 +echo "configure:792: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -829,14 +829,14 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi -echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:834: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 +echo "configure:834: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 echo "configure:839: checking whether we are using GNU C" >&5 -if eval "test \"\${ac_cv_prog_gcc+set}\" = set"; then +if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.c <&6 echo "configure:867: checking whether ${CC-cc} accepts -g" >&5 -if eval "test \"\${ac_cv_prog_cc_g+set}\" = set"; then +if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else echo 'void f(){}' > conftest.c @@ -901,7 +901,7 @@ CPP= fi if test -z "$CPP"; then -if eval "test \"\${ac_cv_prog_CPP+set}\" = set"; then +if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else # This must be in double quotes, not single quotes, because CPP may get @@ -1044,91 +1044,55 @@ fi -echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:1049: checking host system type" >&5 -if test "x$ac_cv_host" = "x" || (test "x$host" != "xNONE" && test "x$host" != "x$ac_cv_host_alias"); then - # Make sure we can run config.sub. - if $ac_config_sub sun4 >/dev/null 2>&1; then : - else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } - fi - - ac_cv_host_alias=$host - case "$ac_cv_host_alias" in - NONE) - case $nonopt in - NONE) - if ac_cv_host_alias=`$ac_config_guess`; then : - else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } - fi ;; - *) ac_cv_host_alias=$nonopt ;; - esac ;; - esac - - ac_cv_host=`$ac_config_sub $ac_cv_host_alias` - ac_cv_host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` - ac_cv_host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` - ac_cv_host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` -else - echo $ac_n "(cached) $ac_c" 1>&6 +if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : +else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } fi - -echo "$ac_t""$ac_cv_host" 1>&6 - -host=$ac_cv_host -host_alias=$ac_cv_host_alias -host_cpu=$ac_cv_host_cpu -host_vendor=$ac_cv_host_vendor -host_os=$ac_cv_host_os - - - - -echo $ac_n "checking build system type""... $ac_c" 1>&6 -echo "configure:1090: checking build system type" >&5 -if test "x$ac_cv_build" = "x" || (test "x$build" != "xNONE" && test "x$build" != "x$ac_cv_build_alias"); then - -# Make sure we can run config.sub. - if $ac_config_sub sun4 >/dev/null 2>&1; then : - else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } - fi +echo $ac_n "checking host system type""... $ac_c" 1>&6 +echo "configure:1054: checking host system type" >&5 - ac_cv_build_alias=$build - case "$ac_cv_build_alias" in +host_alias=$host +case "$host_alias" in +NONE) + case $nonopt in NONE) - case $nonopt in - NONE) - ac_cv_build_alias=$host_alias ;; - - *) ac_cv_build_alias=$nonopt ;; - esac ;; - esac - - ac_cv_build=`$ac_config_sub $ac_cv_build_alias` - ac_cv_build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` - ac_cv_build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` - ac_cv_build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` -else - echo $ac_n "(cached) $ac_c" 1>&6 -fi - -echo "$ac_t""$ac_cv_build" 1>&6 + if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : + else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } + fi ;; + *) host_alias=$nonopt ;; + esac ;; +esac -build=$ac_cv_build -build_alias=$ac_cv_build_alias -build_cpu=$ac_cv_build_cpu -build_vendor=$ac_cv_build_vendor -build_os=$ac_cv_build_os +host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` +host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$host" 1>&6 +echo $ac_n "checking build system type""... $ac_c" 1>&6 +echo "configure:1075: checking build system type" >&5 +build_alias=$build +case "$build_alias" in +NONE) + case $nonopt in + NONE) build_alias=$host_alias ;; + *) build_alias=$nonopt ;; + esac ;; +esac +build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias` +build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$build" 1>&6 # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1131: checking for $ac_word" >&5 -if eval "test \"\${ac_cv_prog_RANLIB+set}\" = set"; then +echo "configure:1095: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$RANLIB"; then @@ -1166,7 +1130,7 @@ if test "$ac_cv_prog_gcc" = yes; then # Check if gcc -print-prog-name=ld gives a path. echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6 -echo "configure:1170: checking for ld used by GCC" >&5 +echo "configure:1134: checking for ld used by GCC" >&5 ac_prog=`($CC -print-prog-name=ld) 2>&5` case "$ac_prog" in # Accept absolute paths. @@ -1190,12 +1154,12 @@ esac elif test "$with_gnu_ld" = yes; then echo $ac_n "checking for GNU ld""... $ac_c" 1>&6 -echo "configure:1194: checking for GNU ld" >&5 +echo "configure:1158: checking for GNU ld" >&5 else echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6 -echo "configure:1197: checking for non-GNU ld" >&5 +echo "configure:1161: checking for non-GNU ld" >&5 fi -if eval "test \"\${ac_cv_path_LD+set}\" = set"; then +if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -z "$LD"; then @@ -1229,8 +1193,8 @@ test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; } echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6 -echo "configure:1233: checking if the linker ($LD) is GNU ld" >&5 -if eval "test \"\${ac_cv_prog_gnu_ld+set}\" = set"; then +echo "configure:1197: checking if the linker ($LD) is GNU ld" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else # I'd rather use --version here, but apparently some GNU ld's only accept -v. @@ -1245,8 +1209,8 @@ echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6 -echo "configure:1249: checking for BSD-compatible nm" >&5 -if eval "test \"\${ac_cv_path_NM+set}\" = set"; then +echo "configure:1213: checking for BSD-compatible nm" >&5 +if eval "test \"`echo '$''{'ac_cv_path_NM'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$NM"; then @@ -1282,8 +1246,8 @@ echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:1286: checking whether ln -s works" >&5 -if eval "test \"\${ac_cv_prog_LN_S+set}\" = set"; then +echo "configure:1250: checking whether ln -s works" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else rm -f conftestdata @@ -1326,8 +1290,8 @@ case "$host" in *-*-irix6*) # Find out which ABI we are using. - echo '#line 1330 "configure"' > conftest.$ac_ext - if { (eval echo configure:1331: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + echo '#line 1294 "configure"' > conftest.$ac_ext + if { (eval echo configure:1295: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then case "`/usr/bin/file conftest.o`" in *32-bit*) LD="${LD-ld} -32" @@ -1348,19 +1312,19 @@ SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6 -echo "configure:1352: checking whether the C compiler needs -belf" >&5 -if eval "test \"\${lt_cv_cc_needs_belf+set}\" = set"; then +echo "configure:1316: checking whether the C compiler needs -belf" >&5 +if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1328: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* lt_cv_cc_needs_belf=yes else @@ -1444,7 +1408,7 @@ # Reload cache, that may have been modified by ltconfig if test -r "$cache_file"; then echo "loading cache $cache_file" - test -f "$cache_file" && . $cache_file + . $cache_file else echo "creating cache $cache_file" > $cache_file @@ -1462,9 +1426,9 @@ exec 5>>./config.log echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:1466: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:1430: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` -if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then +if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftestmake <<\EOF @@ -1595,20 +1559,13 @@ # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. cat > conftest.defs <<\EOF -s%#define \([^ ][^ ]*\) *\(.*\)%-D\1=\2%g +s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g s%\[%\\&%g s%\]%\\&%g s%\$%$$%g EOF -# We use echo to avoid assuming a particular line-breaking character. -# The extra dot is to prevent the shell from consuming trailing -# line-breaks from the sub-command output. A line-break within -# single-quotes doesn't work because, if this script is created in a -# platform that uses two characters for line-breaks (e.g., DOS), tr -# would break. -ac_LF_and_DOT="`echo; echo .`" -DEFS=`sed -f conftest.defs confdefs.h | tr "$ac_LF_and_DOT" ' .'` +DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` rm -f conftest.defs @@ -1637,7 +1594,7 @@ echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; -version | --version | --versio | --versi | --vers | --ver | --ve | --v) - echo "$CONFIG_STATUS generated by autoconf version 2.13.1" + echo "$CONFIG_STATUS generated by autoconf version 2.13" exit 0 ;; -help | --help | --hel | --he | --h) echo "\$ac_cs_usage"; exit 0 ;; @@ -1787,7 +1744,7 @@ rm -f "$ac_file" configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." case "$ac_file" in - *[Mm]akefile*) ac_comsub="1i\\ + *Makefile*) ac_comsub="1i\\ # $configure_input" ;; *) ac_comsub= ;; esac @@ -1812,5 +1769,5 @@ EOF chmod +x $CONFIG_STATUS rm -fr confdefs* $ac_clean_files -test "$no_create" = yes || $SHELL $CONFIG_STATUS || exit 1 +test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 From ossp-cvs-owner@ossp.org Mon Feb 5 14:58:36 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f15DwYu28715; Mon, 5 Feb 2001 14:58:34 +0100 (CET) Date: Mon, 5 Feb 2001 14:58:34 +0100 (CET) Message-Id: <200102051358.f15DwYu28715@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/sfio Makefile.in Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 05-Feb-2001 14:58:34 Branch: HEAD Handle: 2001020513583400 Modified files: ossp-pkg/sfio Makefile.in Log: Update version Summary: Revision Changes Path 1.10 +1 -1 ossp-pkg/sfio/Makefile.in ____________________________________________________________________________ Index: ossp-pkg/sfio/Makefile.in ============================================================ $ cvs diff -u -r1.9 -r1.10 Makefile.in --- ossp-pkg/sfio/Makefile.in 2001/01/26 10:41:39 1.9 +++ ossp-pkg/sfio/Makefile.in 2001/02/05 13:58:34 1.10 @@ -2,7 +2,7 @@ ## Sfio top-level Makefile ## -PACKAGE_VER = 1.0b4 +PACKAGE_VER = 1999.4 LIBTOOL_VER = 10:0 top_builddir = @top_srcdir@ From ossp-cvs-owner@ossp.org Sat Feb 10 17:40:29 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f1AGeRX22716; Sat, 10 Feb 2001 17:40:27 +0100 (CET) Date: Sat, 10 Feb 2001 17:40:27 +0100 (CET) Message-Id: <200102101640.f1AGeRX22716@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/shiela .configure .cvsignore ChangeLog Makefile.i... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 10-Feb-2001 17:40:27 Branch: HEAD Handle: 2001021016402600 Modified files: ossp-pkg/shiela .configure .cvsignore ChangeLog Makefile.in README VERSION configure configure.in shiela-install.pod shiela-install.sh shiela.pl shiela.pod shtool Log: *) Upgraded to GNU shtool 1.5.2-pre. [Ralf S. Engelschall] *) Added --with-perl=PATH and --with-cvs=PATH Autoconf options to allow one to force the use of particular programs. [Ralf S. Engelschall] *) Added $(DESTDIR) support for "make install". [Ralf S. Engelschall] Summary: Revision Changes Path 1.2 +2 -0 ossp-pkg/shiela/.configure 1.2 +4 -0 ossp-pkg/shiela/.cvsignore 1.2 +13 -1 ossp-pkg/shiela/ChangeLog 1.2 +9 -7 ossp-pkg/shiela/Makefile.in 1.2 +1 -1 ossp-pkg/shiela/README 1.2 +1 -1 ossp-pkg/shiela/VERSION 1.2 BLOB ossp-pkg/shiela/configure 1.2 +17 -3 ossp-pkg/shiela/configure.in 1.2 +1 -1 ossp-pkg/shiela/shiela-install.pod 1.2 +1 -1 ossp-pkg/shiela/shiela-install.sh 1.3 +2 -2 ossp-pkg/shiela/shiela.pl 1.2 +1 -1 ossp-pkg/shiela/shiela.pod 1.3 +63 -42 ossp-pkg/shiela/shtool ____________________________________________________________________________ Index: ossp-pkg/shiela/.configure ============================================================ $ cvs diff -u -r1.1.1.1 -r1.2 .configure --- ossp-pkg/shiela/.configure 2000/06/18 14:30:49 1.1.1.1 +++ ossp-pkg/shiela/.configure 2001/02/10 16:40:26 1.2 @@ -1,4 +1,6 @@ : ./configure \ --prefix=/sw/pkg/shiela \ +--with-perl=/sw/bin/perl \ +--with-cvs=/sw/bin/cvs \ "$@" Index: ossp-pkg/shiela/.cvsignore ============================================================ $ cvs diff -u -r1.1 -r1.2 .cvsignore --- ossp-pkg/shiela/.cvsignore 2000/07/18 15:31:58 1.1 +++ ossp-pkg/shiela/.cvsignore 2001/02/10 16:40:26 1.2 @@ -1 +1,5 @@ Makefile +shiela +shiela.1 +shiela-install +shiela-install.1 Index: ossp-pkg/shiela/ChangeLog ============================================================ $ cvs diff -u -r1.1.1.1 -r1.2 ChangeLog --- ossp-pkg/shiela/ChangeLog 2000/06/18 14:30:47 1.1.1.1 +++ ossp-pkg/shiela/ChangeLog 2001/02/10 16:40:26 1.2 @@ -9,7 +9,19 @@ ChangeLog - Changes between *GENESIS* and 0.9.0 (Apr-2000 to XX-Jun-2000): + Changes between 0.9.0 and 0.9.1 (18-Jun-2000 to 10-Feb-2001): + + *) Upgraded to GNU shtool 1.5.2-pre. + [Ralf S. Engelschall] + + *) Added --with-perl=PATH and --with-cvs=PATH Autoconf options + to allow one to force the use of particular programs. + [Ralf S. Engelschall] + + *) Added $(DESTDIR) support for "make install". + [Ralf S. Engelschall] + + Changes between *GENESIS* and 0.9.0 (Apr-2000 to 18-Jun-2000): *) Created the first Shiela version. [Ralf S. Engelschall] Index: ossp-pkg/shiela/Makefile.in ============================================================ $ cvs diff -u -r1.1.1.1 -r1.2 Makefile.in --- ossp-pkg/shiela/Makefile.in 2000/06/18 14:30:49 1.1.1.1 +++ ossp-pkg/shiela/Makefile.in 2001/02/10 16:40:26 1.2 @@ -18,6 +18,8 @@ includedir = @includedir@ mandir = @mandir@ +DESTDIR = + all: shiela shiela.1 shiela-install shiela-install.1 shiela: shiela.pl @@ -50,13 +52,13 @@ --release="$$D" --date="OSSP Shiela $$V" shiela-install.pod >shiela-install.1 install: all - $(SHTOOL) mkdir -f -p -m 755 $(bindir) - $(SHTOOL) mkdir -f -p -m 755 $(libdir) - $(SHTOOL) mkdir -f -p -m 755 $(mandir)/man1 - $(SHTOOL) install -c -m 755 shiela $(bindir)/shiela - $(SHTOOL) install -c -m 644 shiela.1 $(mandir)/man1/shiela.1 - $(SHTOOL) install -c -m 755 shiela-install $(bindir)/shiela-install - $(SHTOOL) install -c -m 644 shiela-install.1 $(mandir)/man1/shiela-install.1 + $(SHTOOL) mkdir -f -p -m 755 $(DESTDIR)$(bindir) + $(SHTOOL) mkdir -f -p -m 755 $(DESTDIR)$(libdir) + $(SHTOOL) mkdir -f -p -m 755 $(DESTDIR)$(mandir)/man1 + $(SHTOOL) install -c -m 755 shiela $(DESTDIR)$(bindir)/shiela + $(SHTOOL) install -c -m 644 shiela.1 $(DESTDIR)$(mandir)/man1/shiela.1 + $(SHTOOL) install -c -m 755 shiela-install $(DESTDIR)$(bindir)/shiela-install + $(SHTOOL) install -c -m 644 shiela-install.1 $(DESTDIR)$(mandir)/man1/shiela-install.1 clean: $(RM) shiela shiela.1 Index: ossp-pkg/shiela/README ============================================================ $ cvs diff -u -r1.1.1.1 -r1.2 README --- ossp-pkg/shiela/README 2000/06/18 14:30:47 1.1.1.1 +++ ossp-pkg/shiela/README 2001/02/10 16:40:26 1.2 @@ -7,7 +7,7 @@ OSSP Shiela - Access Control and Logging Facility for CVS Copyright (c) 2000 Ralf S. Engelschall - Version 0.9.0 (18-Jun-2000) + Version 0.9.1 (27-Jun-2000) Shiela is an access control and logging facility for use with the Concurrent Versions System (CVS). It is intended to be hooked into CVS's Index: ossp-pkg/shiela/VERSION ============================================================ $ cvs diff -u -r1.1.1.1 -r1.2 VERSION --- ossp-pkg/shiela/VERSION 2000/06/18 14:30:49 1.1.1.1 +++ ossp-pkg/shiela/VERSION 2001/02/10 16:40:26 1.2 @@ -1,3 +1,3 @@ - This is OSSP Shiela, Version 0.9.0 (18-Jun-2000) + This is OSSP Shiela, Version 0.9.1 (27-Jun-2000) Index: ossp-pkg/shiela/configure ============================================================ $ cvs update -p -r1.1.1.1 configure >configure.old $ cvs update -p -r1.2 configure >configure.new $ diff -u configure.old configure.new Index: ossp-pkg/shiela/configure.in ============================================================ $ cvs diff -u -r1.1.1.1 -r1.2 configure.in --- ossp-pkg/shiela/configure.in 2000/06/18 14:30:49 1.1.1.1 +++ ossp-pkg/shiela/configure.in 2001/02/10 16:40:26 1.2 @@ -4,17 +4,31 @@ AC_DIVERT_PUSH(AC_DIVERSION_NOTICE) V=`./shtool version -ltxt -dlong VERSION` ./shtool echo -e "Configuring %BOSSP Shiela%b, Version %B${V}%b" -echo "Copyright (c) 2000 Ralf S. Engelschall " +echo "Copyright (c) 2000-2001 Ralf S. Engelschall " echo "" AC_DIVERT_POP() AC_MSG_CHECKING(for Perl program) -PATH_PERL=`./shtool path -m perl5 perl` +AC_ARG_WITH(perl,dnl +[ --with-perl=PATH force the use of a particular Perl program], +with_perl="$withval", +if test ".$with_perl" = .; then + with_perl=`./shtool path -m perl5 perl` +fi +)dnl +PATH_PERL="$with_perl" AC_SUBST(PATH_PERL) AC_MSG_RESULT($PATH_PERL) AC_MSG_CHECKING(for CVS program) -PATH_CVS=`./shtool path cvs` +AC_ARG_WITH(cvs,dnl +[ --with-cvs=PATH force the use of a particular CVS program], +with_cvs="$withval", +if test ".$with_cvs" = .; then + with_perl=`./shtool path cvs` +fi +)dnl +PATH_CVS="$with_cvs" AC_SUBST(PATH_CVS) AC_MSG_RESULT($PATH_CVS) Index: ossp-pkg/shiela/shiela-install.pod ============================================================ $ cvs diff -u -r1.1.1.1 -r1.2 shiela-install.pod --- ossp-pkg/shiela/shiela-install.pod 2000/06/18 14:30:49 1.1.1.1 +++ ossp-pkg/shiela/shiela-install.pod 2001/02/10 16:40:26 1.2 @@ -32,7 +32,7 @@ =head1 VERSION -B 0.9.0 (18-Jun-2000) +B 0.9.1 (27-Jun-2000) =head1 DESCRIPTION Index: ossp-pkg/shiela/shiela-install.sh ============================================================ $ cvs diff -u -r1.1.1.1 -r1.2 shiela-install.sh --- ossp-pkg/shiela/shiela-install.sh 2000/06/18 14:30:50 1.1.1.1 +++ ossp-pkg/shiela/shiela-install.sh 2001/02/10 16:40:26 1.2 @@ -25,7 +25,7 @@ ## shiela-install: Shiela repository install program (syntax: Bourne-Shell) ## -version="0.9.0" +version="0.9.1" prefix="@prefix@" bindir="@bindir@" Index: ossp-pkg/shiela/shiela.pl ============================================================ $ cvs diff -u -r1.2 -r1.3 shiela.pl --- ossp-pkg/shiela/shiela.pl 2000/07/18 15:24:27 1.2 +++ ossp-pkg/shiela/shiela.pl 2001/02/10 16:40:26 1.3 @@ -25,7 +25,7 @@ ## shiela: Shiela control program (syntax: Perl) ## -my $version = '0.9.0'; +my $version = '0.9.1'; require 5.005; @@ -490,7 +490,7 @@ # prepare the pattern if ($pat =~ m|^m(.)(.+)\1$| and $2 !~ m|$1|) { # pattern is a regular expression, - # so just make sure it is achored + # so just make sure it is anchored $pat =~ s|^([^\^])|^$1|; $pat =~ s|([^\$])$|$1\$|; } Index: ossp-pkg/shiela/shiela.pod ============================================================ $ cvs diff -u -r1.1.1.1 -r1.2 shiela.pod --- ossp-pkg/shiela/shiela.pod 2000/06/18 14:30:45 1.1.1.1 +++ ossp-pkg/shiela/shiela.pod 2001/02/10 16:40:26 1.2 @@ -32,7 +32,7 @@ =head1 VERSION -B 0.9.0 (18-Jun-2000) +B 0.9.1 (27-Jun-2000) =head1 DESCRIPTION Index: ossp-pkg/shiela/shtool ============================================================ $ cvs diff -u -r1.2 -r1.3 shtool --- ossp-pkg/shiela/shtool 2000/07/18 15:27:59 1.2 +++ ossp-pkg/shiela/shtool 2001/02/10 16:40:26 1.3 @@ -1,12 +1,12 @@ #!/bin/sh ## ## GNU shtool -- The GNU Portable Shell Tool -## Copyright (c) 1994-2000 Ralf S. Engelschall +## Copyright (c) 1994-2001 Ralf S. Engelschall ## ## See http://www.gnu.org/software/shtool/ for more information. ## See ftp://ftp.gnu.org/gnu/shtool/ for latest version. ## -## Version: 1.5.0 (01-Jul-2000) +## Version: 1.5.2 (05-Oct-2000) ## Contents: 7/17 available modules ## @@ -65,8 +65,8 @@ exit 1 fi if [ ".$1" = ".-h" -o ".$1" = ".--help" ]; then - echo "This is GNU shtool, version 1.5.0 (01-Jul-2000)" - echo "Copyright (c) 1994-2000 Ralf S. Engelschall " + echo "This is GNU shtool, version 1.5.2 (05-Oct-2000)" + echo "Copyright (c) 1994-2001 Ralf S. Engelschall " echo "Report bugs to " echo '' echo "Usage: shtool [] [ [] []]" @@ -80,7 +80,7 @@ echo 'Available [] []:' echo ' echo [-n] [-e] [ ...]' echo ' install [-v] [-t] [-c] [-C] [-s] [-m] [-o] [-g]' - echo ' [-e] [ ...] ' + echo ' [-e] [ ...] ' echo ' mkdir [-t] [-f] [-p] [-m] [ ...]' echo ' fixperm [-v] [-t] [ ...]' echo ' tarball [-t] [-v] [-o ] [-c ] [-d ] [-u' @@ -105,7 +105,7 @@ exit 0 fi if [ ".$1" = ".-v" -o ".$1" = ."--version" ]; then - echo "GNU shtool 1.5.0 (01-Jul-2000)" + echo "GNU shtool 1.5.2 (05-Oct-2000)" exit 0 fi if [ ".$1" = ".-r" -o ".$1" = ."--recreate" ]; then @@ -147,15 +147,15 @@ ;; install ) str_tool="install" - str_usage="[-v] [-t] [-c] [-C] [-s] [-m] [-o] [-g] [-e] [ ...] " + str_usage="[-v] [-t] [-c] [-C] [-s] [-m] [-o] [-g] [-e] [ ...] " arg_spec="2+" - opt_spec="v.t.c.C.s.m:o:g:e:" + opt_spec="v.t.c.C.s.m:o:g:e+" opt_v=no opt_t=no opt_c=no opt_C=no opt_s=no - opt_m="" + opt_m="0755" opt_o="" opt_g="" opt_e="" @@ -366,6 +366,7 @@ tmpfile="$tmpdir/.shtool.$$" rm -f $tmpfile >/dev/null 2>&1 touch $tmpfile + chmod 600 $tmpfile fi ## @@ -377,7 +378,7 @@ echo ) ## ## echo -- Print string with optional construct expansion - ## Copyright (c) 1998-2000 Ralf S. Engelschall + ## Copyright (c) 1998-2001 Ralf S. Engelschall ## Originally written for WML as buildinfo ## @@ -600,7 +601,7 @@ install ) ## ## install -- Install a program, script or datafile - ## Copyright (c) 1997-2000 Ralf S. Engelschall + ## Copyright (c) 1997-2001 Ralf S. Engelschall ## Originally written for shtool ## @@ -630,19 +631,13 @@ for src in $srcs; do dst=$dstpath - # If destination is a directory, append the input filename + # if destination is a directory, append the input filename if [ $dstisdir = 1 ]; then dstfile=`echo "$src" | sed -e 's;.*/\([^/]*\)$;\1;'` dst="$dst/$dstfile" fi - - # Add a possible extension to src and dst - if [ ".$opt_e" != . ]; then - src="$src$opt_e" - dst="$dst$opt_e" - fi - # Check for correct arguments + # check for correct arguments if [ ".$src" = ".$dst" ]; then echo "$msgprefix:Warning: source and destination are the same - skipped" 1>&2 continue @@ -652,18 +647,18 @@ continue fi - # Make a temp file name in the destination directory + # make a temp file name in the destination directory dsttmp=`echo $dst |\ sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;' -e 's;^$;.;' \ -e "s;\$;/#INST@$$#;"` - # Verbosity + # verbosity if [ ".$opt_v" = .yes ]; then echo "$src -> $dst" 1>&2 fi - # Copy or move the file name to the temp name - # (because we might be not allowed to change the source) + # copy or move the file name to the temp name + # (because we might be not allowed to change the source) if [ ".$opt_C" = .yes ]; then opt_c=yes fi @@ -679,8 +674,16 @@ mv $src $dsttmp || exit $? fi - # Adjust the target file - # (we do chmod last to preserve setuid bits) + # adjust the target file + if [ ".$opt_e" != . ]; then + sed='sed' + for e in $opt_e; do + sed="$sed -e '$e'" + done + cp $dsttmp $dsttmp.old + eval "$sed <$dsttmp.old >$dsttmp" || exit $? + rm -f $dsttmp.old + fi if [ ".$opt_s" = .yes ]; then if [ ".$opt_t" = .yes ]; then echo "strip $dsttmp" 1>&2 @@ -699,14 +702,14 @@ fi chgrp $opt_g $dsttmp || exit $? fi - if [ ".$opt_m" != . ]; then + if [ ".$opt_m" != ".-" ]; then if [ ".$opt_t" = .yes ]; then echo "chmod $opt_m $dsttmp" 1>&2 fi chmod $opt_m $dsttmp || exit $? fi - # Determine whether to do a quick install + # determine whether to do a quick install # (has to be done _after_ the strip was already done) quick=no if [ ".$opt_C" = .yes ]; then @@ -717,7 +720,7 @@ fi fi - # Finally install the file to the real destination + # finally, install the file to the real destination if [ $quick = yes ]; then if [ ".$opt_t" = .yes ]; then echo "rm -f $dsttmp" 1>&2 @@ -735,7 +738,7 @@ mkdir ) ## ## mkdir -- Make one or more directories - ## Copyright (c) 1996-2000 Ralf S. Engelschall + ## Copyright (c) 1996-2001 Ralf S. Engelschall ## Originally written for public domain by Noah Friedman ## Cleaned up and enhanced for shtool ## @@ -744,7 +747,7 @@ for p in ${1+"$@"}; do # if the directory already exists... if [ -d "$p" ]; then - if [ ".$opt_f" = .no ] && [ ".$opt_p" = .no ]; then + if [ ".$opt_f" = .no -a ".$opt_p" = .no ]; then echo "$msgprefix:Error: directory already exists: $p" 1>&2 errstatus=1 break @@ -794,7 +797,7 @@ fixperm ) ## ## fixperm -- Fix file permissions inside a source tree - ## Copyright (c) 1996-2000 Ralf S. Engelschall + ## Copyright (c) 1996-2001 Ralf S. Engelschall ## Originally written for ePerl ## @@ -850,7 +853,7 @@ tarball ) ## ## tarball -- Roll distribution tarballs - ## Copyright (c) 1999-2000 Ralf S. Engelschall + ## Copyright (c) 1999-2001 Ralf S. Engelschall ## Originally written for shtool ## @@ -876,7 +879,7 @@ for tool in `echo $tools | sed -e 's/,/ /g'`; do # iterate over paths for path in $paths; do - if [ $minusx "$path/$tool" ] && [ ! -d "$path/$tool" ]; then + if [ $minusx "$path/$tool" -a ! -d "$path/$tool" ]; then eval "prg_${prg}=\"$path/$tool\"" break fi @@ -902,7 +905,7 @@ if [ ".$opt_t" = .yes ]; then echo "(cd $src && $prg_find . -type f -depth -print) | sed -e 's:^\\.\$::' -e 's:^\\./::' | cat $exclude >>$tmpfile.lst" 1>&2 fi - (cd $src && find . -type f -depth -print) |\ + (cd $src && $prg_find . -type f -depth -print) |\ sed -e 's:^\.$::' -e 's:^\./::' | eval cat $exclude >>$tmpfile.lst else if [ ".$opt_t" = .yes ]; then @@ -1013,7 +1016,7 @@ version ) ## ## version -- Maintain a version information file - ## Copyright (c) 1994-2000 Ralf S. Engelschall + ## Copyright (c) 1994-2001 Ralf S. Engelschall ## Originally written for ePerl, rewritten from scratch for shtool ## @@ -1097,7 +1100,8 @@ s ) typnum=15; levnum=255 ;; # snapshots are special esac hex=`echo "$ver:$rev:$typnum:$levnum" |\ - awk -F: '{ printf("0x%X%02X%1X%02X", $1, $2, $3, $4); }'` + awk -F: '{ printf("0x%x%02x%1x%02x", $1, $2, $3, $4); }' |\ + tr 'abcdef' 'ABCDEF'` ltv=`echo "$ver:$rev:$typnum:$levnum" |\ awk -F: '{ printf("%d:%d", $1*10 + $2, $3*10 + $4); }'` @@ -1170,7 +1174,7 @@ vGNU="${name} ${triple} (${tim})" vWeb="${name}/${triple}" vSCCS="@(#)${name} ${triple} (${tim})" - vRCS="\$Id: shtool,v 1.2 2000/07/18 15:27:59 rse Exp ${name} ${triple} (${tim}) \$" + vRCS="\$Id: shtool,v 1.3 2001/02/10 16:40:26 rse Exp ${name} ${triple} (${tim}) \$" # determine string out of filename # (do NOT try to optimize this in any way because of portability) @@ -1263,6 +1267,23 @@ echo >>$file "1;" echo >>$file "" ;; + python ) + echo >>$file "##" + echo >>$file "## ${file} -- Version Information for ${name} (syntax: Python)" + echo >>$file "## [automatically generated and maintained by GNU shtool]" + echo >>$file "##" + echo >>$file "" + echo >>$file "class ${prefix}version:" + echo >>$file " v_hex = ${vHex}" + echo >>$file " v_short = \"${vShort}\"" + echo >>$file " v_long = \"${vLong}\"" + echo >>$file " v_tex = \"${vTeX}\"" + echo >>$file " v_gnu = \"${vGNU}\"" + echo >>$file " v_web = \"${vWeb}\"" + echo >>$file " v_sccs = \"${vSCCS}\"" + echo >>$file " v_rcs = \"${vRCS}\"" + echo >>$file "" + ;; * ) echo "$msgprefix:Error: invalid argument to option \`-l': \`$opt_l'" 1>&2 exit 1 ;; @@ -1273,7 +1294,7 @@ path ) ## ## path -- Deal with program paths - ## Copyright (c) 1998-2000 Ralf S. Engelschall + ## Copyright (c) 1998-2001 Ralf S. Engelschall ## Originally written for Apache ## @@ -1323,7 +1344,7 @@ # MAGIC SITUATION # Perl Interpreter (perl) - if [ ".$opt_m" = .yes ] && [ ".$namelist" = .perl ]; then + if [ ".$opt_m" = .yes -a ".$namelist" = .perl ]; then rm -f $tmpfile touch $tmpfile found=0 @@ -1332,7 +1353,7 @@ dir=`echo $dir | sed -e 's;/*$;;'` nc=99 for name in perl perl5 miniperl; do - if [ $minusx "$dir/$name" ] && [ ! -d "$dir/$name" ]; then + if [ $minusx "$dir/$name" -a ! -d "$dir/$name" ]; then perl="$dir/$name" pv=`$perl -e 'printf("%.3f", $]);'` echo "$pv:$pc:$nc:$perl" >>$tmpfile @@ -1353,7 +1374,7 @@ # MAGIC SITUATION # C pre-processor (cpp) - if [ ".$opt_m" = .yes ] && [ ".$namelist" = .cpp ]; then + if [ ".$opt_m" = .yes -a ".$namelist" = .cpp ]; then echo >$tmpfile.c "#include " echo >>$tmpfile.c "Syntax Error" # 1. try the standard cc -E approach @@ -1369,7 +1390,7 @@ # 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 "$path/cpp" ] && [ ! -d "$path/cpp" ]; then + if [ $minusx "$path/cpp" -a ! -d "$path/cpp" ]; then cpp="$path/cpp" break fi @@ -1398,7 +1419,7 @@ # iterate over paths for path in $paths; do path=`echo $path | sed -e 's;/*$;;'` - if [ $minusx "$path/$name" ] && [ ! -d "$path/$name" ]; then + if [ $minusx "$path/$name" -a ! -d "$path/$name" ]; then if [ ".$opt_s" != .yes ]; then echo "$path/$name" fi From ossp-cvs-owner@ossp.org Mon Feb 12 15:50:14 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f1CEoD317393; Mon, 12 Feb 2001 15:50:13 +0100 (CET) Date: Mon, 12 Feb 2001 15:50:13 +0100 (CET) Message-Id: <200102121450.f1CEoD317393@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/sfio .configure aclocal.m4 configure.in ossp-pkg/... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 12-Feb-2001 15:50:13 Branch: HEAD Handle: 2001021214501101 Modified files: ossp-pkg/sfio .configure aclocal.m4 configure.in ossp-pkg/sfio/etc config.guess config.sub shtool Log: Upgrade development scripts Summary: Revision Changes Path 1.3 +1 -1 ossp-pkg/sfio/.configure 1.2 +31 -24 ossp-pkg/sfio/aclocal.m4 1.10 +2 -2 ossp-pkg/sfio/configure.in 1.3 +591 -157 ossp-pkg/sfio/etc/config.guess 1.3 +203 -70 ossp-pkg/sfio/etc/config.sub 1.4 +74 -52 ossp-pkg/sfio/etc/shtool ____________________________________________________________________________ Index: ossp-pkg/sfio/.configure ============================================================ $ cvs diff -u -r1.2 -r1.3 .configure --- ossp-pkg/sfio/.configure 1999/11/12 14:43:46 1.2 +++ ossp-pkg/sfio/.configure 2001/02/12 14:50:11 1.3 @@ -1,5 +1,5 @@ #!/bin/sh -CC="egcc" \ +CC="ggcc" \ CFLAGS="-pipe -O2 -Wall -Wshadow -Wpointer-arith -Wcast-align -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline" \ ./configure \ --prefix=/sw/pkg/sfio \ Index: ossp-pkg/sfio/aclocal.m4 ============================================================ $ cvs diff -u -r1.1 -r1.2 aclocal.m4 --- ossp-pkg/sfio/aclocal.m4 1999/11/12 14:42:20 1.1 +++ ossp-pkg/sfio/aclocal.m4 2001/02/12 14:50:11 1.2 @@ -1,5 +1,5 @@ ## libtool.m4 - Configure libtool for the target system. -*-Shell-script-*- -## Copyright (C) 1996-1999 Free Software Foundation, Inc. +## Copyright (C) 1996-1999, 2000 Free Software Foundation, Inc. ## Originally by Gordon Matzigkeit , 1996 ## ## This program is free software; you can redistribute it and/or modify @@ -34,7 +34,7 @@ LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \ DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \ ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \ -$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \ +$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \ || AC_MSG_ERROR([libtool configure failed]) # Reload cache, that may have been modified by ltconfig @@ -66,6 +66,11 @@ AC_REQUIRE([AC_PROG_LN_S])dnl dnl +case "$target" in +NONE) lt_target="$host" ;; +*) lt_target="$target" ;; +esac + # Check for any special flags to pass to ltconfig. libtool_flags="--cache-file=$cache_file" test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared" @@ -84,7 +89,7 @@ # Some flags need to be propagated to the compiler or linker for good # libtool support. -case "$host" in +case "$lt_target" in *-*-irix6*) # Find out which ABI we are using. echo '[#]line __oline__ "configure"' > conftest.$ac_ext @@ -300,7 +305,6 @@ AC_MSG_RESULT(no) fi test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) -AC_SUBST(LD) AC_PROG_LD_GNU ]) @@ -346,14 +350,13 @@ fi]) NM="$ac_cv_path_NM" AC_MSG_RESULT([$NM]) -AC_SUBST(NM) ]) # AC_CHECK_LIBM - check for math library AC_DEFUN(AC_CHECK_LIBM, [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= -case "$host" in +case "$lt_target" in *-*-beos* | *-*-cygwin*) # These system don't have libm ;; @@ -368,31 +371,35 @@ ]) # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for -# the libltdl convenience library, adds --enable-ltdl-convenience to -# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor -# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed -# to be `${top_builddir}/libltdl'. Make sure you start DIR with -# '${top_builddir}/' (note the single quotes!) if your package is not -# flat, and, if you're not using automake, define top_builddir as -# appropriate in the Makefiles. +# the libltdl convenience library and INCLTDL to the include flags for +# the libltdl header and adds --enable-ltdl-convenience to the +# configure arguments. Note that LIBLTDL and INCLTDL are not +# AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If DIR is not +# provided, it is assumed to be `libltdl'. LIBLTDL will be prefixed +# with '${top_builddir}/' and INCLTDL will be prefixed with +# '${top_srcdir}/' (note the single quotes!). If your package is not +# flat and you're not using automake, define top_builddir and +# top_srcdir appropriately in the Makefiles. AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl case "$enable_ltdl_convenience" in no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; "") enable_ltdl_convenience=yes ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; esac - LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la - INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl']) + LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la + INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) ]) # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for -# the libltdl installable library, and adds --enable-ltdl-install to -# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor -# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed -# to be `${top_builddir}/libltdl'. Make sure you start DIR with -# '${top_builddir}/' (note the single quotes!) if your package is not -# flat, and, if you're not using automake, define top_builddir as -# appropriate in the Makefiles. +# the libltdl installable library and INCLTDL to the include flags for +# the libltdl header and adds --enable-ltdl-install to the configure +# arguments. Note that LIBLTDL and INCLTDL are not AC_SUBSTed, nor is +# AC_CONFIG_SUBDIRS called. If DIR is not provided and an installed +# libltdl is not found, it is assumed to be `libltdl'. LIBLTDL will +# be prefixed with '${top_builddir}/' and INCLTDL will be prefixed +# with '${top_srcdir}/' (note the single quotes!). If your package is +# not flat and you're not using automake, define top_builddir and +# top_srcdir appropriately in the Makefiles. # In the future, this macro may have to be called after AC_PROG_LIBTOOL. AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_CHECK_LIB(ltdl, main, @@ -405,8 +412,8 @@ ]) if test x"$enable_ltdl_install" = x"yes"; then ac_configure_args="$ac_configure_args --enable-ltdl-install" - LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la - INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl']) + LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la + INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) else ac_configure_args="$ac_configure_args --enable-ltdl-install=no" LIBLTDL="-lltdl" Index: ossp-pkg/sfio/configure.in ============================================================ $ cvs diff -u -r1.9 -r1.10 configure.in --- ossp-pkg/sfio/configure.in 1999/11/12 15:18:33 1.9 +++ ossp-pkg/sfio/configure.in 2001/02/12 14:50:11 1.10 @@ -2,8 +2,8 @@ dnl ## Autoconf specification for Sfio library dnl ## -AC_PREREQ(2.12)dnl -AC_REVISION($Revision: 1.9 $) +AC_PREREQ(2.13)dnl +AC_REVISION($Revision: 1.10 $) SHTOOL="./etc/shtool" AC_SUBST(SHTOOL) Index: ossp-pkg/sfio/etc/config.guess ============================================================ $ cvs diff -u -r1.2 -r1.3 config.guess --- ossp-pkg/sfio/etc/config.guess 2000/07/03 14:15:16 1.2 +++ ossp-pkg/sfio/etc/config.guess 2001/02/12 14:50:12 1.3 @@ -1,8 +1,10 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999 +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. -# + +timestamp='2001-01-17' + # This file 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 @@ -23,34 +25,97 @@ # the same distribution terms that you use for the rest of that program. # Written by Per Bothner . -# The master version of this file is at the FSF in /home/gd/gnu/lib. -# Please send patches to the Autoconf mailing list . +# Please send patches to . # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # The plan is that this can be called by configure scripts if you -# don't specify an explicit system type (host/target name). +# don't specify an explicit build system type. # # Only a few systems have been added to this list; please add others # (but try to keep the structure clean). # -# Use $HOST_CC if defined. $CC may point to a cross-compiler -if test x"$CC_FOR_BUILD" = x; then - if test x"$HOST_CC" != x; then - CC_FOR_BUILD="$HOST_CC" - else - if test x"$CC" != x; then - CC_FOR_BUILD="$CC" - else - CC_FOR_BUILD=cc - fi - fi +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 99, 2000 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit 0 ;; + --version | -v ) + echo "$version" ; exit 0 ;; + --help | --h* | -h ) + echo "$usage"; exit 0 ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 fi +dummy=dummy-$$ +trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15 + +# CC_FOR_BUILD -- compiler used by this script. +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int dummy(){}" > $dummy.c + for c in cc gcc c89 ; do + ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 + if test $? = 0 ; then + CC_FOR_BUILD="$c"; break + fi + done + rm -f $dummy.c $dummy.o $dummy.rel + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +esac + # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 8/24/94.) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then @@ -59,15 +124,57 @@ UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown -UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown -dummy=dummy-$$ -trap 'rm -f $dummy.c $dummy.o $dummy; exit 1' 1 2 15 - # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + *:NetBSD:*:*) + # Netbsd (nbsd) targets should (where applicable) match one or + # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # Determine the machine/vendor (is the vendor relevant). + case "${UNAME_MACHINE}" in + amiga) machine=m68k-unknown ;; + arm32) machine=arm-unknown ;; + atari*) machine=m68k-atari ;; + sun3*) machine=m68k-sun ;; + mac68k) machine=m68k-apple ;; + macppc) machine=powerpc-apple ;; + hp3[0-9][05]) machine=m68k-hp ;; + ibmrt|romp-ibm) machine=romp-ibm ;; + *) machine=${UNAME_MACHINE}-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently, or will in the future. + case "${UNAME_MACHINE}" in + i386|sparc|amiga|arm*|hp300|mvme68k|vax|atari|luna68k|mac68k|news68k|next68k|pc532|sun3*|x68k) + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep __ELF__ >/dev/null + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # The OS release + release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}" + exit 0 ;; alpha:OSF1:*:*) if test $UNAME_RELEASE = "V4.0"; then UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` @@ -77,41 +184,51 @@ # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. cat <$dummy.s + .data +\$Lformat: + .byte 37,100,45,37,120,10,0 # "%d-%x\n" + + .text .globl main + .align 4 .ent main main: - .frame \$30,0,\$26,0 - .prologue 0 - .long 0x47e03d80 # implver $0 - lda \$2,259 - .long 0x47e20c21 # amask $2,$1 - srl \$1,8,\$2 - sll \$2,2,\$2 - sll \$0,3,\$0 - addl \$1,\$0,\$0 - addl \$2,\$0,\$0 - ret \$31,(\$26),1 + .frame \$30,16,\$26,0 + ldgp \$29,0(\$27) + .prologue 1 + .long 0x47e03d80 # implver \$0 + lda \$2,-1 + .long 0x47e20c21 # amask \$2,\$1 + lda \$16,\$Lformat + mov \$0,\$17 + not \$1,\$18 + jsr \$26,printf + ldgp \$29,0(\$26) + mov 0,\$16 + jsr \$26,exit .end main EOF $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null if test "$?" = 0 ; then - ./$dummy - case "$?" in - 7) + case `./$dummy` in + 0-0) UNAME_MACHINE="alpha" ;; - 15) + 1-0) UNAME_MACHINE="alphaev5" ;; - 14) + 1-1) UNAME_MACHINE="alphaev56" ;; - 10) + 1-101) UNAME_MACHINE="alphapca56" ;; - 16) + 2-303) UNAME_MACHINE="alphaev6" ;; + 2-307) + UNAME_MACHINE="alphaev67" + ;; esac fi rm -f $dummy.s $dummy @@ -127,11 +244,8 @@ echo alpha-dec-winnt3.5 exit 0 ;; Amiga*:UNIX_System_V:4.0:*) - echo m68k-cbm-sysv4 + echo m68k-unknown-sysv4 exit 0;; - amiga:NetBSD:*:*) - echo m68k-cbm-netbsd${UNAME_RELEASE} - exit 0 ;; amiga:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; @@ -156,13 +270,13 @@ wgrisc:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit 0 ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit 0;; - arm32:NetBSD:*:*) - echo arm-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` - exit 0 ;; - SR2?01:HI-UX/MPP:*:*) + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit 0;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) @@ -218,9 +332,6 @@ aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit 0 ;; - atari*:NetBSD:*:*) - echo m68k-atari-netbsd${UNAME_RELEASE} - exit 0 ;; atari*:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; @@ -250,15 +361,9 @@ *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit 0 ;; - sun3*:NetBSD:*:*) - echo m68k-sun-netbsd${UNAME_RELEASE} - exit 0 ;; sun3*:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; - mac68k:NetBSD:*:*) - echo m68k-apple-netbsd${UNAME_RELEASE} - exit 0 ;; mac68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; @@ -271,9 +376,6 @@ powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit 0 ;; - macppc:NetBSD:*:*) - echo powerpc-apple-netbsd${UNAME_RELEASE} - exit 0 ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit 0 ;; @@ -289,6 +391,7 @@ mips:*:*:UMIPS | mips:*:*:RISCos) sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus +#include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { @@ -328,15 +431,18 @@ AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` - if [ $UNAME_PROCESSOR = mc88100 -o $UNAME_PROCESSOR = mc88110 ] ; then - if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \ - -o ${TARGET_BINARY_INTERFACE}x = x ] ; then + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ + [ ${TARGET_BINARY_INTERFACE}x = x ] + then echo m88k-dg-dgux${UNAME_RELEASE} - else + else echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else + echo i586-dg-dgux${UNAME_RELEASE} fi - else echo i586-dg-dgux${UNAME_RELEASE} - fi exit 0 ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 @@ -396,13 +502,26 @@ fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit 0 ;; + *:AIX:*:5) + case "`lsattr -El proc0 -a type -F value`" in + PowerPC*) IBM_ARCH=powerpc + IBM_MANUF=ibm ;; + Itanium) IBM_ARCH=ia64 + IBM_MANUF=unknown ;; + POWER*) IBM_ARCH=power + IBM_MANUF=ibm ;; + *) IBM_ARCH=powerpc + IBM_MANUF=ibm ;; + esac + echo ${IBM_ARCH}-${IBM_MANUF}-aix${UNAME_VERSION}.${UNAME_RELEASE} + exit 0 ;; *:AIX:*:*) echo rs6000-ibm-aix exit 0 ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit 0 ;; - ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC NetBSD and + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit 0 ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) @@ -418,11 +537,31 @@ echo m68k-hp-bsd4.4 exit 0 ;; 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) + case "${HPUX_REV}" in + 11.[0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; + esac ;; + esac + fi ;; + esac + if [ "${HP_ARCH}" = "" ]; then sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE #include #include @@ -453,12 +592,17 @@ exit (0); } EOF - ($CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy` + (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy` + if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi rm -f $dummy.c $dummy + fi ;; esac - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit 0 ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} + exit 0 ;; 3050*:HI-UX:*:*) sed 's/^ //' << EOF >$dummy.c #include @@ -547,29 +691,30 @@ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ exit 0 ;; CRAY*TS:*:*:*) - echo t90-cray-unicos${UNAME_RELEASE} + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; + CRAY*T3D:*:*:*) + echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; CRAY*T3E:*:*:*) - echo t3e-cray-unicosmk${UNAME_RELEASE} + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY-2:*:*:*) echo cray2-cray-unicos exit 0 ;; - F300:UNIX_System_V:*:*) + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` - echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit 0 ;; - F301:UNIX_System_V:*:*) - echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'` - exit 0 ;; - hp3[0-9][05]:NetBSD:*:*) - echo m68k-hp-netbsd${UNAME_RELEASE} - exit 0 ;; hp300:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; - i?86:BSD/386:*:* | i?86:BSD/OS:*:*) + i?86:BSD/386:*:* | i?86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit 0 ;; sparc*:BSD/OS:*:*) @@ -579,25 +724,7 @@ echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:FreeBSD:*:*) - # echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` - VERS=`echo ${UNAME_RELEASE} | sed -e 's/[-(].*//'` - MACH=`/sbin/sysctl -n hw.model` - ARCH='unknown' - case ${MACH} in - *386* ) MACH="i386" ;; - *486* ) MACH="i486" ;; - Pentium\ II*) MACH="i686" ;; - Pentium* ) MACH="i586" ;; - Alpha* ) MACH="alpha" ;; - * ) MACH="$UNAME_MACHINE" ;; - esac - case ${MACH} in - i[0-9]86 ) ARCH="pc" ;; - esac - echo "${MACH}-${ARCH}-freebsd${VERS}" - exit 0 ;; - *:NetBSD:*:*) - echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit 0 ;; *:OpenBSD:*:*) echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` @@ -608,6 +735,9 @@ i*:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit 0 ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit 0 ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we @@ -626,61 +756,246 @@ *:GNU:*:*) echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit 0 ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit 0 ;; *:Linux:*:*) - # determine canonical machine name - MACHINE="$UNAME_MACHINE" - case "$MACHINE" in - arm*|sa110*) MACHINE="arm" ;; - esac - - # determine (distribution) vendor - VENDOR="gnu" - for tagfile in dummy `cd /etc && echo *-release *_version 2>/dev/null`; do - test ! -f /etc/$tagfile && continue - VENDOR=`echo $tagfile | sed -e 's/-release$//' -e 's/_version$//' |\ - tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - done - # determine kernel version - KERNEL=`echo ${UNAME_RELEASE} | sed -e 's/^\([0-9]*\.[0-9]*\)\..*$/\1/'` - - # determine [g]libc version - cat >$dummy.c < + # The BFD linker knows what the default object file format is, so + # first see if it will tell us. cd to the root directory to prevent + # problems with other programs or directories called `ld' in the path. + ld_supported_emulations=`cd /; ld --help 2>&1 \ + | sed -ne '/supported emulations:/!d + s/[ ][ ]*/ /g + s/.*supported emulations: *// + s/ .*// + p'` + case "$ld_supported_emulations" in + *ia64) + echo "${UNAME_MACHINE}-unknown-linux" + exit 0 + ;; + i?86linux) + echo "${UNAME_MACHINE}-pc-linux-gnuaout" + exit 0 + ;; + elf_i?86) + TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" + ;; + i?86coff) + echo "${UNAME_MACHINE}-pc-linux-gnucoff" + exit 0 + ;; + sparclinux) + echo "${UNAME_MACHINE}-unknown-linux-gnuaout" + exit 0 + ;; + elf32_sparc) + echo "${UNAME_MACHINE}-unknown-linux-gnu" + exit 0 + ;; + armlinux) + echo "${UNAME_MACHINE}-unknown-linux-gnuaout" + exit 0 + ;; + elf32arm*) + echo "${UNAME_MACHINE}-unknown-linux-gnuoldld" + exit 0 + ;; + armelf_linux*) + echo "${UNAME_MACHINE}-unknown-linux-gnu" + exit 0 + ;; + m68klinux) + echo "${UNAME_MACHINE}-unknown-linux-gnuaout" + exit 0 + ;; + elf32ppc | elf32ppclinux) + # Determine Lib Version + cat >$dummy.c < +#if defined(__GLIBC__) +extern char __libc_version[]; +extern char __libc_release[]; +#endif main(argc, argv) -int argc; -char *argv[]; + int argc; + char *argv[]; { -#if defined(__GLIBC__) && !defined(__GLIBC_MINOR__) - printf("%d", __GLIBC__); -#elif defined(__GLIBC__) && defined(__GLIBC_MINOR__) - printf("%d.%d", __GLIBC__, __GLIBC_MINOR__); -#elif defined(__GNU_LIBRARY__) - printf("%d", __GNU_LIBRARY__); +#if defined(__GLIBC__) + printf("%s %s\n", __libc_version, __libc_release); #else - printf("1"); + printf("unkown\n"); #endif - return 0; + return 0; } EOF - LIBC="1" - $CC_FOR_BUILD $dummy.c -o $dummy # 2>/dev/null - if [ $? = 0 ]; then - LIBC=`./$dummy | sed -e 's/^\([0-9]*\.[0-9]*\)\..*$/\1/'` - fi - rm -f $dummy.c $dummy + LIBC="" + $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null + if test "$?" = 0 ; then + ./$dummy | grep 1\.99 > /dev/null + if test "$?" = 0 ; then + LIBC="libc1" + fi + fi + rm -f $dummy.c $dummy + echo powerpc-unknown-linux-gnu${LIBC} + exit 0 + ;; + shelf_linux) + echo "${UNAME_MACHINE}-unknown-linux-gnu" + exit 0 + ;; + esac - echo "${MACHINE}-${VENDOR}-linux${KERNEL}glibc${LIBC}" - ;; + if test "${UNAME_MACHINE}" = "alpha" ; then + cat <$dummy.s + .data + \$Lformat: + .byte 37,100,45,37,120,10,0 # "%d-%x\n" + + .text + .globl main + .align 4 + .ent main + main: + .frame \$30,16,\$26,0 + ldgp \$29,0(\$27) + .prologue 1 + .long 0x47e03d80 # implver \$0 + lda \$2,-1 + .long 0x47e20c21 # amask \$2,\$1 + lda \$16,\$Lformat + mov \$0,\$17 + not \$1,\$18 + jsr \$26,printf + ldgp \$29,0(\$26) + mov 0,\$16 + jsr \$26,exit + .end main +EOF + LIBC="" + $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null + if test "$?" = 0 ; then + case `./$dummy` in + 0-0) + UNAME_MACHINE="alpha" + ;; + 1-0) + UNAME_MACHINE="alphaev5" + ;; + 1-1) + UNAME_MACHINE="alphaev56" + ;; + 1-101) + UNAME_MACHINE="alphapca56" + ;; + 2-303) + UNAME_MACHINE="alphaev6" + ;; + 2-307) + UNAME_MACHINE="alphaev67" + ;; + esac + + objdump --private-headers $dummy | \ + grep ld.so.1 > /dev/null + if test "$?" = 0 ; then + LIBC="libc1" + fi + fi + rm -f $dummy.s $dummy + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0 + elif test "${UNAME_MACHINE}" = "mips" ; then + cat >$dummy.c < /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif +#ifdef __MIPSEB__ + printf ("%s-unknown-linux-gnu\n", argv[1]); +#endif +#ifdef __MIPSEL__ + printf ("%sel-unknown-linux-gnu\n", argv[1]); +#endif + return 0; +} +EOF + $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0 + rm -f $dummy.c $dummy + elif test "${UNAME_MACHINE}" = "s390"; then + echo s390-ibm-linux && exit 0 + elif test "${UNAME_MACHINE}" = "x86_64"; then + echo x86_64-unknown-linux-gnu && exit 0 + elif test "${UNAME_MACHINE}" = "parisc64" -o "${UNAME_MACHINE}" = "hppa64"; then + echo hppa64-unknown-linux-gnu && exit 0 + elif test "${UNAME_MACHINE}" = "parisc" -o "${UNAME_MACHINE}" = "hppa"; then + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) + echo hppa1.1-unknown-linux-gnu + ;; + PA8*) + echo hppa2.0-unknown-linux-gnu + ;; + *) + echo hppa-unknown-linux-gnu + ;; + esac + exit 0 + else + # Either a pre-BFD a.out linker (linux-gnuoldld) + # or one that does not give us useful --help. + # GCC wants to distinguish between linux-gnuoldld and linux-gnuaout. + # If ld does not provide *any* "supported emulations:" + # that means it is gnuoldld. + test -z "$ld_supported_emulations" \ + && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0 + + case "${UNAME_MACHINE}" in + i?86) + VENDOR=pc; + ;; + *) + VENDOR=unknown; + ;; + esac + # Determine whether the default compiler is a.out or elf + cat >$dummy.c < +#ifdef __cplusplus +#include /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif +#ifdef __ELF__ +# ifdef __GLIBC__ +# if __GLIBC__ >= 2 + printf ("%s-${VENDOR}-linux-gnu\n", argv[1]); +# else + printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]); +# endif +# else + printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]); +# endif +#else + printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]); +#endif + return 0; +} +EOF + $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0 + rm -f $dummy.c $dummy + test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 + fi ;; # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions # are messed up and put the nodename in both sysname and nodename. i?86:DYNIX/ptx:4*:*) echo i386-sequent-sysv4 exit 0 ;; - i?86:UnixWare:*:* ) - echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}uw${UNAME_VERSION} - exit 0 ;; i?86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... @@ -690,19 +1005,21 @@ echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit 0 ;; i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*) + UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then - echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE} + echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else - echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE} + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit 0 ;; i?86:*:5:7*) - UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')` - (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486 - (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) && UNAME_MACHINE=i586 - (/bin/uname -X|egrep '^Machine.*Pent.*II' >/dev/null) && UNAME_MACHINE=i686 - (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) && UNAME_MACHINE=i585 - echo ${UNAME_MACHINE}-${UNAME_SYSTEM}${UNAME_VERSION}-sysv${UNAME_RELEASE} + # Fixed at (any) Pentium or better + UNAME_MACHINE=i586 + if [ ${UNAME_SYSTEM} = "UnixWare" ] ; then + echo ${UNAME_MACHINE}-sco-sysv${UNAME_RELEASE}uw${UNAME_VERSION} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE} + fi exit 0 ;; i?86:*:3.2:*) if test -f /usr/options/cb.name; then @@ -722,7 +1039,11 @@ echo ${UNAME_MACHINE}-pc-sysv32 fi exit 0 ;; + i?86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit 0 ;; pc:*:*:*) + # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i386. echo i386-pc-msdosdjgpp @@ -746,7 +1067,7 @@ exit 0 ;; M68*:*:R3V[567]*:*) test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; - 3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0) + 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` @@ -769,15 +1090,15 @@ TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; - rs6000:LynxOS:2.*:* | PowerPC:LynxOS:2.*:*) + rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit 0 ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:*) + echo powerpc-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit 0 ;; - BS2000:POSIX-BC:*:*) - echo BS2000-siemens-sysv4 - exit 0 ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit 0 ;; @@ -808,7 +1129,7 @@ mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit 0 ;; - news*:NEWS-OS:*:6*) + news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit 0 ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) @@ -839,6 +1160,64 @@ *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit 0 ;; + *:Darwin:*:*) + echo `uname -p`-apple-darwin${UNAME_RELEASE} + exit 0 ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + if test "${UNAME_MACHINE}" = "x86pc"; then + UNAME_MACHINE=pc + fi + echo `uname -p`-${UNAME_MACHINE}-nto-qnx + exit 0 ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit 0 ;; + NSR-[KW]:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit 0 ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit 0 ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit 0 ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + exit 0 ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" = "386"; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo ${UNAME_MACHINE}-unknown-plan9 + exit 0 ;; + i?86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx + exit 0 ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit 0 ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit 0 ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit 0 ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit 0 ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit 0 ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit 0 ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 @@ -930,12 +1309,25 @@ #endif #if defined (vax) -#if !defined (ultrix) - printf ("vax-dec-bsd\n"); exit (0); -#else - printf ("vax-dec-ultrix\n"); exit (0); +# if !defined (ultrix) +# include +# if defined (BSD) +# if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +# else +# if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# endif +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# else + printf ("vax-dec-ultrix\n"); exit (0); +# endif #endif -#endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); @@ -977,7 +1369,49 @@ exit 0 ;; esac fi + +cat >&2 <&2 +This script, last modified $timestamp, has failed to recognize +the operating system you are using. It is advised that you +download the most up to date version of the config scripts from + + ftp://ftp.gnu.org/pub/gnu/config/ + +If the version you run ($0) is already up to date, please +send the following data and any information you think might be +pertinent to in order to provide the needed +information to handle your system. + +config.guess timestamp = $timestamp + +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = ${UNAME_MACHINE} +UNAME_RELEASE = ${UNAME_RELEASE} +UNAME_SYSTEM = ${UNAME_SYSTEM} +UNAME_VERSION = ${UNAME_VERSION} +EOF exit 1 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: Index: ossp-pkg/sfio/etc/config.sub ============================================================ $ cvs diff -u -r1.2 -r1.3 config.sub --- ossp-pkg/sfio/etc/config.sub 2000/07/03 14:15:16 1.2 +++ ossp-pkg/sfio/etc/config.sub 2001/02/12 14:50:12 1.3 @@ -1,6 +1,10 @@ #! /bin/sh -# Configuration validation subroutine script, version 1.1. -# Copyright (C) 1991, 92-97, 1998, 1999 Free Software Foundation, Inc. +# Configuration validation subroutine script. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +# Free Software Foundation, Inc. + +timestamp='2001-01-12' + # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. @@ -25,6 +29,8 @@ # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. +# Please send patches to . +# # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. @@ -45,30 +51,73 @@ # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. -if [ x$1 = x ] -then - echo Configuration name missing. 1>&2 - echo "Usage: $0 CPU-MFR-OPSYS" 1>&2 - echo "or $0 ALIAS" 1>&2 - echo where ALIAS is a recognized configuration type. 1>&2 - exit 1 -fi +me=`echo "$0" | sed -e 's,.*/,,'` -# First pass through any local machine types. -case $1 in - *local*) - echo $1 - exit 0 - ;; - *) - ;; +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS + $0 [OPTION] ALIAS + +Canonicalize a configuration name. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.sub ($timestamp) + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit 0 ;; + --version | -v ) + echo "$version" ; exit 0 ;; + --help | --h* | -h ) + echo "$usage"; exit 0 ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo $1 + exit 0;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in - linux-gnu*) + nto-qnx* | linux-gnu* | storm-chaos* | os2-emx*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; @@ -94,7 +143,7 @@ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple) + -apple | -axis) os= basic_machine=$1 ;; @@ -105,7 +154,7 @@ -scout) ;; -wrs) - os=vxworks + os=-vxworks basic_machine=$1 ;; -hiux*) @@ -156,33 +205,48 @@ -psos*) os=-psos ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. - tahoe | i860 | ia64 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \ - | arme[lb] | pyramid | mn10200 | mn10300 | tron | a29k \ + tahoe | i860 | ia64 | m32r | m68k | m68000 | m88k | ns32k | arc \ + | arm | arme[lb] | arm[bl]e | armv[2345] | armv[345][lb] | strongarm | xscale \ + | pyramid | mn10200 | mn10300 | tron | a29k \ | 580 | i960 | h8300 \ + | x86 | ppcbe | mipsbe | mipsle | shbe | shle \ | hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \ - | alpha | alphaev[4-7] | alphaev56 | alphapca5[67] \ - | we32k | ns16k | clipper | i370 | sh | powerpc | powerpcle \ - | 1750a | dsp16xx | pdp11 | mips16 | mips64 | mipsel | mips64el \ + | hppa64 \ + | alpha | alphaev[4-8] | alphaev56 | alphapca5[67] \ + | alphaev6[78] \ + | we32k | ns16k | clipper | i370 | sh | sh[34] \ + | powerpc | powerpcle \ + | 1750a | dsp16xx | pdp10 | pdp11 \ + | mips16 | mips64 | mipsel | mips64el \ | mips64orion | mips64orionel | mipstx39 | mipstx39el \ | mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \ | mips64vr5000 | miprs64vr5000el | mcore \ | sparc | sparclet | sparclite | sparc64 | sparcv9 | v850 | c4x \ - | thumb | d10v) + | thumb | d10v | d30v | fr30 | avr | openrisc) + basic_machine=$basic_machine-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12) + # Motorola 68HC11/12. basic_machine=$basic_machine-unknown + os=-none ;; - m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | z8k | v70 | h8500 | w65) + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | z8k | v70 | h8500 | w65 | pj | pjl) ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. - i[34567]86) + i[234567]86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. @@ -192,23 +256,28 @@ ;; # Recognize the basic CPU types with company name. # FIXME: clean up the formatting here. - vax-* | tahoe-* | i[34567]86-* | i860-* | ia64-* | m32r-* | m68k-* | m68000-* \ - | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \ + vax-* | tahoe-* | i[234567]86-* | i860-* | ia64-* | m32r-* | m68k-* | m68000-* \ + | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | c[123]* \ + | arm-* | armbe-* | armle-* | armv*-* | strongarm-* | xscale-* \ | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \ | power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \ | xmp-* | ymp-* \ - | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* | hppa2.0n-* \ - | alpha-* | alphaev[4-7]-* | alphaev56-* | alphapca5[67]-* \ + | x86-* | ppcbe-* | mipsbe-* | mipsle-* | shbe-* | shle-* \ + | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* \ + | hppa2.0n-* | hppa64-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphapca5[67]-* \ + | alphaev6[78]-* \ | we32k-* | cydra-* | ns16k-* | pn-* | np1-* | xps100-* \ | clipper-* | orion-* \ - | sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \ + | sparclite-* | pdp10-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \ | sparc64-* | sparcv9-* | sparc86x-* | mips16-* | mips64-* | mipsel-* \ | mips64el-* | mips64orion-* | mips64orionel-* \ | mips64vr4100-* | mips64vr4100el-* | mips64vr4300-* | mips64vr4300el-* \ | mipstx39-* | mipstx39el-* | mcore-* \ - | f301-* | armv*-* | t3e-* \ + | f30[01]-* | f700-* | s390-* | sv1-* | t3e-* \ | m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \ - | thumb-* | v850-* | d30v-* | tic30-* | c30-* ) + | thumb-* | v850-* | d30v-* | tic30-* | c30-* | fr30-* \ + | bs2000-* | tic54x-* | c54x-* | x86_64-*) ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. @@ -245,14 +314,14 @@ os=-sysv ;; amiga | amiga-*) - basic_machine=m68k-cbm + basic_machine=m68k-unknown ;; amigaos | amigados) - basic_machine=m68k-cbm + basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) - basic_machine=m68k-cbm + basic_machine=m68k-unknown os=-sysv4 ;; apollo68) @@ -306,6 +375,9 @@ crds | unos) basic_machine=m68k-crds ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; da30 | da30-*) basic_machine=m68k-da30 ;; @@ -353,6 +425,10 @@ basic_machine=tron-gmicro os=-sysv ;; + go32) + basic_machine=i386-pc + os=-go32 + ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 @@ -426,7 +502,6 @@ ;; i370-ibm* | ibm*) basic_machine=i370-ibm - os=-mvs ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i[34567]86v32) @@ -453,14 +528,6 @@ basic_machine=i386-unknown os=-vsta ;; - i386-go32 | go32) - basic_machine=i386-unknown - os=-go32 - ;; - i386-mingw32 | mingw32) - basic_machine=i386-unknown - os=-mingw32 - ;; iris | iris4d) basic_machine=mips-sgi case $os in @@ -486,10 +553,14 @@ basic_machine=ns32k-utek os=-sysv ;; + mingw32) + basic_machine=i386-pc + os=-mingw32 + ;; miniframe) basic_machine=m68000-convergent ;; - *mint | *MiNT) + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; @@ -507,14 +578,22 @@ mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; + mmix*) + basic_machine=mmix-knuth + os=-mmixware + ;; monitor) basic_machine=m68k-rom68k os=-coff ;; msdos) - basic_machine=i386-unknown + basic_machine=i386-pc os=-msdos ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; ncr3000) basic_machine=i486-ncr os=-sysv4 @@ -524,7 +603,7 @@ os=-netbsd ;; netwinder) - basic_machine=armv4l-corel + basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) @@ -572,9 +651,16 @@ basic_machine=i960-intel os=-mon960 ;; + nonstopux) + basic_machine=mips-compaq + os=-nonstopux + ;; np1) basic_machine=np1-gould ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf @@ -604,28 +690,28 @@ pc532 | pc532-*) basic_machine=ns32k-pc532 ;; - pentium | p5 | k5 | k6 | nexen) + pentium | p5 | k5 | k6 | nexgen) basic_machine=i586-pc ;; - pentiumpro | p6 | 6x86) + pentiumpro | p6 | 6x86 | athlon) basic_machine=i686-pc ;; pentiumii | pentium2) - basic_machine=i786-pc + basic_machine=i686-pc ;; - pentium-* | p5-* | k5-* | k6-* | nexen-*) + pentium-* | p5-* | k5-* | k6-* | nexgen-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; - pentiumpro-* | p6-* | 6x86-*) + pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-*) - basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; - power) basic_machine=rs6000-ibm + power) basic_machine=power-ibm ;; ppc) basic_machine=powerpc-unknown ;; @@ -640,6 +726,10 @@ ps2) basic_machine=i386-ibm ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; rom68k) basic_machine=m68k-rom68k os=-coff @@ -719,17 +809,22 @@ sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; symmetry) basic_machine=i386-sequent os=-dynix ;; - s390*) - basic_machine=s390-ibm - ;; t3e) basic_machine=t3e-cray os=-unicos ;; + tic54x | c54x*) + basic_machine=tic54x-unknown + os=-coff + ;; tx39) basic_machine=mipstx39-unknown ;; @@ -825,12 +920,19 @@ vax) basic_machine=vax-dec ;; + pdp10) + # there are many clones, so DEC is not a safe bet + basic_machine=pdp10-unknown + ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; + sh3 | sh4) + basic_machine=sh-unknown + ;; sparc | sparcv9) basic_machine=sparc-sun ;; @@ -853,8 +955,6 @@ basic_machine=c4x-none os=-coff ;; - BS2000-siemens) - ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 @@ -913,12 +1013,26 @@ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ - | -interix* | -uwin* | -rhapsody* | -openstep* | -oskit*) + | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* | -os2*) # Remember, each alternative MUST END IN *, to match a version number. ;; + -qnx*) + case $basic_machine in + x86-* | i[34567]86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto*) + os=-nto-qnx + ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ - | -macos* | -mpw* | -magic* | -mon960* | -lnews*) + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` @@ -932,6 +1046,12 @@ -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; + -opened*) + os=-openedition + ;; + -wince*) + os=-wince + ;; -osfrose*) os=-osfrose ;; @@ -956,6 +1076,9 @@ -ns2 ) os=-nextstep2 ;; + -nsk*) + os=-nsk + ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` @@ -990,7 +1113,7 @@ -xenix) os=-xenix ;; - -*mint | -*MiNT) + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -none) @@ -1018,12 +1141,15 @@ *-acorn) os=-riscix1.2 ;; - arm*-corel) + arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; + pdp10-*) + os=-tops20 + ;; pdp11-*) os=-none ;; @@ -1132,7 +1258,7 @@ *-masscomp) os=-rtu ;; - f301-fujitsu) + f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) @@ -1192,7 +1318,7 @@ -genix*) vendor=ns ;; - -mvs*) + -mvs* | -opened*) vendor=ibm ;; -ptx*) @@ -1210,7 +1336,7 @@ -mpw* | -macos*) vendor=apple ;; - -*mint | -*MiNT) + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; esac @@ -1220,3 +1346,10 @@ echo $basic_machine$os exit 0 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: Index: ossp-pkg/sfio/etc/shtool ============================================================ $ cvs diff -u -r1.3 -r1.4 shtool --- ossp-pkg/sfio/etc/shtool 2000/07/03 14:15:16 1.3 +++ ossp-pkg/sfio/etc/shtool 2001/02/12 14:50:12 1.4 @@ -1,12 +1,12 @@ #!/bin/sh ## ## GNU shtool -- The GNU Portable Shell Tool -## Copyright (c) 1994-2000 Ralf S. Engelschall +## Copyright (c) 1994-2001 Ralf S. Engelschall ## ## See http://www.gnu.org/software/shtool/ for more information. ## See ftp://ftp.gnu.org/gnu/shtool/ for latest version. ## -## Version: 1.5.0 (01-Jul-2000) +## Version: 1.5.2 (05-Oct-2000) ## Contents: all available modules ## @@ -63,8 +63,8 @@ exit 1 fi if [ ".$1" = ".-h" -o ".$1" = ".--help" ]; then - echo "This is GNU shtool, version 1.5.0 (01-Jul-2000)" - echo "Copyright (c) 1994-2000 Ralf S. Engelschall " + echo "This is GNU shtool, version 1.5.2 (05-Oct-2000)" + echo "Copyright (c) 1994-2001 Ralf S. Engelschall " echo "Report bugs to " echo '' echo "Usage: shtool [] [ [] []]" @@ -82,7 +82,7 @@ echo ' prop [-p]' echo ' move [-v] [-t] [-e] [-p] ' echo ' install [-v] [-t] [-c] [-C] [-s] [-m] [-o] [-g]' - echo ' [-e] [ ...] ' + echo ' [-e] [ ...] ' echo ' mkdir [-t] [-f] [-p] [-m] [ ...]' echo ' mkln [-t] [-f] [-s] [ ...] ' echo ' mkshadow [-v] [-t] [-a] ' @@ -101,7 +101,7 @@ exit 0 fi if [ ".$1" = ".-v" -o ".$1" = ."--version" ]; then - echo "GNU shtool 1.5.0 (01-Jul-2000)" + echo "GNU shtool 1.5.2 (05-Oct-2000)" exit 0 fi if [ ".$1" = ".-r" -o ".$1" = ."--recreate" ]; then @@ -182,15 +182,15 @@ ;; install ) str_tool="install" - str_usage="[-v] [-t] [-c] [-C] [-s] [-m] [-o] [-g] [-e] [ ...] " + str_usage="[-v] [-t] [-c] [-C] [-s] [-m] [-o] [-g] [-e] [ ...] " arg_spec="2+" - opt_spec="v.t.c.C.s.m:o:g:e:" + opt_spec="v.t.c.C.s.m:o:g:e+" opt_v=no opt_t=no opt_c=no opt_C=no opt_s=no - opt_m="" + opt_m="0755" opt_o="" opt_g="" opt_e="" @@ -455,6 +455,7 @@ tmpfile="$tmpdir/.shtool.$$" rm -f $tmpfile >/dev/null 2>&1 touch $tmpfile + chmod 600 $tmpfile fi ## @@ -466,7 +467,7 @@ echo ) ## ## echo -- Print string with optional construct expansion - ## Copyright (c) 1998-2000 Ralf S. Engelschall + ## Copyright (c) 1998-2001 Ralf S. Engelschall ## Originally written for WML as buildinfo ## @@ -814,7 +815,7 @@ table ) ## ## table -- Pretty-print a field-separated list as a table - ## Copyright (c) 1998-2000 Ralf S. Engelschall + ## Copyright (c) 1998-2001 Ralf S. Engelschall ## Originally written for Apache ## @@ -878,7 +879,7 @@ prop ) ## ## prop -- Display progress with a running propeller - ## Copyright (c) 1998-2000 Ralf S. Engelschall + ## Copyright (c) 1998-2001 Ralf S. Engelschall ## Originally written for mod_ssl ## @@ -923,7 +924,7 @@ move ) ## ## move -- Move files with simultaneous substitution - ## Copyright (c) 1999-2000 Ralf S. Engelschall + ## Copyright (c) 1999-2001 Ralf S. Engelschall ## Originally written for shtool ## @@ -1015,7 +1016,7 @@ install ) ## ## install -- Install a program, script or datafile - ## Copyright (c) 1997-2000 Ralf S. Engelschall + ## Copyright (c) 1997-2001 Ralf S. Engelschall ## Originally written for shtool ## @@ -1045,19 +1046,13 @@ for src in $srcs; do dst=$dstpath - # If destination is a directory, append the input filename + # if destination is a directory, append the input filename if [ $dstisdir = 1 ]; then dstfile=`echo "$src" | sed -e 's;.*/\([^/]*\)$;\1;'` dst="$dst/$dstfile" fi - - # Add a possible extension to src and dst - if [ ".$opt_e" != . ]; then - src="$src$opt_e" - dst="$dst$opt_e" - fi - # Check for correct arguments + # check for correct arguments if [ ".$src" = ".$dst" ]; then echo "$msgprefix:Warning: source and destination are the same - skipped" 1>&2 continue @@ -1067,18 +1062,18 @@ continue fi - # Make a temp file name in the destination directory + # make a temp file name in the destination directory dsttmp=`echo $dst |\ sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;' -e 's;^$;.;' \ -e "s;\$;/#INST@$$#;"` - # Verbosity + # verbosity if [ ".$opt_v" = .yes ]; then echo "$src -> $dst" 1>&2 fi - # Copy or move the file name to the temp name - # (because we might be not allowed to change the source) + # copy or move the file name to the temp name + # (because we might be not allowed to change the source) if [ ".$opt_C" = .yes ]; then opt_c=yes fi @@ -1094,8 +1089,16 @@ mv $src $dsttmp || exit $? fi - # Adjust the target file - # (we do chmod last to preserve setuid bits) + # adjust the target file + if [ ".$opt_e" != . ]; then + sed='sed' + for e in $opt_e; do + sed="$sed -e '$e'" + done + cp $dsttmp $dsttmp.old + eval "$sed <$dsttmp.old >$dsttmp" || exit $? + rm -f $dsttmp.old + fi if [ ".$opt_s" = .yes ]; then if [ ".$opt_t" = .yes ]; then echo "strip $dsttmp" 1>&2 @@ -1114,14 +1117,14 @@ fi chgrp $opt_g $dsttmp || exit $? fi - if [ ".$opt_m" != . ]; then + if [ ".$opt_m" != ".-" ]; then if [ ".$opt_t" = .yes ]; then echo "chmod $opt_m $dsttmp" 1>&2 fi chmod $opt_m $dsttmp || exit $? fi - # Determine whether to do a quick install + # determine whether to do a quick install # (has to be done _after_ the strip was already done) quick=no if [ ".$opt_C" = .yes ]; then @@ -1132,7 +1135,7 @@ fi fi - # Finally install the file to the real destination + # finally, install the file to the real destination if [ $quick = yes ]; then if [ ".$opt_t" = .yes ]; then echo "rm -f $dsttmp" 1>&2 @@ -1150,7 +1153,7 @@ mkdir ) ## ## mkdir -- Make one or more directories - ## Copyright (c) 1996-2000 Ralf S. Engelschall + ## Copyright (c) 1996-2001 Ralf S. Engelschall ## Originally written for public domain by Noah Friedman ## Cleaned up and enhanced for shtool ## @@ -1159,7 +1162,7 @@ for p in ${1+"$@"}; do # if the directory already exists... if [ -d "$p" ]; then - if [ ".$opt_f" = .no ] && [ ".$opt_p" = .no ]; then + if [ ".$opt_f" = .no -a ".$opt_p" = .no ]; then echo "$msgprefix:Error: directory already exists: $p" 1>&2 errstatus=1 break @@ -1209,7 +1212,7 @@ mkln ) ## ## mkln -- Make link with calculation of relative paths - ## Copyright (c) 1999-2000 Ralf S. Engelschall + ## Copyright (c) 1999-2001 Ralf S. Engelschall ## Originally written for shtool ## @@ -1287,12 +1290,12 @@ # split away a common prefix prefix="" - if [ ".$srcdir" = ".$dstdir" ] && [ ".$srcdir" != . ]; then + if [ ".$srcdir" = ".$dstdir" -a ".$srcdir" != . ]; then prefix="$srcdir/" srcdir="" dstdir="" else - while [ ".$srcdir" != . ] && [ ".$dstdir" != . ]; do + while [ ".$srcdir" != . -a ".$dstdir" != . ]; do presrc=`echo $srcdir | sed -e 's;^\([^/]*\)/.*;\1;'` predst=`echo $dstdir | sed -e 's;^\([^/]*\)/.*;\1;'` if [ ".$presrc" != ".$predst" ]; then @@ -1348,7 +1351,7 @@ mkshadow ) ## ## mkshadow -- Make a shadow tree through symbolic links - ## Copyright (c) 1998-2000 Ralf S. Engelschall + ## Copyright (c) 1998-2001 Ralf S. Engelschall ## Originally written for Apache ## @@ -1465,7 +1468,7 @@ fixperm ) ## ## fixperm -- Fix file permissions inside a source tree - ## Copyright (c) 1996-2000 Ralf S. Engelschall + ## Copyright (c) 1996-2001 Ralf S. Engelschall ## Originally written for ePerl ## @@ -1521,7 +1524,7 @@ tarball ) ## ## tarball -- Roll distribution tarballs - ## Copyright (c) 1999-2000 Ralf S. Engelschall + ## Copyright (c) 1999-2001 Ralf S. Engelschall ## Originally written for shtool ## @@ -1547,7 +1550,7 @@ for tool in `echo $tools | sed -e 's/,/ /g'`; do # iterate over paths for path in $paths; do - if [ $minusx "$path/$tool" ] && [ ! -d "$path/$tool" ]; then + if [ $minusx "$path/$tool" -a ! -d "$path/$tool" ]; then eval "prg_${prg}=\"$path/$tool\"" break fi @@ -1573,7 +1576,7 @@ if [ ".$opt_t" = .yes ]; then echo "(cd $src && $prg_find . -type f -depth -print) | sed -e 's:^\\.\$::' -e 's:^\\./::' | cat $exclude >>$tmpfile.lst" 1>&2 fi - (cd $src && find . -type f -depth -print) |\ + (cd $src && $prg_find . -type f -depth -print) |\ sed -e 's:^\.$::' -e 's:^\./::' | eval cat $exclude >>$tmpfile.lst else if [ ".$opt_t" = .yes ]; then @@ -1747,6 +1750,7 @@ ;; HP-UX:*) HPUXVER=`echo ${RELEASE}|sed -e 's/[^.]*.[0B]*//'` + MACHINE=`echo ${MACHINE}|sed -e 's:/:_:'` echo "${MACHINE}-hp-hpux${HPUXVER}"; exit 0 ;; IRIX:*) @@ -1930,7 +1934,7 @@ arx ) ## ## arx -- Extended archive command - ## Copyright (c) 1999-2000 Ralf S. Engelschall + ## Copyright (c) 1999-2001 Ralf S. Engelschall ## Originally written for shtool ## @@ -2008,7 +2012,7 @@ slo ) ## ## slo -- Separate linker options by library class - ## Copyright (c) 1998-2000 Ralf S. Engelschall + ## Copyright (c) 1998-2001 Ralf S. Engelschall ## Originally written for Apache ## @@ -2164,7 +2168,7 @@ scpp ) ## ## scpp -- Sharing C Pre-Processor - ## Copyright (c) 1999-2000 Ralf S. Engelschall + ## Copyright (c) 1999-2001 Ralf S. Engelschall ## Originally written for GNU Pth ## @@ -2377,7 +2381,7 @@ version ) ## ## version -- Maintain a version information file - ## Copyright (c) 1994-2000 Ralf S. Engelschall + ## Copyright (c) 1994-2001 Ralf S. Engelschall ## Originally written for ePerl, rewritten from scratch for shtool ## @@ -2461,7 +2465,8 @@ s ) typnum=15; levnum=255 ;; # snapshots are special esac hex=`echo "$ver:$rev:$typnum:$levnum" |\ - awk -F: '{ printf("0x%X%02X%1X%02X", $1, $2, $3, $4); }'` + awk -F: '{ printf("0x%x%02x%1x%02x", $1, $2, $3, $4); }' |\ + tr 'abcdef' 'ABCDEF'` ltv=`echo "$ver:$rev:$typnum:$levnum" |\ awk -F: '{ printf("%d:%d", $1*10 + $2, $3*10 + $4); }'` @@ -2534,7 +2539,7 @@ vGNU="${name} ${triple} (${tim})" vWeb="${name}/${triple}" vSCCS="@(#)${name} ${triple} (${tim})" - vRCS="\$Id: shtool,v 1.3 2000/07/03 14:15:16 rse Exp ${name} ${triple} (${tim}) \$" + vRCS="\$Id: shtool,v 1.4 2001/02/12 14:50:12 rse Exp ${name} ${triple} (${tim}) \$" # determine string out of filename # (do NOT try to optimize this in any way because of portability) @@ -2627,6 +2632,23 @@ echo >>$file "1;" echo >>$file "" ;; + python ) + echo >>$file "##" + echo >>$file "## ${file} -- Version Information for ${name} (syntax: Python)" + echo >>$file "## [automatically generated and maintained by GNU shtool]" + echo >>$file "##" + echo >>$file "" + echo >>$file "class ${prefix}version:" + echo >>$file " v_hex = ${vHex}" + echo >>$file " v_short = \"${vShort}\"" + echo >>$file " v_long = \"${vLong}\"" + echo >>$file " v_tex = \"${vTeX}\"" + echo >>$file " v_gnu = \"${vGNU}\"" + echo >>$file " v_web = \"${vWeb}\"" + echo >>$file " v_sccs = \"${vSCCS}\"" + echo >>$file " v_rcs = \"${vRCS}\"" + echo >>$file "" + ;; * ) echo "$msgprefix:Error: invalid argument to option \`-l': \`$opt_l'" 1>&2 exit 1 ;; @@ -2637,7 +2659,7 @@ path ) ## ## path -- Deal with program paths - ## Copyright (c) 1998-2000 Ralf S. Engelschall + ## Copyright (c) 1998-2001 Ralf S. Engelschall ## Originally written for Apache ## @@ -2687,7 +2709,7 @@ # MAGIC SITUATION # Perl Interpreter (perl) - if [ ".$opt_m" = .yes ] && [ ".$namelist" = .perl ]; then + if [ ".$opt_m" = .yes -a ".$namelist" = .perl ]; then rm -f $tmpfile touch $tmpfile found=0 @@ -2696,7 +2718,7 @@ dir=`echo $dir | sed -e 's;/*$;;'` nc=99 for name in perl perl5 miniperl; do - if [ $minusx "$dir/$name" ] && [ ! -d "$dir/$name" ]; then + if [ $minusx "$dir/$name" -a ! -d "$dir/$name" ]; then perl="$dir/$name" pv=`$perl -e 'printf("%.3f", $]);'` echo "$pv:$pc:$nc:$perl" >>$tmpfile @@ -2717,7 +2739,7 @@ # MAGIC SITUATION # C pre-processor (cpp) - if [ ".$opt_m" = .yes ] && [ ".$namelist" = .cpp ]; then + if [ ".$opt_m" = .yes -a ".$namelist" = .cpp ]; then echo >$tmpfile.c "#include " echo >>$tmpfile.c "Syntax Error" # 1. try the standard cc -E approach @@ -2733,7 +2755,7 @@ # 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 "$path/cpp" ] && [ ! -d "$path/cpp" ]; then + if [ $minusx "$path/cpp" -a ! -d "$path/cpp" ]; then cpp="$path/cpp" break fi @@ -2762,7 +2784,7 @@ # iterate over paths for path in $paths; do path=`echo $path | sed -e 's;/*$;;'` - if [ $minusx "$path/$name" ] && [ ! -d "$path/$name" ]; then + if [ $minusx "$path/$name" -a ! -d "$path/$name" ]; then if [ ".$opt_s" != .yes ]; then echo "$path/$name" fi From ossp-cvs-owner@ossp.org Mon Feb 12 19:08:01 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f1CI80h33288; Mon, 12 Feb 2001 19:08:00 +0100 (CET) Date: Mon, 12 Feb 2001 19:08:00 +0100 (CET) Message-Id: <200102121808.f1CI80h33288@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/petidomo/config petidomo.conf Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 12-Feb-2001 19:08:00 Branch: HEAD Handle: 2001021218080000 Modified files: ossp-pkg/petidomo/config petidomo.conf Log: The sample config file should contain the -i parameter at the MTAOptions, not the -v parameter, which does not make any sense here at all and probably was a typo to begin with. Summary: Revision Changes Path 1.9 +4 -4 ossp-pkg/petidomo/config/petidomo.conf ____________________________________________________________________________ Index: ossp-pkg/petidomo/config/petidomo.conf ============================================================ $ cvs diff -u -r1.8 -r1.9 petidomo.conf --- ossp-pkg/petidomo/config/petidomo.conf 2001/01/20 13:58:45 1.8 +++ ossp-pkg/petidomo/config/petidomo.conf 2001/02/12 18:08:00 1.9 @@ -1,5 +1,5 @@ # -# $Header: /e/ossp/cvs/ossp-pkg/petidomo/config/petidomo.conf,v 1.8 2001/01/20 13:58:45 simons Exp $ +# $Header: /e/ossp/cvs/ossp-pkg/petidomo/config/petidomo.conf,v 1.9 2001/02/12 18:08:00 simons Exp $ # # TAG: Hostname @@ -44,9 +44,9 @@ # This entry sets the options which will be handed over to the MTA # when it is called. The following example # -# MTAOptions "-odq -v -f%s" +# MTAOptions "-odq -i -f%s" # -# will yield a call " -odq -v -f". The '%s' is +# will yield a call " -odq -i -f". The '%s' is # replaced with the envelope the mail should be sent under. If you # set this this option, be sure to include the '%s' tag or Petidomo # will terminate with an error, because it depends on setting the @@ -55,7 +55,7 @@ # In 99% of all cases you won't need to set this option and should # leave it alone. # -# The default, if the option is unset, is the string '-f%s'. +# The default, if the option is unset, is '-i -f%s'. #MTAOptions "-i -f%s" # TAG: ListDirectory From ossp-cvs-owner@ossp.org Mon Feb 12 20:18:20 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f1CJIJm39423; Mon, 12 Feb 2001 20:18:19 +0100 (CET) Date: Mon, 12 Feb 2001 20:18:19 +0100 (CET) Message-Id: <200102121918.f1CJIJm39423@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/petidomo/docs .cvsignore Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 12-Feb-2001 20:18:19 Branch: HEAD Handle: 2001021219181900 Modified files: ossp-pkg/petidomo/docs .cvsignore Log: Added petidomo.ps to the list of ignored files. Summary: Revision Changes Path 1.2 +1 -4 ossp-pkg/petidomo/docs/.cvsignore ____________________________________________________________________________ Index: ossp-pkg/petidomo/docs/.cvsignore ============================================================ $ cvs diff -u -r1.1 -r1.2 .cvsignore --- ossp-pkg/petidomo/docs/.cvsignore 2001/01/20 11:00:17 1.1 +++ ossp-pkg/petidomo/docs/.cvsignore 2001/02/12 19:18:19 1.2 @@ -1,4 +1 @@ -petidomo.log -petidomo.aux -petidomo.dvi -petidomo.toc +petidomo.log petidomo.aux petidomo.dvi petidomo.ps petidomo.toc From ossp-cvs-owner@ossp.org Mon Feb 12 20:23:16 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f1CJNFk40057; Mon, 12 Feb 2001 20:23:15 +0100 (CET) Date: Mon, 12 Feb 2001 20:23:15 +0100 (CET) Message-Id: <200102121923.f1CJNFk40057@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/petidomo config-files.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 12-Feb-2001 20:23:15 Branch: HEAD Handle: 2001021219231500 Modified files: ossp-pkg/petidomo config-files.c Log: Fixed the incorrect default path to the help file. Summary: Revision Changes Path 1.4 +2 -2 ossp-pkg/petidomo/config-files.c ____________________________________________________________________________ Index: ossp-pkg/petidomo/config-files.c ============================================================ $ cvs diff -u -r1.3 -r1.4 config-files.c --- ossp-pkg/petidomo/config-files.c 2001/01/20 13:58:45 1.3 +++ ossp-pkg/petidomo/config-files.c 2001/02/12 19:23:15 1.4 @@ -1,6 +1,6 @@ /* $Source: /e/ossp/cvs/ossp-pkg/petidomo/config-files.c,v $ - $Revision: 1.3 $ + $Revision: 1.4 $ Copyright (C) 2000 by CyberSolutions GmbH, Germany. @@ -37,7 +37,7 @@ static char* master_password = NULL; static char* mta = NULL; static char* mta_options = "-i -f%s"; -static char* help_file = DATADIR "/petidomo.conf"; +static char* help_file = DATADIR "/help"; static char* acl_file = SYSCONFDIR "/petidomo.acl"; static char* index_file = LOCALSTATEDIR "/index"; static char* list_dir = LOCALSTATEDIR "/lists"; From ossp-cvs-owner@ossp.org Mon Feb 12 20:23:53 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f1CJNqu40127; Mon, 12 Feb 2001 20:23:52 +0100 (CET) Date: Mon, 12 Feb 2001 20:23:52 +0100 (CET) Message-Id: <200102121923.f1CJNqu40127@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/petidomo/docs petidomo.tex Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 12-Feb-2001 20:23:52 Branch: HEAD Handle: 2001021219235100 Modified files: ossp-pkg/petidomo/docs petidomo.tex Log: Started a complete rewrite of the user manual. So far, the installation process is covered. Other things will follow. Summary: Revision Changes Path 1.3 +402 -1805 ossp-pkg/petidomo/docs/petidomo.tex ____________________________________________________________________________ Index: ossp-pkg/petidomo/docs/petidomo.tex ============================================================ $ cvs diff -u -r1.2 -r1.3 petidomo.tex --- ossp-pkg/petidomo/docs/petidomo.tex 2000/12/13 14:24:03 1.2 +++ ossp-pkg/petidomo/docs/petidomo.tex 2001/02/12 19:23:51 1.3 @@ -2,1888 +2,485 @@ % % Petidomo Manual % -% $Header: /e/ossp/cvs/ossp-pkg/petidomo/docs/petidomo.tex,v 1.2 2000/12/13 14:24:03 simons Exp $ +% $Header: /e/ossp/cvs/ossp-pkg/petidomo/docs/petidomo.tex,v 1.3 2001/02/12 19:23:51 simons Exp $ % \typearea[2cm]{12} -\usepackage{graphicx} -\usepackage{lastpage} -\usepackage{fancyhdr} -\pagestyle{fancy} -\lhead{\sl The Petidomo Mailing List Manager} -\chead{} -\rhead{Page \thepage\ of \pageref{LastPage}} -\lfoot{} -\cfoot{} -\rfoot{} -\fancypagestyle{plain}{} \fussy -% -% Self-defined macros -% -\newcommand{\PetidomoM}{{\scshape Peti\-domo Mail\-ing List Ma\-nager}} -\newcommand{\Petidomo}{{\scshape Peti\-domo}} -\newcommand{\PetidomoTwo}{{\scshape Peti\-domo 2.2}} -\newcommand{\Def}[1]{{\sl #1}} -\newcommand{\file}[1]{{\sf #1}} - -% -% Begin of document -% \begin{document} - -% -% Titlepage -% \title{The Petidomo Mailing List Manager} -\author{Peter Simons $<$simons@petidomo.com$>$} -\date{March, 7th 1999} +\author{Peter Simons $<$simons@computer.org$>$} +\date{February 2001} \maketitle -% -% Table of contents -% \tableofcontents \clearpage -% -% Begin of actual text -% -\chapter{Introduction} - -Congratulations. Obviously you are a clever person. Not only -did you choose the \PetidomoM\ to run your mailing lists, you also -decided to read the user manual. I really appreciate that, mostly -because I strongly dislike writing user manuals and it gives the whole -process at least some sense that someone actually reads it. - -For a start, I think, I will bore you with a few historical facts, -which you can absolutely afford to skip if you're in a hurry. What you -probably are. I'll recount the story of \Petidomo\ nonetheless. - -\section{History of Petidomo} - -Thanks to using version control systems consequently, I was able to -determine that I started working on \Petidomo\ exactly at fourty -minutes after midnight on the December 26th, 1993. I was in desperate -need of a mailing list server for my Amiga computer and so I queried -``archie'' for source codes. (Does anybody remember the days when -``archie'' was still popular?) - -What I found was a Unix package called ``Listserv'', which implemented -some basic functionality like subscribing and unsubscribing a mailing -list automatically. Unfortunately there are many differences between -Unix and the AmigaOS, which my computer had. It took until January -9th, 1994 before I had a running version of the program and not even -the small number of commands the Unix version originally had worked. - -Anyway, I had my mailing list server and eventually I was able to -release it to the public under the name ``AmigaListserv''. Since it -was the only mailing list server in existance for the Amiga platform, -it became pretty popular after a while and I was flooded with bug -reports, enhancement requests, proposals of marriage and insults of my -general ability to program. So I turned the project into a shareware -product and spent countless hours improving the code and adding new -features. If I remember correctly, I was able to bring two more major -releases out until I had reached ``AmigaListserv version 3.0''. - -At some point, though, I became more and more discontend with the -abilities of the Amiga's operating system as an Internet server and at -last I switched to Unix. After looking at various mailing list servers -for the Unix operating system and disliking them thoroughly, I started -porting my own program back to Unix, where it came from originally. - -It took quite a while before I had a running version again, but on -December 30th, 1995 ``Listserv 4.0 beta'' took over my mailing lists on -Unix. Needless to say that porting a souce code between two different -systems twice leaves traces behind. The source code was a mess and the -number of recursive defines, redefining what other defines had been -redefined before had increased beyond the point where you call a -source code ``spaghetti code''. - -Nonetheless, around May 1996 I faithfully release the 1.0 version to -the public under GNU General Public License and waited for feedback. -The first mail that arrived after my announcement in the USENET-news -was a mail from an L-Soft employee who told me that I would be sued if -I wouldn't change the name of my package, because they were selling a -program called ``LISTSERV'' for years already and had protected the -name. - -So I renamed my package to ``\Petidomo\ 1.0'' and released it again. - -The number of installations \Petidomo\ quickly had, and the number of -positive feedback I received exceeded my expectations by far. Clearly, -I must have been doing something right, if a serious number of people -preferred my package over the way more powerful alternatives for Unix, -like Majordomo, Smartlist, Procmail and LISTSERV. - -Again I started improving the functionality, cleaning up the code, -making it more portable and stable and so on\dots{} \Petidomo\ reached -release number 1.3 on December 27th, 1996, almost exactly three years -after I started working on the very first version. - -\Petidomo\ 1.3 was a widely used and appreciated package, it was stable, -very portable, easy to understand and to maintain and it was all in -all pretty neat. So I deleted all the source codes and started -re-writing it from the scratch. - -Don't ask why, programmers do these things occasionally. - -The result of this effort is \PetidomoTwo, as you can see. The 2.1 -version exceeds \Petidomo\ 1.x's functionality and power in absolutely -every aspect, while being even easier to setup and to maintain. Not a -single line of code from the original 1.x version was used and the -benefit of this is a very modern and efficient design that I am quite -proud of. - -Some people are disappointed that the 2.1 version is a commercial -product now, but too much time and effort has been put into it to give -it away for free, I am afraid. But I think the ``free for -non-commercial use'' clause is fair for everybody. - -Well, thanks for bearing with me during all this gossip, but I felt -obligated to tell this story. - -And now have fun with the technical part of the manual and I hope you -like my program. - -\section{Acknowledgments} - -Many people contributed to the development of \Petidomo\ directly or -indirectly, and we would like to thank everybody for their help at -this point. - -Hey, all you beta testers: This paragraph is for you. I bet you still -can't believe that there's an actual manual for \Petidomo\ available -now. Be assured of our deep respect and gratitude for managing to use -a software package that was sometimes unstable and weird, and always -undocumented except for a totally outdated README file. - -A big ``thank you'' to Markus Fleck of the University of Bonn for -providing us with an FTP mirror of the \Petidomo\ Beta distributions. - -\begin{sloppypar} -Furthermore, our appreciation to Gray Watson for writing the excellent -``argv'' and ``dmalloc''-libraries, which have been used in the -\PetidomoM\ during the beta testing phase. -\end{sloppypar} - -And last, but not least, the developers would like to thank the team -of CyberSolutions~GmbH for their support during the development, -for taking over all the marketing stuff while we were programming and -for providing the Internet WWW server for \Petidomo. - -\chapter{What is a mailing list anyway?} - -This chapter is meant as an introduction into the principles of -mailing lists, the way a mailing list server works and the terminology -commonly used in this context. For the beginner, it is recommended to -read this chapter carefully, as many of the terms used in the rest of -the manual will be explained here. Advanced readers can safely skip -this chapter because it does not describe the \Petidomo\ mailing list -server in particular and is not relevant for configuring and using the -package. - -\bigskip - -Electronic mail is still the most-used service in the Internet, and -not the WWW, as one might expect. It use it for causual conversations -between people all over the world, for discussions of all kind of -topics, for transmitting data files through the net or for -distributing information amongst colleagues in a world-wide company. -Even in Intranets electronic mail is very useful, because it is quick, -easy to archive and reliable. - -Electronic mail is not limited to conversations between only two -peers. A mail may have several recipients unlike a paper letter. -Hence, discussions between groups of people can be held with this -media easily. Everybody sends the mail to all persons involved in the -discussion and everybody can reply in a way that all others see his -text, too. - -For larger groups of people, though, this becomes inconvenient. When -exchanging e-mail in a larger group of recipients, people tend to -accidently forget persons in the list of recipients, they send their -replies to the wrong person, they have to keep their aliases -up-to-date for the mail to reach the person, etc\dots{} - -To remedy these shortcomings, the idea of the mailing list was -developed. A mailing list is \Def(hosted) on a central server, which has the addresses of the people who -are on that mailing list. Then a special account is created, called -the \Def{mailing list address}, to which people can send the mail they -want to be distributed to all receivers. - -\begin{figure}[bth] -\begin{center} -\includegraphics{ml-principle1.eps} -\caption{A mail is posted to the mailing list.} -\end{center} -\end{figure} - -The machine accepts the mail, looks up the list of addresses in the -list, and re-sends the mail to all those people. If one of the persons -on the list wants to reply to a mail he or she has received via the -mailing list, he or she sends the reply to the mailing list address -again and it is automatically distributed among all recipients again. - -The list of addresses on the machine hosting the mailing list is -called the \Def{list of subscribers} and a person who is on that list -is consequently called a \Def{mailing list subscriber}. The process of -sending an e-mail to the special address with the intention to get it -distributed to all subscribers is called \Def{posting to a list}. - -\begin{figure}[bth] -\begin{center} -\includegraphics{ml-principle2.eps} -\caption{A subscriber replies to the mail.} -\end{center} -\end{figure} - -The advantage of this setup is that each subscriber only has to know -the address of the mailing list and not all the addresses of all the -subscribers. In fact, a subscriber doesn't even have to know who is -subscribed to the mailing list at all. - -Imagine the company you're working for would have a mailing list where -all employees are subscribed with their current e-mail address. The -mailing list address would then be, say, -``all-employees@enterprise.com''. If you'd like to inform all your -colleagues about an important happening, you'd simply send an e-mail -to that address and everybody would receive it. If a person leaves the -company, or a new employee comes to the company, only the list of -subscribers on the mailing list server has to be updated and -everything would work fine. - -Basically, this is what a mailing list server does: It is nothing more -than a program that stores a list of addresses, receives mail under a -special mailing list address and then re-sends the mail to all -subscribers. - -Of course you're not limited to one mailing list, you can host as many -as you like. Not only a list for all employees, but also discussion -forums for the management of the company, for all members of a certain -department or all the left-handers. Privately, you can use mailing -lists to discuss your favourite hobby with other interested people, -you can spread basketball statistics or the latest version of a -program all the subscribers are using. There's no limitation. Whenever -a group of people has to exchange electronic mail on a regular basis, -a mailing list is a good way to do it. - -\bigskip - -As you can probably imagine, the task of keeping the list of -subscribers up-to-date becomes a bit difficult when the number of -subscribe addresses grows beyond a few dozen, because people tend to -change their e-mail addresses from time to time, for various reasons. -On a mailing list for a thousand subscribers from all over the world, -the maintainer of the list would probably spend most of his time -editing the list file, removing or adding addresses. - -That is why \Petidomo\ allows people to do that themselves. -Additionally to the part that re-sends the mail to all subscribers, -there's a program included in the package that understands a number of -commands, like ``subscribe'' or ``unsubscribe''. - -If you want to have your address added to a mailing list, you do not -contact the maintainer of the list, but you send an e-mail to -\Petidomo\ and put the command ``subscribe'' into the mail. \Petidomo\ -will then add your address to the list automatically. Not only is this -easier and more convenient for you, it is also a lot faster. Usually, -\Petidomo\ will process a subscription request for a mailing list in a -tenth of a second, 24 hours a day, while a human maintainer of the -list would probably need several hours or even days to cope with the -incoming e-mail. - -Similarly you can remove your address from a mailing list, or you can -change the address you are subscribed under within a few moments and -now human interaction is required. - -So how does this work? It's very easy in fact: The command interpreter -of the mailing list server has a special address, too. This is the -name of the list, with the text ``-request'' append to it. All e-mails -directed to this account will be processed by the server. If, for -example, you want to subscribe to a mailing list with the name -``basketball'', which has the address ``basketball@nba.com'', you'd -send an e-mail to the address ``basketball-request@nba.com'' and put -the word ``subscribe'' in the body of the mail. - -\Petidomo\ would then receive the mail a few moments later, process -it, add your address to the list of subscribers and send you a short -recipt back to let you know that your subscription was successful. - -It is very important that you know the difference between the address -of the mailing list itself, and the program that is maintaining the -list of addresses. If you'd write your mail to ``basketball@nba.com'' ---- to stick with our example --- instead of -``basketball-request@nba.com'', your command would not be processed by -the server but would be re-sent to all subscribers. This is a common -mistake beginners make and it is a particular annoying one, because -the subscribers are bothered with the useless article on the list, and -secondly, because the person who tried to subscribe will not get what -he or she wanted: To be subscribed to the list. - -The type of mailing list we have described so far is known as a -\Def{public mailing list}. That is a list that is open to everyone to -subscribe. Opposed to that is a \Def{closed mailing list}. That is a -mailing list where only certain people may subscribe or where every -subscription requests needs the approval of the list maintainer to -succeed. - -The public mailing list is widely used in the Internet for all kind -discussion forums, while a closed mailing list is typically used by -companies or organizations for maintaining internal forums, that are -not meant for everybody. \Petidomo\ can maintain both kind of lists, -of course, and a number of variations between the public and the -closed list, so it will usually suit your needs just fine. - \chapter{Installing Petidomo} -The installation of the \PetidomoM\ is mostly handled by the script -\file{install.sh}, which is included in the distribution. But before -the script can be run, a few preperations have to be done manually. - -Just follow the steps as described below: - -\begin{enumerate} - -\item Become `root'. You will need super user privileges. - -\item Create a user `petidomo' using vipw(8), - adduser(8) or whatever method your system uses. The user should - not have a valid shell, nor a valid password because it is very - unlikely that anybody ever needs to log in as `petidomo'. The - home directory, though, is of some importance because the - directory you specify here is the base directory for the whole - \Petidomo\ installation. An example entry in \file{/etc/passwd} - looks like this: +The installation of the Petidomo Mailing List Manager is simple and +straight forward; do not be scared by the length of this chapter. +There are many different ways and options how to install it and I have +tried my best to cover \emph{all} of them. If you are not interested +in every little detail, you will be able to skim over most of the text +here. + +\section{Getting it} + + {\sf This section has not been written yet, because the means of + obtaining Petidomo from the Internet are not entirely defined at + the moment. I put all my hope into the most kind Mister + Engelschall to fill in the details here. } + +\section{Building the Binaries} + +Untar the source archive of Petidomo in a directory of your choice +like {\sf /usr/local/src} or your home directory. This will create a +directory called {\sf petidomo-VERSION}, where the ``{\sf VERSION}'' +part is called exactly as in the file name of the tar archive. Change +into this directory. -\begin{verbatim} - petidomo:*:300:300:Petidomo Mailing List Manager: - /usr/local/petidomo:/usr/bin/true -\end{verbatim} - - This means that all files belonging to \PetidomoTwo\ live in the - \file{/usr/lo\-cal/pe\-ti\-domo} tree. The entry in the password file can be - changed at any time. Hence it is very easy to move \Petidomo\ - to a different location or to de-install the whole package. - -\item Create a group `petidomo' and make the `petidomo'-user a member of it. - You should also add all users of your system, that will administrate - the mailing list server. Membership in the `petidomo' group will give - these users full access to all configuration files, so be careful who - to add. - -\item As `root', execute the - install script included in the distribution with `./install.sh' - The script will ask you a couple of questions about your system - and insert the appropriate values in the config files. Ones the - script is finished, your \Petidomo-Installation is complete and - ready to run. - -\end{enumerate} - -If choose not to let the install script create the required aliases -for \Petidomo, you will have to do that manually as described in -section~\ref{aliases} of the manual. - -\section{Logfiles} - -Reading the log files \Petidomo\ writes the single most important -thing you have to do whenever something unexpected happens. Often -enough the problem is very easy to to fix, if you know what the -problem actually is. To support you in locating problems, \Petidomo\ -does extensive logging, espcially in case of an error. - -For this, \Petidomo\ uses the syslog(3) functionality, which is part -of every major Unix derivate today. \Petidomo\ uses the {\tt -MAIL}-facility to log via syslog, so it is recommended, that you check -your \file{/etc/syslog.conf} file, whether you are writing the {\tt -MAIL}-facility into a file or not. Typically an entry in -\file{/etc/syslog.conf} would look like this: -\begin{verbatim} -mail.* /var/log/maillog -\end{verbatim} - -If you are unfamiliar with the syslog-functionality, please read the -following man pages: syslog.conf(5), syslogd(8) and syslog(3). They -explain all the features briefly and you will greatly benefit from the -knowlege --- not only for using \Petidomo, but for maintaining your -whole system. - -\section{Directory Structure} - -\begin{figure}[bth] -\begin{center} -\includegraphics[width=\textwidth]{directory-struct.eps} -\caption{The \Petidomo\ directory structure.} -\label{directory structure} -\end{center} -\end{figure} - -Before we dive into the details configuration of \Petidomo, it is -necessary to describe the directory structure of the package. -\Petidomo's base path, which we call \Def{\~{}petidomo} throughout the -manual, is the home directory of the `petidomo' user. Relative to this -directory, \Petidomo\ accesses its master config file as -\file{etc/petidomo.conf}. This is the so called \Def{master config -file}, which sets globally required options such as the path to the -mail transport agent (MTA), the fully qualified domain name of the -machine, \Petidomo\ is running on, etc\dots{} - -Each list now has a config file of its own, where various settings are -configured that are valid only for that list locally. All mailing -lists live in the path \file{lists/$<$listname$>$}, with ``$<$listname$>$'' -being the name of the mailing list. The config file for the mailing -list ``testlist'' can congruously be found under the path -\file{lists/testlist/config}, relative to the base directory of -course. - -\section{The Config Files} - -We will describe the master config file first now, followed by the -options you can set on a per-list basis. - -\subsection{Config File Syntax} - -All configuration files in the \Petidomo-package\label{Config file -format}, have the following format: -\begin{verbatim} -keyword parameter -\end{verbatim} - -The ``keyword''-part must start at the first column of the line and is -followed by one or several blanks or tabs. The first non-blank -character then is interpreted as the parameter for this keyword. The -following line, for example: -\begin{verbatim} -Hostname petidomo.is.great -\end{verbatim} -will tell \Petidomo\ that the name of the machine it is running on is -called ``petidomo.is.great''. If the parameter contains any blanks, -what is not very likely for a hostname, but may happen with other -settings, you should enclose it in double quotes, like this: +Now you have to run the configure script +\begin{quote} \begin{verbatim} -AdminPassword "open sesame" +./configure \end{verbatim} - -Quoting the parameter is not strictly necessary, though, \Petidomo's -config file parser will get it right anyway. You only have to quote -the parameter, if it contains blanks as first or last character, what -is rather unlikely to happen. - -Furthermore all empty lines are ignored. So are lines that start with -a `\#' sign. You can use this for writing comments for the reader into -the config file. - -\subsection{The Master Config File} -\label{master config file} - -\Petidomo\ expects its master config file to be found under -\file{\~{}peti\-do\-mo/etc/pe\-ti\-domo.conf}. The following keywords are -recognized: - - +\end{quote} +which will determine the characteristics of your system and create the +files required to actually build Petidomo. You may provide several +parameters to the script. The interesting ones, including the default +values if unspecified, are: \begin{description} - -\item[Hostname] \hfill ``hostname.domainname'' - -This entry specifies the fully qualified domain name of the machine, -\Petidomo\ is running on. A fully qualified domain name is the -hostname of the machine with the domain name appended with a dot. The -following, for example: -\begin{verbatim} -HostName listserver.foo.bar -\end{verbatim} -would be a valid statement. Normally this option has been set by the -install script correctly already. - -The name you set here is not necessarily the name, \Petidomo\ will use -when delivering mailing list-postings to the subscribers, or when -answering requests, because you can specify a different fully -qualified domain name for every mailing list you host. This is known -as \Def{virtual hosting}. - -This option is \emph{required}. \Petidomo\ will abort with an error, -if the master config file doesn't set it. - -\item[AdminPassword] \hfill ``password'' - -This tag sets the master password, which authenticiates the -administrator of the \PetidomoM. Here is an example: -\begin{verbatim} -AdminPassword "open sesame" -\end{verbatim} -Normally this option has been set by the install script already. - -Please chose this password carefully. Knowledge of the master password -will enable you to access \emph{all} mailing lists running on this -system. -Passwords are compared case-insensitively. That means, that the -passwords ``Open SESAME'', ``open sesame'' and ``OPEN seSAme'' are all -the same. +\item[{-}{-}help] Display the complete list of command line options. -This option is \emph{required}. \Petidomo\ will abort with an error, -if the master config file doesn't set it. +\item[{-}{-}prefix] The the {\sf PREFIX} for all following paths. The +default is {\sf /usr/local}. - -\item[MTA] \hfill \file{/path/to/sendmail} - -The MTA tag tells \Petidomo\ which mail transport agent should be used -to deliver outgoing emails. Normally this option has been set by the -install script already, so you don't need to worry about this anymore. - -An example setting is: -\begin{verbatim} -MTA "/usr/sbin/sendmail" -\end{verbatim} -but \Petidomo\ will run fine with other mail transport agents, too. So -far, the system has been tested with the Allman sendmail, SMail and -qmail without any problems. - -This option is \emph{required}. \Petidomo\ will abort with an error, -if the master config file doesn't set it. - - -\item[MTA\_Options] \hfill ``string'' - -This tag is a bit tricky and in ninety-nine out of hundred cases you -should simply leave this option undefined as it is rarely required -anyway. - -This entry sets the options which will be handed over to the MTA -when it is called. The following example -\begin{verbatim} -MTA_Options "-odq -v -f%s" -\end{verbatim} -will yield a call ``$<$MTA$>$ -odq -v -f$<$envelope$>$''. The `\%s' is -replaced with the envelope the mail should be sent under. - -Adding options to the execution call of the mail transport agent can -be useful to enable or disable certain features for mailing lists -only, while leaving them on for all other mail. The `-odq' setting is -a fine example. This parameter will tell the Allmann sendmail to queue -all mail, instead of trying to deliver it immediately. - -\item[DetachImmediately] \hfill ``yes'' or ``no'' - -This option decides whether \Petidomo\ will run in syncronous or -asyncronous mode. When a part of the package is called, it expects an -incoming email message on standard input, which has usually been -received by the SMTP daemon before. So the daemon will pipe the mail -into the program. - -In syncronous mode, \Petidomo\ will process the mail completely, before -it terminates. Hence, the SMTP daemon has to wait until the whole mail -is processed, before it can terminate itself. This may cause memory -problems at high-load servers, where several dozen, or even hundreds -of emails can arrive at the same time. - -In asyncronous mode, \Petidomo\ will read the mail and then detach -itself. The advantage is that the SMTP daemon can terminate -immediately and doesn't have to wait until \Petidomo\ is finished -processing the mail. The disadvantage is that in case of an error, the -SMTP daemon will not receive the return code from \Petidomo. For -smaller servers, syncronous mode is recommended --- larger servers -should use asyncronous mode. - -To run in syncronous mode, set the parameter to ``no'': -\begin{verbatim} -DetachImmediately no -\end{verbatim} -to run in asyncronous mode, set the parameter to ``yes'': -\begin{verbatim} -DetachImmediately yes -\end{verbatim} +\item[{-}{-}exec-prefix] Set the {\sf EPREFIX} for all following +paths. This is useful in case you want to install binaries into a +different directory hierarchy than normal text files, but usually the +{\sf EPREFIX} is identical to {\sf PREFIX}. The default is {\sf +PREFIX}. + +\item[{-}{-}bindir] Set the directory where the binaries should be +installed. The default is {\sf EPREFIX/bin}. + +\item[{-}{-}libexecdir] Set the directory where executables should be +installed that will be called by Petidomo but not by the user directly +(like posting filters). The default is {\sf EPREFIX/libexec}. + +\item[{-}{-}datadir] Set the directory where read-only +architecture-independent data files should be installed (like the help +file). The default is {\sf PREFIX/share}. + +\item[{-}{-}sysconfdir] Set the directory where read-only +configuration files should be installed. The default is {\sf +PREFIX/etc}. + +\item[{-}{-}localstatedir] Set the directory where modifiable +data files should be installed (like the approve-queue or the mailing +list config files). The default is {\sf PREFIX/var}. -The default, if the option is unset, is to operate syncronously. +\item[{-}{-}mandir] Set the directory where man documentation files +should be installed. The default is {\sf PREFIX/man}. -\item[ShowStatistics] \hfill ``yes'' or ``no'' +\end{description} -\Petidomo\ will append a small signature to all request-mails it -processes. This signature looks like this: +Please note that the directories you specify here are only the default +settings that are compiled into Petidomo. You can modify \emph{all} +paths at run-time via the command line and through the configuration +files. So don't waste to much time figuring out what you want here, +you can change anything later without having to recompile Petidomo. +Finally, here is an example output of the configuration script when +run without any parameters on a Linux machine: \begin{quote} \begin{verbatim} --- - /* - * Listserver software: Petidomo 2.2-beta-2 (non-commercial) - * Server hardware : NetBSD-i386 - * Utilized cpu time : 0.125863 seconds - * Utilized memory : 227 KByte - */ +simons@peti:~/projects/petidomo-4.0b1$ ./configure +Configuring OSSP Petidomo, Version 4.0b1 (18-Jan-2001) +creating cache ./config.cache +checking for gcc... gcc +checking whether the C compiler (gcc ) works... yes +checking whether the C compiler (gcc ) is a cross-compiler... no +checking whether we are using GNU C... yes +checking whether gcc accepts -g... yes +checking for ranlib... ranlib +checking for flex... flex +checking for yywrap in -lfl... yes +checking for bison... bison -y +checking size of unsigned short... 2 +checking size of unsigned int... 4 +checking size of unsigned long... 4 +checking how to run the C preprocessor... gcc -E +checking for ANSI C header files... yes +checking for ssize_t... yes +updating cache ./config.cache +creating ./config.status +creating Makefile \end{verbatim} \end{quote} - -You can switch this behavior off by setting this option to ``no''. - -\end{description} - -\subsection{The list config file} -\label{list config file} -While the master config file sets options which are relevant for the -\Petidomo\ package as a whole, the list config file sets -options which are valid only locally for the mailing list. Each -mailing list expects its local config file to be found at -\file{\~{}petidomo/lists//config}, with ``$<$listname$>$'' -being the name of the mailing list. - -For a description of the config file format, please refer to -section~\ref{Config file format} of the user manual. We will only -describe the various settings here. - +Often, you may want to pass certain flags to the compiler or the +linker to modify the building process. To achieve this, you can set +certain environment variables before calling the configure script. +These variables are: \begin{description} - -\item[ListType] \hfill ``open'', ``closed'' or ``moderated'' - -There are three types of mailing lists \Petidomo\ knows about: ``Open -lists'' (or ``public lists''), ``closed lists'' and ``moderated -lists''. The difference betweem the three types is, who is allowd to -post an article on the mailing list. - -If you want everybody to be able to post to the mailing list, whether -he is subscribed or not, you should set this entry like this: -\begin{verbatim} -ListType open -\end{verbatim} +\item[CC] The name of the C compiler to use. -If you want to allow only postings from people, who are subscribed to -the list, set the entry as follows instead: -\begin{verbatim} -ListType closed -\end{verbatim} - -Or, if you want to allow only a small number of people to post, set -the list to ``moderated'': -\begin{verbatim} -ListType moderated -\end{verbatim} - -Please note that the ``ListType'' tag specifies only who is allowed to -\emph{post}, not who is allowed to subscribe to the list. - -The list type you will usually use is ``open'', at least for a public -mailing list where everybody is free to subscribe. The ``closed'' list -has been added, because open mailing lists are frequently abused by a -few people who use them to distribute commercial advertisement. -Because these people (common known as \Def{Spammer}s) do not actually -subscribe to the list, but merely post their junk to it, their abuse -will be rejected on a closed forum, while all the regular users can -post without any problems. - -The problem is, though, that the distinction between a subscriber and -a non-subscriber is made by the address the e-mail is coming from. -This causes problems when a person is subscribed to a list as -``example@address.net'', but tries to post from a different account -than that one. \Petidomo\ tries to recognize that as far as it can. -It doesn't matter, for example, whether you are posting from -``address@host1.address.net'' or ``address@host2.address.net''. -\Petidomo\ will handle that. But if the article comes from -``example@private.account'', it will be rejected, even though the -sender might be a valid subscriber. - -It depends on the subscribers of the mailing list, whether this is a -problem or not. - -A moderated list, finally, is a list where all postings will be -rejected unless they have a valid password included in the mail. This -type of list is useful for a mailing list that is meant to distribute -certain information to a group of people, but not for discussion. -Everybody, who wants to have an article delivered to the subscribers, -will send it to the mailing list. The list server will then forward -the article to the list maintainer for approval. - -The list maintainer can now either drop the mail, if it doesn't fit -into the list's topic, or he can post it to the list, using the -propper password. How this is done in detail is exlained in -section~\ref{petidomo as admin} of the user manual. - -This option is \emph{required}. \Petidomo\ will abort with an error, -if the list config file doesn't set it. - -\item[AllowPublicSubscription] \hfill ``yes'' or ``no'' - -Set this entry to either ``yes'' or ``no'', depending on whether you -want the mailing list to be open for everybody to subscribe or not. - -If somebody tries to subscribe to a mailing list, which has been set -to ``no'' here, the request will be forwarded to the list -administrator for approval by \Petidomo. - -If this option is unset, the default to allow public subscription. - -\item[AllowAlienSubscription] \hfill ``yes'' or ``no'' - -Please excuse the name of this tag, but no matter how hard we thought, -we were unable to come up with a better name for it. If you have any -suggestions, please send them to $<$simons@petidomo.com$>$. - -Anyway, this option specifies whether it is allowed to subscribe or to -unsubscribe an address not equal to the one, the mail has been sent -from. Set the option to ``yes'' to allow un-/subscribing a different -address, or to ``no'' to disallow it. - -\item[AllowMembersCommand] \hfill ``yes'' or ``no'' - -\Petidomo\ knows a command ``members'' or ``who'', which can be sent -to the server and it will reply with the complete list of subscribed -addresses for the mailing list. This may be useful for list -administrators, but it can be abused easily by spammers, to collect -addresses where to send their unsolicted commercial e-mail to. - -Furthermore, with certain mailing lists it may be undesirable that one -can see ``who else'' is subscribed to that list. That's why this -option has been added. If you set it to ``no'', the -``members''-command will be diabled for this list. (This is also the -default if the option is not specified in the config file.) - -If you set it to ``yes'', the ``members''-comman will work. - -\item[ShowOnIndex] \hfill ``yes'' or ``no'' - -\Petidomo\ allows people to request a list of mailing list running on -the server, using the ``index'' command. While it is generally a good -thing that everybody can look up what mailing lists exist, there are -mailing lists that you don't want to make publically known, such as -internal lists of your company, etc\dots{} - -If you set this option to ``no'', the mailing list will not appear on -the index listing. The default, if this option is unset, though, is -``yes'' --- to show the mailing list. - - -\item[Hostname] \hfill ``hostname.domainname'' - -This options tells \Petidomo\ to use this hostname for the mailing -list, instead of the one configured in -\file{\~{}petidomo/etc/petidomo.conf}. This feature is useful to do -virtual hosting. - -\Def{Virtual hosting} is required when -several mailing lists run on the same server, but they have to look -like they would coming from different machines. Let's use an example: -The internet service provider ``Inter.Net'' offers its customers to -host mailing lists for them. A small software house of the name -``Petiware'' wants to provide a mailing list for all its customers, -but they don't have a dedicated Internet line. - -So they use the service provided by Inter.Net and let them host the -mailing list on their machine. The mailing list server at Inter.Net -has the fully qualified domain name ``mail.inter.net''. Petiware, -though, wants the list to run under the name -``customers@petiware.com'' and \emph{not} ``customers@inter.net'' --- -what would a be misleading. - -So all the mailing list guru from Inter.Net has to do is to set the -entry -\begin{verbatim} -Hostname petiware.com -\end{verbatim} -in the config file of the ``customers'' mailing list -(\file{\~{}peti\-domo/lists/cu\-stomers/config}). \Petidomo\ will now use the -hostname ``peti\-ware.com'' in all mails that are posted to that list, -instead of ``mail.inter.net''. - -You can specify a different hostname for every mailing list, using -this feature. \emph{That} is ``virtual hosting''. Further details on -virtual hosting can be found in section~\ref{virtual hosting and -sendmail} of the user manual. - -If this entry is unset, the name configured in the master config file -will be used as hostname for this mailing list. - -\item[AdminPassword] \hfill ``password'' -\label{list admin password} - -This tag sets the master password, which authenticiates the -administrator of this mailing list. The administrator has special -priviledes, such as deleting other users, overriding access control -restrictions or un-/subscribing users to closed mailing lists. This is -described briefly in section~\ref{petidomo as admin} of the user manual. - -Please note that passwords are always case-insensitive. It is also -worth noting that the master password is always valid as administrator -password for the list, also. - -Leave this entry blank, if you don't want to enable remote -administration of the mailing list. - -\item[PostingPassword] \hfill ``password'' -\label{posting password} - -This tag sets the ``posting password''. The posting password allows to -post an article to a moderated mailing list, but it does not allow any -administration of the list itself. On lists that are of a different -type than moderated, setting a posting password does usually not make -any sense and you can leave this entry unset. - -\item[ReplyTo] \hfill ``email@address.net'' or ``none'' - -This tag controls the `Reply-To:' field, which \Petidomo\ adds to -posted articles before it is delivered to the recipients. Using this -option, you can force \Petidomo\ to insert a `Reply-To:' which points -to a certain address. On a moderated list, for example, you can set -this as follows: -\begin{verbatim} -ReplyTo moderator@address.net -\end{verbatim} -to direct all replies to the posting to the moderator again, -regardless of what address is noted in the `From:' line of the mail. - -If you set ``none'', \Petidomo\ will not add a `Reply-To:' header at -all. - -If this option is unset, \Petidomo\ will to insert a `Reply-To:' -header that directs replies back to the mailing list, so that -subscribers can conveniently post simply by hitting the `reply' -function in their mail reader. - -\item[PostingFilter] \hfill ``bourne shell command'' - -If you specify a posting filter, this program or script will be -started by \Petidomo\ before it sends a posting out to the -subscribers. The programm will receive the article, as it has been -prepared by Petidomo, on standard input and is expected to write the -final version of the mail to standard output. The posting filter can -be used to manipulate the headers for special purposes. - -An example for a postin filter that wouldn't modify the mail at all is -the following: -\begin{verbatim} -PostingFilter /bin/cat -\end{verbatim} +\item[CPPFLAGS] Flags to pass to the preprocesser before compiling a +source code file. -A detailed discussion of posting filters can be found in -section~\ref{using posting filters} of the manual. +\item[CFLAGS] Flags to pass to the compiler when compiling a C source +code file. -If the filter program exits with a returncode not equal to 0 (zero), -\Petidomo\ will not post the article and terminate. +\item[LDFLAGS] Flags to pass to the linker when linking the binaries. - -\item[Archive] \hfill \file{/path/of/archive} - -If this option is set, \Petidomo\ will archive all articles that have -been posted on that mailing list. The parameter for this tag may -either be the name and path of a file or of a directory. - -The path may either be absolute (\file{/var/archive/list}) or relative -(\file{archive}). For relative paths the current directory is the home -directory of the mailing list this option is set for. - -If the ``Archive''-tag is set to a file, \Petidomo\ will append every -posted article to that file. If it is a directory, each posting will -be stored in that directory in a seperate file. - -Creating a mailing list archive is discussed in greater deatil in the -section~\ref{mailing list archives} of the user manual. - -If this option is unset, posted articles will not be archived at all. - \end{description} - -\section{The Binaries} - -The \Petidomo\ package consists of mainly two binaries: -\file{hermes} and \file{listserv}. Both -files are located in the \file{\~{}petidomo/bin} directory. In fact, -``hermes'' and ``listserv'' are the same binary, but they do different -things when called under the appropriate program name, like many other -commands of the Unix operating system do. They are only links of the -\file{petidomo}, which has no purpose -at all, but we thought it would be weird to deliver a package called -\Petidomo\ without actually having a binary of that name in there. -Since these three are all links to the same files, it doesn't consume -any diskspace anyway. - -\subsection{listserv} - -The ``listserv'' program is the tool that handles incoming requests -like subscribing an address to a list, unsubscribing it again or -generating an index of available mailing lists for the server. -``listserv'' will usually not be started from a shell, but from the -sendmail daemon. Further details on that can be found in -section~\ref{aliases} of the user manual. - -\subsection{hermes} - -``hermes'' is the program that processes and delivers an incoming -e-mail. It does not understand any commands but simply takes an e-mail -from the standard input file stream, re-writes the headers a bit and -then calls the mail transport agent with the result to be delivered to -the list of subscribers. - -\section{Aliases} -\label{aliases} - -The binaries of the \Petidomo\ package are usually not called manually -from the shell, but by the mail transport agent. This works as -follows: You create an e-mail account, which serves the purpose of -accepting the incoming e-mail and piping it into the appropriate -binary. - -This is archieved with the ``alias''-function of your mail transport -agent. Most MTAs, like sendmail, have a file where a list of special -account names is given together with the instructions what to do with -any mail received for that account. This file is usually located in -\file{/etc/aliases}. - -One thing, aliases can do is to pipe the mail into a program for -processing. This is the mechanism \Petidomo\ uses. \Petidomo\ requires -you to add the following aliases to your system: -\begin{verbatim} -# -# Mailing List Stuff -# -petidomo-manager: root -petidomo: "|/usr/local/petidomo/bin/listserv" -\end{verbatim} - -The lines starting with the `\#' character are only comments and are -ignored by the mail transport agent. The fourth line, though, is the -first command. It tells the MTA to accept mail for an user of the name -``petidomo-manager'' and to re-direct the e-mail to an user of the -name ``root'' --- the system administrator. - -\Petidomo\ will send notifications of an error and administrative -things like that to the address ``petidomo-manager''. By setting this -alias to a certain user name, you can control who will receive those -mails. - -The next line now tells the MTA to pipe any incoming mail for the user -``petidomo'' into the ``listserv'' program, instead of delivering it -into a mailbox. ``listserv'' will then parse the mail for commands and -react accordingly. Hence, the address people can send their -subscription requests to is ``petidomo@your.host.name''. - -These aliases have been created by the install script, unless you told -it not to, and you don't need to worry about them. - -\bigskip - -Furthermore, each mailing list on your server requires three aliases, -as shown in the example below, which is written for the ``testlist'' -mailing list that comes with the distribution: -\begin{verbatim} -testlist: "|/usr/local/petidomo/bin/hermes testlist" -testlist-request: "|/usr/local/petidomo/bin/listserv testlist" -testlist-owner: petidomo-manager -\end{verbatim} - -The first alias, ``testlist'' is the address to which people can send -their mail in order to post to the mailing list. Any incoming mail for -that account will be piped into the ``hermes'' binary, which will -process the mail and then re-send it to all subscribers of the mailing -list. In order to let ``hermes'' know, for which mailing list the -posting was meant, the parameter ``testlist'' has to be specified on -the command line. If the name of the mailing list was ``foobar'', the -line would look like this: -\begin{verbatim} -foobar: "|/usr/local/petidomo/bin/hermes foobar" -\end{verbatim} - -The second alias is a special request address, to which users can send -their commands. The difference between this address and the -``petidomo'' alias described above is that ``listserv'' is being given -a default listname on the command line. The difference is this: If -``listserv'' receives a mail, which has the command ``subscribe'' in -it, without any further parameters, it will reject the command with an -error, because it doesn't know to which list the sender wants to be -added. - -If the command ``subscribe'' is sent to the ``testlist-request'' -address, though, it will assume that the user wants to be subscribed -to the ``testlist'' mailing list, as this is the default list for this -address. - -The name of this alias should always be the name of the mailing list -with the string ``-request'' appended. Theoretically you could choose -a different name, but this unwritten standard is wide accepted -throghout the Internet for several years now. - -The last alias is the name of the mailing list with the string -``-owner'' appended. This alias points to the person who is -responsible for managing the ``testlist'' mailing list. \Petidomo\ -will send all e-mail concerning the administration of the mailing list -to the address ``listname-owner''. Usually this will ultimately be the -same person as the ``petidomo-manager'', but you are free to direct -mail for this account to somebody else, or to several persons. - -\chapter{Using Petidomo as user} -\label{petidomo as user} - -In this chapter, we will describe the commands, that are -understood by the ``listserv'' program. ``listserv'' is the interface -for the users of the mailing lists, where they can send their requests -to in order to be subscribed to a mailing list, be unsubscribed again -and similar things. The text here is mostly identical with the -default help text that is sent to the user -whenever he or she issues a command that is syntactically incorrect. -This text is stored in the file -\file{\~{}petidomo/etc/help} and can be -customized to fit the requirements of your site. - -User commands always have to be sent to the request address of -the mailing list --- \emph{not} to the mailing list itself. \Petidomo\ -will try to recognize commands that are sent to the mailing list and -redirect them to the ``listserv'' program, but naturally this will not -work in all cases. The address, where requests should be directed to, -is \emph{always} the address of the mailing list with the string -``-request'' appended to the username. If the mailing list is called -``politics@foo.bar'', the appropriate request address is -``politics-requst@foo.bar''. - -Alternatively, commands can always be sent to the address -``peti\-do\-mo@your.ad\-dress'', but the ``-request''-address is preferable, -for the fact that the ``listserv'' will have a default listname for -this address and thus understand a simpler command syntax. - -\section{SUBSCRIBE} - -The ``subscribe'' command will add the address of the user to a -mailing list. When using the ``-request''-address, only the word -``subscribe'' is required for the request to suceed. If the command is -sent to the ``petidomo'' address, the user will have to specify an -additional parameter: The name of the mailing list he or she wants to -be added to, like in the following example: -\begin{verbatim} -subscribe politics -\end{verbatim} - -If the user wants to add an address that is not equal to the one he or -she is sending the e-mail from, the e-mail address will have to be -specified, too: -\begin{verbatim} -subscribe politics joe@foo.bar -\end{verbatim} - -The order in which the e-mail address and the mailing list name are -provided does not matter. Please note that the administrator can -configure \Petidomo\ to disallow un-/subscring other addresses than -the one, the request is sent from, using the -``AllowAlienSubscription'' option in the list's config file. - -The command ``add'' is synonymous to ``subscribe''. - -\section{UNSUBSCRIBE} - -The syntax and usage of the ``unsubscribe`` command are the same as the -``subscribe'' command. The difference is, though, the the user's address -is removed from the mailing list rather than added to it. - -``delete'' and ``remove'' can be used synonymously to ``unsubscribe''. - -\section{INDEX} - -The ``index'' command does not need any parameters. Sending it to the -server will return a list of available mailing lists on this server. -This is useful in case you want to subscribe to a list but can't -remember the exact name anymore. -The commands ``lists'' and ``longindex'' are synonyms to ``index''. - -\section{HELP} - -If the server receives the command ``help'', it will send the file -\file{\~{}peti\-domo/etc/help} back. If ``help'' has a parameter, -\Petidomo\ will check whether this is a valid name of an existing -mailing list, and if it is, it will return the description file for -this mailing list, rather than the help-file. - -\section{MEMBERS} - -The ``members'' command will return the addresses of all subscribers -of the mailing list, if the administrator chose to allow this command. -When ``members' is sent to the ``-request''-address, the default list -will be used by \Petidomo. Otherwise, the name of the mailing list -which's subscribers should be listed, has to be specified as an option -like in the following example: -\begin{verbatim} -members politics -\end{verbatim} - -The command ``who'' can be used synonymously to ``members''. - -\chapter{Using Petidomo as Administrator} -\label{petidomo as admin} - -On the ``other side'' of \Petidomo, from the user's -perspective, is the administrator of the mailing list --- also called -the \Def{mailing list owner}). Each mailing list has an -alias ``listname-owner'' (see section~\ref{aliases}), where the mail -address of the person who is responsible for this mailing list should -be specified. Per default, this is the user who is known as -``petidomo-manager''. But you are free to direct mail for this accoun -to any other person --- or several persons. - -The list owner will receive administrative e-mail from \Petidomo\ in -the following cases: - -\begin{itemize} - -\item When a new user subscribes, or a subscriber removes himself from -the list, a carbon copy of the recipt will be sent to the owner. By -looking at these mails, the owner can check whether a ``subscribe'' or -``unsubscribe'' command looks bogus. He or she can also keep track of -who is on the list and who is not. - -\item If a ``members'' command is received for a mailing list where -this command has been disabled, this will also be forwarded to the -owner. - -\end{itemize} - -These mails are merely for information purposes and do not necessarily -require an action from the admin. There are cases, where the list -owner will receive mails from \Petidomo, though, that require some -kind of reaction. - -\section{Bounces} - -While maintaining mailing list with a larger number of subscribers, it -happens regularly that subscribed addresses become invalid or are -temporarily not reachable. In this case postings will \Def{bounce}. -You will then receive a mail from a mail server telling you, that the -delivery of the mail failed. - -Often, addresses become unreachable due to a misconfiguration of a -machine, so it is not always necessary to remove that address from the -list immediately, but when an addresses bounces for several days in a -row, it is a good idea to delete that address from the mailing list. -You should do that by sending an ``unsubscribe'' command for that -address to the ``-request''-address of the mailing list. - -If you have configured \Petidomo\ to disallow the unsubscription of -addresses not equal to the address the mail is sent from, you will -have to specify your admin password in the mail, to override the -barrier. How this is done is described in section~\ref{approve} later. - -\section{Closed and moderated lists} - -If you have configured a mailing list to reject postings under certain -circumstances, such as a closed or moderated mailing list, these -rejected articles will be forwarded to you for approval. When you -receive such a rejected article, you can either silently -discard it, contact the author or post it to the mailing list with -your approval. - -You can approve an article with the master password for \Petidomo, the -admin password of the mailing list in question or the posting password -(see section~\ref{posting password} of that list. - -\section{Approving requests} -\label{approve} - -To approve an article, you have several ways of specifying the -appropriate password. They are all the same for \Petidomo\ and it is -only a matter of taste, which scheme you use. - -When sending a command to the ``listserv'' program, though the -``-request'' or ``petidomo''-address, it is easy. Just preface your -commands with a ``password'' command, like in the -following example: -\begin{verbatim} -To: testlist-request@foo.bar -Subject: - -password open sesame -subscribe some@one.else -subscribe someone@even.elser -\end{verbatim} - -One ``password'' command sets your password for all the commands to -follow. If you want to use one mail to send requests for several -mailing lists with different passwords, just give a ``password'' -command again: -\begin{verbatim} -To: petidomo@foo.bar -Subject: - -password open sesame -subscribe user@inter.net testlist1 -password let me in -subscribe user@inter.net testlist2 -\end{verbatim} - -Instead of ``password'', you can also use the commands ``passwd'', or -``approve'', they are all synonymous. - -\section{Approving postings} - -If you want to approve a posting for a mailing list, just send the -article to the mailing list and specify your password either in the -header or in the body of the mail. - -If you choose to approve the mail in the body, add line with the -command ``approve'' to the mail as first line of the body. \Petidomo\ -will strip that line before actually posting the article then. You can -also use the synonyms ``approved'', ``password'' or ``passwd'' -instead. Here is an example: -\begin{verbatim} -From: simons@petidomo.com (Peter Simons) -Subject: Cats are the most beautiful animals in the world. - -approve let me post -It's not that I wouldn't like animals like dogs, birds -or fishes, but for me, a cat is *the* animal to have. -[...] -\end{verbatim} - -The line ``approve let me post'' will be stripped by \Petidomo\ and -then the article will be sent out. - -If you want to specify the password in the headers, just add an header -of the name ``Approved'' or ``Approve'' to the headers of the mail. -(Unfortunately, many mail readers do not allow you to modify the -headers of outgoing mail. That is why the body-approval has been -added.) Here is the same example as above now using the headers: -\begin{verbatim} -From: simons@petidomo.com (Peter Simons) -Subject: Cats are the most beautiful animals in the world. -Approve: let me post - -It's not that I wouldn't like animals like dogs, birds -or fishes, but for me, a cat is *the* animal to have. -[...] -\end{verbatim} - -Please note that you have to add a colon to the keyword to make a -valid RFC mail-header. - - -\chapter{The Access Control Language} - -Unfortunately, we live in a world where some people are trying to -abuse services like mailing lists for their entertainment or for -commercial purposes. It is also not uncommon that among thousands of -mailing list subscribers, there is one particular moron who simply -can't behave. That is why access control is a useful feature, even -though it contradicts the idea of a mailing list: To be a media for -communication. - -Writing and understanding ACL files is, to be honest, not very easy -and the novice mailing list administrator should better be careful -when using them, because a wrong access control rule might cause more -trouble than it is worth, but the experienced administrator will -certainly appreciate their power. Understanding how ACL files work -will also require you to know a bit about the syntax of an RFC format -e-mail. A good place to start is to take a look at RFC822 and its -sons. - -In \Petidomo, two places exist to control who is allowed to do what: -The global acl file -\file{\~{}petidomo/etc/acl} and the acl -file that is local to the mailing list: -\file{\~{}petidomo/lists/list\-name/acl}. While the latter is valid only -for the list in which's home directory it is stored, the globl acl -file will be parsed for \emph{all} your mailing lists. ACL files are -only relevant for mailing list postings, the ``listserv'' program does -not use them. - -The syntax of an ACL file is similar to the C programming -language, as you can see in the following example: -\begin{verbatim} -if (envelope matches "mailer-daemon@") then - forward "petidomo-manager"; -\end{verbatim} - -This is a simple version of the default ACL file which comes with the -\Petidomo\ distribution and is installed in -\file{\~{}petidomo/etc/acl}. It tells hermes to forward all postings -to a mailing list, where the envelope of the mail matches the regular -expression ``mailer-daemon@''. This rule is included in the default -distribution to make sure that bounces of articles will not be posted -to the list again, thus causing an infinite mail loop. The syntax of -an ACL statement is shown in figure~\ref{acl syntax}. - -\begin{figure}[bth] -\begin{center} -\begin{tabular}{cccccccccc} -IF & ( & from & match & {\tt "}regexp{\tt "} & ) & THEN & pass & & ; \\ - & & subject & matches & & & & drop & & \\ - & & envelope & == & {\tt "}string{\tt "} & & & reject & & \\ - & & header & = & & & & rejectwith & {\tt "}file{\tt "} & \\ - & & body & & & & & redirect & {\tt "}address{\tt "} & \\ - & & & & & & & forward & {\tt "}address{\tt "} & \\ - & & & & & & & filter & {\tt "}script{\tt "} & \\ -IF & ( & & {\tt "}filter{\tt "} & & ) & THEN & & & ; \\ -\end{tabular} -\caption{The Access Control Language syntax.} -\label{acl syntax} -\end{center} -\end{figure} - -Admittedly, the figure is rather impossible to understand without -further explaination, don't worry if things are still a bit unclear -after looking at it. - -Every ACL statement looks like this: ``IF condition THEN action ;''. -The condition may or may not be enclosed in brackets. Several -conditions can be combined with the keywords ``OR'' and ``AND''. -Furthermore every condition can prefaced with a ``NOT'', which will -reverse the outcome of the condition. - -Let's explain this all at a concrete example: You want to reject all -postings which come from the addresses ``moron@moron.net'' and -``spam@spam.net'', because these people have constantly been abusing -your mailing list service. This can be done with the following two -statements: -\begin{verbatim} -IF from == "moron@moron.net" THEN reject; -IF from == "spam@spam.net" THEN reject; -\end{verbatim} - -Using the ``OR'' statement you can combine this into one statement: -\begin{verbatim} -IF from == "moron@moron.net" OR - from == "spam@spam.net" THEN - reject; -\end{verbatim} - -And now we include brackets for readability: -\begin{verbatim} -IF (from == "moron@moron.net") OR - (from == "spam@spam.net") THEN - reject; -\end{verbatim} - -The keyword ``from'' stands for the address, noted in the ``From:'' -header line of the mail and, the ``== {\tt "}address{\tt "}'' means -that the condition if this address is equal to the one written in -quotes thereafter. (You can also use a single `=' character, if you -prefer that over two equal-characters.) This is a verbatim match. If -we'd use the ``match'' or ``matches'' keyword instead of the ``=='', -the parameter would be interpreted as an extended regular expression -and the condition would be true if the addresses matched this pattern. -(Regular expressions are described in the re\_format(7) man page, or -in the manpages of sed(1), grep(1) or egrep(1).) - -Other keywords than ``from'' for the first part of the conditional are -``subject'' (the contents of the ``Subject:'' header), ``envelope'' -(the envelope of the mail), header and body. The latter two represent -the whole header or body of the mail and should be used only for -regular expression matches and not for verbatim matches. - -A short comment on the difference between ``redirect'' and -``forward'': The ``redirect'' action will send the mail to the -specified address without changing anythin in the mail. All the -headers are left untouched and thus the mail will look as if it has -been sent by the person to that address right away. This is useful for -redirecting mails to daemons or programs, but it will usually confuse -a human recipient - -The ``forward'' action, though, will send a mail to the specified -address with a new set of headers, which identify the \PetidomoM\ as -originator and then it will quote the mail that has been forwarded in -the mail body. - -Valid actions are ``pass'' (post the mail immediately), ``drop'' -(discard the mail without further notice), ``reject'' (send a mail to -the poster, telling him his posting was rejected), ``rejectwith'' -(sending mail to the poster, too, but with the contents of a specified -file), ``redirect'' (redirect the mail to a specified address), -``forward'' (like ``redirect'' but preface the mail with a note -telling why the mail was re-sent) or ``filter'' (pipe the mail into -the specified filter script and post the mail as the filter writes it -to the standard output). - -Here are a few more examples in the hope that they make this all -easier to understand: Let's assume you would like to catch all -postings to your mailing lists, that contain the words ``MAKE MONEY -FAST'' in the subject. Then one way of doing this is the following -statement: -\begin{verbatim} -IF (subejct matches "make money fast") THEN - rejectwith "/usr/local/petidomo/etc/make-money-fast.txt"; -\end{verbatim} - -The file \file{/usr/local/petidomo/etc/make-money-fast.txt} could, for -example, contain the following text: -\begin{quotation} -Dear poster, - -your mail has been rejected. Please note that chain letters like the -``make money fast'' text you tried to post are illegal throughout the -world and your are likely to get in trouble if you continue to spread -them. -\end{quotation} - -If someone tried to post the chain letter to your mailing lists now, -he would receive a mail like that: -\begin{verbatim} -Date: Sat, 28 Jun 1997 19:59:18 +0200 (MET DST) -From: testlist-owner@peti.cys.de (Petidomo Mailing List Server) -To: simons@cys.de -Cc: testlist-owner@peti.cys.de -Subject: Your posting to list "testlist" was rejected -Precedence: junk -Sender: testlist-owner@peti.cys.de - -Dear poster, - -your mail has been rejected. Please note that chain -letters like the ``make money fast'' text you tried -to post are illegal throughout the world and your are -likely to get in trouble if you continue to spread them. - ->From simons Sat Jun 28 19:59:17 1997 -Received: from [[UNIX: localhost]] - by peti.cys.de (8.8.5/8.8.4) id TAA16959 -Date: Sat, 28 Jun 1997 19:59:17 +0200 (MET DST) -Message-Id: <199706281759.TAA16959@peti.cys.de> -From: Peter Simons -To: testlist -Subject: MAKE MONEY FAST -Mime-Version: 1.0 (generated by tm-edit 7.92) -Content-Type: text/plain; charset=US-ASCII - -Hi, my name is David Rodes... -\end{verbatim} - -A few more words about how the ACL files are parsed: -\begin{itemize} - -\item All comparisons are done case insensitive. ``MAKE MONEY FAST'' -matches ``make money fast'' in both the verbatim and the regular -expression match just fine. - -\item Any whitespace in the ACL file is ignored. The statements -\begin{verbatim} -if (envelope matches "mailer-daemon@") then drop; -\end{verbatim} -and -\begin{verbatim} -if - (envelope matches -"mailer-daemon@") -then - drop -; -\end{verbatim} -are the same for \Petidomo. - -\item The argument after the ``=='' or ``matches'' keyword \emph{has} -to be included in quotes. An ACL statement like this: +I personally find this useful to raise the level of compiler +optimization or to add linker flags that tell the linker to strip +unnecessary symbols from the binaries. To achive these effects, I call +the configure script like this: +\begin{quote} \begin{verbatim} -if from == simons@petidomo.com then drop; +CFLAGS=-O3 LDFLAGS=-s ./configure \end{verbatim} -will cause \Petidomo\ to abort with an error, because it can't parse -this. +\end{quote} -\item If you use an action that requires a parameter, like -``rejectwith'' or ``forward'', this parameter has to be enclosed in -quotes, too. A statement like this can also not be parsed by -\Petidomo: +Anyway, once the configure script has been run, just call +\begin{quote} \begin{verbatim} -if from == "simons@petidomo.com" then - forward postmaster@petidomo.com; +make \end{verbatim} +\end{quote} +to start the building process. Petidomo has been tested with various +flavours of the make utility and all of them seem to work fine. If in +doubt, try GNU Make, which is available from {\sf ftp.gnu.org}. + +Petidomo has also been built using parallel builds. This is useful if +you have a multi-processer system. You can do this with most make +utilities by adding the flag ``-j4'' with ``4'' being the number of +processes you want to spawn simultaneously. Please note, though, that +some make utilities have problems with the rules that translate the +yacc-modules included in Petidomo correctly when building in parallel. +If you experience any trouble, just build it conventionally and you +should be fine. -\item \Petidomo\ stops parsing the ACL file after the first statement -has matched. If you want to reject all mails from an address that -matches ``simons@.*\.de'', but you want mails from the address -``simons@rhein.de'' to pass nonetheless, the following two statements -will not work as expected: -\begin{verbatim} -if from matches "simons@.*\.de" then reject; -if from == "simons@rhein.de" then pass; -\end{verbatim} +\section{Installing the Binaries} -Instead you should use +To install the software to your system, all you have to do is execute +\begin{quote} \begin{verbatim} -if from == "simons@rhein.de" then pass; -if from matches "simons@.*\.de" then reject; +make install \end{verbatim} -or +\end{quote} +This will copy the Petidomo binary, the posting filters included in +the distribution, the sample config files and the manual pages into +the directories you chose at configure time earlier. If you're a +first-time user, you may also want to execute +\begin{quote} \begin{verbatim} -if (from matches "simons@.*\.de") and - (not (from == "simons@rhein.de")) then - reject; +make install-testlist \end{verbatim} +\end{quote} +which will create a sample mailing list called ``testlist'' for you. -\item Currently you can't match for the double quote character ({\tt -"}), we're afraid. The escape sequence {\tt \verb+\+"} is not -supported yet. - -\end{itemize} - -One last example and then we'll come to the filters. The following -statement rejectes a mail based on a match in the headers. This is -very useful for rejecting mail from known spam domains. You usually -can't rely on the spammer to use a valid ``From:'' header and hence -the ``from''-match is useless to catch them. But the following -statement will usually get them nonetheless: +Assuming you used the default paths when running configure, the +install process will create the follwing directories, respectively +copy the following files to your system: +\begin{quote} \begin{verbatim} -if (header matches "^Received:.*from spam.domain") then - forward "petidomo-manager"; +/usr/local/ +/usr/local/bin/ +/usr/local/bin/petidomo +/usr/local/bin/petidomo-approve +/usr/local/bin/petidomo-kickout +/usr/local/etc/ +/usr/local/etc/petidomo.acl-sample +/usr/local/etc/petidomo.conf-sample +/usr/local/libexec/ +/usr/local/libexec/petidomo/ +/usr/local/libexec/petidomo/insert-name-in-subject.sh +/usr/local/libexec/petidomo/pgp-decrypt.sh +/usr/local/libexec/petidomo/pgp-encrypt.sh +/usr/local/libexec/petidomo/rfc2369.sh +/usr/local/man/ +/usr/local/man/man1/ +/usr/local/man/man1/petidomo.1 +/usr/local/share/ +/usr/local/share/petidomo/ +/usr/local/share/petidomo/help +/usr/local/var/ +/usr/local/var/petidomo/ +/usr/local/var/petidomo/ack-queue/ +/usr/local/var/petidomo/index +/usr/local/var/petidomo/lists/ \end{verbatim} - -\bigskip - -If you thought, the Access Control Language is powerful so far, take a -look at the things you can do using filters. Rather than the syntax -described below, you can use the following statement: +\end{quote} +If you run the ``install-testlist'' target, the following +directory/files will be created additionally: +\begin{quote} \begin{verbatim} -if ("/usr/local/petidomo/bin/CheckPosting") then reject; +/usr/local/var/petidomo/lists/testlist/ +/usr/local/var/petidomo/lists/testlist/config +/usr/local/var/petidomo/lists/testlist/acl +/usr/local/var/petidomo/lists/testlist/list \end{verbatim} - -This is a special form of the usual ACL statements and it means the -following: The mail in question is piped into the ``CheckPostin'' -script. The script or program can perform various tests and when it -exists, the action part is executed depending on the return code the -script exited with. A return code of zero (0) means ``true'' and the -action will be executed. A return code of one (1) ``false'' and the -action will not be executed. - -Any other return code will cause \Petidomo\ to abort with an error and -to save the mail. By using this mechanism, you can program even the -most sophisticated tests and hook them into the access control -mechanism. - -Another feature that hasn't been described yet is the action -``filter''. The filter-action is pretty much the same as the posting -filter, but it allows you to re-write the posting depending on who -posted it or other criteria. Please note that this filter is executed -additionally to a regular posting filter you might have configured. +\end{quote} -A nice example for what this feature can be used is the following: -\begin{verbatim} -if (address == "simons@petidomo.com") then - filter "/usr/local/petidomo/bin/simons.filter"; -\end{verbatim} +\section{Configuring Sendmail} -The script \file{simons.filter} would then look like this: +Before you can use Petidomo, you have to configure sendmail so that it +knows about Petidomo --- I assume that you have sendmail installed +already. If you are using an MTA other than sendmail, you are on your +own from here on, I am afraid. Any users who have successfully +installed Petidomo on a qmail-, vmailer-, or postfix-based system are +more than welcome to contribute to this documentation to help other +users. + +To run Petidomo via sendmail --- what is what you want to do ---, you +have to create apropriate aliases for it. You can do this by adding +the folling lines to your {\sf aliases} file, which usually resides in +{\sf /etc/aliases} or, with newer sendmail versions, in {\sf +/etc/mail/aliases}: +\begin{quote} \begin{verbatim} -#! /bin/sh - -cat -echo -echo "-- " -echo " Hold your breath -- this is *the* Peter Simons!" +petidomo-manager: postmaster +petidomo: "|/usr/local/bin/petidomo --mode=listserv" +petidomo-approve: "|/usr/local/bin/petidomo --mode=approve" \end{verbatim} - -We resisted the temptation of adding this ACL statement into the -default configuration of \Petidomo. - -% \chapter{Administrating Mailing Lists} -% -\chapter{Miscellaneous Topics} -\section{Using posting filters} -\label{using posting filters} - -The posting filter functionality of \PetidomoTwo\ is a very useful -mechanism for you, if you run mailing lists where you want to -guarantee certain formal criteria, because you can hook a script or -program of your into the posting process and use it to re-format or -re-write the article that is going to be posted. - -We have included one -script into the distribution, -\file{\~{}peti\-domo/bin/Insert\-Name\-In\-Sub\-ject.sh}, which adds a string -into the subject line of every posting. The script is pretty short and -used sed(1) to perform its function. - -To use it, just add the line +\end{quote} +In case you installed the Petidomo binary to some other location, you +will have to change the paths here apropriately of course. You may +also chose that mail for the ``petidomo-manager'' should go to some +different address than ``postmaster'', if that suits your needs +better; the main point is that somebody actually \emph{reads} what +arrives there. + +If executed the ``install-testlist'' target earlier and thus have the +example mailing list from the distribution installed, you may also +want to add the lines: +\begin{quote} \begin{verbatim} -PostingFilter ~petidomo/bin/InsertNameInSubject.sh listname +testlist: "|/usr/local/bin/petidomo --mode=deliver testlist" +testlist-request: "|/usr/local/bin/petidomo --mode=listserv testlist" +testlist-owner: petidomo-manager \end{verbatim} -with ``listname'' being the name of the mailing list. +\end{quote} +Having done all this, execute the {\sf newaliases} utility to rebuild +sendmail's internal database. Your changes will not have any effect +unless you do this. + +\section{Configuring the File Permissions} + +The final step, before Petidomo is successfully installed, is to set +the right permissions to the installation directories and installed +files. Unfortunately, the installation process can not do this +automatically; you have to chose what permissions are ``right'' +yourself. If works like this: Petidomo will be called from sendmail, +thanks to the aliases you just created. That means, that sendmail +determines under what user to start Petidomo. In 99\% of all +configurations I have ever seen, that user is ``daemon'', but it +\emph{may} be something else, so we better figure it out for sure. -If the mailing list name was ``testlist'', for example, then this -posting filter would re-write the subject line -\begin{verbatim} -Subject: Hi everbody -\end{verbatim} -to +Add the line +\begin{quote} \begin{verbatim} -Subject: [testlist] Hi everbody +foobar: "/tmp/foobar-mail" \end{verbatim} - -It is recommended to take a look at the script itself to understand -how this works. You will need a bit of knowledge of the Unix scripting -language and tools like sed(1) to program more complex posting filter, -we're afraid. - -As the last point it should be made clear, that the string you specify -as a filter is interpreted by the bourne shell for execution. It is -thus absolutely possible, to use a posting filter like that +\end{quote} +to your aliases file and execute {\sf newaliases}. Then send an e-mail +to the address ``foobar''. The contents of this mail will be stored in +the file {\sf /tmp/foobar-mail} then and we are interested in the user +who owns this file: +\begin{quote} \begin{verbatim} -PostingFilter "/bin/cat | /bin/cat ; echo ; echo testing" +root@peti:/# sendmail -v foobar $''. - -\item Create a \file{config.txt} file for PGP in -\file{\~{}petidomo/.pgp} and insert the appropriate user id there. - -\item Distribute the newly created PGP key of the mailing list among -the subscribers. - -\item Add the PGP keys of the subscribers to \Petidomo's keyring. - -\item Edit the following definitions in -\file{\~{}petidomo/bin/pgp-encrypt.sh}: - +\end{quote} +See? On my system it is ``daemon'' indeed. On your system it may be +someone else. Now that we know, you may remove the foobar-line from +the aliases file again. + +OK, sendmail starts Petidomo under user id ``daemon''. This means that +``daemon'' must have read access to virtually any file in the Petidomo +installation. This is the default, because all files are installed +with read permisson for everybody. Also, all directories allow access +to anybody by default. But ``daemon'' also needs write access to the +``localstatedir'' --- {\sf /usr/local/var/petidomo} per default. You +can ensure this by executing the command: +\begin{quote} \begin{verbatim} -# -# Please customize these things for your system. -# -PGP=/usr/local/bin/pgp -PASSWORD="DecryptMe" -PGPPATH=$PDHOME/.pgp +chown -R daemon /usr/local/var/petidomo \end{verbatim} - -You will need to change the location of the PGP binary and insert the -password you chose for the secret key. For security reasons, the -script itself should be owned by ``petidomo'' as user- and group id, -and it should have the permission ``110'', so that only Petidomo can -execute it. - -\item Edit the equivalent definitions in -\file{\~{}petidomo/bin/pgp-encrypt.sh}. - -\item Now create the mailing list in question. In our example that -would be ``secretlist''. Naturally the mailing list should not be open -for public subscription. +\end{quote} -\item Edit the ACL file of the ``secretlist'' to contain the following -line: +This is a rather simplistic solution to the permisson problem; you +\emph{can} use much more fine-grained settings if you like to. But I +figured that if you are the kind of person who wants to do things like +this, you won't need an explanation how to do it anyway. Just that +much information for you: Petidomo does not actually write to the +``localstatdir'', but only to the subdirectory {\sf ack-queue} located +in it. + +Of course, you do not necessarily need to have the {\sf ack-queue} +directory owned by ``daemon'', you can also set the group permissions +apropriately. Furthermore, Petidomo will usually want to write to the +{\sf lists} directory located in the ``localstatedir'', because most +list administrators tend to place the mailing list archives there, but +you can enable write access according to the list's configuration once +you know how you're mailing lists are configured. In case something +does not work as expected, check out the syslog messages for the {\sf +LOG\_MAIL} facility --- this is where Petidomo logs its error messages. + +\section{Configuring Petidomo} + +The last step before we can test our installation is to configure +Petidomo. This is really simple. List the contents of the +``sysconfdir'' you chose. If you did not change the default paths, +this is {\sf /usr/local/etc}. There you will find two files: {\sf +petidomo.conf-sample} and {\sf petidomo.acl-sample}. Just rename them +to {\sf petidomo.conf} and {\sf petidomo.acl} respectively and fire up +your favorite text editor to edit the file {\sf petidomo.conf}. + +Uncomment the options ``Hostname'', ``AdminPassword'', and ``MTA'' and +set the values correctly. ``Hostname'' should be the fully qualified +domain name of the machine running Petidomo. It is essential that this +name can receive e-mail, that is, that is has an MX record. (Talk to +the person administrating the domain name service of your organization +if this doesn't make any sense to you.) As ``AdminPassword'', you can +chose pretty much any text you like, just make sure you remember it. +The ``MTA'' setting will usually be alright the way it is. You may +want to check whether sendmail does actually live at this path; on +some Unixes, it is not installed at {\sf /usr/sbin/sendmail}, but at +{\sf /usr/lib/sendmail}. Change the setting if this is the case. You +can ignore all other settings right now. Come back and configure those +once you have read the apropriate sections of this manual. If you're +an experienced Unix wizard, the comments in the config file will +probably be enough for you to guess what these options do, though. + +Once you have done this, your installation is ready to be tested. + +\section{Testing the Installation} + +Asserting you followed all steps described above, you have a working +Petidomo installation now. Occasionally, some minor permisson problem +may still remain to be fixed, or you may want to customize some texts. +To figure out what is left to do (or to realize that there is nothing +left do to), send an e-mail to the ``petidomo'' user on your machine +and put the word ``help'' into the mail body --- without the quotes of +course. +On my system, this looks like this: +\begin{quote} \begin{verbatim} -if (body matches "^-----BEGIN PGP MESSAGE-----$") then - filter "~petidomo/bin/pgp-decrypt.sh"; +simons@peti:~/projects/petidomo$ echo help | sendmail -v petidomo +petidomo... aliased to "|/usr/local/bin/petidomo --mode=listserv" +"|/usr/local/bin/petidomo --mode=listserv"... Connecting to prog... +"|/usr/local/bin/petidomo --mode=listserv"... Sent \end{verbatim} - -\item Edit the config file to have the following posting filter: +\end{quote} +Once you sent the e-mail, sendmail will start up Petidomo and feed the +mail text into it for processing. If you take a look at the syslogfile +containing the {\sf LOG\_MAIL} facility now --- this is usally {\sf +/var/log/messages} or {\sf /var/log/maillog} ---, you will find that +Petidomo logged entries there that look pretty much like the following +ones. The backslash (``\verb#\#'') characters at the end of some of +these lines denote that the line has been wrapped for readability. In +reality, this would be one single large line. +\begin{quote} \begin{verbatim} -PostingFilter "~petidomo/bin/pgp-encrypt.sh secretlist" +sendmail[8705]: f1CIHWJ08705: from=simons, size=5, class=0, \ + nrcpts=1, msgid=<200102121817.f1CIHWJ08705@peti.cryp.to>, \ + relay=simons@localhost +petidomo[8706]: Petidomo 4.0b1 (18-Jan-2001) starting up; \ + mode=listserv, listname=, \ + masterconf=/usr/local/etc/petidomo.conf, \ + approved=false, ruid=2, euid=2, gid=2, egid=2 +petidomo[8706]: simons@peti.cryp.to: help +sendmail[8707]: f1CIHX508707: from=petidomo-manager@peti.cryp.to, \ + size=2091, class=-100, nrcpts=1, \ + msgid=<200102121817.f1CIHX508707@peti.cryp.to>, \ + relay=daemon@localhost +sendmail[8705]: f1CIHWJ08705: \ + to="|/usr/local/bin/petidomo --mode=listserv", \ + ctladdr=petidomo (2/0), delay=00:00:01, xdelay=00:00:01, \ + mailer=prog, pri=30005, dsn=2.0.0, stat=Sent +sendmail[8709]: f1CIHX508707: to=simons@peti.cryp.to, delay=00:00:00, \ + xdelay=00:00:00, mailer=local, pri=212091, dsn=2.0.0, stat=Sent \end{verbatim} +\end{quote} -Please note that you must provide the name of the mailing list on the -command line as parameter to \file{pgp-encrypt.sh}, so that it know -which list file it should take the subscriber addresses from. - -\item Do a test posting and that's it. - -\end{enumerate} - -There are a few things you should take care of: First of all, you must -make sure that you have the PGP public keys of all subscribers in the -keyring belonging to the ``petidomo'' user, or some of them won't be -able to decipher the mail posted via the list. You must also take care -that the addresses these people are subscribed under, are actually -listed in their public key, or PGP won't be able to recognize who is -who, when being called by \file{pgp-encrypt.sh}. - -Finally, make sure that you do this only with the correct versions of -the software. \Petidomo\ needs to be version 2.1 or later, earlier -versions won't work. The PGP binary needs to understand the {\tt -@} -operator on the command line, which has been added in PGP 2.6i at some -time. - -One last hint: If PGP-encryption or decryption doesn't work, it will -usually help to remove the {\tt \$LOGFILE} parameter from the {\tt -trap} command in the scripts: +As you can see, Petidomo logged how it was started, where it is +expecting its master config file and under which user- and group id it +is running. Then it logs that it has received a HELP request. This +request will be answered by sending the file {\sf +/usr/local/share/petidomo/help} back to the person who requested help, +and if everthing worked, you will now find that mail in your mail box. + +If something went wrong, Petidomo will tell you what went wrong. So, +please fix the problem and try again. In 99\% of all cases, the error +will say something like ``opening file XYZ failed: permission +denied''. Then all you have to do is to make sure that the user under +which Petidomo has been started (you have the numeric id in the +logfile) has read access to that file. If the user has but Petidomo +keeps complaining, check, whether that user has access to the +directory at all! + +Those of you who executed the ``install-testlist'' target earlier in +the ``Building the Binaries'' chapter may also want to test whether +this mailing list is working. To do so, send another mail to Petidomo +and put the command ``subscribe YOUR-ADDRESS testlist'' in the mail +body --- without the quotes! ``YOUR-ADDRESS'' naturally means that you +should insert your e-mail address here. This command will subscribe +your e-mail address to the ``testlist'' mailing list; you should +receive a confirmation about that via e-mail within moments. Once that +is accomplished, send another e-mail to the ``testlist'' address on +your system. The e-mail may look like whatever you want. + +Within seconds, you should get the mail back from the mailing list +server --- and so will all other addresses that are subscribed to the +list. My personal test mail looked like this: +\begin{quote} \begin{verbatim} -trap 'rm -f $TMPFILE $HEADER $BODY $NEWBODY $LOGFILE; exit'... - ^^^^^^^^ -\end{verbatim} +From testlist-owner@peti.cryp.to Mon Feb 12 19:43:56 2001 +Received: (from daemon@localhost) + by peti.cryp.to id f1CIhuA08872 for simons@peti.cryp.to; + Mon, 12 Feb 2001 19:43:56 +0100 +Received: (from simons@localhost) + by peti.cryp.to id f1CIhJY08853 for testlist; + Mon, 12 Feb 2001 19:43:19 +0100 +Date: Mon, 12 Feb 2001 19:43:19 +0100 +From: Peter Simons +Message-Id: <200102121843.f1CIhJY08853@peti.cryp.to> +Subject: Petidomo absolutely rules the known earth! +Reply-To: testlist@peti.cryp.to +Sender: testlist-owner@peti.cryp.to +Precedence: list -As a result, the script won't delete the output PGP issued when called -after exiting. Thus you will find the file still lying in \file{/tmp} -and can easily investigate what's wrong. - -\section{Virtual hosting and sendmail} -\label{virtual hosting and sendmail} - -A very useful things is \Petidomo's virtual hosting feature. -Unfortunately, there are a few traps into which you might run when you -are trying to use it together with the Allmann sendmail. But we'll -start at the beginning. - -If you host mailing lists for domains other than your own, you can -tell \Petidomo\ to use this name instead of the local one for certain -mailing lists in the list config file by setting the appropriate -``HostName''. Now all mail posted to this list, or sent to the -``-request'' address of the list, will appear to be coming from the -domain name you configured, rather than your own. - -When you are using sendmail v8, you will have to write these names to -the \$w\$ class in your sendmail.cf file, or the corresponfing M4 -config. This is done by adding the line -\begin{verbatim} -Cwdomain.name1 domain.name2 ... +It does ... \end{verbatim} -to the file. - -This will tell sendmail that these names are to be accepted and -delivered locally rather than to the MX of these entries. - -Doing this might deliver a surprise, though, if you are using -sendmail's masquerading abilities to hide the various hostname of your -domain. Per default, sendmail masquerades not only the domain names -you told him with the MASQUERADE\_DOMAIN() command, it automatically -masquerades all domain names of the \$w\$ class, too. - -The result is that \Petidomo's fine virtual hosting is gone -immediately, because sendmail will re-write the name to your own -domain name. The fix for this is rather easy: Add the command -``FEATURE(limited\_masquerade)'' to your M4 file and sendmail won't -touch the names that are stated only in the \$w\$ class. - -\section{Mailing list archives} -\label{mailing list archives} - -If your are hosting a public mailing list, you might want to offer a -mailing list archive, that is accessible through the WWW and has all -the postings available for immediate access. We were in the midst of -developing a tool that does this for you when we came accross a -brilliant tool named ``MHonArc''. We installed it, tested it, and -deleted all attempts of writing something like that ourselves -immediately. - -We strongly recommend looking at MHonArc, if you want to offer a WWW -archive of your mailing lists. You can find more information about -MHonArc at the following location: -`http://www.oac.uci.edu/indiv/ehood/mhonarc.html' - -The installation of the tool itself is very easy. Once you have -MHonArc running, just enable the archiving feature in Petidomo and -feed the archives into MHonArc. That's it. - -\section{Verifying the address lists} - -\Petidomo\ tries its best to make sure that only syntactically correct -addresses are subscribed to mailing lists, and if you stick to the -listserv interface, there's very little chance, an incorrect address -will make it into the \file{list} file. - -Sometimes, it is necessary to edit these files manually, though, or -\Petidomo's address validation algorithm fails. Once you have an -incorrect address in your list file, sendmail will abort with an -error, without trying to deliver the mail at all. - -To clarify, this does not happen when an address is not reachable, -this happens only when you subscribe something like {\tt -hey@this@is@wrong....}. Once you suspect that your address list has -been corrupted, there's an easy way to find out, which addresses are -wrong. Simply use sendmail's address verification mode like this: - -\begin{verbatim} - $ xargs @bogus.address.here... user address required -\end{verbatim} - -This call will find all incorrect address and notify you. The 'sed' -call will filter out all correct addresses for your convenience. - -\chapter{If something doesn't work\dots{}} +\end{quote} -Even though it is highly unlikely that \Petidomo\ will not -work as you expect it to (`Highly unlikely' is actually an -understatement. It is so amazingly breath-takingly mind-boggingly -stunningly unlikely, even less probable than the absolute impossible -and totally unthinkable, so flabbergastingly unlikely that we actually -wonder why we have that section at all\dots{}), you have several means -of getting help: - -\begin{enumerate} - -\item Before anything else, please take a look at the logfile. -\Petidomo\ hardly ever does anything without making an entry in the -logfile. Usually, your problem is caused by a wrong file permission or -a misspelled keyword. These things can easily be found and fixed if -you read the logfile. - -\item Take a look at the logfile again. - -\item If the logfile doesn't help, you can post a description of your -problem to the ``petidomo-users'' mailing lists, where the -CyberSolutions staff and many other users might be able to help you. -To subscribe to the mailing list, send an ``subscribe'' request to the -address: ``petidomo-users-request@petidomo.com''. - -\end{enumerate} - -\section{The mail-rescue mechanism} - -\PetidomoTwo\ has not lost a single e-mail due to a bug or a faulty -configuration yet and we are optimistic that it will stay that way. -The reason for this belief is the mail-rescue mechanism, which works -as follows: Whenever either ``listserv'' or ``hermes'' are started, -the program will read the complete mail it is receiving and -immediately stores it under an unique filename in the directory -\file{\~{}petidomo/crash}. - -When this file has been created, the program will start to actually -process the mail. If a situation arises that \Petidomo\ can't handle, -like a syntax error in the ACL files, a missing keyword in the master -config file, or a faulty file permission of a file \Petidomo needs to -read, \Petidomo will notify the ``petidomo-manager'' via e-mail and -terminate without deleting the mail in the rescue-directory. Even in -case of a core dump, the mail is still there. Only if \Petidomo\ has -succeeded in processing the request or posting completely, the rescue -file will be deleted. - -So in case your installation can't process a request or posting for -whatever reasons, all you have to do is to fix the problem and then to -feed the mail from the rescue-directory into the program again to -process it. - -Please note that \Petidomo\ might not be able to send the notification -mail out (for example if the reason that it aborted in the first place -was that it couldn't start the mail transport agent), so you should -check the \file{\~{}petidomo/crash} directory from time to time, -probably in your daily- or weekly script, which is run by cron. - -It might also be a good idea to take a look at the logfiles -occasionally, even when \Petidomo\ is running fine, just to make sure -it stays that way. +If this all worked for you, you have a your Petidomo installation up +and running. Men will envy you and women will desire you --- unless, +of course, you \emph{are} a woman, then it is vice versa. You will be +able to stop smoking any time you want, you may eat anything you like +and as much as you like, but you will never gain a single pound. Your +sex life will improve dramatically, your boss will like you, your hard +drives will never crash and your Internet connections will always be +fast. All this, thanks to the wonders of the {\bf Petidomo Mailing +List Manager!} + +In case any of the benefits promised above stays away, please consult +paragraphs 11 and 12 of the file {\sf COPYING} included in this +distribution. -% -% End of document -% \end{document} From ossp-cvs-owner@ossp.org Mon Feb 12 20:33:07 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f1CJX7Y40820; Mon, 12 Feb 2001 20:33:07 +0100 (CET) Date: Mon, 12 Feb 2001 20:33:07 +0100 (CET) Message-Id: <200102121933.f1CJX7Y40820@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/petidomo/docs Xstation.bm directory-struct.eps di... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 12-Feb-2001 20:33:07 Branch: HEAD Handle: 1970010101000000 Removed files: ossp-pkg/petidomo/docs Xstation.bm directory-struct.eps directory-struct.fig ml-principle1.eps ml-principle1.fig ml-principle2.eps ml-principle2.fig router.bm world.bm Log: Removed diagrams required by the old version of the manual; the new version will not use these. Summary: Revision Changes Path NONE +0 -0 ossp-pkg/petidomo/docs/Xstation.bm NONE +0 -0 ossp-pkg/petidomo/docs/directory-struct.eps NONE +0 -0 ossp-pkg/petidomo/docs/directory-struct.fig NONE +0 -0 ossp-pkg/petidomo/docs/ml-principle1.eps NONE +0 -0 ossp-pkg/petidomo/docs/ml-principle1.fig NONE +0 -0 ossp-pkg/petidomo/docs/ml-principle2.eps NONE +0 -0 ossp-pkg/petidomo/docs/ml-principle2.fig NONE +0 -0 ossp-pkg/petidomo/docs/router.bm NONE +0 -0 ossp-pkg/petidomo/docs/world.bm ____________________________________________________________________________ From ossp-cvs-owner@ossp.org Mon Feb 12 20:34:51 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f1CJYou40971; Mon, 12 Feb 2001 20:34:50 +0100 (CET) Date: Mon, 12 Feb 2001 20:34:50 +0100 (CET) Message-Id: <200102121934.f1CJYou40971@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/petidomo/docs Makefile Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 12-Feb-2001 20:34:50 Branch: HEAD Handle: 2001021219345000 Modified files: ossp-pkg/petidomo/docs Makefile Log: Replaced GNU make-specific stuff by the general make syntax to make the file more portable. Summary: Revision Changes Path 1.4 +7 -13 ossp-pkg/petidomo/docs/Makefile ____________________________________________________________________________ Index: ossp-pkg/petidomo/docs/Makefile ============================================================ $ cvs diff -u -r1.3 -r1.4 Makefile --- ossp-pkg/petidomo/docs/Makefile 2000/12/13 14:24:03 1.3 +++ ossp-pkg/petidomo/docs/Makefile 2001/02/12 19:34:50 1.4 @@ -1,28 +1,22 @@ # # Petidomo User Manual # -# $Header: /e/ossp/cvs/ossp-pkg/petidomo/docs/Makefile,v 1.3 2000/12/13 14:24:03 simons Exp $ +# $Header: /e/ossp/cvs/ossp-pkg/petidomo/docs/Makefile,v 1.4 2001/02/12 19:34:50 simons Exp $ # -all: petidomo.ps +.SUFFIXES: +.SUFFIXES: .tex .dvi .ps -%.dvi : %.tex +.tex.dvi: latex \\nonstopmode\\input $<; \ - while egrep 'Rerun to' $*.log; do \ + while grep 'Rerun to' $*.log; do \ latex \\nonstopmode\\input $<; \ done -%.ps : %.dvi +.dvi.ps: dvips $< -o $@ - -%.eps: %.fig - fig2dev -L ps $< $@ -petidomo.dvi: ml-principle1.eps ml-principle2.eps directory-struct.eps - -ml-principle1.eps: ml-principle1.fig -ml-principle2.eps: ml-principle2.fig -directory-struct.eps: directory-struct.fig +all: petidomo.ps clean distclean realclean: rm -f petidomo.aux petidomo.dvi petidomo.log petidomo.ps petidomo.toc From ossp-cvs-owner@ossp.org Mon Feb 12 21:44:14 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f1CKiDi48172; Mon, 12 Feb 2001 21:44:13 +0100 (CET) Date: Mon, 12 Feb 2001 21:44:13 +0100 (CET) Message-Id: <200102122044.f1CKiDi48172@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/petidomo help.c hermes.c listserv.c members.c rfc... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 12-Feb-2001 21:44:13 Branch: HEAD Handle: 2001021220441300 Modified files: ossp-pkg/petidomo help.c hermes.c listserv.c members.c rfcparse.c Log: Changed loglevel of sereval syslog() calls from NOTICE to INFO, because they do not really require the administrator's attention but are informational. Summary: Revision Changes Path 1.9 +2 -2 ossp-pkg/petidomo/help.c 1.19 +7 -7 ossp-pkg/petidomo/hermes.c 1.8 +1 -2 ossp-pkg/petidomo/listserv.c 1.10 +3 -3 ossp-pkg/petidomo/members.c 1.5 +6 -6 ossp-pkg/petidomo/rfcparse.c ____________________________________________________________________________ Index: ossp-pkg/petidomo/help.c ============================================================ $ cvs diff -u -r1.8 -r1.9 help.c --- ossp-pkg/petidomo/help.c 2001/01/18 20:30:50 1.8 +++ ossp-pkg/petidomo/help.c 2001/02/12 20:44:13 1.9 @@ -1,6 +1,6 @@ /* $Source: /e/ossp/cvs/ossp-pkg/petidomo/help.c,v $ - $Revision: 1.8 $ + $Revision: 1.9 $ Copyright (C) 2000 by CyberSolutions GmbH, Germany. @@ -73,7 +73,7 @@ free(p); } else { - syslog(LOG_NOTICE, "List \"%s\" doesn't have a description.", param1); + syslog(LOG_INFO, "List \"%s\" doesn't have a description.", param1); fprintf(fh, "No description available.\n"); } CloseMailer(fh); Index: ossp-pkg/petidomo/hermes.c ============================================================ $ cvs diff -u -r1.18 -r1.19 hermes.c --- ossp-pkg/petidomo/hermes.c 2001/01/20 14:29:28 1.18 +++ ossp-pkg/petidomo/hermes.c 2001/02/12 20:44:13 1.19 @@ -1,6 +1,6 @@ /* $Source: /e/ossp/cvs/ossp-pkg/petidomo/hermes.c,v $ - $Revision: 1.18 $ + $Revision: 1.19 $ Copyright (C) 2000 by CyberSolutions GmbH, Germany. @@ -125,7 +125,7 @@ if (ListConfig->listtype == LIST_MODERATED) { - syslog(LOG_NOTICE, "\"%s\" tried to post to list \"%s\", but failed to " \ + syslog(LOG_INFO, "\"%s\" tried to post to list \"%s\", but failed to " \ "provide a correct password.", MailStruct->From, listname); fh = vOpenMailer(envelope, owner, NULL); @@ -156,7 +156,7 @@ if (isSubscribed(listname, MailStruct->From, NULL, NULL, TRUE) == FALSE) { - syslog(LOG_NOTICE, "\"%s\" tried to post to closed list \"%s\", but " \ + syslog(LOG_INFO, "\"%s\" tried to post to closed list \"%s\", but " \ "he is no subscriber.", MailStruct->From, listname); fh = vOpenMailer(envelope, owner, NULL); @@ -190,7 +190,7 @@ char* cookie; char* originator = (MailStruct->Reply_To) ? MailStruct->Reply_To : MailStruct->From; - syslog(LOG_NOTICE, "\"%s\" tried to post to acknowledged list \"%s\"; posting " \ + syslog(LOG_INFO, "\"%s\" tried to post to acknowledged list \"%s\"; posting " \ "has been deferred.", MailStruct->From, listname); cookie = queue_posting(MailStruct, listname); @@ -225,7 +225,7 @@ if (g_is_approved) { - syslog(LOG_NOTICE, "\"%s\" acknowledged a former posting attempt on ack-once list \"%s\"; " \ + syslog(LOG_INFO, "\"%s\" acknowledged a former posting attempt on ack-once list \"%s\"; " \ "add him to the ack file and let the posting pass.", MailStruct->From, listname); rc = add_address(ListConfig->ack_file, MailStruct->From); @@ -250,7 +250,7 @@ { char* cookie; - syslog(LOG_NOTICE, "\"%s\" tried to post to ack-once list \"%s\", but is posting " \ + syslog(LOG_INFO, "\"%s\" tried to post to ack-once list \"%s\", but is posting " \ "for the first time; posting has been deferred.", MailStruct->From, listname); cookie = queue_posting(MailStruct, listname); @@ -280,7 +280,7 @@ return; } else - syslog(LOG_NOTICE, "\"%s\" tried to post to ack-once list \"%s\" and has been found in " \ + syslog(LOG_INFO, "\"%s\" tried to post to ack-once list \"%s\" and has been found in " \ "the ack file; letting posting pass.", MailStruct->From, listname); } } Index: ossp-pkg/petidomo/listserv.c ============================================================ $ cvs diff -u -r1.7 -r1.8 listserv.c --- ossp-pkg/petidomo/listserv.c 2001/01/20 14:29:28 1.7 +++ ossp-pkg/petidomo/listserv.c 2001/02/12 20:44:13 1.8 @@ -1,6 +1,6 @@ /* $Source: /e/ossp/cvs/ossp-pkg/petidomo/listserv.c,v $ - $Revision: 1.7 $ + $Revision: 1.8 $ Copyright (C) 2000 by CyberSolutions GmbH, Germany. @@ -84,7 +84,6 @@ g_currLine = MailStruct->Body; if (*g_currLine == '\0') { - syslog(LOG_NOTICE, "Received mail with empty body."); SendHelp(MailStruct, NULL, NULL, default_list); return; } Index: ossp-pkg/petidomo/members.c ============================================================ $ cvs diff -u -r1.9 -r1.10 members.c --- ossp-pkg/petidomo/members.c 2001/01/19 14:56:33 1.9 +++ ossp-pkg/petidomo/members.c 2001/02/12 20:44:13 1.10 @@ -1,6 +1,6 @@ /* $Source: /e/ossp/cvs/ossp-pkg/petidomo/members.c,v $ - $Revision: 1.9 $ + $Revision: 1.10 $ Copyright (C) 2000 by CyberSolutions GmbH, Germany. @@ -54,7 +54,7 @@ listname = defaultlist; if (address == NULL || listname == NULL) { - syslog(LOG_NOTICE, "%s: members-command invalid: No list specified.", + syslog(LOG_INFO, "%s: members-command invalid: No list specified.", MailStruct->From); return 0; } @@ -70,7 +70,7 @@ if (isValidAdminPassword(getPassword(), listname) == FALSE && ListConfig->allowmembers == FALSE) { - syslog(LOG_NOTICE, "MEMBERS command from \"%s\" has been denied.", address); + syslog(LOG_INFO, "MEMBERS command from \"%s\" has been denied.", address); fh = vOpenMailer(envelope, address, owner, NULL); if (fh != NULL) { fprintf(fh, "From: %s-request@%s (Petidomo Mailing List Server)\n", Index: ossp-pkg/petidomo/rfcparse.c ============================================================ $ cvs diff -u -r1.4 -r1.5 rfcparse.c --- ossp-pkg/petidomo/rfcparse.c 2001/01/18 20:30:50 1.4 +++ ossp-pkg/petidomo/rfcparse.c 2001/02/12 20:44:13 1.5 @@ -1,6 +1,6 @@ /* $Source: /e/ossp/cvs/ossp-pkg/petidomo/rfcparse.c,v $ - $Revision: 1.4 $ + $Revision: 1.5 $ Copyright (C) 2000 by CyberSolutions GmbH, Germany. @@ -271,7 +271,7 @@ if (strncasecmp("From:", currLine, strlen("From:")) == 0) { if (MailStruct->From != NULL) { - syslog(LOG_NOTICE, "Received mail with multiple From: lines."); + syslog(LOG_INFO, "Received mail with multiple From: lines."); continue; } MailStruct->From = &currLine[strlen("From:")]; @@ -281,7 +281,7 @@ CanonizeAddress(&(MailStruct->From), fqdn); } else if (strncasecmp("Reply-To:", currLine, strlen("Reply-To:")) == 0) { if (MailStruct->Reply_To != NULL) { - syslog(LOG_NOTICE, "Received mail with multiple Reply-To: lines."); + syslog(LOG_INFO, "Received mail with multiple Reply-To: lines."); continue; } MailStruct->Reply_To = &currLine[strlen("Reply-To:")]; @@ -301,7 +301,7 @@ } else if (strncasecmp("Approve:", currLine, strlen("Approve:")) == 0) { if (MailStruct->Approve != NULL) - syslog(LOG_NOTICE, "Received mail with multiple Approve: lines."); + syslog(LOG_INFO, "Received mail with multiple Approve: lines."); MailStruct->Approve = &currLine[strlen("Approve:")]; rc = ParseApproveLine(MailStruct->Approve); if (rc != 0) @@ -309,7 +309,7 @@ } else if (strncasecmp("Approved:", currLine, strlen("Approved:")) == 0) { if (MailStruct->Approve != NULL) - syslog(LOG_NOTICE, "Received mail with multiple Approve: lines."); + syslog(LOG_INFO, "Received mail with multiple Approve: lines."); MailStruct->Approve = &currLine[strlen("Approved:")]; rc = ParseApproveLine(MailStruct->Approve); if (rc != 0) @@ -317,7 +317,7 @@ } else if (strncasecmp("Subject:", currLine, strlen("Subject:")) == 0) { if (MailStruct->Subject != NULL) - syslog(LOG_NOTICE, "Received mail with multiple Subject: lines."); + syslog(LOG_INFO, "Received mail with multiple Subject: lines."); MailStruct->Subject = &currLine[strlen("Subject:")]; if (*MailStruct->Subject == ' ') MailStruct->Subject += 1; From ossp-cvs-owner@ossp.org Sat Feb 17 21:19:07 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f1HKJ6i65327; Sat, 17 Feb 2001 21:19:06 +0100 (CET) Date: Sat, 17 Feb 2001 21:19:06 +0100 (CET) Message-Id: <200102172019.f1HKJ6i65327@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/petidomo/docs petidomo.tex Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 17-Feb-2001 21:19:06 Branch: HEAD Handle: 2001021720190600 Modified files: ossp-pkg/petidomo/docs petidomo.tex Log: Added a half finished chapter about the configuration of Petidomo. Summary: Revision Changes Path 1.4 +109 -1 ossp-pkg/petidomo/docs/petidomo.tex ____________________________________________________________________________ Index: ossp-pkg/petidomo/docs/petidomo.tex ============================================================ $ cvs diff -u -r1.3 -r1.4 petidomo.tex --- ossp-pkg/petidomo/docs/petidomo.tex 2001/02/12 19:23:51 1.3 +++ ossp-pkg/petidomo/docs/petidomo.tex 2001/02/17 20:19:06 1.4 @@ -2,7 +2,7 @@ % % Petidomo Manual % -% $Header: /e/ossp/cvs/ossp-pkg/petidomo/docs/petidomo.tex,v 1.3 2001/02/12 19:23:51 simons Exp $ +% $Header: /e/ossp/cvs/ossp-pkg/petidomo/docs/petidomo.tex,v 1.4 2001/02/17 20:19:06 simons Exp $ % \typearea[2cm]{12} \fussy @@ -367,6 +367,7 @@ Once you have done this, your installation is ready to be tested. \section{Testing the Installation} +\label{testing} Asserting you followed all steps described above, you have a working Petidomo installation now. Occasionally, some minor permisson problem @@ -483,4 +484,111 @@ paragraphs 11 and 12 of the file {\sf COPYING} included in this distribution. +\chapter{Configuring Petidomo} + +\section{The Master Configuration File} + +At startup, Petidomo will read its master configuration file in order +to determine the correct file system paths, the machine's hostname, +and the location of the system's MTA --- usually sendmail. If Petidomo +is unable to locate or to parse that config file, it will abort +immediately. + +When you started Petidomo while running the tests described in section +\ref{testing}, you certainly noticed that Petidomo logs the path where +it expects to find that config file: +\begin{quote} +\begin{verbatim} +petidomo[8706]: Petidomo 4.0b1 (18-Jan-2001) starting up; \ + mode=listserv, listname=, \ + masterconf=/usr/local/etc/petidomo.conf, \ + approved=false, ruid=2, euid=2, gid=2, egid=2 +\end{verbatim} +\end{quote} + +Here, the master config file will be expected at {\sf +/usr/local/etc/petidomo.conf} --- what is the default, unless you +changed the ``sysconfdir'' while compiling the binary. If you want to +change that path without re-compiling the binary, you can simply +provide a new location on the command line when calling Petidomo by +adding the parameter ``{\sf {-}-masterconf=/new/path/to/file}''. You +can also omit the equal sign and write ``{\sf +{-}-masterconf~/new/path/to/file}'' if you prefer that. + +In any case, this config file must exist, be readable for Petidomo and +have correct contents, or your installation won't do anything but tell +you that there's something wrong. In the following, we'll list all +directives you can set in that file and explain their syntax and +semantics. + +\label{config file syntax} +All directives must be stated at the first column of a line and +obviously only one directive per line is allowed. Each directive +consists of a keyword and the data part. Which keywords exist will be +explained below. You separate the keyword from the data by whitespace. +Either tabs of blanks are fine and you may use any number of +whitespace characters you like. + +The case of the keywords does not matter; both ``hostname'' and +``HoStNaMe'' are the same to Petidomo. If the data part contains any +whitespace itself --- as in the MTAOptions directive ---, it is +recommended to enclose it in double quotes to avoid confusion. +Petidomo will get it right if you do not use double quotes, though, +unless you need to specifi whitespace at the beginning or the end of +the data part; any whitespace there will be ignored. + +Empty lines will be ignored and so will any line that starts with the +{\sf \#} character; you can use it to add comments to the config file. + +OK, here is the list of keywords to be used in the master config file +including a description what they mean. + +\paragraph{Hostname} + +This is a required directive that tells Petidomo how the system's +Internet host name is. You should use the fully qualified host name +here --- the host's name including the domain name that is. If you +omit the domain, things might work, but they probably won't. + +\paragraph{AdminPassword} + +Use this to specify a password, which only the administrator of the +Petidomo systems should know. You can use this password to approve +e-mails or to subscribe addresses to closed lists. You can do pretty +much anything with Petidomo you want, so choose somthing a bit more +original than the example ``open sesame'' found in the config file +examples. This option is required; Petidomo will not run unless it is +there. + +\paragraph{MTA} + +Here you must specify the path to the MTA Petidomo will use to send +outbound e-mail. This option is required. + +\paragraph{MTAOptions} + +Depending on which MTA you use, you may want to provide parameters to +it when it is started. Those options can be specified here. The +default options, if this directive is not specified in the master +config file, are ``{\tt -i -f\%s}''. The {\tt \%s} is a place holder +for the envelope from to be added by Petidomo and it will be replaced +by the apropriate e-mail address at execution time. + +Please note that the compiled in default options work for sendmail, +you may have to change them if you're using a different MTA. + +\paragraph{ListDirectory} + +\paragraph{AckQueueDirectory} + +\paragraph{HelpFile} + +\paragraph{ACLFile} + +\paragraph{IndexFile} + +\section{List Config Files} + + \end{document} + From ossp-cvs-owner@ossp.org Sat Feb 17 22:37:07 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f1HLb5071046; Sat, 17 Feb 2001 22:37:05 +0100 (CET) Date: Sat, 17 Feb 2001 22:37:05 +0100 (CET) Message-Id: <200102172137.f1HLb5071046@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/petidomo hermes.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 17-Feb-2001 22:37:05 Branch: HEAD Handle: 2001021721370500 Modified files: ossp-pkg/petidomo hermes.c Log: Petidomo will now let the "keywords:" and "summary:" headers pass when posting to a list. These headers are uncommon but have been around for ages. Summary: Revision Changes Path 1.20 +3 -1 ossp-pkg/petidomo/hermes.c ____________________________________________________________________________ Index: ossp-pkg/petidomo/hermes.c ============================================================ $ cvs diff -u -r1.19 -r1.20 hermes.c --- ossp-pkg/petidomo/hermes.c 2001/02/12 20:44:13 1.19 +++ ossp-pkg/petidomo/hermes.c 2001/02/17 21:37:05 1.20 @@ -1,6 +1,6 @@ /* $Source: /e/ossp/cvs/ossp-pkg/petidomo/hermes.c,v $ - $Revision: 1.19 $ + $Revision: 1.20 $ Copyright (C) 2000 by CyberSolutions GmbH, Germany. @@ -312,6 +312,8 @@ !strncasecmp(currLine, "In-Reply-To:", 12) || !strncasecmp(currLine, "References:", 11) || !strncasecmp(currLine, "Message-Id:", 11) || + !strncasecmp(currLine, "Keywords:", 11) || + !strncasecmp(currLine, "Summary:", 11) || !strncasecmp(currLine, "Received:", 9)) { len = nextLine - currLine; From ossp-cvs-owner@ossp.org Sat Feb 17 22:46:48 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f1HLkk171752; Sat, 17 Feb 2001 22:46:46 +0100 (CET) Date: Sat, 17 Feb 2001 22:46:46 +0100 (CET) Message-Id: <200102172146.f1HLkk171752@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/petidomo/docs petidomo.tex Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 17-Feb-2001 22:46:46 Branch: HEAD Handle: 2001021721464600 Modified files: ossp-pkg/petidomo/docs petidomo.tex Log: Added descriptions of the configuration file and moved some contents from the old manual version back in. Summary: Revision Changes Path 1.5 +1405 -93 ossp-pkg/petidomo/docs/petidomo.tex ____________________________________________________________________________ Index: ossp-pkg/petidomo/docs/petidomo.tex ============================================================ $ cvs diff -u -r1.4 -r1.5 petidomo.tex --- ossp-pkg/petidomo/docs/petidomo.tex 2001/02/17 20:19:06 1.4 +++ ossp-pkg/petidomo/docs/petidomo.tex 2001/02/17 21:46:46 1.5 @@ -2,17 +2,30 @@ % % Petidomo Manual % -% $Header: /e/ossp/cvs/ossp-pkg/petidomo/docs/petidomo.tex,v 1.4 2001/02/17 20:19:06 simons Exp $ +% $Header: /e/ossp/cvs/ossp-pkg/petidomo/docs/petidomo.tex,v 1.5 2001/02/17 21:46:46 simons Exp $ % \typearea[2cm]{12} +\usepackage{lastpage} +\usepackage{fancyhdr} +\pagestyle{fancy} +\lhead{\sl The Petidomo Mailing List Manager} +\chead{} +\rhead{Page \thepage\ of \pageref{LastPage}} +\lfoot{} +\cfoot{} +\rfoot{} +\fancypagestyle{plain}{} \fussy +\newcommand{\Def}[1]{{\sl #1}} +\newcommand{\file}[1]{{\sf #1}} + \begin{document} + \title{The Petidomo Mailing List Manager} \author{Peter Simons $<$simons@computer.org$>$} \date{February 2001} \maketitle - \tableofcontents \clearpage @@ -486,109 +499,1408 @@ \chapter{Configuring Petidomo} +\section{Configuration File Syntax} + +All configuration files in the Petidomo-package\label{Config file +format}, have the following format: +\begin{verbatim} +keyword parameter +\end{verbatim} + +The ``keyword''-part must start at the first column of the line and is +followed by one or several blanks or tabs. The first non-blank +character then is interpreted as the parameter for this keyword. The +following line, for example: +\begin{verbatim} +Hostname petidomo.is.great +\end{verbatim} +will tell Petidomo that the name of the machine it is running on is +called ``petidomo.is.great''. If the parameter contains any blanks, +what is not very likely for a hostname, but may happen with other +settings, you should enclose it in double quotes, like this: +\begin{verbatim} +AdminPassword "open sesame" +\end{verbatim} + +Quoting the parameter is not strictly necessary, though, Petidomo's +config file parser will get it right anyway. You only have to quote +the parameter, if it contains blanks as first or last character, what +is rather unlikely to happen. + +Furthermore all empty lines are ignored. So are lines that start with +a `\#' sign. You can use this for writing comments for the reader into +the config file. + \section{The Master Configuration File} +\label{master config file} -At startup, Petidomo will read its master configuration file in order -to determine the correct file system paths, the machine's hostname, -and the location of the system's MTA --- usually sendmail. If Petidomo -is unable to locate or to parse that config file, it will abort -immediately. +Petidomo expects its master config file to be found under +\file{\~{}peti\-do\-mo/etc/pe\-ti\-domo.conf}. The following keywords are +recognized: + +\begin{description} + +\item[Hostname] \hfill ``hostname.domain.name'' + +This entry specifies the fully qualified domain name of the machine, +Petidomo is running on. A fully qualified domain name is the +hostname of the machine with the domain name appended with a dot. The +following, for example: +\begin{verbatim} +HostName listserver.foo.bar +\end{verbatim} +would be a valid statement. Normally this option has been set by the +install script correctly already. + +The name you set here is not necessarily the name, Petidomo will use +when delivering mailing list-postings to the subscribers, or when +answering requests, because you can specify a different fully +qualified domain name for every mailing list you host. This is known +as \Def{virtual hosting}. + +This option is \emph{required}. Petidomo will abort with an error, +if the master config file doesn't set it. + +\item[AdminPassword] \hfill ``password'' + +This tag sets the master password, which authenticiates the Petidmo +administrator. Here is an example: +\begin{verbatim} +AdminPassword "open sesame" +\end{verbatim} +Normally this option has been set by the install script already. + +Please chose this password carefully. Knowledge of the master password +will enable you to access \emph{all} mailing lists running on this +system. + +Passwords are compared case-insensitively. That means, that the +passwords ``Open SESAME'', ``open sesame'' and ``OPEN seSAme'' are all +the same. + +This option is \emph{required}. Petidomo will abort with an error, +if the master config file doesn't set it. + + +\item[MTA] \hfill ``/path/to/executable'' + +The MTA tag tells Petidomo which mail transport agent should be used +to deliver outgoing emails. Normally this option has been set by the +install script already, so you don't need to worry about this anymore. + +An example setting is: +\begin{verbatim} +MTA "/usr/sbin/sendmail" +\end{verbatim} +but Petidomo will run fine with other mail transport agents, too. So +far, the system has been tested with the Allman sendmail, SMail and +qmail without any problems. + +This option is \emph{required}. Petidomo will abort with an error, +if the master config file doesn't set it. + + +\item[MTAOptions] \hfill ``string'' + +This tag is a bit tricky and in ninety-nine out of hundred cases you +should simply leave this option undefined as it is rarely required +anyway. + +This entry sets the options which will be handed over to the MTA +when it is called. The following example +\begin{verbatim} +MTAOptions "-odq -i -f%s" +\end{verbatim} +will yield a call ``$<$MTA$>$ -odq -i -f$<$envelope$>$''. The `\%s' is +replaced with the envelope the mail should be sent under. + +Adding options to the execution call of the mail transport agent can +be useful to enable or disable certain features for mailing lists +only, while leaving them on for all other mail. The `-odq' setting is +a fine example. This parameter will tell the Allmann sendmail to queue +all mail, instead of trying to deliver it immediately. + + +\item[ListDirectory] \hfill ``/path/to/directory'' + +Here you can tell Petidomo the path to the directory where the mailing +list config file reside. The compiled-in default is +``LOCALSTATEDIR/petidomo/lists'' --- in most cases that resolves to +\file{/usr/local/var/petidomo/lists}. When Petidomo tries to find the +configuration of list, say, ``foobar'', it will look for any of the +following files in this directory: \file{foobar.conf}, +\file{foobar.config}, \file{foobar/conf}, or \file{foobar/config}. + +\item[AckQueueDirectory] \hfill ``/path/to/directory'' + +This tag will tell Petidomo where to store files that need to be +queued for later processing --- for example subscribe requests that +need to be acknowledged by the user before they'll be carried out. The +default location is ``LOCALSTATEDIR/petidomo/ack-queue''; unless you +changed the default path at compile time, this will resolve to +\file{/usr/local/var/petidomo/ack-queue}. Please note that Petidomo +will need permission to write to that directory in order for things to +work. + +\item[HelpFile] \hfill ``/path/to/file'' + +This tag will tell Petidomo where to find the text file that will be +sent back to a user sending in a ``help'' command. The default +location is ``DATADIR/petidomo/help"'', what is usually the file +\file{/usr/local/share/petidomo/help}. + + +\item[ACLFile] \hfill ``/path/to/file'' + +This tag tells Petidomo the path to the system-wide ACL file. The +default location is ``SYSCONFDIR/petidomo.acl'', what usually resolves +to \file{/usr/local/etc/petidomo.acl}. + +\item[IndexFile] \hfill ``/path/to/file'' + +Similarly to ``HelpFile'', this tag will tell Petidomo where to find +the text file that will be sent back to a user requesting the server's +``index''. The default location is ``LOCALSTATEDIR/petidomo/index''; +unless you changed the default path at compile time, this will resolve +to \file{/usr/local/var/petidomo/index}. + +\end{description} + +\section{List Configuration Files} +\label{list config file} + +While the master config file sets options which are relevant for the +Petidomo package as a whole, the list config file sets options which +are valid only locally for the mailing list. The supported keywords +are as follows. + +\begin{description} + +\item[ListType] \hfill ``open'', ``closed'', ``moderated'', +``acknowledged'', or ``acknowledged-once'' + +This setting tells Petidomo who is allowed to post to the mailing +list. On an ``open'' mailing list, everybody is allowed to post, +whether he's subscribed or not. On a ``closed'' mailing list, only +subscribers are allowed to post. That means that only mails coming +from an address found on the list's address database will go through. +All other mails will be sent back to the person trying to post with +the comment that he should subscribe first. + +Please note that a closed list may not do exactly what you want, +because when a person is subscribed to a list as +``example@address.net'', but tries to post from a different account +than that one, Petidomo will not let him post. It tries to recognize +this case as far as possible: For example, it doesn't matter whether +you are posting from ``address@host1.address.net'' or +``address@host2.address.net'', Petidomo will handle that. But if the +article comes from ``example@private.account'', it will be rejected, +even though the sender might be a valid subscriber. It depends on the +subscribers of the mailing list, whether this is a problem or not. + +A better way to keep spam off your lists may be the ``acknowledged'' +or ``acknowledged-once'' type of list. The former list mode means that +every time someone tries to post, he will get a short reply back which +contains some cryptographic cookie. Furthermore the mail will tell +him to please reply to that mail and send the cookie back to Petidomo. +Once that is accomplished, Petidomo will let the posting pass. + +This means that only people will be able to post that have a valid +envelope or from address --- something spammers usually do not. Since +the request for confirmation never reaches them, their postings will +not go through. Everybody else can acknoledge the posting by sending +the cookie back and thus get by that hurdle. + +The difference between the ``acknowledged'' and ``acknowledged-once'' +mode finally is that in the latter mode, people have to send that +confirmation back only \emph{once}, while in the first mode, they have +to send it in every time they're trying to post. Petidomo will keep a +database of addresses that have been confirmed by that mechanism and +these addresses are allowed to post from now on without having to +confirm their posting again. Please note that this list of addresses +is not related to the list of subscribers! + +Last but not least, there is a mode called ``moderated''; in this +mode, nobody is allowed to post unless he can provide the correct +posting- or administrator password for the list. + +If this option is unset, the default is to run an open list. + +\item[SubscriptionType] \hfill ``public'', ``admin'', or ``acknowledged'' + +This option specifies who may subscribe to a mailing list. On an +``open''-subscription list, anybody may subscribe any address to the +list. If the subscription type is ``admin'', only the person knowing +the admin password of the mailing list is allowed to subscribe or +unsubscribe addresses. All other requests that aren't properly +authenticated will be forwarded to the list owner for approval. + +If the subscription type is set to ``acknowledged'', anybody can issue +a subscribe command, but the address will not be added to the list (or +removed from the list in case of an ``unsubscribe'') unless the +request has been confirmed: Petidomo will send a random cookie to the +address in questing and ask to send the cookie back to acknowledge the +request. Once the cookie has been send back, the request is carried +out. + +This mode is useful to prevent people from adding random addresses to +the list or to prevent them from removing other people from the list +without their consesus. + +If this option is unset, the default to allow public subscription. + +\item[AllowMembersCommand] \hfill ``yes'' or ``no'' + +Petidomo knows a command ``members'' or ``who'', which can be sent +to the server and it will reply with the complete list of subscribed +addresses for the mailing list. This may be useful for list +administrators, but it can be abused easily by spammers, to collect +addresses where to send their unsolicted commercial e-mail to. + +Furthermore, with certain mailing lists it may be undesirable that one +can see ``who else'' is subscribed to that list. That's why this +option has been added. If you set it to ``no'', the +``members''-command will be diabled for this list. (This is also the +default if the option is not specified in the config file.) + +If you set it to ``yes'', the ``members''-command will work. + +\item[Hostname] \hfill ``hostname.domainname'' + +This options tells Petidomo to use this hostname for the mailing list, +instead of the one configured in the master configuration file. This +feature is useful to do virtual hosting. + +\Def{Virtual hosting} is required when several mailing lists run on +the same server, but they have to look like they would coming from +different machines. Let's use an example: The internet service +provider ``Inter.Net'' offers its customers to host mailing lists for +them. A small software house of the name ``Petiware'' wants to provide +a mailing list for all its customers, but they don't have a dedicated +Internet line. + +So they use the service provided by Inter.Net and let them host the +mailing list on their machine. The mailing list server at Inter.Net +has the fully qualified domain name ``mail.inter.net''. Petiware, +though, wants the list to run under the name +``customers@petiware.com'' and \emph{not} ``customers@inter.net'' --- +what would a be misleading. + +So all the mailing list guru from Inter.Net has to do is to set the +entry +\begin{verbatim} +Hostname petiware.com +\end{verbatim} +in the config file of the ``customers'' mailing list. Petidomo will +now use the hostname ``peti\-ware.com'' in all mails that are posted +to that list, instead of ``mail.inter.net''. + +You can specify a different hostname for every mailing list, using +this feature. \emph{That} is ``virtual hosting''. Further details on +virtual hosting can be found in section~\ref{virtual hosting and +sendmail} of the user manual. + +If this entry is unset, the name configured in the master config file +will be used as hostname for this mailing list. + +\item[AdminPassword] \hfill ``string'' +\label{list admin password} + +This tag sets the master password, which authenticiates the +administrator of this mailing list. The administrator has special +priviledes, such as deleting other users, overriding access control +restrictions or un-/subscribing users to closed mailing lists. This is +described briefly in section~\ref{petidomo as admin} of the user manual. + +Please note that passwords are always case-insensitive. It is also +worth noting that the master password is always valid as administrator +password for the list, also. + +Leave this entry blank, if you don't want to enable remote +administration of the mailing list. + +\item[PostingPassword] \hfill ``string'' +\label{posting password} + +This tag sets the ``posting password''. The posting password allows to +post an article to a moderated mailing list, but it does not allow any +administration of the list itself. On lists that are of a different +type than moderated, setting a posting password does usually not make +any sense and you can leave this entry unset. + +\item[ReplyTo] \hfill ``email@address.net'' or ``none'' + +This tag controls the `Reply-To:' field, which Petidomo adds to +posted articles before it is delivered to the recipients. Using this +option, you can force Petidomo to insert a `Reply-To:' which points +to a certain address. On a moderated list, for example, you can set +this as follows: +\begin{verbatim} +ReplyTo moderator@address.net +\end{verbatim} +to direct all replies to the posting to the moderator again, +regardless of what address is noted in the `From:' line of the mail. + +If you set ``none'', Petidomo will not add a `Reply-To:' header at +all. + +If this option is unset, Petidomo will to insert a `Reply-To:' +header that directs replies back to the mailing list, so that +subscribers can conveniently post simply by hitting the `reply' +function in their mail reader. + +\item[PostingFilter] \hfill ``bourne shell command'' + +If you specify a posting filter, this program or script will be +started by Petidomo before it sends a posting out to the +subscribers. The programm will receive the article, as it has been +prepared by Petidomo, on standard input and is expected to write the +final version of the mail to standard output. The posting filter can +be used to manipulate the headers for special purposes. + +An example for a postin filter that wouldn't modify the mail at all is +the following: +\begin{verbatim} +PostingFilter /bin/cat +\end{verbatim} + +A detailed discussion of posting filters can be found in +section~\ref{using posting filters} of the manual. + +If the filter program exits with a returncode not equal to 0 (zero), +Petidomo will not post the article and terminate. + -When you started Petidomo while running the tests described in section -\ref{testing}, you certainly noticed that Petidomo logs the path where -it expects to find that config file: +\item[Archive] \hfill ``/path/of/archive'' + +If this option is set, Petidomo will archive all articles that have +been posted on that mailing list. The parameter for this tag may +either be the name and path of a file or of a directory. The path may +either be absolute (\file{/var/archive/list}) or relative +(\file{archive}). For relative paths, the directory where the list's +config file resides will be used as starting point. If the +``Archive''-tag points to a file, Petidomo will append every posted +article to that file. If points to a directory, each posting will be +stored in that directory in a separate file. + +If this option is unset, posted articles will not be archived at all. + +For further information an creating mailing list archives, please +refer to section~\ref{mailing list archives} of the user manual. + + +\item[IntroductionFile] \hfill ``/path/to/file'' + +This tag specifies the path to the so called ``introduction'' file. +Every time an address is added to the mailing list, Petidomo will send +the contents of this file to the new subscriber. This is meant to be +used to inform the new subscriber about the list's topic, habits he +should know, etc. If the file does not exist, no mail is sent out. + +If the path specified here is relative --- not starting with a ``/'' +character that is ---, it is interpreted to be relative to the +directory where the list's config file has been found. The default +path is \file{introduction}. + + +\item[DescriptionFile] \hfill ``/path/to/file'' + +This tag specifies the path to the so called ``description'' file. +This file is supposed to contain a short description of the mailing +list's topic and purpose. It's contents will be sent back if a user +requests the command ``help listname''. + +If the path specified here is relative --- not starting with a ``/'' +character that is ---, it is interpreted to be relative to the +directory where the list's config file has been found. The default +path is \file{description}. + + +\item[ACLFile] \hfill ``/path/to/file'' + +This tag specifies the path to the list-specific ACL file. Please +refer to section~\ref{acl} for more information about the access +control language of Petidomo. + +If the path specified here is relative --- not starting with a ``/'' +character that is ---, it is interpreted to be relative to the +directory where the list's config file has been found. The default +path is \file{acl}. + + +\item[HeaderFile] \hfill ``/path/to/file'' + +The contents of this file this tag points to will be added to the +header of \emph{every} posting on this list. This may be used to add +custom headers like: \begin{quote} \begin{verbatim} -petidomo[8706]: Petidomo 4.0b1 (18-Jan-2001) starting up; \ - mode=listserv, listname=, \ - masterconf=/usr/local/etc/petidomo.conf, \ - approved=false, ruid=2, euid=2, gid=2, egid=2 +X-List-Archive-is-at: http://list-archive.example.org/ +\end{verbatim} +\end{quote} + +Please note that the contents of this file will be added +\emph{verbatim}! So don't include any empty lines in here as empty +lines mark the end of the mail headers! Generally, please use this +feature with care; most mailing list administrators tend to +overestimate the importance of custom headers on their mailing list. + +If the path specified here is relative --- not starting with a ``/'' +character that is ---, it is interpreted to be relative to the +directory where the list's config file has been found. The default +path is \file{header}. + + +\item[SignatureFile] \hfill ``/path/to/file'' + +The contents of this file this tag points to will be appended to +\emph{every} posting on this list. This may be used to add a +list-specific signature, like: +\begin{quote} +\begin{verbatim} +-- + Useful comment here. \end{verbatim} \end{quote} -Here, the master config file will be expected at {\sf -/usr/local/etc/petidomo.conf} --- what is the default, unless you -changed the ``sysconfdir'' while compiling the binary. If you want to -change that path without re-compiling the binary, you can simply -provide a new location on the command line when calling Petidomo by -adding the parameter ``{\sf {-}-masterconf=/new/path/to/file}''. You -can also omit the equal sign and write ``{\sf -{-}-masterconf~/new/path/to/file}'' if you prefer that. - -In any case, this config file must exist, be readable for Petidomo and -have correct contents, or your installation won't do anything but tell -you that there's something wrong. In the following, we'll list all -directives you can set in that file and explain their syntax and -semantics. - -\label{config file syntax} -All directives must be stated at the first column of a line and -obviously only one directive per line is allowed. Each directive -consists of a keyword and the data part. Which keywords exist will be -explained below. You separate the keyword from the data by whitespace. -Either tabs of blanks are fine and you may use any number of -whitespace characters you like. - -The case of the keywords does not matter; both ``hostname'' and -``HoStNaMe'' are the same to Petidomo. If the data part contains any -whitespace itself --- as in the MTAOptions directive ---, it is -recommended to enclose it in double quotes to avoid confusion. -Petidomo will get it right if you do not use double quotes, though, -unless you need to specifi whitespace at the beginning or the end of -the data part; any whitespace there will be ignored. - -Empty lines will be ignored and so will any line that starts with the -{\sf \#} character; you can use it to add comments to the config file. - -OK, here is the list of keywords to be used in the master config file -including a description what they mean. - -\paragraph{Hostname} - -This is a required directive that tells Petidomo how the system's -Internet host name is. You should use the fully qualified host name -here --- the host's name including the domain name that is. If you -omit the domain, things might work, but they probably won't. - -\paragraph{AdminPassword} - -Use this to specify a password, which only the administrator of the -Petidomo systems should know. You can use this password to approve -e-mails or to subscribe addresses to closed lists. You can do pretty -much anything with Petidomo you want, so choose somthing a bit more -original than the example ``open sesame'' found in the config file -examples. This option is required; Petidomo will not run unless it is -there. - -\paragraph{MTA} - -Here you must specify the path to the MTA Petidomo will use to send -outbound e-mail. This option is required. - -\paragraph{MTAOptions} - -Depending on which MTA you use, you may want to provide parameters to -it when it is started. Those options can be specified here. The -default options, if this directive is not specified in the master -config file, are ``{\tt -i -f\%s}''. The {\tt \%s} is a place holder -for the envelope from to be added by Petidomo and it will be replaced -by the apropriate e-mail address at execution time. - -Please note that the compiled in default options work for sendmail, -you may have to change them if you're using a different MTA. - -\paragraph{ListDirectory} - -\paragraph{AckQueueDirectory} +If the path specified here is relative --- not starting with a ``/'' +character that is ---, it is interpreted to be relative to the +directory where the list's config file has been found. The default +path is \file{signature}. -\paragraph{HelpFile} -\paragraph{ACLFile} +\item[AddressFile] \hfill ``/path/to/file'' -\paragraph{IndexFile} +This tag specifies the path to the path of the file Petidomo uses to +store the list of subscribed addresses. If the path specified here is +relative --- not starting with a ``/'' character that is ---, it is +interpreted to be relative to the directory where the list's config +file has been found. The default path is \file{list}. -\section{List Config Files} +\item[AcknowledgementFile] \hfill ``/path/to/file'' -\end{document} +This tag specifies the path to the path of the file Petidomo uses to +store the list of addresses that have been verified by the +acknowledgement mechanism and may furtheron post without having to +acknowledge their posting again. This is only used if the list is set +to ``acknowledge-once'' mode. + +If the path specified here is relative --- not starting with a ``/'' +character that is ---, it is interpreted to be relative to the +directory where the list's config file has been found. The default +path is \file{ack}. + +\end{description} + +\section{Command Line Syntax} + +\section{Aliases} +\label{aliases} + +The binaries of the Petidomo package are usually not called manually +from the shell, but by the mail transport agent. This works as +follows: You create an e-mail account, which serves the purpose of +accepting the incoming e-mail and piping it into the appropriate +binary. + +This is archieved with the ``alias''-function of your mail transport +agent. Most MTAs, like sendmail, have a file where a list of special +account names is given together with the instructions what to do with +any mail received for that account. This file is usually located in +\file{/etc/aliases}. + +One thing, aliases can do is to pipe the mail into a program for +processing. This is the mechanism Petidomo uses. Petidomo requires +you to add the following aliases to your system: +\begin{verbatim} +# +# Mailing List Stuff +# +petidomo-manager: root +petidomo: "|/usr/local/petidomo/bin/listserv" +\end{verbatim} + +The lines starting with the `\#' character are only comments and are +ignored by the mail transport agent. The fourth line, though, is the +first command. It tells the MTA to accept mail for an user of the name +``petidomo-manager'' and to re-direct the e-mail to an user of the +name ``root'' --- the system administrator. + +Petidomo will send notifications of an error and administrative +things like that to the address ``petidomo-manager''. By setting this +alias to a certain user name, you can control who will receive those +mails. + +The next line now tells the MTA to pipe any incoming mail for the user +``petidomo'' into the ``listserv'' program, instead of delivering it +into a mailbox. ``listserv'' will then parse the mail for commands and +react accordingly. Hence, the address people can send their +subscription requests to is ``petidomo@your.host.name''. + +These aliases have been created by the install script, unless you told +it not to, and you don't need to worry about them. + +\bigskip + +Furthermore, each mailing list on your server requires three aliases, +as shown in the example below, which is written for the ``testlist'' +mailing list that comes with the distribution: +\begin{verbatim} +testlist: "|/usr/local/petidomo/bin/hermes testlist" +testlist-request: "|/usr/local/petidomo/bin/listserv testlist" +testlist-owner: petidomo-manager +\end{verbatim} + +The first alias, ``testlist'' is the address to which people can send +their mail in order to post to the mailing list. Any incoming mail for +that account will be piped into the ``hermes'' binary, which will +process the mail and then re-send it to all subscribers of the mailing +list. In order to let ``hermes'' know, for which mailing list the +posting was meant, the parameter ``testlist'' has to be specified on +the command line. If the name of the mailing list was ``foobar'', the +line would look like this: +\begin{verbatim} +foobar: "|/usr/local/petidomo/bin/hermes foobar" +\end{verbatim} + +The second alias is a special request address, to which users can send +their commands. The difference between this address and the +``petidomo'' alias described above is that ``listserv'' is being given +a default listname on the command line. The difference is this: If +``listserv'' receives a mail, which has the command ``subscribe'' in +it, without any further parameters, it will reject the command with an +error, because it doesn't know to which list the sender wants to be +added. + +If the command ``subscribe'' is sent to the ``testlist-request'' +address, though, it will assume that the user wants to be subscribed +to the ``testlist'' mailing list, as this is the default list for this +address. + +The name of this alias should always be the name of the mailing list +with the string ``-request'' appended. Theoretically you could choose +a different name, but this unwritten standard is wide accepted +throghout the Internet for several years now. + +The last alias is the name of the mailing list with the string +``-owner'' appended. This alias points to the person who is +responsible for managing the ``testlist'' mailing list. Petidomo +will send all e-mail concerning the administration of the mailing list +to the address ``listname-owner''. Usually this will ultimately be the +same person as the ``petidomo-manager'', but you are free to direct +mail for this account to somebody else, or to several persons. + +\chapter{Petidomo for Mailing List Users} +\label{petidomo as user} + +In this chapter, we will describe the commands, that are +understood by the ``listserv'' program. ``listserv'' is the interface +for the users of the mailing lists, where they can send their requests +to in order to be subscribed to a mailing list, be unsubscribed again +and similar things. The text here is mostly identical with the +default help text that is sent to the user +whenever he or she issues a command that is syntactically incorrect. +This text is stored in the file +\file{\~{}petidomo/etc/help} and can be +customized to fit the requirements of your site. + +User commands always have to be sent to the request address of +the mailing list --- \emph{not} to the mailing list itself. Petidomo +will try to recognize commands that are sent to the mailing list and +redirect them to the ``listserv'' program, but naturally this will not +work in all cases. The address, where requests should be directed to, +is \emph{always} the address of the mailing list with the string +``-request'' appended to the username. If the mailing list is called +``politics@foo.bar'', the appropriate request address is +``politics-requst@foo.bar''. + +Alternatively, commands can always be sent to the address +``peti\-do\-mo@your.ad\-dress'', but the ``-request''-address is preferable, +for the fact that the ``listserv'' will have a default listname for +this address and thus understand a simpler command syntax. + +\section{SUBSCRIBE} + +The ``subscribe'' command will add the address of the user to a +mailing list. When using the ``-request''-address, only the word +``subscribe'' is required for the request to suceed. If the command is +sent to the ``petidomo'' address, the user will have to specify an +additional parameter: The name of the mailing list he or she wants to +be added to, like in the following example: +\begin{verbatim} +subscribe politics +\end{verbatim} + +If the user wants to add an address that is not equal to the one he or +she is sending the e-mail from, the e-mail address will have to be +specified, too: +\begin{verbatim} +subscribe politics joe@foo.bar +\end{verbatim} + +The order in which the e-mail address and the mailing list name are +provided does not matter. Please note that the administrator can +configure Petidomo to disallow un-/subscring other addresses than +the one, the request is sent from, using the +``AllowAlienSubscription'' option in the list's config file. + +The command ``add'' is synonymous to ``subscribe''. + +\section{UNSUBSCRIBE} + +The syntax and usage of the ``unsubscribe`` command are the same as the +``subscribe'' command. The difference is, though, the the user's address +is removed from the mailing list rather than added to it. + +``delete'' and ``remove'' can be used synonymously to ``unsubscribe''. + +\section{INDEX} + +The ``index'' command does not need any parameters. Sending it to the +server will return a list of available mailing lists on this server. +This is useful in case you want to subscribe to a list but can't +remember the exact name anymore. + +The commands ``lists'' and ``longindex'' are synonyms to ``index''. + +\section{HELP} + +If the server receives the command ``help'', it will send the file +\file{\~{}peti\-domo/etc/help} back. If ``help'' has a parameter, +Petidomo will check whether this is a valid name of an existing +mailing list, and if it is, it will return the description file for +this mailing list, rather than the help-file. + +\section{MEMBERS} + +The ``members'' command will return the addresses of all subscribers +of the mailing list, if the administrator chose to allow this command. +When ``members' is sent to the ``-request''-address, the default list +will be used by Petidomo. Otherwise, the name of the mailing list +which's subscribers should be listed, has to be specified as an option +like in the following example: +\begin{verbatim} +members politics +\end{verbatim} + +The command ``who'' can be used synonymously to ``members''. +\chapter{Petidomo for Administrators} +\label{petidomo as admin} + +On the ``other side'' of Petidomo, from the user's +perspective, is the administrator of the mailing list --- also called +the \Def{mailing list owner}). Each mailing list has an +alias ``listname-owner'' (see section~\ref{aliases}), where the mail +address of the person who is responsible for this mailing list should +be specified. Per default, this is the user who is known as +``petidomo-manager''. But you are free to direct mail for this accoun +to any other person --- or several persons. + +The list owner will receive administrative e-mail from Petidomo in +the following cases: + +\begin{itemize} + +\item When a new user subscribes, or a subscriber removes himself from +the list, a carbon copy of the recipt will be sent to the owner. By +looking at these mails, the owner can check whether a ``subscribe'' or +``unsubscribe'' command looks bogus. He or she can also keep track of +who is on the list and who is not. + +\item If a ``members'' command is received for a mailing list where +this command has been disabled, this will also be forwarded to the +owner. + +\end{itemize} + +These mails are merely for information purposes and do not necessarily +require an action from the admin. There are cases, where the list +owner will receive mails from Petidomo, though, that require some +kind of reaction. + +\section{Bounces} + +While maintaining mailing list with a larger number of subscribers, it +happens regularly that subscribed addresses become invalid or are +temporarily not reachable. In this case postings will \Def{bounce}. +You will then receive a mail from a mail server telling you, that the +delivery of the mail failed. + +Often, addresses become unreachable due to a misconfiguration of a +machine, so it is not always necessary to remove that address from the +list immediately, but when an addresses bounces for several days in a +row, it is a good idea to delete that address from the mailing list. +You should do that by sending an ``unsubscribe'' command for that +address to the ``-request''-address of the mailing list. + +If you have configured Petidomo to disallow the unsubscription of +addresses not equal to the address the mail is sent from, you will +have to specify your admin password in the mail, to override the +barrier. How this is done is described in section~\ref{approve} later. + +\section{Closed and moderated lists} + +If you have configured a mailing list to reject postings under certain +circumstances, such as a closed or moderated mailing list, these +rejected articles will be forwarded to you for approval. When you +receive such a rejected article, you can either silently +discard it, contact the author or post it to the mailing list with +your approval. + +You can approve an article with the master password for Petidomo, the +admin password of the mailing list in question or the posting password +(see section~\ref{posting password} of that list. + +\section{Approving requests} +\label{approve} + +To approve an article, you have several ways of specifying the +appropriate password. They are all the same for Petidomo and it is +only a matter of taste, which scheme you use. + +When sending a command to the ``listserv'' program, though the +``-request'' or ``petidomo''-address, it is easy. Just preface your +commands with a ``password'' command, like in the +following example: +\begin{verbatim} +To: testlist-request@foo.bar +Subject: + +password open sesame +subscribe some@one.else +subscribe someone@even.elser +\end{verbatim} + +One ``password'' command sets your password for all the commands to +follow. If you want to use one mail to send requests for several +mailing lists with different passwords, just give a ``password'' +command again: +\begin{verbatim} +To: petidomo@foo.bar +Subject: + +password open sesame +subscribe user@inter.net testlist1 +password let me in +subscribe user@inter.net testlist2 +\end{verbatim} + +Instead of ``password'', you can also use the commands ``passwd'', or +``approve'', they are all synonymous. + +\section{Approving postings} + +If you want to approve a posting for a mailing list, just send the +article to the mailing list and specify your password either in the +header or in the body of the mail. + +If you choose to approve the mail in the body, add line with the +command ``approve'' to the mail as first line of the body. Petidomo +will strip that line before actually posting the article then. You can +also use the synonyms ``approved'', ``password'' or ``passwd'' +instead. Here is an example: +\begin{verbatim} +From: simons@petidomo.com (Peter Simons) +Subject: Cats are the most beautiful animals in the world. + +approve let me post +It's not that I wouldn't like animals like dogs, birds +or fishes, but for me, a cat is *the* animal to have. +[...] +\end{verbatim} + +The line ``approve let me post'' will be stripped by Petidomo and +then the article will be sent out. + +If you want to specify the password in the headers, just add an header +of the name ``Approved'' or ``Approve'' to the headers of the mail. +(Unfortunately, many mail readers do not allow you to modify the +headers of outgoing mail. That is why the body-approval has been +added.) Here is the same example as above now using the headers: +\begin{verbatim} +From: simons@petidomo.com (Peter Simons) +Subject: Cats are the most beautiful animals in the world. +Approve: let me post + +It's not that I wouldn't like animals like dogs, birds +or fishes, but for me, a cat is *the* animal to have. +[...] +\end{verbatim} + +Please note that you have to add a colon to the keyword to make a +valid RFC mail-header. + + +\chapter{The Access Control Language} +\label{acl} + +Unfortunately, we live in a world where some people are trying to +abuse services like mailing lists for their entertainment or for +commercial purposes. It is also not uncommon that among thousands of +mailing list subscribers, there is one particular moron who simply +can't behave. That is why access control is a useful feature, even +though it contradicts the idea of a mailing list: To be a media for +communication. + +Writing and understanding ACL files is, to be honest, not very easy +and the novice mailing list administrator should better be careful +when using them, because a wrong access control rule might cause more +trouble than it is worth, but the experienced administrator will +certainly appreciate their power. Understanding how ACL files work +will also require you to know a bit about the syntax of an RFC format +e-mail. A good place to start is to take a look at RFC822 and its +sons. + +In Petidomo, two places exist to control who is allowed to do what: +The global acl file +\file{\~{}petidomo/etc/acl} and the acl +file that is local to the mailing list: +\file{\~{}petidomo/lists/list\-name/acl}. While the latter is valid only +for the list in which's home directory it is stored, the globl acl +file will be parsed for \emph{all} your mailing lists. ACL files are +only relevant for mailing list postings, the ``listserv'' program does +not use them. + +The syntax of an ACL file is similar to the C programming +language, as you can see in the following example: +\begin{verbatim} +if (envelope matches "mailer-daemon@") then + forward "petidomo-manager"; +\end{verbatim} + +This is a simple version of the default ACL file which comes with the +Petidomo distribution and is installed in +\file{\~{}petidomo/etc/acl}. It tells hermes to forward all postings +to a mailing list, where the envelope of the mail matches the regular +expression ``mailer-daemon@''. This rule is included in the default +distribution to make sure that bounces of articles will not be posted +to the list again, thus causing an infinite mail loop. The syntax of +an ACL statement is shown in figure~\ref{acl syntax}. + +\begin{figure}[bth] +\begin{center} +\begin{tabular}{cccccccccc} +IF & ( & from & match & {\tt "}regexp{\tt "} & ) & THEN & pass & & ; \\ + & & subject & matches & & & & drop & & \\ + & & envelope & == & {\tt "}string{\tt "} & & & reject & & \\ + & & header & = & & & & rejectwith & {\tt "}file{\tt "} & \\ + & & body & & & & & redirect & {\tt "}address{\tt "} & \\ + & & & & & & & forward & {\tt "}address{\tt "} & \\ + & & & & & & & filter & {\tt "}script{\tt "} & \\ +IF & ( & & {\tt "}filter{\tt "} & & ) & THEN & & & ; \\ +\end{tabular} +\caption{The Access Control Language syntax.} +\label{acl syntax} +\end{center} +\end{figure} + +Admittedly, the figure is rather impossible to understand without +further explaination, don't worry if things are still a bit unclear +after looking at it. + +Every ACL statement looks like this: ``IF condition THEN action ;''. +The condition may or may not be enclosed in brackets. Several +conditions can be combined with the keywords ``OR'' and ``AND''. +Furthermore every condition can prefaced with a ``NOT'', which will +reverse the outcome of the condition. + +Let's explain this all at a concrete example: You want to reject all +postings which come from the addresses ``moron@moron.net'' and +``spam@spam.net'', because these people have constantly been abusing +your mailing list service. This can be done with the following two +statements: +\begin{verbatim} +IF from == "moron@moron.net" THEN reject; +IF from == "spam@spam.net" THEN reject; +\end{verbatim} + +Using the ``OR'' statement you can combine this into one statement: +\begin{verbatim} +IF from == "moron@moron.net" OR + from == "spam@spam.net" THEN + reject; +\end{verbatim} + +And now we include brackets for readability: +\begin{verbatim} +IF (from == "moron@moron.net") OR + (from == "spam@spam.net") THEN + reject; +\end{verbatim} + +The keyword ``from'' stands for the address, noted in the ``From:'' +header line of the mail and, the ``== {\tt "}address{\tt "}'' means +that the condition if this address is equal to the one written in +quotes thereafter. (You can also use a single `=' character, if you +prefer that over two equal-characters.) This is a verbatim match. If +we'd use the ``match'' or ``matches'' keyword instead of the ``=='', +the parameter would be interpreted as an extended regular expression +and the condition would be true if the addresses matched this pattern. +(Regular expressions are described in the re\_format(7) man page, or +in the manpages of sed(1), grep(1) or egrep(1).) + +Other keywords than ``from'' for the first part of the conditional are +``subject'' (the contents of the ``Subject:'' header), ``envelope'' +(the envelope of the mail), header and body. The latter two represent +the whole header or body of the mail and should be used only for +regular expression matches and not for verbatim matches. + +A short comment on the difference between ``redirect'' and +``forward'': The ``redirect'' action will send the mail to the +specified address without changing anythin in the mail. All the +headers are left untouched and thus the mail will look as if it has +been sent by the person to that address right away. This is useful for +redirecting mails to daemons or programs, but it will usually confuse +a human recipient + +The ``forward'' action, though, will send a mail to the specified +address with a new set of headers, which identify the Petidomo Mailing List Manager as +originator and then it will quote the mail that has been forwarded in +the mail body. + +Valid actions are ``pass'' (post the mail immediately), ``drop'' +(discard the mail without further notice), ``reject'' (send a mail to +the poster, telling him his posting was rejected), ``rejectwith'' +(sending mail to the poster, too, but with the contents of a specified +file), ``redirect'' (redirect the mail to a specified address), +``forward'' (like ``redirect'' but preface the mail with a note +telling why the mail was re-sent) or ``filter'' (pipe the mail into +the specified filter script and post the mail as the filter writes it +to the standard output). + +Here are a few more examples in the hope that they make this all +easier to understand: Let's assume you would like to catch all +postings to your mailing lists, that contain the words ``MAKE MONEY +FAST'' in the subject. Then one way of doing this is the following +statement: +\begin{verbatim} +IF (subejct matches "make money fast") THEN + rejectwith "/usr/local/petidomo/etc/make-money-fast.txt"; +\end{verbatim} + +The file \file{/usr/local/petidomo/etc/make-money-fast.txt} could, for +example, contain the following text: +\begin{quotation} +Dear poster, + +your mail has been rejected. Please note that chain letters like the +``make money fast'' text you tried to post are illegal throughout the +world and your are likely to get in trouble if you continue to spread +them. +\end{quotation} + +If someone tried to post the chain letter to your mailing lists now, +he would receive a mail like that: +\begin{verbatim} +Date: Sat, 28 Jun 1997 19:59:18 +0200 (MET DST) +From: testlist-owner@peti.cys.de (Petidomo Mailing List Server) +To: simons@cys.de +Cc: testlist-owner@peti.cys.de +Subject: Your posting to list "testlist" was rejected +Precedence: junk +Sender: testlist-owner@peti.cys.de + +Dear poster, + +your mail has been rejected. Please note that chain +letters like the ``make money fast'' text you tried +to post are illegal throughout the world and your are +likely to get in trouble if you continue to spread them. + +>From simons Sat Jun 28 19:59:17 1997 +Received: from [[UNIX: localhost]] + by peti.cys.de (8.8.5/8.8.4) id TAA16959 +Date: Sat, 28 Jun 1997 19:59:17 +0200 (MET DST) +Message-Id: <199706281759.TAA16959@peti.cys.de> +From: Peter Simons +To: testlist +Subject: MAKE MONEY FAST +Mime-Version: 1.0 (generated by tm-edit 7.92) +Content-Type: text/plain; charset=US-ASCII + +Hi, my name is David Rodes... +\end{verbatim} + +A few more words about how the ACL files are parsed: +\begin{itemize} + +\item All comparisons are done case insensitive. ``MAKE MONEY FAST'' +matches ``make money fast'' in both the verbatim and the regular +expression match just fine. + +\item Any whitespace in the ACL file is ignored. The statements +\begin{verbatim} +if (envelope matches "mailer-daemon@") then drop; +\end{verbatim} +and +\begin{verbatim} +if + (envelope matches +"mailer-daemon@") +then + drop +; +\end{verbatim} +are the same for Petidomo. + +\item The argument after the ``=='' or ``matches'' keyword \emph{has} +to be included in quotes. An ACL statement like this: +\begin{verbatim} +if from == simons@petidomo.com then drop; +\end{verbatim} +will cause Petidomo to abort with an error, because it can't parse +this. + +\item If you use an action that requires a parameter, like +``rejectwith'' or ``forward'', this parameter has to be enclosed in +quotes, too. A statement like this can also not be parsed by +Petidomo: +\begin{verbatim} +if from == "simons@petidomo.com" then + forward postmaster@petidomo.com; +\end{verbatim} + +\item Petidomo stops parsing the ACL file after the first statement +has matched. If you want to reject all mails from an address that +matches ``simons@.*\.de'', but you want mails from the address +``simons@rhein.de'' to pass nonetheless, the following two statements +will not work as expected: +\begin{verbatim} +if from matches "simons@.*\.de" then reject; +if from == "simons@rhein.de" then pass; +\end{verbatim} + +Instead you should use +\begin{verbatim} +if from == "simons@rhein.de" then pass; +if from matches "simons@.*\.de" then reject; +\end{verbatim} +or +\begin{verbatim} +if (from matches "simons@.*\.de") and + (not (from == "simons@rhein.de")) then + reject; +\end{verbatim} + +\item Currently you can't match for the double quote character ({\tt +"}), we're afraid. The escape sequence {\tt \verb+\+"} is not +supported yet. + +\end{itemize} + +One last example and then we'll come to the filters. The following +statement rejectes a mail based on a match in the headers. This is +very useful for rejecting mail from known spam domains. You usually +can't rely on the spammer to use a valid ``From:'' header and hence +the ``from''-match is useless to catch them. But the following +statement will usually get them nonetheless: +\begin{verbatim} +if (header matches "^Received:.*from spam.domain") then + forward "petidomo-manager"; +\end{verbatim} + +\bigskip + +If you thought, the Access Control Language is powerful so far, take a +look at the things you can do using filters. Rather than the syntax +described below, you can use the following statement: +\begin{verbatim} +if ("/usr/local/petidomo/bin/CheckPosting") then reject; +\end{verbatim} + +This is a special form of the usual ACL statements and it means the +following: The mail in question is piped into the ``CheckPostin'' +script. The script or program can perform various tests and when it +exists, the action part is executed depending on the return code the +script exited with. A return code of zero (0) means ``true'' and the +action will be executed. A return code of one (1) ``false'' and the +action will not be executed. + +Any other return code will cause Petidomo to abort with an error and +to save the mail. By using this mechanism, you can program even the +most sophisticated tests and hook them into the access control +mechanism. + +Another feature that hasn't been described yet is the action +``filter''. The filter-action is pretty much the same as the posting +filter, but it allows you to re-write the posting depending on who +posted it or other criteria. Please note that this filter is executed +additionally to a regular posting filter you might have configured. + +A nice example for what this feature can be used is the following: +\begin{verbatim} +if (address == "simons@petidomo.com") then + filter "/usr/local/petidomo/bin/simons.filter"; +\end{verbatim} + +The script \file{simons.filter} would then look like this: +\begin{verbatim} +#! /bin/sh + +cat +echo +echo "-- " +echo " Hold your breath -- this is *the* Peter Simons!" +\end{verbatim} + +We resisted the temptation of adding this ACL statement into the +default configuration of Petidomo. + +% \chapter{Administrating Mailing Lists} +% +\chapter{Miscellaneous Topics} +\section{Using posting filters} +\label{using posting filters} + +The posting filter functionality of Petidomo is a very useful +mechanism for you, if you run mailing lists where you want to +guarantee certain formal criteria, because you can hook a script or +program of your into the posting process and use it to re-format or +re-write the article that is going to be posted. + +We have included one +script into the distribution, +\file{\~{}peti\-domo/bin/Insert\-Name\-In\-Sub\-ject.sh}, which adds a string +into the subject line of every posting. The script is pretty short and +used sed(1) to perform its function. + +To use it, just add the line +\begin{verbatim} +PostingFilter ~petidomo/bin/InsertNameInSubject.sh listname +\end{verbatim} +with ``listname'' being the name of the mailing list. + +If the mailing list name was ``testlist'', for example, then this +posting filter would re-write the subject line +\begin{verbatim} +Subject: Hi everbody +\end{verbatim} +to +\begin{verbatim} +Subject: [testlist] Hi everbody +\end{verbatim} + +It is recommended to take a look at the script itself to understand +how this works. You will need a bit of knowledge of the Unix scripting +language and tools like sed(1) to program more complex posting filter, +we're afraid. + +As the last point it should be made clear, that the string you specify +as a filter is interpreted by the bourne shell for execution. It is +thus absolutely possible, to use a posting filter like that +\begin{verbatim} +PostingFilter "/bin/cat | /bin/cat ; echo ; echo testing" +\end{verbatim} +even though one might argue whether this particular example is a +useful thing. Anyway, you know what we wanted to demonstrate. + +\section{PGP-encrypted mailing lists} + +Another very useful feature of the posting filter and the access +control languange is the ability to maintain \Def{encrypted mailing +lists}. The idea is very simple: You create a PGP key pair for your +mailing list and spread the public key among the subscribers of your +mailing list. In turn you collect their public keys and store them on +the mailing list server. + +Whenever a subscriber wants to post an article to the mailing list, he +will encrypt it with the public key of the list server before +transferring it through the Internet. Petidomo will then receive the +mail, decrypt and process it and encrypt it again, with the public +keys of the subscribers. Once encrypted again, the mail is distributed +to the readers. + +Please note that at no time the mail was sent through the Internet in +clear text. Hence this mode is well-suited for maintaining internal +discussion lists for, say, software development among a few people who +know each other but live spread throughout the world. Included in the +distribution are two scripts, \file{pgp-encrypt.sh} and +\file{pgp-decrypt.sh}, which realize this. The setup needs a bit of +work, but once you understand the principle, it is rather easy. Just +follow the steps described below. + +\begin{enumerate} + +\item Get the PGP software package from `http://www.pgpi.com/', you +will need the PGP 2.6.2 version or later --- 5.x won't work, as far as +I know, maybe someone wants to adapt the PGP-mechanism to PGP 5.x, any +volunteers are welcome, and install it. + +\item Log in as user ``petidomo''. + +\item Create a directory \file{\~{}petidomo/.pgp} and set the {\tt +\$PGPPATH} variable to it. + +\item Create a PGP key pair by calling `pgp -kg''. As user-id enter +the address of the mailing list itself, for example: ``The secret +mailing list $<$secretlist@petidomo.com$>$''. + +\item Create a \file{config.txt} file for PGP in +\file{\~{}petidomo/.pgp} and insert the appropriate user id there. + +\item Distribute the newly created PGP key of the mailing list among +the subscribers. + +\item Add the PGP keys of the subscribers to Petidomo's keyring. + +\item Edit the following definitions in +\file{\~{}petidomo/bin/pgp-encrypt.sh}: + +\begin{verbatim} +# +# Please customize these things for your system. +# +PGP=/usr/local/bin/pgp +PASSWORD="DecryptMe" +PGPPATH=$PDHOME/.pgp +\end{verbatim} + +You will need to change the location of the PGP binary and insert the +password you chose for the secret key. For security reasons, the +script itself should be owned by ``petidomo'' as user- and group id, +and it should have the permission ``110'', so that only Petidomo can +execute it. + +\item Edit the equivalent definitions in +\file{\~{}petidomo/bin/pgp-encrypt.sh}. + +\item Now create the mailing list in question. In our example that +would be ``secretlist''. Naturally the mailing list should not be open +for public subscription. + +\item Edit the ACL file of the ``secretlist'' to contain the following +line: + +\begin{verbatim} +if (body matches "^-----BEGIN PGP MESSAGE-----$") then + filter "~petidomo/bin/pgp-decrypt.sh"; +\end{verbatim} + +\item Edit the config file to have the following posting filter: + +\begin{verbatim} +PostingFilter "~petidomo/bin/pgp-encrypt.sh secretlist" +\end{verbatim} + +Please note that you must provide the name of the mailing list on the +command line as parameter to \file{pgp-encrypt.sh}, so that it know +which list file it should take the subscriber addresses from. + +\item Do a test posting and that's it. + +\end{enumerate} + +There are a few things you should take care of: First of all, you must +make sure that you have the PGP public keys of all subscribers in the +keyring belonging to the ``petidomo'' user, or some of them won't be +able to decipher the mail posted via the list. You must also take care +that the addresses these people are subscribed under, are actually +listed in their public key, or PGP won't be able to recognize who is +who, when being called by \file{pgp-encrypt.sh}. + +Finally, make sure that you do this only with the correct versions of +the software. Petidomo needs to be version 2.1 or later, earlier +versions won't work. The PGP binary needs to understand the {\tt -@} +operator on the command line, which has been added in PGP 2.6i at some +time. + +One last hint: If PGP-encryption or decryption doesn't work, it will +usually help to remove the {\tt \$LOGFILE} parameter from the {\tt +trap} command in the scripts: + +\begin{verbatim} +trap 'rm -f $TMPFILE $HEADER $BODY $NEWBODY $LOGFILE; exit'... + ^^^^^^^^ +\end{verbatim} + +As a result, the script won't delete the output PGP issued when called +after exiting. Thus you will find the file still lying in \file{/tmp} +and can easily investigate what's wrong. + +\section{Virtual hosting and sendmail} +\label{virtual hosting and sendmail} + +A very useful things is Petidomo's virtual hosting feature. +Unfortunately, there are a few traps into which you might run when you +are trying to use it together with the Allmann sendmail. But we'll +start at the beginning. + +If you host mailing lists for domains other than your own, you can +tell Petidomo to use this name instead of the local one for certain +mailing lists in the list config file by setting the appropriate +``HostName''. Now all mail posted to this list, or sent to the +``-request'' address of the list, will appear to be coming from the +domain name you configured, rather than your own. + +When you are using sendmail v8, you will have to write these names to +the \$w\$ class in your sendmail.cf file, or the corresponfing M4 +config. This is done by adding the line +\begin{verbatim} +Cwdomain.name1 domain.name2 ... +\end{verbatim} +to the file. + +This will tell sendmail that these names are to be accepted and +delivered locally rather than to the MX of these entries. + +Doing this might deliver a surprise, though, if you are using +sendmail's masquerading abilities to hide the various hostname of your +domain. Per default, sendmail masquerades not only the domain names +you told him with the MASQUERADE\_DOMAIN() command, it automatically +masquerades all domain names of the \$w\$ class, too. + +The result is that Petidomo's fine virtual hosting is gone +immediately, because sendmail will re-write the name to your own +domain name. The fix for this is rather easy: Add the command +``FEATURE(limited\_masquerade)'' to your M4 file and sendmail won't +touch the names that are stated only in the \$w\$ class. + +\section{Mailing list archives} +\label{mailing list archives} + +If your are hosting a public mailing list, you might want to offer a +mailing list archive, that is accessible through the WWW and has all +the postings available for immediate access. We were in the midst of +developing a tool that does this for you when we came accross a +brilliant tool named ``MHonArc''. We installed it, tested it, and +deleted all attempts of writing something like that ourselves +immediately. + +We strongly recommend looking at MHonArc, if you want to offer a WWW +archive of your mailing lists. You can find more information about +MHonArc at the following location: +`http://www.oac.uci.edu/indiv/ehood/mhonarc.html' + +The installation of the tool itself is very easy. Once you have +MHonArc running, just enable the archiving feature in Petidomo and +feed the archives into MHonArc. That's it. + +\section{Verifying the address lists} + +Petidomo tries its best to make sure that only syntactically correct +addresses are subscribed to mailing lists, and if you stick to the +listserv interface, there's very little chance, an incorrect address +will make it into the \file{list} file. + +Sometimes, it is necessary to edit these files manually, though, or +Petidomo's address validation algorithm fails. Once you have an +incorrect address in your list file, sendmail will abort with an +error, without trying to deliver the mail at all. + +To clarify, this does not happen when an address is not reachable, +this happens only when you subscribe something like {\tt +hey@this@is@wrong....}. Once you suspect that your address list has +been corrupted, there's an easy way to find out, which addresses are +wrong. Simply use sendmail's address verification mode like this: + +\begin{verbatim} + $ xargs @bogus.address.here... user address required +\end{verbatim} + +This call will find all incorrect address and notify you. The 'sed' +call will filter out all correct addresses for your convenience. + +\end{document} From ossp-cvs-owner@ossp.org Sat Feb 17 22:59:18 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f1HLxHv72641; Sat, 17 Feb 2001 22:59:17 +0100 (CET) Date: Sat, 17 Feb 2001 22:59:17 +0100 (CET) Message-Id: <200102172159.f1HLxHv72641@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/petidomo main.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 17-Feb-2001 22:59:17 Branch: HEAD Handle: 2001021721591700 Modified files: ossp-pkg/petidomo main.c Log: Added check whether the required listname parameter is there _before_ we try and read the mail from standard input. Summary: Revision Changes Path 1.20 +18 -10 ossp-pkg/petidomo/main.c ____________________________________________________________________________ Index: ossp-pkg/petidomo/main.c ============================================================ $ cvs diff -u -r1.19 -r1.20 main.c --- ossp-pkg/petidomo/main.c 2001/01/21 12:00:35 1.19 +++ ossp-pkg/petidomo/main.c 2001/02/17 21:59:17 1.20 @@ -1,6 +1,6 @@ /* $Source: /e/ossp/cvs/ossp-pkg/petidomo/main.c,v $ - $Revision: 1.19 $ + $Revision: 1.20 $ Copyright (C) 2000 by CyberSolutions GmbH, Germany. @@ -90,24 +90,32 @@ argv_version_string = (char *)petidomo_version.v_gnu; argv_process(args, argc, argv); + /* Make sure we got all required parameters. */ + + if ((!strcasecmp(mode, "deliver") || !strcasecmp(mode, "dump")) && listname == NULL) + { + fprintf(stderr, "petidomo: %s mode requires a list name argument\n", mode); + exit(1); + } + /* Member Dump Mode */ - if (strcasecmp(mode, "dump") == 0) { + + if (strcasecmp(mode, "dump") == 0) + { char *cp; const struct List_Config *ListConfig; - if (listname == NULL) { - fprintf(stderr, "petidomo: dump mode requires a list name argument\n"); - exit(1); - } - if (InitPetidomo(masterconfig_path) != 0) { + if (InitPetidomo(masterconfig_path) != 0) + { fprintf(stderr, "petidomo: failed load master configuration.\n"); exit(1); - } + } MasterConfig = getMasterConfig(); ListConfig = getListConfig(listname); - if ((cp = loadfile(ListConfig->address_file)) == NULL) { + if ((cp = loadfile(ListConfig->address_file)) == NULL) + { fprintf(stderr, "petidomo: failed to open file \"%s\"\n", ListConfig->address_file); exit(1); - } + } fwrite(cp, strlen(cp), 1, stdout); free(cp); exit(0); From ossp-cvs-owner@ossp.org Sun Feb 18 00:06:07 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f1HN66H77612; Sun, 18 Feb 2001 00:06:06 +0100 (CET) Date: Sun, 18 Feb 2001 00:06:06 +0100 (CET) Message-Id: <200102172306.f1HN66H77612@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/petidomo/docs petidomo.tex Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 18-Feb-2001 00:06:06 Branch: HEAD Handle: 2001021723060500 Modified files: ossp-pkg/petidomo/docs petidomo.tex Log: - Updated the ACL chapter. - Removed all references to ~petidomo. - Documented the missing options. - Updated the chapter about aliases. - Updated the chapter about command line syntax. Summary: Revision Changes Path 1.6 +315 -135 ossp-pkg/petidomo/docs/petidomo.tex ____________________________________________________________________________ Index: ossp-pkg/petidomo/docs/petidomo.tex ============================================================ $ cvs diff -u -r1.5 -r1.6 petidomo.tex --- ossp-pkg/petidomo/docs/petidomo.tex 2001/02/17 21:46:46 1.5 +++ ossp-pkg/petidomo/docs/petidomo.tex 2001/02/17 23:06:05 1.6 @@ -2,7 +2,7 @@ % % Petidomo Manual % -% $Header: /e/ossp/cvs/ossp-pkg/petidomo/docs/petidomo.tex,v 1.5 2001/02/17 21:46:46 simons Exp $ +% $Header: /e/ossp/cvs/ossp-pkg/petidomo/docs/petidomo.tex,v 1.6 2001/02/17 23:06:05 simons Exp $ % \typearea[2cm]{12} \usepackage{lastpage} @@ -503,24 +503,30 @@ All configuration files in the Petidomo-package\label{Config file format}, have the following format: +\begin{quote} \begin{verbatim} keyword parameter \end{verbatim} +\end{quote} The ``keyword''-part must start at the first column of the line and is followed by one or several blanks or tabs. The first non-blank character then is interpreted as the parameter for this keyword. The following line, for example: +\begin{quote} \begin{verbatim} Hostname petidomo.is.great \end{verbatim} +\end{quote} will tell Petidomo that the name of the machine it is running on is called ``petidomo.is.great''. If the parameter contains any blanks, what is not very likely for a hostname, but may happen with other settings, you should enclose it in double quotes, like this: +\begin{quote} \begin{verbatim} AdminPassword "open sesame" \end{verbatim} +\end{quote} Quoting the parameter is not strictly necessary, though, Petidomo's config file parser will get it right anyway. You only have to quote @@ -534,9 +540,7 @@ \section{The Master Configuration File} \label{master config file} -Petidomo expects its master config file to be found under -\file{\~{}peti\-do\-mo/etc/pe\-ti\-domo.conf}. The following keywords are -recognized: +The following keywords are recognized in the master config file. \begin{description} @@ -546,9 +550,11 @@ Petidomo is running on. A fully qualified domain name is the hostname of the machine with the domain name appended with a dot. The following, for example: +\begin{quote} \begin{verbatim} HostName listserver.foo.bar \end{verbatim} +\end{quote} would be a valid statement. Normally this option has been set by the install script correctly already. @@ -565,9 +571,11 @@ This tag sets the master password, which authenticiates the Petidmo administrator. Here is an example: +\begin{quote} \begin{verbatim} AdminPassword "open sesame" \end{verbatim} +\end{quote} Normally this option has been set by the install script already. Please chose this password carefully. Knowledge of the master password @@ -589,9 +597,11 @@ install script already, so you don't need to worry about this anymore. An example setting is: +\begin{quote} \begin{verbatim} MTA "/usr/sbin/sendmail" \end{verbatim} +\end{quote} but Petidomo will run fine with other mail transport agents, too. So far, the system has been tested with the Allman sendmail, SMail and qmail without any problems. @@ -608,9 +618,11 @@ This entry sets the options which will be handed over to the MTA when it is called. The following example +\begin{quote} \begin{verbatim} MTAOptions "-odq -i -f%s" \end{verbatim} +\end{quote} will yield a call ``$<$MTA$>$ -odq -i -f$<$envelope$>$''. The `\%s' is replaced with the envelope the mail should be sent under. @@ -788,9 +800,11 @@ So all the mailing list guru from Inter.Net has to do is to set the entry +\begin{quote} \begin{verbatim} Hostname petiware.com \end{verbatim} +\end{quote} in the config file of the ``customers'' mailing list. Petidomo will now use the hostname ``peti\-ware.com'' in all mails that are posted to that list, instead of ``mail.inter.net''. @@ -835,9 +849,11 @@ option, you can force Petidomo to insert a `Reply-To:' which points to a certain address. On a moderated list, for example, you can set this as follows: +\begin{quote} \begin{verbatim} ReplyTo moderator@address.net \end{verbatim} +\end{quote} to direct all replies to the posting to the moderator again, regardless of what address is noted in the `From:' line of the mail. @@ -860,9 +876,11 @@ An example for a postin filter that wouldn't modify the mail at all is the following: +\begin{quote} \begin{verbatim} PostingFilter /bin/cat \end{verbatim} +\end{quote} A detailed discussion of posting filters can be found in section~\ref{using posting filters} of the manual. @@ -995,80 +1013,143 @@ \section{Command Line Syntax} +Petidomo understans several command line parameters. Here is the +complete list: + +\begin{description} + +\item[{-}-mode={\sf mode}] \hfill ``listserv'', ``deliver'', ``approve'', or ``dump'' + +The mode parameter is the only mandatory parameter and it will +determine what mode Petidomo runs in. Anyway, if Petidomo is started +in ``listserv'' mode, it will expect to read an e-mail from standard +input, which contains commands like ``subscribe'', ``index'' or +``help''. These commands will be carried out and notifications be sent +back to the mail's originator if apropriate. + +In ``deliver'' mode, Petidomo will read the incoming e-mail from +standard input and post it to the mailing list, which's name has been +provided via the ``listname'' option. When running in ``approve'' +mode, Petidomo will read the incoming mail from standard input and +search for any cookies that mail might contain. If it does, it checks +the ack-queue for a mail that has been deferred until confirmation +that matches that cookie and processes the mail. + +In ``dump'' mode, Petidomo will expect the name of a mailing list on +the command line --- the ``listname'' option --- and dump the list of +subscribed addresses on that list to standart output. + +\item[{-}-listname={\sf list name}] + +This parameter may contain any valid mailing list name. Depending on +the mode, it this list name will be used as follows. In ``listserv'' +mode, that list will be used as default list name for any command +where no list name has been specified. A ``subscribe'', for example'' +will subscribe the user to the list given here; a ``subscribe +some-other-name'' will still subscribe the user to that other list, +though. + +When running in ``deliver'' mode, this is the name of the list the +posting is supposed to be posted to. In ``dump'' mode, this is the +name of the list, which's subscriber list should be dumped. In +``approve'' mode, this parameter is ignored. + +\item[{-}-masterconf={\sf /path/to/petidomo.conf}] + +Using this parameter you can tell Petidomo to use a different location +for the master config file than the one that has been compiled in. + +\item[{-}-approved] + +This flag is for internal purposes and should not be specified by the +administrator. It will tell Petidomo that, whatever it is supposed to +do now, is the result of a received confirmation cookie. This will +effectively tell the checks for posting (in ListType ``acknowledged'' +and ``acknowledged-once'' mode) and un-/subscription (in +SubscriptionType ``acknowledged'' mode) that everything is fine and +that the request should be carried out. + +\end{description} + + \section{Aliases} \label{aliases} -The binaries of the Petidomo package are usually not called manually -from the shell, but by the mail transport agent. This works as -follows: You create an e-mail account, which serves the purpose of -accepting the incoming e-mail and piping it into the appropriate -binary. +The Petidomo binary will usually not be called manually from the +shell, but by the mail transport agent. This works as follows: You +create an e-mail account, which serves the purpose of accepting the +incoming e-mail and piping it into the Petidomo binary. This is archieved with the ``alias''-function of your mail transport agent. Most MTAs, like sendmail, have a file where a list of special account names is given together with the instructions what to do with -any mail received for that account. This file is usually located in -\file{/etc/aliases}. +any mail received for that account. This file is usually located at +\file{/etc/aliases} or \file{/etc/mail/aliases}. -One thing, aliases can do is to pipe the mail into a program for -processing. This is the mechanism Petidomo uses. Petidomo requires -you to add the following aliases to your system: +One thing, aliases can do is pipe the mail into a program for +processing. This is the mechanism Petidomo uses. Petidomo requires you +to add the following aliases to your system: +\begin{quote} \begin{verbatim} # # Mailing List Stuff # -petidomo-manager: root -petidomo: "|/usr/local/petidomo/bin/listserv" +petidomo-manager: postmaster +petidomo: "|/usr/local/bin/petidomo --mode=listserv" +petidomo-approve: "|/usr/local/bin/petidomo --mode=approve" \end{verbatim} +\end{quote} The lines starting with the `\#' character are only comments and are ignored by the mail transport agent. The fourth line, though, is the first command. It tells the MTA to accept mail for an user of the name -``petidomo-manager'' and to re-direct the e-mail to an user of the -name ``root'' --- the system administrator. +``petidomo-manager'' and to re-direct the e-mail to the address +``postmaster'' --- the mail system administrator. -Petidomo will send notifications of an error and administrative -things like that to the address ``petidomo-manager''. By setting this -alias to a certain user name, you can control who will receive those -mails. - -The next line now tells the MTA to pipe any incoming mail for the user -``petidomo'' into the ``listserv'' program, instead of delivering it -into a mailbox. ``listserv'' will then parse the mail for commands and -react accordingly. Hence, the address people can send their -subscription requests to is ``petidomo@your.host.name''. - -These aliases have been created by the install script, unless you told -it not to, and you don't need to worry about them. - -\bigskip - -Furthermore, each mailing list on your server requires three aliases, -as shown in the example below, which is written for the ``testlist'' -mailing list that comes with the distribution: -\begin{verbatim} -testlist: "|/usr/local/petidomo/bin/hermes testlist" -testlist-request: "|/usr/local/petidomo/bin/listserv testlist" -testlist-owner: petidomo-manager +Petidomo will send error notifications and things like that to the +address ``petidomo-manager''. By setting this alias to a certain user +name, you can control who will receive those mails. + +The next line tells the MTA to pipe any incoming mail for the user +``petidomo'' into the ``petidomo'' program, instead of delivering it +into a mailbox. ``petidomo'' (in listserv mode) will then parse the +mail for commands and react accordingly. Hence, the address people can +send their subscription requests to is ``petidomo@your.host.name''. + +Similarly, the address ``petidomo-approve'' will be used to receive +any acknowledges user send back after Petidomo requested them. Only +now, Petidomo is started in ``approve'' mode. + +Furthermore, each mailing list on your server \emph{requires} three +aliases, as shown in the example below, which is written for the +``testlist'' mailing list that comes with the distribution: +\begin{quote} +\begin{verbatim} +testlist: "|/usr/local/bin/petidomo --mode=deliver testlist" +testlist-request: "|/usr/local/bin/petidomo --mode=listserv testlist" +testlist-owner: petidomo-manager \end{verbatim} +\end{quote} The first alias, ``testlist'' is the address to which people can send their mail in order to post to the mailing list. Any incoming mail for -that account will be piped into the ``hermes'' binary, which will -process the mail and then re-send it to all subscribers of the mailing -list. In order to let ``hermes'' know, for which mailing list the -posting was meant, the parameter ``testlist'' has to be specified on -the command line. If the name of the mailing list was ``foobar'', the -line would look like this: +that account will be piped into the ``petidomo'' binary in ``deliver'' +mode, which will process the mail and then re-send it to all +subscribers of the mailing list. In order to let Petidomo know, for +which mailing list the posting was meant, the parameter ``testlist'' +has to be specified on the command line. If the name of the mailing +list was ``foobar'', the line would look like this: +\begin{quote} \begin{verbatim} -foobar: "|/usr/local/petidomo/bin/hermes foobar" +foobar: "|/usr/local/bin/petidomo --mode=deliver foobar" \end{verbatim} +\end{quote} The second alias is a special request address, to which users can send their commands. The difference between this address and the -``petidomo'' alias described above is that ``listserv'' is being given -a default listname on the command line. The difference is this: If -``listserv'' receives a mail, which has the command ``subscribe'' in +``petidomo'' alias described above is that here Petidomo is being +given a default listname on the command line. The difference is this: +If Petidomo receives a mail, which has the command ``subscribe'' in it, without any further parameters, it will reject the command with an error, because it doesn't know to which list the sender wants to be added. @@ -1080,8 +1161,8 @@ The name of this alias should always be the name of the mailing list with the string ``-request'' appended. Theoretically you could choose -a different name, but this unwritten standard is wide accepted -throghout the Internet for several years now. +a different name, but this unwritten standard has been widely accepted +in the Internet for several years now. The last alias is the name of the mailing list with the string ``-owner'' appended. This alias points to the person who is @@ -1094,31 +1175,22 @@ \chapter{Petidomo for Mailing List Users} \label{petidomo as user} -In this chapter, we will describe the commands, that are -understood by the ``listserv'' program. ``listserv'' is the interface -for the users of the mailing lists, where they can send their requests -to in order to be subscribed to a mailing list, be unsubscribed again -and similar things. The text here is mostly identical with the -default help text that is sent to the user -whenever he or she issues a command that is syntactically incorrect. -This text is stored in the file -\file{\~{}petidomo/etc/help} and can be -customized to fit the requirements of your site. +In this chapter, we will describe the commands, that are understood in +``listserv'' mode. This is the interface for the users of the mailing +lists, where they can send their requests to in order to be subscribed +to a mailing list, be unsubscribed again and similar things. The text +here is mostly identical with the default help text that is sent to +the user whenever he or she issues a command that is syntactically +incorrect. User commands always have to be sent to the request address of -the mailing list --- \emph{not} to the mailing list itself. Petidomo -will try to recognize commands that are sent to the mailing list and -redirect them to the ``listserv'' program, but naturally this will not -work in all cases. The address, where requests should be directed to, -is \emph{always} the address of the mailing list with the string -``-request'' appended to the username. If the mailing list is called -``politics@foo.bar'', the appropriate request address is -``politics-requst@foo.bar''. +the mailing list --- \emph{not} to the mailing list itself! Alternatively, commands can always be sent to the address -``peti\-do\-mo@your.ad\-dress'', but the ``-request''-address is preferable, -for the fact that the ``listserv'' will have a default listname for -this address and thus understand a simpler command syntax. +``peti\-do\-mo@your.ad\-dress'', but the ``-request''-address is +preferable, for the fact that the Petidomo will have a default +listname for this address and thus understand a simpler command +syntax. \section{SUBSCRIBE} @@ -1128,16 +1200,20 @@ sent to the ``petidomo'' address, the user will have to specify an additional parameter: The name of the mailing list he or she wants to be added to, like in the following example: +\begin{quote} \begin{verbatim} subscribe politics \end{verbatim} +\end{quote} If the user wants to add an address that is not equal to the one he or she is sending the e-mail from, the e-mail address will have to be specified, too: +\begin{quote} \begin{verbatim} subscribe politics joe@foo.bar \end{verbatim} +\end{quote} The order in which the e-mail address and the mailing list name are provided does not matter. Please note that the administrator can @@ -1166,11 +1242,11 @@ \section{HELP} -If the server receives the command ``help'', it will send the file -\file{\~{}peti\-domo/etc/help} back. If ``help'' has a parameter, -Petidomo will check whether this is a valid name of an existing -mailing list, and if it is, it will return the description file for -this mailing list, rather than the help-file. +If the server receives the command ``help'', it will send the help +file back. If ``help'' has a parameter, Petidomo will check whether +this is a valid name of an existing mailing list, and if it is, it +will return the description file for this mailing list, rather than +the help file. \section{MEMBERS} @@ -1180,9 +1256,11 @@ will be used by Petidomo. Otherwise, the name of the mailing list which's subscribers should be listed, has to be specified as an option like in the following example: +\begin{quote} \begin{verbatim} members politics \end{verbatim} +\end{quote} The command ``who'' can be used synonymously to ``members''. @@ -1260,10 +1338,10 @@ appropriate password. They are all the same for Petidomo and it is only a matter of taste, which scheme you use. -When sending a command to the ``listserv'' program, though the -``-request'' or ``petidomo''-address, it is easy. Just preface your -commands with a ``password'' command, like in the -following example: +When sending a command to Petidomo in ``listserv'' mode through the +``-request'' or ``petidomo''-address, it is easy: Just preface your +commands with a ``password'' command, like in the following example. +\begin{quote} \begin{verbatim} To: testlist-request@foo.bar Subject: @@ -1272,11 +1350,13 @@ subscribe some@one.else subscribe someone@even.elser \end{verbatim} +\end{quote} One ``password'' command sets your password for all the commands to follow. If you want to use one mail to send requests for several mailing lists with different passwords, just give a ``password'' command again: +\begin{quote} \begin{verbatim} To: petidomo@foo.bar Subject: @@ -1286,6 +1366,7 @@ password let me in subscribe user@inter.net testlist2 \end{verbatim} +\end{quote} Instead of ``password'', you can also use the commands ``passwd'', or ``approve'', they are all synonymous. @@ -1301,6 +1382,7 @@ will strip that line before actually posting the article then. You can also use the synonyms ``approved'', ``password'' or ``passwd'' instead. Here is an example: +\begin{quote} \begin{verbatim} From: simons@petidomo.com (Peter Simons) Subject: Cats are the most beautiful animals in the world. @@ -1310,6 +1392,7 @@ or fishes, but for me, a cat is *the* animal to have. [...] \end{verbatim} +\end{quote} The line ``approve let me post'' will be stripped by Petidomo and then the article will be sent out. @@ -1319,6 +1402,7 @@ (Unfortunately, many mail readers do not allow you to modify the headers of outgoing mail. That is why the body-approval has been added.) Here is the same example as above now using the headers: +\begin{quote} \begin{verbatim} From: simons@petidomo.com (Peter Simons) Subject: Cats are the most beautiful animals in the world. @@ -1328,12 +1412,13 @@ or fishes, but for me, a cat is *the* animal to have. [...] \end{verbatim} +\end{quote} Please note that you have to add a colon to the keyword to make a valid RFC mail-header. -\chapter{The Access Control Language} +\section{The Access Control Language} \label{acl} Unfortunately, we live in a world where some people are trying to @@ -1354,26 +1439,24 @@ sons. In Petidomo, two places exist to control who is allowed to do what: -The global acl file -\file{\~{}petidomo/etc/acl} and the acl -file that is local to the mailing list: -\file{\~{}petidomo/lists/list\-name/acl}. While the latter is valid only -for the list in which's home directory it is stored, the globl acl -file will be parsed for \emph{all} your mailing lists. ACL files are -only relevant for mailing list postings, the ``listserv'' program does -not use them. +The global acl file and the acl file that is local to the mailing +list. While the latter is valid only for the list in which's home +directory it is stored, the globl acl file will be parsed for +\emph{all} your mailing lists. ACL files are only relevant for mailing +list postings, Petidomo does not use them in ``listserv'' mode. The syntax of an ACL file is similar to the C programming language, as you can see in the following example: +\begin{quote} \begin{verbatim} if (envelope matches "mailer-daemon@") then forward "petidomo-manager"; \end{verbatim} +\end{quote} This is a simple version of the default ACL file which comes with the -Petidomo distribution and is installed in -\file{\~{}petidomo/etc/acl}. It tells hermes to forward all postings -to a mailing list, where the envelope of the mail matches the regular +Petidomo distribution. It tells Petidomo to forward all postings to a +mailing list, where the envelope of the mail matches the regular expression ``mailer-daemon@''. This rule is included in the default distribution to make sure that bounces of articles will not be posted to the list again, thus causing an infinite mail loop. The syntax of @@ -1389,17 +1472,64 @@ & & body & & & & & redirect & {\tt "}address{\tt "} & \\ & & & & & & & forward & {\tt "}address{\tt "} & \\ & & & & & & & filter & {\tt "}script{\tt "} & \\ + & & & & & & & approve & & \\ IF & ( & & {\tt "}filter{\tt "} & & ) & THEN & & & ; \\ \end{tabular} -\caption{The Access Control Language syntax.} +\caption{Access Control Language syntax} \label{acl syntax} \end{center} \end{figure} Admittedly, the figure is rather impossible to understand without further explaination, don't worry if things are still a bit unclear -after looking at it. +after looking at it. There is also an EBNF grammar of the ACL to be +found in figure~\ref{ebnf}, which might help those who can read BNF +much more than the other figure. +\begin{figure}[bth] +\begin{quote} +\begin{verbatim} +input: /* empty */ + | input statmt + ; + +statmt: `;' + | `if' exp `then' action `;' + ; + +exp: qualifier `=' string + | qualifier `match' string + | string + | exp `or' exp + | exp `and' exp + | `!' exp + | `(' exp `)' + ; + +qualifier: `from' + | `subject' + | `envelope' + | `header' + | `body' + ; + +action: `pass' + | `drop' + | `approve' + | `reject' + | `rejectwith' string + | `redirect' string + | `forward' string + | `filter' string + ; + +string: `"' [^"]* `"' +\end{verbatim} +\end{quote} +\caption{EBNF of the Access Control Language} +\label{ebnf} +\end{figure} + Every ACL statement looks like this: ``IF condition THEN action ;''. The condition may or may not be enclosed in brackets. Several conditions can be combined with the keywords ``OR'' and ``AND''. @@ -1411,24 +1541,30 @@ ``spam@spam.net'', because these people have constantly been abusing your mailing list service. This can be done with the following two statements: +\begin{quote} \begin{verbatim} IF from == "moron@moron.net" THEN reject; IF from == "spam@spam.net" THEN reject; \end{verbatim} +\end{quote} Using the ``OR'' statement you can combine this into one statement: +\begin{quote} \begin{verbatim} IF from == "moron@moron.net" OR from == "spam@spam.net" THEN reject; \end{verbatim} +\end{quote} And now we include brackets for readability: +\begin{quote} \begin{verbatim} IF (from == "moron@moron.net") OR (from == "spam@spam.net") THEN reject; \end{verbatim} +\end{quote} The keyword ``from'' stands for the address, noted in the ``From:'' header line of the mail and, the ``== {\tt "}address{\tt "}'' means @@ -1468,31 +1604,37 @@ ``forward'' (like ``redirect'' but preface the mail with a note telling why the mail was re-sent) or ``filter'' (pipe the mail into the specified filter script and post the mail as the filter writes it -to the standard output). +to the standard output). Furthermore, there is the ``approve'' action +that allows you to approve the posting, thus bypassing all other +checks. Here are a few more examples in the hope that they make this all easier to understand: Let's assume you would like to catch all postings to your mailing lists, that contain the words ``MAKE MONEY FAST'' in the subject. Then one way of doing this is the following statement: +\begin{quote} \begin{verbatim} IF (subejct matches "make money fast") THEN - rejectwith "/usr/local/petidomo/etc/make-money-fast.txt"; + rejectwith "/usr/local/share/petidomo/make-money-fast.txt"; \end{verbatim} - -The file \file{/usr/local/petidomo/etc/make-money-fast.txt} could, for -example, contain the following text: -\begin{quotation} +\end{quote} +The file \file{make-money-fast.txt} could, for example, contain the +following text: +\begin{quote} +\begin{verbatim} Dear poster, -your mail has been rejected. Please note that chain letters like the -``make money fast'' text you tried to post are illegal throughout the -world and your are likely to get in trouble if you continue to spread -them. -\end{quotation} +your mail has been rejected. Please note that chain letters +like the "make money fast" text you tried to post are +illegal throughout the world and your are likely to get in +trouble if you continue to spread them. +\end{verbatim} +\end{quote} If someone tried to post the chain letter to your mailing lists now, he would receive a mail like that: +\begin{quote} \begin{verbatim} Date: Sat, 28 Jun 1997 19:59:18 +0200 (MET DST) From: testlist-owner@peti.cys.de (Petidomo Mailing List Server) @@ -1504,10 +1646,10 @@ Dear poster, -your mail has been rejected. Please note that chain -letters like the ``make money fast'' text you tried -to post are illegal throughout the world and your are -likely to get in trouble if you continue to spread them. +your mail has been rejected. Please note that chain letters +like the ``make money fast'' text you tried to post are +illegal throughout the world and your are likely to get in +trouble if you continue to spread them. >From simons Sat Jun 28 19:59:17 1997 Received: from [[UNIX: localhost]] @@ -1522,6 +1664,7 @@ Hi, my name is David Rodes... \end{verbatim} +\end{quote} A few more words about how the ACL files are parsed: \begin{itemize} @@ -1531,10 +1674,13 @@ expression match just fine. \item Any whitespace in the ACL file is ignored. The statements +\begin{quote} \begin{verbatim} if (envelope matches "mailer-daemon@") then drop; \end{verbatim} +\end{quote} and +\begin{quote} \begin{verbatim} if (envelope matches @@ -1543,13 +1689,16 @@ drop ; \end{verbatim} -are the same for Petidomo. +\end{quote} +are the same to Petidomo. \item The argument after the ``=='' or ``matches'' keyword \emph{has} to be included in quotes. An ACL statement like this: +\begin{quote} \begin{verbatim} if from == simons@petidomo.com then drop; \end{verbatim} +\end{quote} will cause Petidomo to abort with an error, because it can't parse this. @@ -1557,32 +1706,40 @@ ``rejectwith'' or ``forward'', this parameter has to be enclosed in quotes, too. A statement like this can also not be parsed by Petidomo: +\begin{quote} \begin{verbatim} if from == "simons@petidomo.com" then forward postmaster@petidomo.com; \end{verbatim} +\end{quote} \item Petidomo stops parsing the ACL file after the first statement has matched. If you want to reject all mails from an address that matches ``simons@.*\.de'', but you want mails from the address ``simons@rhein.de'' to pass nonetheless, the following two statements will not work as expected: +\begin{quote} \begin{verbatim} if from matches "simons@.*\.de" then reject; if from == "simons@rhein.de" then pass; \end{verbatim} +\end{quote} Instead you should use +\begin{quote} \begin{verbatim} if from == "simons@rhein.de" then pass; if from matches "simons@.*\.de" then reject; \end{verbatim} +\end{quote} or +\begin{quote} \begin{verbatim} if (from matches "simons@.*\.de") and (not (from == "simons@rhein.de")) then reject; \end{verbatim} +\end{quote} \item Currently you can't match for the double quote character ({\tt "}), we're afraid. The escape sequence {\tt \verb+\+"} is not @@ -1596,22 +1753,24 @@ can't rely on the spammer to use a valid ``From:'' header and hence the ``from''-match is useless to catch them. But the following statement will usually get them nonetheless: +\begin{quote} \begin{verbatim} if (header matches "^Received:.*from spam.domain") then forward "petidomo-manager"; \end{verbatim} - -\bigskip +\end{quote} If you thought, the Access Control Language is powerful so far, take a -look at the things you can do using filters. Rather than the syntax -described below, you can use the following statement: +look at the things you can do using filters. Rather than the examples +described above, you could use the following statement: +\begin{quote} \begin{verbatim} -if ("/usr/local/petidomo/bin/CheckPosting") then reject; +if ("/usr/local/libexec/petidomo/CheckPosting") then reject; \end{verbatim} +\end{quote} This is a special form of the usual ACL statements and it means the -following: The mail in question is piped into the ``CheckPostin'' +following: The mail in question is piped into the ``CheckPosting'' script. The script or program can perform various tests and when it exists, the action part is executed depending on the return code the script exited with. A return code of zero (0) means ``true'' and the @@ -1630,12 +1789,15 @@ additionally to a regular posting filter you might have configured. A nice example for what this feature can be used is the following: +\begin{quote} \begin{verbatim} if (address == "simons@petidomo.com") then - filter "/usr/local/petidomo/bin/simons.filter"; + filter "/usr/local/libexec/petidomo/simons.filter"; \end{verbatim} +\end{quote} The script \file{simons.filter} would then look like this: +\begin{quote} \begin{verbatim} #! /bin/sh @@ -1644,6 +1806,7 @@ echo "-- " echo " Hold your breath -- this is *the* Peter Simons!" \end{verbatim} +\end{quote} We resisted the temptation of adding this ACL statement into the default configuration of Petidomo. @@ -1660,27 +1823,32 @@ program of your into the posting process and use it to re-format or re-write the article that is going to be posted. -We have included one -script into the distribution, -\file{\~{}peti\-domo/bin/Insert\-Name\-In\-Sub\-ject.sh}, which adds a string -into the subject line of every posting. The script is pretty short and -used sed(1) to perform its function. +We have included one script into the distribution, +\file{Insert\-Name\-In\-Sub\-ject.sh}, which adds a string into the +subject line of every posting. The script is pretty short and used +sed(1) to perform its function. To use it, just add the line +\begin{quote} \begin{verbatim} PostingFilter ~petidomo/bin/InsertNameInSubject.sh listname \end{verbatim} +\end{quote} with ``listname'' being the name of the mailing list. If the mailing list name was ``testlist'', for example, then this posting filter would re-write the subject line +\begin{quote} \begin{verbatim} Subject: Hi everbody \end{verbatim} +\end{quote} to +\begin{quote} \begin{verbatim} Subject: [testlist] Hi everbody \end{verbatim} +\end{quote} It is recommended to take a look at the script itself to understand how this works. You will need a bit of knowledge of the Unix scripting @@ -1690,9 +1858,11 @@ As the last point it should be made clear, that the string you specify as a filter is interpreted by the bourne shell for execution. It is thus absolutely possible, to use a posting filter like that +\begin{quote} \begin{verbatim} PostingFilter "/bin/cat | /bin/cat ; echo ; echo testing" \end{verbatim} +\end{quote} even though one might argue whether this particular example is a useful thing. Anyway, you know what we wanted to demonstrate. @@ -1730,24 +1900,24 @@ \item Log in as user ``petidomo''. -\item Create a directory \file{\~{}petidomo/.pgp} and set the {\tt -\$PGPPATH} variable to it. +\item Create a directory \file{.pgp} in the home directory of the +users Petidomo runs under and set the {\tt \$PGPPATH} variable to it. \item Create a PGP key pair by calling `pgp -kg''. As user-id enter the address of the mailing list itself, for example: ``The secret mailing list $<$secretlist@petidomo.com$>$''. -\item Create a \file{config.txt} file for PGP in -\file{\~{}petidomo/.pgp} and insert the appropriate user id there. +\item Create a \file{config.txt} file for PGP in the \file{.pgp} +directory and insert the appropriate user id there. \item Distribute the newly created PGP key of the mailing list among the subscribers. \item Add the PGP keys of the subscribers to Petidomo's keyring. -\item Edit the following definitions in -\file{\~{}petidomo/bin/pgp-encrypt.sh}: +\item Edit the following definitions in \file{pgp-encrypt.sh}: +\begin{quote} \begin{verbatim} # # Please customize these things for your system. @@ -1756,6 +1926,7 @@ PASSWORD="DecryptMe" PGPPATH=$PDHOME/.pgp \end{verbatim} +\end{quote} You will need to change the location of the PGP binary and insert the password you chose for the secret key. For security reasons, the @@ -1763,8 +1934,7 @@ and it should have the permission ``110'', so that only Petidomo can execute it. -\item Edit the equivalent definitions in -\file{\~{}petidomo/bin/pgp-encrypt.sh}. +\item Edit the equivalent definitions in \file{pgp-encrypt.sh}. \item Now create the mailing list in question. In our example that would be ``secretlist''. Naturally the mailing list should not be open @@ -1773,16 +1943,20 @@ \item Edit the ACL file of the ``secretlist'' to contain the following line: +\begin{quote} \begin{verbatim} if (body matches "^-----BEGIN PGP MESSAGE-----$") then filter "~petidomo/bin/pgp-decrypt.sh"; \end{verbatim} +\end{quote} \item Edit the config file to have the following posting filter: +\begin{quote} \begin{verbatim} PostingFilter "~petidomo/bin/pgp-encrypt.sh secretlist" \end{verbatim} +\end{quote} Please note that you must provide the name of the mailing list on the command line as parameter to \file{pgp-encrypt.sh}, so that it know @@ -1810,10 +1984,12 @@ usually help to remove the {\tt \$LOGFILE} parameter from the {\tt trap} command in the scripts: +\begin{quote} \begin{verbatim} trap 'rm -f $TMPFILE $HEADER $BODY $NEWBODY $LOGFILE; exit'... ^^^^^^^^ \end{verbatim} +\end{quote} As a result, the script won't delete the output PGP issued when called after exiting. Thus you will find the file still lying in \file{/tmp} @@ -1837,9 +2013,11 @@ When you are using sendmail v8, you will have to write these names to the \$w\$ class in your sendmail.cf file, or the corresponfing M4 config. This is done by adding the line +\begin{quote} \begin{verbatim} Cwdomain.name1 domain.name2 ... \end{verbatim} +\end{quote} to the file. This will tell sendmail that these names are to be accepted and @@ -1881,8 +2059,8 @@ Petidomo tries its best to make sure that only syntactically correct addresses are subscribed to mailing lists, and if you stick to the -listserv interface, there's very little chance, an incorrect address -will make it into the \file{list} file. +correct mail interface, there's very little chance, an incorrect +address will make it into the \file{list} file. Sometimes, it is necessary to edit these files manually, though, or Petidomo's address validation algorithm fails. Once you have an @@ -1895,10 +2073,12 @@ been corrupted, there's an easy way to find out, which addresses are wrong. Simply use sendmail's address verification mode like this: +\begin{quote} \begin{verbatim} $ xargs @bogus.address.here... user address required \end{verbatim} +\end{quote} This call will find all incorrect address and notify you. The 'sed' call will filter out all correct addresses for your convenience. From ossp-cvs-owner@ossp.org Sun Feb 18 01:05:40 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f1I05dF81817; Sun, 18 Feb 2001 01:05:39 +0100 (CET) Date: Sun, 18 Feb 2001 01:05:39 +0100 (CET) Message-Id: <200102180005.f1I05dF81817@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/petidomo ChangeLog configure.in Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 18-Feb-2001 01:05:39 Branch: HEAD Handle: 2001021800053900 Modified files: ossp-pkg/petidomo ChangeLog configure.in Log: - Removed AC_REVISION: The information can not be found trivially in the configure file anyway. - Rather than patching the "-g -O2" away, set CFLAGS in any case -- even if it is emty --, so that autoconf will not even generate it. Summary: Revision Changes Path 1.3 +790 -0 ossp-pkg/petidomo/ChangeLog 1.10 +7 -10 ossp-pkg/petidomo/configure.in ____________________________________________________________________________ Index: ossp-pkg/petidomo/ChangeLog ============================================================ $ cvs diff -u -r1.2 -r1.3 ChangeLog --- ossp-pkg/petidomo/ChangeLog 2001/01/18 20:07:58 1.2 +++ ossp-pkg/petidomo/ChangeLog 2001/02/18 00:05:39 1.3 @@ -1,3 +1,793 @@ +2001-02-17 Peter Simons + + * Updated the documentation for the 4.x version. + + * When posting to a list, Petidomo will now let the "Keywords:" + and "Summary:" headers pass. These headers are uncommon but have + been around for ages. + + * Petidomo will not log to syslog() with level LOG_NOTICE anymore + unless it is an error or at least an unusual condition. Lowered + level of most messages to LOG_INFO or below. + + * Fixed a type in the example master config file: MTAOptions + should have '-i' set, not '-v'. + +2001-01-21 Ralf S. Engelschall + + * Added DESTDIR support to the Makefile. + + * Added "dump" mode to Petidomo, which is used by the + petidomo-kickout script rather than messing in the config files + itself. + +2001-01-20 Ralf S. Engelschall + + * Changed Petidomo so that it will send a separate mail to the + list owner when someone subscribes, rather than just sending a + carbon copy of the mail the user receives. This will prevent + unnecessary confusion. + +2001-01-20 Ralf S. Engelschall + + * Added "dist" and "snap" target to the Makefile. These can be + used to build a distribution or a snapshot respectively. + + * Added make targets for increasing or updating version + information the version information: "update-version" will update + the date but keep version number, "new-version" will let you + interactively specify new version number. To specify the new + version number for "new-version" on the command line, provide + "VERSION=0.8.15". + +2001-01-20 Peter Simons + + * Underscores in file names suck, because you need an extra + key-press to type them compared to the hyphen. For this reason + (and for consistency) I corrected this horrible, horrible mistake + of the past and renamed everything that contained an underscore. + +2001-01-20 Ralf S. Engelschall + + * .cvsignore, Makefile.in, petidomo.pod: + Add first cut for a petidomo(1) manual page. + +2001-01-20 Peter Simons + + * Makefile.in, config-files.c, config.c: + Renamed the followings tags in petidomo.conf + + MTA_Options --> MTAOptions + List_Directory --> ListDirectory + Ack_Queue_Directory --> AckQueueDirectory + + for consistency reasons. While I was at it, I also renamed the source + file from config.c to config-files.c, because the module config.c is + generally associated with GNU autoconf and this has nothing to do with + it. + +2001-01-20 Ralf S. Engelschall + + * main.c: + Be careful, listname can be NULL in global operation mode and not + all printf implementations are as smart as BSD's variant. Instead of + printing "(null)" others just dump core. + + * docs/.cvsignore: + Ignore LaTeX generated files + +2001-01-19 Peter Simons + + * Makefile.in: Cosmetic change. + + * Makefile.in: Updated dependencies. + + * archive.c: + Enhanced portability. This commit also contains an older + change made by Ralf, which I have to re-commit after + screwing up with the "cvs admin" command. Sorry!!! + + * mailer.c: + Minor change to enhance portability. + + * config.c: + The module contains the static variable MasterConfig, which all other + Petidomo routines can access via getMasterConfig(). The routine + getListConfig(), which is defined in config.c, too, used the "correct" + mechanism to access MasterConfig, even though it could access it + directly. Since I chose the same name ("MasterConfig" :->) for the + local copy of the pointer, gcc warns that this variable shadows the + static one. To get rid of this warning, and since it doesn't make one + bit a difference, getListConfig() accessse the static variable + directly now. + + * hermes.c: + Changed ACL semantics: The ACL is processed only if the posting didn't + have a valid password. If it did, the mail is going through in any + case and the ACL is not tested. + + * config/index, Makefile.in: + In case no index file is installed, "make install" will create an + example file at the correct location so that the admininstrator + hopefully figures out that there is some work to be done. + + * acl.y: + - Added a warning message to be logged when no global ACL file exists. + + - Reordered tests in check_local_acl_file: When no listname has been + given, we don't need to initialize the lexer at all. + + * hermes.c: + Petidomo used the mail's envelope to deliver the request for + confirmation. I have changed this to either reply-to or from (if + reply-to is unset), because sendmail will destroy the original + envelope under obscure circumstances. + + * main.c: Removed unnecessary cast. + + * config.c: + Due to a mix-up in the variable names, Petidomo expanded all list + config file paths incorrectly when the list has a flat hierarchy. That + is fixed now. + +2001-01-19 Ralf S. Engelschall + + * Makefile.in: + Provide "make dist" command for rolling distribution tarball. + +2001-01-19 Peter Simons + + * main.c: + Added version information to the start-up log message. + +2001-01-19 Ralf S. Engelschall + + * Makefile.in, main.c, version.c: + First step in GNu shtool version support: + Add version.c and use it for "petidomo --version". + Support for handling version.c in Makefile.in is coming later. + + * libconfigfile/config.c, librfc822/address.y, librfc822/decomment.c, libargv/argv.c, acl.y, address-db.c, approve.c, config.c, filter.c, hermes.c, index.c, io.c, mailer.c, members.c, password.c, queue_command.c, queue_posting.c, subscribe.c, unsubscribe.c: + Get rid of all complaints from GCC 2.97 + (except for two things which I do not want to change on my own) + +2001-01-19 Peter Simons + + * queue_command.c, queue_posting.c: + Incorporated the cookie into the end-of-mail-marker used in the + ack-script, so that the whole mechanism doesn't break when somebody + has the words '[end-of-mail-marker]' in the mail body itself. + + * subscribe.c, unsubscribe.c: + Fixed the spelling of the newly added syslog messages. + + * main.c: + Moved the initial startup log message up so that it is logged before + the main config file is parsed. Also added the path of the main config + file to the message so that people can see where Petidomo locks for it + in case parsing fails. + + * hermes.c, subscribe.c, unsubscribe.c: + Greatly enhanced the log messages Petidomo writes. Made the existing + messages more helpful, added lots of new ones, generally made things + real perfect. Remember: Life is BEAUTIFUL. + +2001-01-19 Ralf S. Engelschall + + * Makefile.in: + Do not show subdir walking commands + +2001-01-19 Peter Simons + + * main.c: + Added a message that is logged every time Petidomo starts up. This + message will "dump" the configuration of Petidomo so that the user has + a clue which Petidomo instance is doing what. + + * subscribe.c, unsubscribe.c: + When a un-/subscribe command needs confirmation, the request for + confirmation is sent to the address that is supposed to added to or + removed from the list. If, and only if, this address is different than + the one from which the request came, a short mail is sent to the + requestor to inform him what is going on. + + * tool.c, config.c: + Mailing list config files may now have the suffix ".config" or + ".conf". Similarly, if the list config file is in a separate + directory, it may be called /config or /conf. + + * main.c: + Added code that will set the real user id of the process equal to the + effective user id. + + * Makefile.in: + - Word-wrapped long lines to fit into 80 characters per line. + - Updated dependencies. + - Removed BINDIR from FLAGS_TO_PASS as it isn't needed anymore. + + * main.c, petidomo.h, queue_command.c, queue_posting.c: + Petidomo needs to know the path to the executable in order to write + the ack-spool file, which starts Petidomo again to process the + acknowledged command or posting. I used BINDIR for that, but realized + that this sucks when somebody manually moves the binary. Hence, I am + using the contents of argv[0] now, normalized to an absolute path. + This value is stored in the global variable who_am_i, which the + queue_*() routines now use. + +2001-01-19 Ralf S. Engelschall + + * generate_cookie.c: + Get rid of the following GCC complains: + generate_cookie.c: In function `generate_cookie': + generate_cookie.c:58: warning: implicit declaration of function `strlen' + generate_cookie.c: In function `MD5Update': + generate_cookie.c:245: warning: declaration of `index' shadows global declaration + generate_cookie.c:260: warning: implicit declaration of function `memcpy' + generate_cookie.c: In function `MD5Final': + generate_cookie.c:286: warning: declaration of `index' shadows global declaration + generate_cookie.c:303: warning: implicit declaration of function `memset' + + * archive.c: + As GCC complained: There is an ISO 9899:1990 (``ISO C'') function + clock(3), so we have a symbol conflict here. Get rid of this by renaming + our symbol. + + * libtext/text.h: + Do not use C++ comments in ANSI C + +2001-01-18 Ralf S. Engelschall + + * README, acl.y, acl_scan.l, address-db.c, approve.c, archive.c, authen.c, config.c, filter.c, generate_cookie.c, handleacl.c, help.c, hermes.c, index.c, io.c, listserv.c, mailer.c, main.c, members.c, parsearray.c, password.c, petidomo.h, queue_command.c, queue_posting.c, rfcparse.c, subscribe.c, tool.c, unsubscribe.c: + As we agreed today, Petidomo is now open because licensed under GPL and + always will be licensed under GPL, so use "Petidomo" as the program name + everywhere and consistently. + + * Makefile.in: + Install petidomo-xxxx tools + + * Makefile.in: Show were we are operating + + * ChangeLog: Start filling ChangeLog... + + * README: *** empty log message *** + +2001-01-18 Peter Simons + + * petidomo-approve, petidomo-kickout: + Add old RSE admin scripts + +2001-01-18 Ralf S. Engelschall + + * config.c: ListACLFile -> ACLFile + + * Makefile.in: New layout + + * configure.in, Makefile.in: + Switch to GNU shtool + + * etc/install-sh: + Remove obsolete install-sh + + * etc/shtool: Add GNU shtool + + * Makefile.in: + fix install-testlist target + +2001-01-16 Peter Simons + + * subscribe.c, unsubscribe.c: + When a request for confirmation is required, the originator of the + command will receive a short mail, telling him that this is so, so + that he knows what's going on. + + * subscribe.c, unsubscribe.c: + Delayed the processing of the acknowledgment-requirement so that you + don't have to ack commands that will fail anyways. + + * Makefile.in, address-db.c, hermes.c, petidomo.h: + Implemented the acked-once feature. + + * acl.y, acl_scan.l, handleacl.c, petidomo.h: + Added new action keyword to the Access Control Language: approve. This + keyword will -- unlike to "pass" -- not only pass the mail, but will + also make sure that the mail passes all other authorization controls. + This means, the mail will be treated as if the Petidomo master + password had been given in the header. + + * approve.c: + Added include of sys/types.h. Required on some systems to be able to + include regex.h. + + * hermes.c: + Moved the call to checkACL() before anything else is tested regarding + authorization. Combined with the new "approve" action in the ACL file, + this allows to pass all other authentication mechanisms with the ACL. + +2001-01-15 Peter Simons + + * hermes.c: + Added code that will request confirmation when posting to a list that + is set to "acknowledged". + + * Makefile.in, approve.c, main.c, petidomo.h: + Implemented the approve mode, where incoming mails are searched for + confirmation cookies and the apropriate queue entries will be + executed. + + * subscribe.c: + The call to queue_command() had the command wrong. + + * subscribe.c, unsubscribe.c: + Added code that will send the "request for confirmation" mail out when + apropriate. + + * hermes.c: + Cosmetic change: Reformatted the source. + + * config.c, config/list-config: + - ListType is no longer a required parameter; it now defaults to "open". + + * hermes.c, listserv.c, main.c, petidomo.h: + Had to make is_approved a global variable, because it is actually + tested in subroutines of listserv_main() and hermes_main(), like + subscribe(), which's parameter list I don't want to change. + + * petidomo.h, queue_command.c, queue_posting.c: + queue_command() and queue_posting() will now return the cookie used as + filename, so that the calling code can mail back the request for + confirmation. + + * config.c, config/list-config, petidomo.h, subscribe.c, unsubscribe.c: + List's "AllowPublicSubscripiton" does not exist anymore. Now we have + "SubscriptionType" with valid values "public", "admin" or + "acknowledged". + + * config/petidomo.conf: + - Added Ack_Queue_Dir keyword. + + - Changed default of List_Directory from LOCALSTATEDIR to + LOCALSTATEDIR/lists. + + * config/list-config, unsubscribe.c, config.c, petidomo.h, subscribe.c: + Removed the whole concept of "alien subscription". It was stupid to + begin with and now that we'll have acknowledged subscriptions, it is + useless, too. + + * Makefile.in, config.c, petidomo.h, queue_command.c, queue_posting.c: + Implemented spooling mechanism for requests and postings that need an + acknowledgement to be processed. The code is there, it just isn't + called yet. + + * hermes.c, listserv.c, main.c: + Added --approved command line parameter, which is treated as a + boolean. Whether it is set or not will be passed through to + listserv_main() and to hermes_main(). The parameter will be used by + the spooling mechanism. + +2001-01-11 Peter Simons + + * config.c, config/list-config, petidomo.h: + Added config entry "AcknowledgementFile" to the mailing list's config file. + + * Makefile.in, configure.in, generate_cookie.c, petidomo.h: + Added generate_cookie() routine taken from mapSoN. + + * unsubscribe.c: + The requestor will now receive a mail telling him something went wrong + when he tries to unsubscribe an address without specifying a list + name. + +2001-01-10 Peter Simons + + * help.c, members.c, subscribe.c, unsubscribe.c: + Set the right margin for word-wrapping to 70 characters instead of 75. + + * subscribe.c: + The requestor will now receive a mail telling him something went wrong + when he tries to subscribe an address without specifying a list name. + + * acl.y: + When running in listserv mode, there is no 'listname' which can be + used to get the mailing list's configuration. Thus, the routine + shouldn't try to got one. Fixed it. + + * config.c: Removed debugging output. + +2001-01-08 Peter Simons + + * acl.y: + Changed the ACL code to use the configured locations of the list's ACL + file rather than the hard-coded one. + + * Makefile.in: + Completed the install-testlist target. + + * acl.y, archive.c, config.c, help.c, hermes.c, index.c, mailer.c, main.c, members.c, petidomo.h, subscribe.c, tool.c, unsubscribe.c: + Rewrote Petidomo so that virtually any file's path can be configured + at run-time now. + + * config/petidomo.conf: + Added example entries for the new keywords "List_Directory", + "Help_File", "ACL_File", and "Index_File". + + * config/list-config: + Added example entries for the new keywords "IntroductionFile", + "DescriptionFile", "ACLFile", "HeaderFile", "SignatureFile", and + "AddressFile". + + * config/petidomo.acl: + Removed the path of the file in the comment header, since it doesn't + fit anymore anyway. + + * Makefile.in: Added dependencies. + + * config.c, main.c, petidomo.h: + Petidomo will now expect its master config file at + SYSCONFDIR/petidomo.conf. This location can be changed at run-time + with the command line parameter --masterconf. + + * Makefile.in: + Added preliminary install and install-testlist target. + + * configure.in: + Removed the ETCDIR stuff again. We use sysconfdir instead. + +2001-01-06 Peter Simons + + * Makefile.in, config.c, configure.in, petidomo.h: + Replaced the old basedir-mechanism in Petidomo, which used to be the + home directory of the petidomo user. Now, Petidomo expects its master + config file in ETCDIR, which is '/etc' per default. All other paths + will be set there at run-time. + + * handleacl.c, help.c, hermes.c, index.c, members.c, subscribe.c, unsubscribe.c: + - Added a "Petidomo:" prefix to all subject lines, to distinguish them + from regular mail. Rejection mails furthermore have the prefix + "BOUNCE :", mails that need approval have the prefix + "APROVE :". + + - When a mail is rejected due to ACL, the mail body will tell you + whether the global acl file or the list's local acl file hit. + + - If a file "lists//header" exists, it contents will be + added to the headers of the article posted to the list. Be careful + not to have blank lines in there, as this will screw the whole + message up. + + - When generating the index of available mailing lists, the list type + will now be typeset in brackets, e.g.: "(public mailing list)". + + - The index will no longer contain tabs in the mail body. + + * handleacl.c: + The local List_Config variable was potentially used uninitialized. + Fixed that. + +2000-12-16 Peter Simons + + * librfc822/Makefile: + Added dependency to stop parallel make from messing up with the + yacc/lex targets. + + * librfc822/decomment.c: + Fixed parsing bug. + + * librfc822/address.y: + Added definition of YYSTYPE. + + * configure.in: + Use petidomo.h file to determine $srcdir, rather than main.c. + + * Makefile.in, main.c, petidomo.h: + Reversed all changes concerning C++ in Petidomo ... it isn't worth the + major rewrite. + + * librfc822/.cvsignore: + Ignore yacc and lex files + + * librfc822/Makefile, librfc822/address.c, librfc822/address.y, librfc822/address_scan.c, librfc822/address_scan.h, librfc822/address_scan.l, librfc822/address_sep.c, librfc822/decomment.c, librfc822/parse_address.c, librfc822/rfc822.h, librfc822/test.c, libmpools/Makefile, libmpools/mpools.c, libmpools/mpools.h: + - Added GNU GPL copyright headers. + - Cleaned build process up. + + * libmpools/Makefile, libmpools/mpools.c, libmpools/mpools.h: + Imported Petidomo 2.2 as found on www.petidomo.com. + + * libmpools/Makefile, libmpools/mpools.c, libmpools/mpools.h: + New file. + + * librfc822/address_scan.c: + Imported Petidomo 2.2 as found on www.petidomo.com. + + * librfc822/address_scan.c: New file. + + * librfc822/address.c: + Imported Petidomo 2.2 as found on www.petidomo.com. + + * librfc822/address.c: New file. + + * librfc822/decomment.c, librfc822/parse_address.c, librfc822/rfc822.h, librfc822/test.c, librfc822/testaddresslines: + Imported Petidomo 2.2 as found on www.petidomo.com. + + * librfc822/decomment.c, librfc822/parse_address.c, librfc822/rfc822.h, librfc822/test.c, librfc822/testaddresslines: + New file. + + * librfc822/Makefile, librfc822/address.y, librfc822/address_scan.h, librfc822/address_scan.l, librfc822/address_sep.c: + Imported Petidomo 2.2 as found on www.petidomo.com. + + * librfc822/Makefile, librfc822/address.y, librfc822/address_scan.h, librfc822/address_scan.l, librfc822/address_sep.c: + New file. + + * Makefile.in: + Added preliminary install target. + + * config/petidomo.conf: + Removed reference to firepower altogether; MTA is a required keyword. + +2000-12-15 Peter Simons + + * config/petidomo.conf: + Removed note about Firepore MTA. + + * config.c: + Hardcoded the base directory /usr/local/petidomo for the moment. + + * libtext/text.h: + Wrapped the header's contents in "extern C" linkage when compiling in + a C++ module. + + * Makefile.in: + The petidomo binary will now be linked with $(CXX). + Updated dependencies. + + * Makefile.in, config.c, help.c, index.c, members.c, signature.c, subscribe.c, unsubscribe.c: + Removed the signature code and all code that depended on it. In the + new Petidomo, the signature mechanism for server mails will work + differently. + + * config.c, config/petidomo.conf, signature.c: + Removed the global configuration options "DetachImmediately" and + "ShowStatistics". Consequently removed all code that deals with these + options, too. + + * libargv/Makefile: + The clean target will now erase the argv.info file. + + * libargv/.cvsignore: + Ignore the argv.info file. + + * Makefile.in, exit.c: + Removed the mail rescue mechanism and all relating code. I guess + _nobody_ ever used that mechanism anyway, not even me. :-) + + * Makefile.in, acl.y, archive.c, argvSetDebugLevel.c, authen.c, config.c, debug.h, exit.c, filter.c, handleacl.c, help.c, hermes.c, index.c, listserv.c, mailer.c, members.c, password.c, rfcparse.c, subscribe.c, tool.c, unsubscribe.c: + - Removed all debugging code. Now that Petidomo will be "rewritten" + in C++, I need a new paradigm for debugging anyway and the old + solution of mine was to messy for my taste anyway. + + - Petidomo no longer cares under what name it has been started. The + different modes of operation will now be distinguished by a + mandatory command line parameter. + + * Makefile.in: + Added support for C++ source modules within Petidomo. + +2000-12-14 Peter Simons + + * Makefile.in: + Modified the main Makefile so that it will pass the values determined + by Autoconf down to the libraries. + + * Makefile.in: + FreeBSD's make again: That stupid thing really doesn't grasp $< targets. + + * Makefile.in: + FreeBSD's make sucks big time: It doesn't honor the -C flag. Hence we + have to change into the target directory before calling make. + + * Makefile.in: + BSD make doesn't understand $< like GNU make does, thus it is better + to explicitely name the targets for the sake of portability. + + * Makefile.in: + Rewrote the makefile to not require GNU make. + + * libargv/Makefile, libconfigfile/Makefile, liblists/Makefile, libtext/Makefile: + Removed unused suffix .a from the .SUFFIXES target. + + * .cvsignore, configure.in: + - Libraries do not need Autoconf anymore, thus I removed the + AC_CONFIG_SUBDIRS call. + + - Added -O3 to CFLAGS for the sake of good optimization. + + * Makefile.in: Updated dependencies. + + * libargv/.cvsignore, libargv/Makefile, libconfigfile/Makefile, libconfigfile/SMakefile, libconfigfile/configure.in, liblists/Makefile, liblists/SMakefile, liblists/configure.in, liblists/lists.h, liblists/lists.h.in, libtext/Makefile, libtext/SMakefile, libtext/configure.in, libtext/test.txt: + - Removed smake build and autoconf from the libraries. + - Removed unused files. + + * libargv/Makefile, libargv/SMakefile, libargv/configure.in: + Added a real makefile. + + * libargv/argvSetDebugLevel.c: + The file is never used here. + +2000-12-13 Peter Simons + + * libargv/argvSetDebugLevel.c, libargv/test.c, libconfigfile/config.c, libconfigfile/configfile.h, liblists/lists.c, liblists/lists.h.in, libtext/easy_pattern_match.c, libtext/easy_sprintf.c, libtext/find_next_line.c, libtext/find_string.c, libtext/text.h, libtext/transform_text.c, libtext/wordwrap.c: + Added correct GPL copyright headers. + + * libtext/CustomTokenIterator.cpp, libtext/RegexTokenizer.cpp, libtext/RegexTokenizer_test.cpp, libtext/TokenIterator.cpp, libtext/TokenIterator_test.cpp, libtext/text.hpp, libtext/tokenizer_test.cpp: + Removed unused C++ code. + + * Makefile.in: + Cosmetic changes to the Makefile ... nothing important. + + * Makefile.in, configure.in: + After changing librfc822 to get along without libmpools, the library + can (and has been) removed from Petidomo. + + * debug.h: + This header file defines the debug modules Petidomo supports. + + * configure.in: + The source for the configure script generated by Autoconf. + + * petidomo.h: + All internal prototypes and definitions. + + * etc/install-sh: + Autoconf needs this script in order to run sub-configure scripts. + + * liblists/lists.h.in, libtext/CustomTokenIterator.cpp, libtext/RegexTokenizer.cpp, libtext/RegexTokenizer_test.cpp, libtext/TokenIterator.cpp, libtext/TokenIterator_test.cpp, libtext/test.txt, libtext/text.hpp, libtext/tokenizer_test.cpp, liblists/Makefile, liblists/SMakefile, liblists/configure.in, liblists/lists.c, liblists/lists.h, libtext/Makefile, libtext/SMakefile, libtext/configure.in, libtext/easy_pattern_match.c, libtext/easy_sprintf.c, libtext/find_next_line.c, libtext/find_string.c, libtext/text.h, libtext/transform_text.c, libtext/wordwrap.c: + Imported latest version. + + * libconfigfile/Makefile, libconfigfile/SMakefile, libconfigfile/config.c, libconfigfile/configfile.h, libconfigfile/configure.in: + Imported latest version of the library. + + * libargv/NEWS, libargv/SMakefile, libargv/argv.texi, libargv/argv_loc.h, libargv/configure.in, libargv/Makefile, libargv/Makefile.inc, libargv/_argv.h, libargv/argv.c, libargv/argv.h, libargv/argvSetDebugLevel.c, libargv/test.c: + Imported libargv version 2.4.0. + + * acl.y, acl_scan.l, archive.c, argvSetDebugLevel.c, authen.c, config.c, exit.c, filter.c, handleacl.c, help.c, hermes.c, index.c, io.c, listserv.c, mailer.c, main.c, members.c, parsearray.c, password.c, rfcparse.c, signature.c, subscribe.c, tool.c, unsubscribe.c: + - Added correct GNU GPL copyright statements to the files. + - Removed unnecessary include statements. + + * Makefile, Makefile.in: + Rewrote the build process from the scratch. + + * version.h: + The old versioning mechanism needs to be replaced any time soon. + + * archive.h, authen.h, filter.h, mailer.h, rfcparse.h: + The contents of these headers is now included in petidomo.h. + + * signature.c, unregsig.c, unregsig.h: + Renamed unregsig module to signature. Now that Petidomo is released + under GPL, there is no such thing as an "unregistered" version + anymore. + + * acl.c, acl_scan.c, acl_scan.h: + Removed dependent files from CVS repository. + + * etc/mail2news.c: + The program isn't tested, it isn't documented ... so away with it. + + * docs/Makefile, docs/petidomo.tex: + - Removed all use of html.sty. + + - Removed all references to the CGI manager. + + - Removed autoconf support. + + - Removed the index. + + - Reformatted the document to look good and to compile without + warnings. + + * docs/Makefile: + Don't erase the EPS files at 'clean'. + + * docs/directory-struct.eps, docs/ml-principle1.eps, docs/ml-principle2.eps: + Adding EPS files to repository, because those are really hard to + generate correctly. + + * docs/GNUmakefile, docs/Makefile: + Renamed GNUmakefile to Makefile; there's nothing in this makefile + that's specific to GNU make. + + * docs/GNUmakefile: + Added '-f' flag to the 'rm' call in the clean target. + + * docs/GNUmakefile: + Cleaned the Makefile up a lot. Removed explicit targets whereever an + implicit target will do. + + * docs/GNUmakefile, docs/Xstation.bm, docs/directory-struct.fig, docs/ml-principle1.fig, docs/ml-principle2.fig, docs/petidomo.tex, docs/router.bm, docs/world.bm: + Imported Petidomo 2.2 as found on www.petidomo.com. + + * docs/GNUmakefile, docs/Xstation.bm, docs/directory-struct.fig, docs/ml-principle1.fig, docs/ml-principle2.fig, docs/petidomo.tex, docs/router.bm, docs/world.bm: + New file. + + * acl.c, acl_scan.c, acl_scan.h: + Imported Petidomo 2.2 as found on www.petidomo.com. + + * acl.c, acl_scan.c, acl_scan.h: + New file. + + * subscribe.c, tool.c, unregsig.c, unregsig.h, unsubscribe.c, version.h: + Imported Petidomo 2.2 as found on www.petidomo.com. + + * subscribe.c, tool.c, unregsig.c, unregsig.h, unsubscribe.c, version.h: + New file. + + * mailer.c, mailer.h, main.c, members.c, parsearray.c, password.c, rfcparse.c, rfcparse.h: + Imported Petidomo 2.2 as found on www.petidomo.com. + + * mailer.c, mailer.h, main.c, members.c, parsearray.c, password.c, rfcparse.c, rfcparse.h: + New file. + + * filter.c, filter.h, handleacl.c, help.c, hermes.c, index.c, io.c, listserv.c: + Imported Petidomo 2.2 as found on www.petidomo.com. + + * filter.c, filter.h, handleacl.c, help.c, hermes.c, index.c, io.c, listserv.c: + New file. + + * Makefile, acl.y, acl_scan.l, archive.c, archive.h, argvSetDebugLevel.c, authen.c, authen.h, config.c, exit.c: + Imported Petidomo 2.2 as found on www.petidomo.com. + + * Makefile, acl.y, acl_scan.l, archive.c, archive.h, argvSetDebugLevel.c, authen.c, authen.h, config.c, exit.c: + New file. + + * filter/pgp-decrypt.sh, filter/pgp-encrypt.sh: + Imported Petidomo 2.2 as found on www.petidomo.com. + + * filter/pgp-decrypt.sh, filter/pgp-encrypt.sh: + New file. + + * filter/insert-name-in-subject.sh, filter/rfc2369.sh: + Imported Petidomo 2.2 as found on www.petidomo.com. + + * filter/insert-name-in-subject.sh, filter/rfc2369.sh: + New file. + + * libargv/argv.c, libargv/argv.h, libargv/argvSetDebugLevel.c, libargv/test.c: + Imported Petidomo 2.2 as found on www.petidomo.com. + + * libargv/argv.c, libargv/argv.h, libargv/argvSetDebugLevel.c, libargv/test.c: + New file. + + * libargv/Makefile, libargv/Makefile.inc, libargv/_argv.h, libconfigfile/Makefile, libconfigfile/config.c, libconfigfile/configfile.h, libtext/transform_text.c, libtext/wordwrap.c: + Imported Petidomo 2.2 as found on www.petidomo.com. + + * libargv/Makefile, libargv/Makefile.inc, libargv/_argv.h, libconfigfile/Makefile, libconfigfile/config.c, libconfigfile/configfile.h, libtext/transform_text.c, libtext/wordwrap.c: + New file. + + * liblists/Makefile, liblists/lists.c, liblists/lists.h, libtext/Makefile, libtext/easy_pattern_match.c, libtext/easy_sprintf.c, libtext/find_next_line.c, libtext/find_string.c, libtext/text.h: + Imported Petidomo 2.2 as found on www.petidomo.com. + + * liblists/Makefile, liblists/lists.c, liblists/lists.h, libtext/Makefile, libtext/easy_pattern_match.c, libtext/easy_sprintf.c, libtext/find_next_line.c, libtext/find_string.c, libtext/text.h: + New file. + + * config/petidomo.acl, config/petidomo.conf, etc/mail2news.c: + Imported Petidomo 2.2 as found on www.petidomo.com. + + * config/petidomo.acl, config/petidomo.conf, etc/mail2news.c: + New file. + + * README, config/help, config/list-acl, config/list-config: + Imported Petidomo 2.2 as found on www.petidomo.com. + + * README, config/help, config/list-acl, config/list-config: + New file. + + * COPYING, ChangeLog: + Imported Petidomo 2.2 as found on www.petidomo.com. + + * COPYING, ChangeLog: + New file. + + + Petidomo v4 =========== Index: ossp-pkg/petidomo/configure.in ============================================================ $ cvs diff -u -r1.9 -r1.10 configure.in --- ossp-pkg/petidomo/configure.in 2001/01/20 14:36:43 1.9 +++ ossp-pkg/petidomo/configure.in 2001/02/18 00:05:39 1.10 @@ -1,17 +1,22 @@ dnl dnl configure.in -- Process this file with autoconf to produce a configure script. dnl -dnl $Header: /e/ossp/cvs/ossp-pkg/petidomo/configure.in,v 1.9 2001/01/20 14:36:43 rse Exp $ +dnl $Header: /e/ossp/cvs/ossp-pkg/petidomo/configure.in,v 1.10 2001/02/18 00:05:39 simons Exp $ dnl AC_INIT(petidomo.h) -AC_REVISION($Revision: 1.9 $)dnl +dnl Print the standard OSSP. +dnl AC_DIVERT_PUSH(AC_DIVERSION_NOTICE) V=`./etc/shtool version -lc -dlong version.c` ./etc/shtool echo -e "Configuring %BOSSP Petidomo%b, Version %B${V}%b" AC_DIVERT_POP() +dnl Get rid of the lousy -g and -O defaults in CFLAGS. +dnl +CFLAGS=${CFLAGS:-} + dnl Checks for paths and programs. dnl AC_PROG_CC @@ -40,14 +45,6 @@ if test "$GCC" = yes; then CFLAGS="$CFLAGS -Wall -pedantic -pipe" fi - -dnl Remove '-g' from the compile flags. -dnl -CFLAGS=`echo $CFLAGS | sed -e "s/-g//"` - -dnl Turn '-O2' to '-O3'. -dnl -CFLAGS=`echo $CFLAGS | sed -e "s/-O2/-O3/"` dnl Write results. dnl From ossp-cvs-owner@ossp.org Sun Feb 18 01:20:06 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f1I0K4T82865; Sun, 18 Feb 2001 01:20:04 +0100 (CET) Date: Sun, 18 Feb 2001 01:20:04 +0100 (CET) Message-Id: <200102180020.f1I0K4T82865@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/petidomo ChangeLog Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 18-Feb-2001 01:20:04 Branch: HEAD Handle: 2001021800200400 Modified files: ossp-pkg/petidomo ChangeLog Log: Updated ChangeLog based on the CVS history. Summary: Revision Changes Path 1.4 +112 -725 ossp-pkg/petidomo/ChangeLog ____________________________________________________________________________ Index: ossp-pkg/petidomo/ChangeLog ============================================================ $ cvs diff -u -r1.3 -r1.4 ChangeLog --- ossp-pkg/petidomo/ChangeLog 2001/02/18 00:05:39 1.3 +++ ossp-pkg/petidomo/ChangeLog 2001/02/18 00:20:04 1.4 @@ -1,6 +1,6 @@ 2001-02-17 Peter Simons - * Updated the documentation for the 4.x version. + * Updated the documentation for the new version. * When posting to a list, Petidomo will now let the "Keywords:" and "Summary:" headers pass. These headers are uncommon but have @@ -47,786 +47,173 @@ (and for consistency) I corrected this horrible, horrible mistake of the past and renamed everything that contained an underscore. -2001-01-20 Ralf S. Engelschall - - * .cvsignore, Makefile.in, petidomo.pod: - Add first cut for a petidomo(1) manual page. - 2001-01-20 Peter Simons - - * Makefile.in, config-files.c, config.c: - Renamed the followings tags in petidomo.conf - - MTA_Options --> MTAOptions - List_Directory --> ListDirectory - Ack_Queue_Directory --> AckQueueDirectory - - for consistency reasons. While I was at it, I also renamed the source - file from config.c to config-files.c, because the module config.c is - generally associated with GNU autoconf and this has nothing to do with - it. - -2001-01-20 Ralf S. Engelschall - - * main.c: - Be careful, listname can be NULL in global operation mode and not - all printf implementations are as smart as BSD's variant. Instead of - printing "(null)" others just dump core. - - * docs/.cvsignore: - Ignore LaTeX generated files - -2001-01-19 Peter Simons - - * Makefile.in: Cosmetic change. - - * Makefile.in: Updated dependencies. - - * archive.c: - Enhanced portability. This commit also contains an older - change made by Ralf, which I have to re-commit after - screwing up with the "cvs admin" command. Sorry!!! - - * mailer.c: - Minor change to enhance portability. - - * config.c: - The module contains the static variable MasterConfig, which all other - Petidomo routines can access via getMasterConfig(). The routine - getListConfig(), which is defined in config.c, too, used the "correct" - mechanism to access MasterConfig, even though it could access it - directly. Since I chose the same name ("MasterConfig" :->) for the - local copy of the pointer, gcc warns that this variable shadows the - static one. To get rid of this warning, and since it doesn't make one - bit a difference, getListConfig() accessse the static variable - directly now. - - * hermes.c: - Changed ACL semantics: The ACL is processed only if the posting didn't - have a valid password. If it did, the mail is going through in any - case and the ACL is not tested. - - * config/index, Makefile.in: - In case no index file is installed, "make install" will create an - example file at the correct location so that the admininstrator - hopefully figures out that there is some work to be done. - - * acl.y: - - Added a warning message to be logged when no global ACL file exists. - - - Reordered tests in check_local_acl_file: When no listname has been - given, we don't need to initialize the lexer at all. - - * hermes.c: - Petidomo used the mail's envelope to deliver the request for - confirmation. I have changed this to either reply-to or from (if - reply-to is unset), because sendmail will destroy the original - envelope under obscure circumstances. - - * main.c: Removed unnecessary cast. - - * config.c: - Due to a mix-up in the variable names, Petidomo expanded all list - config file paths incorrectly when the list has a flat hierarchy. That - is fixed now. - -2001-01-19 Ralf S. Engelschall - - * Makefile.in: - Provide "make dist" command for rolling distribution tarball. - -2001-01-19 Peter Simons - - * main.c: - Added version information to the start-up log message. -2001-01-19 Ralf S. Engelschall + * Renamed the MTA_Options" tag in the master config file to + "MTAOptions" for consistency. - * Makefile.in, main.c, version.c: - First step in GNu shtool version support: - Add version.c and use it for "petidomo --version". - Support for handling version.c in Makefile.in is coming later. - - * libconfigfile/config.c, librfc822/address.y, librfc822/decomment.c, libargv/argv.c, acl.y, address-db.c, approve.c, config.c, filter.c, hermes.c, index.c, io.c, mailer.c, members.c, password.c, queue_command.c, queue_posting.c, subscribe.c, unsubscribe.c: - Get rid of all complaints from GCC 2.97 - (except for two things which I do not want to change on my own) - 2001-01-19 Peter Simons - - * queue_command.c, queue_posting.c: - Incorporated the cookie into the end-of-mail-marker used in the - ack-script, so that the whole mechanism doesn't break when somebody - has the words '[end-of-mail-marker]' in the mail body itself. - - * subscribe.c, unsubscribe.c: - Fixed the spelling of the newly added syslog messages. - - * main.c: - Moved the initial startup log message up so that it is logged before - the main config file is parsed. Also added the path of the main config - file to the message so that people can see where Petidomo locks for it - in case parsing fails. - - * hermes.c, subscribe.c, unsubscribe.c: - Greatly enhanced the log messages Petidomo writes. Made the existing - messages more helpful, added lots of new ones, generally made things - real perfect. Remember: Life is BEAUTIFUL. -2001-01-19 Ralf S. Engelschall + * Changed ACL semantics: The ACL is processed _only_ if the + posting didn't have a valid password. If it did, the mail is going + through in any case and the ACL is not processed. - * Makefile.in: - Do not show subdir walking commands + * Added a warning message to be logged when no global ACL file exists. 2001-01-19 Peter Simons - * main.c: - Added a message that is logged every time Petidomo starts up. This - message will "dump" the configuration of Petidomo so that the user has - a clue which Petidomo instance is doing what. - - * subscribe.c, unsubscribe.c: - When a un-/subscribe command needs confirmation, the request for - confirmation is sent to the address that is supposed to added to or - removed from the list. If, and only if, this address is different than - the one from which the request came, a short mail is sent to the - requestor to inform him what is going on. + * Greatly enhanced the log messages Petidomo writes. Made the + existing messages more helpful, added lots of new ones, generally + made things real perfect. Remember: Life is BEAUTIFUL. + + * Added a message that is logged every time Petidomo starts up. + This message will "dump" the configuration of Petidomo so that the + user has a clue which Petidomo instance is doing what. + + * When a un-/subscribe command needs confirmation, the request for + confirmation is sent to the address that is supposed to be added + to or to be removed from the list. If, and only if, this address + is different from the one the request came from, a short mail is + sent to the requestor to inform him what is going on. - * tool.c, config.c: - Mailing list config files may now have the suffix ".config" or + * Mailing list config files may now have the suffix ".config" or ".conf". Similarly, if the list config file is in a separate directory, it may be called /config or /conf. - - * main.c: - Added code that will set the real user id of the process equal to the - effective user id. - - * Makefile.in: - - Word-wrapped long lines to fit into 80 characters per line. - - Updated dependencies. - - Removed BINDIR from FLAGS_TO_PASS as it isn't needed anymore. - - * main.c, petidomo.h, queue_command.c, queue_posting.c: - Petidomo needs to know the path to the executable in order to write - the ack-spool file, which starts Petidomo again to process the - acknowledged command or posting. I used BINDIR for that, but realized - that this sucks when somebody manually moves the binary. Hence, I am - using the contents of argv[0] now, normalized to an absolute path. - This value is stored in the global variable who_am_i, which the - queue_*() routines now use. - -2001-01-19 Ralf S. Engelschall - - * generate_cookie.c: - Get rid of the following GCC complains: - generate_cookie.c: In function `generate_cookie': - generate_cookie.c:58: warning: implicit declaration of function `strlen' - generate_cookie.c: In function `MD5Update': - generate_cookie.c:245: warning: declaration of `index' shadows global declaration - generate_cookie.c:260: warning: implicit declaration of function `memcpy' - generate_cookie.c: In function `MD5Final': - generate_cookie.c:286: warning: declaration of `index' shadows global declaration - generate_cookie.c:303: warning: implicit declaration of function `memset' - - * archive.c: - As GCC complained: There is an ISO 9899:1990 (``ISO C'') function - clock(3), so we have a symbol conflict here. Get rid of this by renaming - our symbol. - * libtext/text.h: - Do not use C++ comments in ANSI C + * Added code that will set the real user id of the process equal + to the effective user id. Makes life easier for people who use + Petidomo as a setuid binary. 2001-01-18 Ralf S. Engelschall - - * README, acl.y, acl_scan.l, address-db.c, approve.c, archive.c, authen.c, config.c, filter.c, generate_cookie.c, handleacl.c, help.c, hermes.c, index.c, io.c, listserv.c, mailer.c, main.c, members.c, parsearray.c, password.c, petidomo.h, queue_command.c, queue_posting.c, rfcparse.c, subscribe.c, tool.c, unsubscribe.c: - As we agreed today, Petidomo is now open because licensed under GPL and - always will be licensed under GPL, so use "Petidomo" as the program name - everywhere and consistently. - - * Makefile.in: - Install petidomo-xxxx tools - * Makefile.in: Show were we are operating + * Added two useful scripts for list administrators: + petidomo-approve and petidomo-kickout. - * ChangeLog: Start filling ChangeLog... - - * README: *** empty log message *** - -2001-01-18 Peter Simons - - * petidomo-approve, petidomo-kickout: - Add old RSE admin scripts - -2001-01-18 Ralf S. Engelschall +2001-01-16 Peter Simons - * config.c: ListACLFile -> ACLFile + * Added the "acknowledge" feature for mailing list postings. - * Makefile.in: New layout + * Added new action keyword to the Access Control Language: + "approve". This keyword will -- unlike "pass" -- not only pass the + mail, but will also make sure that the mail passes all other + authorization controls. This means, the mail will be treated as if + the Petidomo master password had been provided. - * configure.in, Makefile.in: - Switch to GNU shtool + * The ACL is now tested _before_ anything else, meaning that you + can use the "approve" action to bypass all other tests. - * etc/install-sh: - Remove obsolete install-sh +2001-01-15 Peter Simons - * etc/shtool: Add GNU shtool + * The "ListType" keyword is no longer a mandatory directive in the + list's config file; it now defaults to "open". - * Makefile.in: - fix install-testlist target + * List config's "AllowPublicSubscripiton" does not exist anymore. + Now we have "SubscriptionType" with valid values "public", "admin" + or "acknowledged". -2001-01-16 Peter Simons + * Added "AckQueueDirectory" directive to the master config file. - * subscribe.c, unsubscribe.c: - When a request for confirmation is required, the originator of the - command will receive a short mail, telling him that this is so, so - that he knows what's going on. - - * subscribe.c, unsubscribe.c: - Delayed the processing of the acknowledgment-requirement so that you - don't have to ack commands that will fail anyways. - - * Makefile.in, address-db.c, hermes.c, petidomo.h: - Implemented the acked-once feature. - - * acl.y, acl_scan.l, handleacl.c, petidomo.h: - Added new action keyword to the Access Control Language: approve. This - keyword will -- unlike to "pass" -- not only pass the mail, but will - also make sure that the mail passes all other authorization controls. - This means, the mail will be treated as if the Petidomo master - password had been given in the header. - - * approve.c: - Added include of sys/types.h. Required on some systems to be able to - include regex.h. - - * hermes.c: - Moved the call to checkACL() before anything else is tested regarding - authorization. Combined with the new "approve" action in the ACL file, - this allows to pass all other authentication mechanisms with the ACL. - -2001-01-15 Peter Simons + * Removed the whole concept of "alien subscription". It was stupid + to begin with and now that we'll have acknowledged subscriptions, + it is useless, too. - * hermes.c: - Added code that will request confirmation when posting to a list that - is set to "acknowledged". - - * Makefile.in, approve.c, main.c, petidomo.h: - Implemented the approve mode, where incoming mails are searched for - confirmation cookies and the apropriate queue entries will be - executed. - - * subscribe.c: - The call to queue_command() had the command wrong. - - * subscribe.c, unsubscribe.c: - Added code that will send the "request for confirmation" mail out when - apropriate. - - * hermes.c: - Cosmetic change: Reformatted the source. - - * config.c, config/list-config: - - ListType is no longer a required parameter; it now defaults to "open". - - * hermes.c, listserv.c, main.c, petidomo.h: - Had to make is_approved a global variable, because it is actually - tested in subroutines of listserv_main() and hermes_main(), like - subscribe(), which's parameter list I don't want to change. - - * petidomo.h, queue_command.c, queue_posting.c: - queue_command() and queue_posting() will now return the cookie used as - filename, so that the calling code can mail back the request for - confirmation. - - * config.c, config/list-config, petidomo.h, subscribe.c, unsubscribe.c: - List's "AllowPublicSubscripiton" does not exist anymore. Now we have - "SubscriptionType" with valid values "public", "admin" or - "acknowledged". - - * config/petidomo.conf: - - Added Ack_Queue_Dir keyword. - - - Changed default of List_Directory from LOCALSTATEDIR to - LOCALSTATEDIR/lists. - - * config/list-config, unsubscribe.c, config.c, petidomo.h, subscribe.c: - Removed the whole concept of "alien subscription". It was stupid to - begin with and now that we'll have acknowledged subscriptions, it is - useless, too. - - * Makefile.in, config.c, petidomo.h, queue_command.c, queue_posting.c: - Implemented spooling mechanism for requests and postings that need an - acknowledgement to be processed. The code is there, it just isn't - called yet. + * Added "acknowledge" feature for un-/subscription requests. - * hermes.c, listserv.c, main.c: - Added --approved command line parameter, which is treated as a + * Added --approved command line parameter, which is treated as a boolean. Whether it is set or not will be passed through to - listserv_main() and to hermes_main(). The parameter will be used by - the spooling mechanism. + listserv_main() and to hermes_main(). The parameter will be used + by the "acknowledge" mechanism. 2001-01-11 Peter Simons - - * config.c, config/list-config, petidomo.h: - Added config entry "AcknowledgementFile" to the mailing list's config file. - - * Makefile.in, configure.in, generate_cookie.c, petidomo.h: - Added generate_cookie() routine taken from mapSoN. - - * unsubscribe.c: - The requestor will now receive a mail telling him something went wrong - when he tries to unsubscribe an address without specifying a list - name. - -2001-01-10 Peter Simons - * help.c, members.c, subscribe.c, unsubscribe.c: - Set the right margin for word-wrapping to 70 characters instead of 75. + * Added config entry "AcknowledgementFile" to the mailing list's + config file. - * subscribe.c: - The requestor will now receive a mail telling him something went wrong - when he tries to subscribe an address without specifying a list name. + * The requestor will now receive a mail telling him something went + wrong when he tries to un-/subscribe an address without specifying + a (valid) list name. - * acl.y: - When running in listserv mode, there is no 'listname' which can be - used to get the mailing list's configuration. Thus, the routine - shouldn't try to got one. Fixed it. - - * config.c: Removed debugging output. - 2001-01-08 Peter Simons - * acl.y: - Changed the ACL code to use the configured locations of the list's ACL - file rather than the hard-coded one. - - * Makefile.in: - Completed the install-testlist target. - - * acl.y, archive.c, config.c, help.c, hermes.c, index.c, mailer.c, main.c, members.c, petidomo.h, subscribe.c, tool.c, unsubscribe.c: - Rewrote Petidomo so that virtually any file's path can be configured - at run-time now. - - * config/petidomo.conf: - Added example entries for the new keywords "List_Directory", - "Help_File", "ACL_File", and "Index_File". - - * config/list-config: - Added example entries for the new keywords "IntroductionFile", - "DescriptionFile", "ACLFile", "HeaderFile", "SignatureFile", and - "AddressFile". - - * config/petidomo.acl: - Removed the path of the file in the comment header, since it doesn't - fit anymore anyway. - - * Makefile.in: Added dependencies. - - * config.c, main.c, petidomo.h: - Petidomo will now expect its master config file at - SYSCONFDIR/petidomo.conf. This location can be changed at run-time - with the command line parameter --masterconf. + * Added "install-testlist" target to the Makefile. - * Makefile.in: - Added preliminary install and install-testlist target. + * Rewrote Petidomo so that virtually any file's path can be + configured at run-time now. The directives we suppert in the + master config file are "ListDirectory", "HelpFile", "ACLFile", and + "IndexFile". The ones in the list's config file are + "IntroductionFile", "DescriptionFile", "ACLFile", "HeaderFile", + "SignatureFile", and "AddressFile". - * configure.in: - Removed the ETCDIR stuff again. We use sysconfdir instead. + * Added "install" target to the Makefile. 2001-01-06 Peter Simons - - * Makefile.in, config.c, configure.in, petidomo.h: - Replaced the old basedir-mechanism in Petidomo, which used to be the - home directory of the petidomo user. Now, Petidomo expects its master - config file in ETCDIR, which is '/etc' per default. All other paths - will be set there at run-time. - - * handleacl.c, help.c, hermes.c, index.c, members.c, subscribe.c, unsubscribe.c: - - Added a "Petidomo:" prefix to all subject lines, to distinguish them - from regular mail. Rejection mails furthermore have the prefix - "BOUNCE :", mails that need approval have the prefix - "APROVE :". - - - When a mail is rejected due to ACL, the mail body will tell you - whether the global acl file or the list's local acl file hit. - - - If a file "lists//header" exists, it contents will be - added to the headers of the article posted to the list. Be careful - not to have blank lines in there, as this will screw the whole - message up. - - - When generating the index of available mailing lists, the list type - will now be typeset in brackets, e.g.: "(public mailing list)". - - - The index will no longer contain tabs in the mail body. - - * handleacl.c: - The local List_Config variable was potentially used uninitialized. - Fixed that. - -2000-12-16 Peter Simons - - * librfc822/Makefile: - Added dependency to stop parallel make from messing up with the - yacc/lex targets. - - * librfc822/decomment.c: - Fixed parsing bug. - - * librfc822/address.y: - Added definition of YYSTYPE. - - * configure.in: - Use petidomo.h file to determine $srcdir, rather than main.c. - - * Makefile.in, main.c, petidomo.h: - Reversed all changes concerning C++ in Petidomo ... it isn't worth the - major rewrite. - - * librfc822/.cvsignore: - Ignore yacc and lex files - - * librfc822/Makefile, librfc822/address.c, librfc822/address.y, librfc822/address_scan.c, librfc822/address_scan.h, librfc822/address_scan.l, librfc822/address_sep.c, librfc822/decomment.c, librfc822/parse_address.c, librfc822/rfc822.h, librfc822/test.c, libmpools/Makefile, libmpools/mpools.c, libmpools/mpools.h: - - Added GNU GPL copyright headers. - - Cleaned build process up. - - * libmpools/Makefile, libmpools/mpools.c, libmpools/mpools.h: - Imported Petidomo 2.2 as found on www.petidomo.com. - - * libmpools/Makefile, libmpools/mpools.c, libmpools/mpools.h: - New file. - * librfc822/address_scan.c: - Imported Petidomo 2.2 as found on www.petidomo.com. + * The whole concept of the "petidomo" user is gone. Instead, + compile complete paths into the binary and make them run-time + configurable. + + * Added a "Petidomo:" prefix to all subject lines, to distinguish + mail sent by Petidomo from regular mail. Rejection mails + furthermore have the prefix "BOUNCE :", mails that + need approval have the prefix "APPROVE :". + + * When a mail is rejected due to ACL, the mail body will tell you + whether the global acl file or the list's local acl file hit. + + * If a file "lists//header" exists, it contents will be + added to the headers of the article posted to the list. Be careful + not to have blank lines in there, as this will screw the whole + message up. + + * The result of the INDEX command is no longer generated on the + fly. Instead, the contents of a file is send back, which the + administrator can edit as he wishes -- very much like the HELP + file thing Petidomo had for ever. Consequently, the "ShowOnIndex" + directive in the list's config file is gone. - * librfc822/address_scan.c: New file. - - * librfc822/address.c: - Imported Petidomo 2.2 as found on www.petidomo.com. - - * librfc822/address.c: New file. - - * librfc822/decomment.c, librfc822/parse_address.c, librfc822/rfc822.h, librfc822/test.c, librfc822/testaddresslines: - Imported Petidomo 2.2 as found on www.petidomo.com. - - * librfc822/decomment.c, librfc822/parse_address.c, librfc822/rfc822.h, librfc822/test.c, librfc822/testaddresslines: - New file. - - * librfc822/Makefile, librfc822/address.y, librfc822/address_scan.h, librfc822/address_scan.l, librfc822/address_sep.c: - Imported Petidomo 2.2 as found on www.petidomo.com. - - * librfc822/Makefile, librfc822/address.y, librfc822/address_scan.h, librfc822/address_scan.l, librfc822/address_sep.c: - New file. - - * Makefile.in: - Added preliminary install target. - - * config/petidomo.conf: - Removed reference to firepower altogether; MTA is a required keyword. - 2000-12-15 Peter Simons - * config/petidomo.conf: - Removed note about Firepore MTA. + * The whole signature stuff the commercial Petidomo is gone; the + free version does not need this. This, the "AppendSignature" + directive in the list's config file is gone. - * config.c: - Hardcoded the base directory /usr/local/petidomo for the moment. + * Removed options "DetachImmediately" and "ShowStatistics" options + from the master config file. These were never used anyway. - * libtext/text.h: - Wrapped the header's contents in "extern C" linkage when compiling in - a C++ module. - - * Makefile.in: - The petidomo binary will now be linked with $(CXX). - Updated dependencies. - - * Makefile.in, config.c, help.c, index.c, members.c, signature.c, subscribe.c, unsubscribe.c: - Removed the signature code and all code that depended on it. In the - new Petidomo, the signature mechanism for server mails will work - differently. - - * config.c, config/petidomo.conf, signature.c: - Removed the global configuration options "DetachImmediately" and - "ShowStatistics". Consequently removed all code that deals with these - options, too. - - * libargv/Makefile: - The clean target will now erase the argv.info file. - - * libargv/.cvsignore: - Ignore the argv.info file. - - * Makefile.in, exit.c: - Removed the mail rescue mechanism and all relating code. I guess + * Removed the mail rescue mechanism and all relating code. I guess _nobody_ ever used that mechanism anyway, not even me. :-) - * Makefile.in, acl.y, archive.c, argvSetDebugLevel.c, authen.c, config.c, debug.h, exit.c, filter.c, handleacl.c, help.c, hermes.c, index.c, listserv.c, mailer.c, members.c, password.c, rfcparse.c, subscribe.c, tool.c, unsubscribe.c: - - Removed all debugging code. Now that Petidomo will be "rewritten" - in C++, I need a new paradigm for debugging anyway and the old - solution of mine was to messy for my taste anyway. - - - Petidomo no longer cares under what name it has been started. The - different modes of operation will now be distinguished by a - mandatory command line parameter. + * Petidomo no longer cares under what name it has been started. + The different modes of operation will now be distinguished by the + mandatory command line parameter "--mode". - * Makefile.in: - Added support for C++ source modules within Petidomo. - 2000-12-14 Peter Simons - - * Makefile.in: - Modified the main Makefile so that it will pass the values determined - by Autoconf down to the libraries. - - * Makefile.in: - FreeBSD's make again: That stupid thing really doesn't grasp $< targets. - - * Makefile.in: - FreeBSD's make sucks big time: It doesn't honor the -C flag. Hence we - have to change into the target directory before calling make. - - * Makefile.in: - BSD make doesn't understand $< like GNU make does, thus it is better - to explicitely name the targets for the sake of portability. - - * Makefile.in: - Rewrote the makefile to not require GNU make. - * libargv/Makefile, libconfigfile/Makefile, liblists/Makefile, libtext/Makefile: - Removed unused suffix .a from the .SUFFIXES target. + * Removed the complimentary mail2news.c program from the + distribution. The program isn't tested, it isn't documented ... so + away with it. - * .cvsignore, configure.in: - - Libraries do not need Autoconf anymore, thus I removed the - AC_CONFIG_SUBDIRS call. - - - Added -O3 to CFLAGS for the sake of good optimization. - - * Makefile.in: Updated dependencies. - - * libargv/.cvsignore, libargv/Makefile, libconfigfile/Makefile, libconfigfile/SMakefile, libconfigfile/configure.in, liblists/Makefile, liblists/SMakefile, liblists/configure.in, liblists/lists.h, liblists/lists.h.in, libtext/Makefile, libtext/SMakefile, libtext/configure.in, libtext/test.txt: - - Removed smake build and autoconf from the libraries. - - Removed unused files. - - * libargv/Makefile, libargv/SMakefile, libargv/configure.in: - Added a real makefile. - - * libargv/argvSetDebugLevel.c: - The file is never used here. - -2000-12-13 Peter Simons - - * libargv/argvSetDebugLevel.c, libargv/test.c, libconfigfile/config.c, libconfigfile/configfile.h, liblists/lists.c, liblists/lists.h.in, libtext/easy_pattern_match.c, libtext/easy_sprintf.c, libtext/find_next_line.c, libtext/find_string.c, libtext/text.h, libtext/transform_text.c, libtext/wordwrap.c: - Added correct GPL copyright headers. - - * libtext/CustomTokenIterator.cpp, libtext/RegexTokenizer.cpp, libtext/RegexTokenizer_test.cpp, libtext/TokenIterator.cpp, libtext/TokenIterator_test.cpp, libtext/text.hpp, libtext/tokenizer_test.cpp: - Removed unused C++ code. - - * Makefile.in: - Cosmetic changes to the Makefile ... nothing important. - - * Makefile.in, configure.in: - After changing librfc822 to get along without libmpools, the library - can (and has been) removed from Petidomo. - - * debug.h: - This header file defines the debug modules Petidomo supports. - - * configure.in: - The source for the configure script generated by Autoconf. - - * petidomo.h: - All internal prototypes and definitions. - - * etc/install-sh: - Autoconf needs this script in order to run sub-configure scripts. - - * liblists/lists.h.in, libtext/CustomTokenIterator.cpp, libtext/RegexTokenizer.cpp, libtext/RegexTokenizer_test.cpp, libtext/TokenIterator.cpp, libtext/TokenIterator_test.cpp, libtext/test.txt, libtext/text.hpp, libtext/tokenizer_test.cpp, liblists/Makefile, liblists/SMakefile, liblists/configure.in, liblists/lists.c, liblists/lists.h, libtext/Makefile, libtext/SMakefile, libtext/configure.in, libtext/easy_pattern_match.c, libtext/easy_sprintf.c, libtext/find_next_line.c, libtext/find_string.c, libtext/text.h, libtext/transform_text.c, libtext/wordwrap.c: - Imported latest version. - - * libconfigfile/Makefile, libconfigfile/SMakefile, libconfigfile/config.c, libconfigfile/configfile.h, libconfigfile/configure.in: - Imported latest version of the library. - - * libargv/NEWS, libargv/SMakefile, libargv/argv.texi, libargv/argv_loc.h, libargv/configure.in, libargv/Makefile, libargv/Makefile.inc, libargv/_argv.h, libargv/argv.c, libargv/argv.h, libargv/argvSetDebugLevel.c, libargv/test.c: - Imported libargv version 2.4.0. - - * acl.y, acl_scan.l, archive.c, argvSetDebugLevel.c, authen.c, config.c, exit.c, filter.c, handleacl.c, help.c, hermes.c, index.c, io.c, listserv.c, mailer.c, main.c, members.c, parsearray.c, password.c, rfcparse.c, signature.c, subscribe.c, tool.c, unsubscribe.c: - - Added correct GNU GPL copyright statements to the files. - - Removed unnecessary include statements. - - * Makefile, Makefile.in: - Rewrote the build process from the scratch. - - * version.h: - The old versioning mechanism needs to be replaced any time soon. - - * archive.h, authen.h, filter.h, mailer.h, rfcparse.h: - The contents of these headers is now included in petidomo.h. - - * signature.c, unregsig.c, unregsig.h: - Renamed unregsig module to signature. Now that Petidomo is released - under GPL, there is no such thing as an "unregistered" version - anymore. - - * acl.c, acl_scan.c, acl_scan.h: - Removed dependent files from CVS repository. - - * etc/mail2news.c: - The program isn't tested, it isn't documented ... so away with it. - - * docs/Makefile, docs/petidomo.tex: - - Removed all use of html.sty. - - - Removed all references to the CGI manager. - - - Removed autoconf support. - - - Removed the index. - - - Reformatted the document to look good and to compile without - warnings. - - * docs/Makefile: - Don't erase the EPS files at 'clean'. - - * docs/directory-struct.eps, docs/ml-principle1.eps, docs/ml-principle2.eps: - Adding EPS files to repository, because those are really hard to - generate correctly. - - * docs/GNUmakefile, docs/Makefile: - Renamed GNUmakefile to Makefile; there's nothing in this makefile - that's specific to GNU make. - - * docs/GNUmakefile: - Added '-f' flag to the 'rm' call in the clean target. - - * docs/GNUmakefile: - Cleaned the Makefile up a lot. Removed explicit targets whereever an - implicit target will do. - - * docs/GNUmakefile, docs/Xstation.bm, docs/directory-struct.fig, docs/ml-principle1.fig, docs/ml-principle2.fig, docs/petidomo.tex, docs/router.bm, docs/world.bm: - Imported Petidomo 2.2 as found on www.petidomo.com. - - * docs/GNUmakefile, docs/Xstation.bm, docs/directory-struct.fig, docs/ml-principle1.fig, docs/ml-principle2.fig, docs/petidomo.tex, docs/router.bm, docs/world.bm: - New file. - - * acl.c, acl_scan.c, acl_scan.h: - Imported Petidomo 2.2 as found on www.petidomo.com. - - * acl.c, acl_scan.c, acl_scan.h: - New file. - - * subscribe.c, tool.c, unregsig.c, unregsig.h, unsubscribe.c, version.h: - Imported Petidomo 2.2 as found on www.petidomo.com. - - * subscribe.c, tool.c, unregsig.c, unregsig.h, unsubscribe.c, version.h: - New file. - - * mailer.c, mailer.h, main.c, members.c, parsearray.c, password.c, rfcparse.c, rfcparse.h: - Imported Petidomo 2.2 as found on www.petidomo.com. - - * mailer.c, mailer.h, main.c, members.c, parsearray.c, password.c, rfcparse.c, rfcparse.h: - New file. - - * filter.c, filter.h, handleacl.c, help.c, hermes.c, index.c, io.c, listserv.c: - Imported Petidomo 2.2 as found on www.petidomo.com. - - * filter.c, filter.h, handleacl.c, help.c, hermes.c, index.c, io.c, listserv.c: - New file. - - * Makefile, acl.y, acl_scan.l, archive.c, archive.h, argvSetDebugLevel.c, authen.c, authen.h, config.c, exit.c: - Imported Petidomo 2.2 as found on www.petidomo.com. - - * Makefile, acl.y, acl_scan.l, archive.c, archive.h, argvSetDebugLevel.c, authen.c, authen.h, config.c, exit.c: - New file. - - * filter/pgp-decrypt.sh, filter/pgp-encrypt.sh: - Imported Petidomo 2.2 as found on www.petidomo.com. - - * filter/pgp-decrypt.sh, filter/pgp-encrypt.sh: - New file. - - * filter/insert-name-in-subject.sh, filter/rfc2369.sh: - Imported Petidomo 2.2 as found on www.petidomo.com. - - * filter/insert-name-in-subject.sh, filter/rfc2369.sh: - New file. - - * libargv/argv.c, libargv/argv.h, libargv/argvSetDebugLevel.c, libargv/test.c: - Imported Petidomo 2.2 as found on www.petidomo.com. - - * libargv/argv.c, libargv/argv.h, libargv/argvSetDebugLevel.c, libargv/test.c: - New file. - - * libargv/Makefile, libargv/Makefile.inc, libargv/_argv.h, libconfigfile/Makefile, libconfigfile/config.c, libconfigfile/configfile.h, libtext/transform_text.c, libtext/wordwrap.c: - Imported Petidomo 2.2 as found on www.petidomo.com. - - * libargv/Makefile, libargv/Makefile.inc, libargv/_argv.h, libconfigfile/Makefile, libconfigfile/config.c, libconfigfile/configfile.h, libtext/transform_text.c, libtext/wordwrap.c: - New file. - - * liblists/Makefile, liblists/lists.c, liblists/lists.h, libtext/Makefile, libtext/easy_pattern_match.c, libtext/easy_sprintf.c, libtext/find_next_line.c, libtext/find_string.c, libtext/text.h: - Imported Petidomo 2.2 as found on www.petidomo.com. - - * liblists/Makefile, liblists/lists.c, liblists/lists.h, libtext/Makefile, libtext/easy_pattern_match.c, libtext/easy_sprintf.c, libtext/find_next_line.c, libtext/find_string.c, libtext/text.h: - New file. - - * config/petidomo.acl, config/petidomo.conf, etc/mail2news.c: - Imported Petidomo 2.2 as found on www.petidomo.com. - - * config/petidomo.acl, config/petidomo.conf, etc/mail2news.c: - New file. - - * README, config/help, config/list-acl, config/list-config: - Imported Petidomo 2.2 as found on www.petidomo.com. - - * README, config/help, config/list-acl, config/list-config: - New file. - - * COPYING, ChangeLog: - Imported Petidomo 2.2 as found on www.petidomo.com. - - * COPYING, ChangeLog: - New file. - - - - -Petidomo v4 -=========== - -2000-12-01 Peter Simons - - * [...TO BE FILLED IN BY PETI...] - 2000-12-01 Ralf S. Engelschall - * Included various cleanups and adjustments derived from the original - OSSP hacks for Petidomo 2.2 + * Added Perl scripts petidomo-approve and petidomo-kickout which + are useful to reduce the amount of effort required in daily + mailing lists administration. - * Added Perl scripts petidomo-approve and petidomo-kickout which are - useful to reduce the amount of effort required in daily mailing lists - administration. - 2000-12-01 Peter Simons - - * The base of this work off is again the latest free - version of Petidomo: 2.2, as released under GPLv2 on - http://www.petidomo.com/download/OpenPetidomo/source/ by - CyberSolutions GmbH. - -Petidomo v3 -=========== - - * There are no ChangeLog entries available for Petidomo v3, but that - doesn't matter because Petidomo v4 is based on the last version of - Petidomo v2. Nevertheless the non-free Petidomo v3 provided mainly an - optional user-interface and the ability to directly deliver mails in - parallel via SMTP. - -Petidomo v2 -=========== - -1999-06-01 Peter Simons - * Re-released under GNU GPL. + * CyberSolutions GmbH has released a version of Petidomo 2.2 under + GPL at . + Now that Petidomo is available under a free license again, I + imported these sources and started working it. The free version + will be released as part of the Open Structured Server Platform + (OSSP) project. Financing has kindly been provided by the Cable + and Wireless Corporation. + +1999-11-15 Peter Simons + + * Petidomo has been sold to CyberSolutions GmbH, Germany. All work + on it stops here. They will release a new version (Petidomo III) + as a commercial product. The free branch of the program is dead. 1998-08-20 Peter Simons From ossp-cvs-owner@ossp.org Sun Feb 18 01:27:37 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f1I0Rao83415; Sun, 18 Feb 2001 01:27:36 +0100 (CET) Date: Sun, 18 Feb 2001 01:27:36 +0100 (CET) Message-Id: <200102180027.f1I0Rao83415@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/petidomo ChangeLog Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 18-Feb-2001 01:27:36 Branch: HEAD Handle: 2001021800273600 Modified files: ossp-pkg/petidomo ChangeLog Log: Updated ChangeLog. Summary: Revision Changes Path 1.5 +7 -0 ossp-pkg/petidomo/ChangeLog ____________________________________________________________________________ Index: ossp-pkg/petidomo/ChangeLog ============================================================ $ cvs diff -u -r1.4 -r1.5 ChangeLog --- ossp-pkg/petidomo/ChangeLog 2001/02/18 00:20:04 1.4 +++ ossp-pkg/petidomo/ChangeLog 2001/02/18 00:27:36 1.5 @@ -1,3 +1,10 @@ +2001-02-18 Peter Simons + + * Per default, Petidomo will not be compiled with '-g -O2' as it + is common for GNU autoconf programs. I don't believe in these kind + of defaults, the user should choose his CFLAGS himself. The '-g' + is particularly annoying. + 2001-02-17 Peter Simons * Updated the documentation for the new version. From ossp-cvs-owner@ossp.org Sun Feb 18 01:33:46 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f1I0Xj683880; Sun, 18 Feb 2001 01:33:45 +0100 (CET) Date: Sun, 18 Feb 2001 01:33:45 +0100 (CET) Message-Id: <200102180033.f1I0Xj683880@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/petidomo/docs petidomo.tex Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 18-Feb-2001 01:33:23 Branch: HEAD Handle: 2001021800332300 Modified files: ossp-pkg/petidomo/docs petidomo.tex Log: Removed all references to petidomo.com and cys.de. Summary: Revision Changes Path 1.7 +15 -15 ossp-pkg/petidomo/docs/petidomo.tex ____________________________________________________________________________ Index: ossp-pkg/petidomo/docs/petidomo.tex ============================================================ $ cvs diff -u -r1.6 -r1.7 petidomo.tex --- ossp-pkg/petidomo/docs/petidomo.tex 2001/02/17 23:06:05 1.6 +++ ossp-pkg/petidomo/docs/petidomo.tex 2001/02/18 00:33:23 1.7 @@ -2,7 +2,7 @@ % % Petidomo Manual % -% $Header: /e/ossp/cvs/ossp-pkg/petidomo/docs/petidomo.tex,v 1.6 2001/02/17 23:06:05 simons Exp $ +% $Header: /e/ossp/cvs/ossp-pkg/petidomo/docs/petidomo.tex,v 1.7 2001/02/18 00:33:23 simons Exp $ % \typearea[2cm]{12} \usepackage{lastpage} @@ -1384,7 +1384,7 @@ instead. Here is an example: \begin{quote} \begin{verbatim} -From: simons@petidomo.com (Peter Simons) +From: simons@computer.org (Peter Simons) Subject: Cats are the most beautiful animals in the world. approve let me post @@ -1404,7 +1404,7 @@ added.) Here is the same example as above now using the headers: \begin{quote} \begin{verbatim} -From: simons@petidomo.com (Peter Simons) +From: simons@computer.org (Peter Simons) Subject: Cats are the most beautiful animals in the world. Approve: let me post @@ -1637,12 +1637,12 @@ \begin{quote} \begin{verbatim} Date: Sat, 28 Jun 1997 19:59:18 +0200 (MET DST) -From: testlist-owner@peti.cys.de (Petidomo Mailing List Server) -To: simons@cys.de -Cc: testlist-owner@peti.cys.de +From: testlist-owner@example.org (Petidomo Mailing List Server) +To: simons@example.org +Cc: testlist-owner@example.org Subject: Your posting to list "testlist" was rejected Precedence: junk -Sender: testlist-owner@peti.cys.de +Sender: testlist-owner@example.org Dear poster, @@ -1653,10 +1653,10 @@ >From simons Sat Jun 28 19:59:17 1997 Received: from [[UNIX: localhost]] - by peti.cys.de (8.8.5/8.8.4) id TAA16959 + by example.org (8.8.5/8.8.4) id TAA16959 Date: Sat, 28 Jun 1997 19:59:17 +0200 (MET DST) -Message-Id: <199706281759.TAA16959@peti.cys.de> -From: Peter Simons +Message-Id: <199706281759.TAA16959@example.org> +From: Peter Simons To: testlist Subject: MAKE MONEY FAST Mime-Version: 1.0 (generated by tm-edit 7.92) @@ -1696,7 +1696,7 @@ to be included in quotes. An ACL statement like this: \begin{quote} \begin{verbatim} -if from == simons@petidomo.com then drop; +if from == simons@computer.org then drop; \end{verbatim} \end{quote} will cause Petidomo to abort with an error, because it can't parse @@ -1708,8 +1708,8 @@ Petidomo: \begin{quote} \begin{verbatim} -if from == "simons@petidomo.com" then - forward postmaster@petidomo.com; +if from == "simons@computer.org" then + forward postmaster@example.org; \end{verbatim} \end{quote} @@ -1791,7 +1791,7 @@ A nice example for what this feature can be used is the following: \begin{quote} \begin{verbatim} -if (address == "simons@petidomo.com") then +if (address == "simons@computer.org") then filter "/usr/local/libexec/petidomo/simons.filter"; \end{verbatim} \end{quote} @@ -1905,7 +1905,7 @@ \item Create a PGP key pair by calling `pgp -kg''. As user-id enter the address of the mailing list itself, for example: ``The secret -mailing list $<$secretlist@petidomo.com$>$''. +mailing list $<$secretlist@example.org$>$''. \item Create a \file{config.txt} file for PGP in the \file{.pgp} directory and insert the appropriate user id there. From ossp-cvs-owner@ossp.org Sun Feb 18 02:03:01 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f1I12cC85917; Sun, 18 Feb 2001 02:02:38 +0100 (CET) Date: Sun, 18 Feb 2001 02:02:38 +0100 (CET) Message-Id: <200102180102.f1I12cC85917@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/petidomo/docs petidomo.tex Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 18-Feb-2001 02:02:08 Branch: HEAD Handle: 2001021801020800 Modified files: ossp-pkg/petidomo/docs petidomo.tex Log: Used the \file{} macro rather than setting the font directly. Summary: Revision Changes Path 1.8 +44 -42 ossp-pkg/petidomo/docs/petidomo.tex ____________________________________________________________________________ Index: ossp-pkg/petidomo/docs/petidomo.tex ============================================================ $ cvs diff -u -r1.7 -r1.8 petidomo.tex --- ossp-pkg/petidomo/docs/petidomo.tex 2001/02/18 00:33:23 1.7 +++ ossp-pkg/petidomo/docs/petidomo.tex 2001/02/18 01:02:08 1.8 @@ -2,7 +2,7 @@ % % Petidomo Manual % -% $Header: /e/ossp/cvs/ossp-pkg/petidomo/docs/petidomo.tex,v 1.7 2001/02/18 00:33:23 simons Exp $ +% $Header: /e/ossp/cvs/ossp-pkg/petidomo/docs/petidomo.tex,v 1.8 2001/02/18 01:02:08 simons Exp $ % \typearea[2cm]{12} \usepackage{lastpage} @@ -48,8 +48,8 @@ \section{Building the Binaries} Untar the source archive of Petidomo in a directory of your choice -like {\sf /usr/local/src} or your home directory. This will create a -directory called {\sf petidomo-VERSION}, where the ``{\sf VERSION}'' +like \file{/usr/local/src} or your home directory. This will create a +directory called \file{petidomo-VERSION}, where the ``VERSION'' part is called exactly as in the file name of the tar archive. Change into this directory. @@ -67,36 +67,36 @@ \item[{-}{-}help] Display the complete list of command line options. -\item[{-}{-}prefix] The the {\sf PREFIX} for all following paths. The -default is {\sf /usr/local}. +\item[{-}{-}prefix] The the \file{PREFIX} for all following paths. The +default is \file{/usr/local}. -\item[{-}{-}exec-prefix] Set the {\sf EPREFIX} for all following +\item[{-}{-}exec-prefix] Set the \file{EPREFIX} for all following paths. This is useful in case you want to install binaries into a different directory hierarchy than normal text files, but usually the -{\sf EPREFIX} is identical to {\sf PREFIX}. The default is {\sf -PREFIX}. +\file{EPREFIX} is identical to \file{PREFIX}. The default is +\file{PREFIX}. \item[{-}{-}bindir] Set the directory where the binaries should be -installed. The default is {\sf EPREFIX/bin}. +installed. The default is \file{EPREFIX/bin}. \item[{-}{-}libexecdir] Set the directory where executables should be installed that will be called by Petidomo but not by the user directly -(like posting filters). The default is {\sf EPREFIX/libexec}. +(like posting filters). The default is \file{EPREFIX/libexec}. \item[{-}{-}datadir] Set the directory where read-only architecture-independent data files should be installed (like the help -file). The default is {\sf PREFIX/share}. +file). The default is \file{PREFIX/share}. \item[{-}{-}sysconfdir] Set the directory where read-only -configuration files should be installed. The default is {\sf -PREFIX/etc}. +configuration files should be installed. The default is +\file{PREFIX/etc}. \item[{-}{-}localstatedir] Set the directory where modifiable data files should be installed (like the approve-queue or the mailing -list config files). The default is {\sf PREFIX/var}. +list config files). The default is \file{PREFIX/var}. \item[{-}{-}mandir] Set the directory where man documentation files -should be installed. The default is {\sf PREFIX/man}. +should be installed. The default is \file{PREFIX/man}. \end{description} @@ -169,7 +169,7 @@ \end{quote} to start the building process. Petidomo has been tested with various flavours of the make utility and all of them seem to work fine. If in -doubt, try GNU Make, which is available from {\sf ftp.gnu.org}. +doubt, try GNU Make, which is available from ftp.gnu.org. Petidomo has also been built using parallel builds. This is useful if you have a multi-processer system. You can do this with most make @@ -254,9 +254,9 @@ To run Petidomo via sendmail --- what is what you want to do ---, you have to create apropriate aliases for it. You can do this by adding -the folling lines to your {\sf aliases} file, which usually resides in -{\sf /etc/aliases} or, with newer sendmail versions, in {\sf -/etc/mail/aliases}: +the folling lines to your aliases file, which usually resides in +\file{/etc/aliases} or, with newer sendmail versions, in +\file{/etc/mail/aliases}: \begin{quote} \begin{verbatim} petidomo-manager: postmaster @@ -281,7 +281,7 @@ testlist-owner: petidomo-manager \end{verbatim} \end{quote} -Having done all this, execute the {\sf newaliases} utility to rebuild +Having done all this, execute the newaliases(1) utility to rebuild sendmail's internal database. Your changes will not have any effect unless you do this. @@ -303,9 +303,9 @@ foobar: "/tmp/foobar-mail" \end{verbatim} \end{quote} -to your aliases file and execute {\sf newaliases}. Then send an e-mail -to the address ``foobar''. The contents of this mail will be stored in -the file {\sf /tmp/foobar-mail} then and we are interested in the user +to your aliases file and execute newaliases(1). Then send an e-mail to +the address ``foobar''. The contents of this mail will be stored in +the file \file{/tmp/foobar-mail} then and we are interested in the user who owns this file: \begin{quote} \begin{verbatim} @@ -325,7 +325,7 @@ installation. This is the default, because all files are installed with read permisson for everybody. Also, all directories allow access to anybody by default. But ``daemon'' also needs write access to the -``localstatedir'' --- {\sf /usr/local/var/petidomo} per default. You +``localstatedir'' --- \file{/usr/local/var/petidomo} per default. You can ensure this by executing the command: \begin{quote} \begin{verbatim} @@ -338,28 +338,29 @@ figured that if you are the kind of person who wants to do things like this, you won't need an explanation how to do it anyway. Just that much information for you: Petidomo does not actually write to the -``localstatdir'', but only to the subdirectory {\sf ack-queue} located +``localstatdir'', but only to the subdirectory \file{ack-queue} located in it. -Of course, you do not necessarily need to have the {\sf ack-queue} +Of course, you do not necessarily need to have the \file{ack-queue} directory owned by ``daemon'', you can also set the group permissions apropriately. Furthermore, Petidomo will usually want to write to the -{\sf lists} directory located in the ``localstatedir'', because most +\file{lists} directory located in the ``localstatedir'', because most list administrators tend to place the mailing list archives there, but you can enable write access according to the list's configuration once you know how you're mailing lists are configured. In case something -does not work as expected, check out the syslog messages for the {\sf -LOG\_MAIL} facility --- this is where Petidomo logs its error messages. +does not work as expected, check out the syslog messages for the +LOG\_MAIL facility --- this is where Petidomo logs its error messages. \section{Configuring Petidomo} The last step before we can test our installation is to configure Petidomo. This is really simple. List the contents of the ``sysconfdir'' you chose. If you did not change the default paths, -this is {\sf /usr/local/etc}. There you will find two files: {\sf -petidomo.conf-sample} and {\sf petidomo.acl-sample}. Just rename them -to {\sf petidomo.conf} and {\sf petidomo.acl} respectively and fire up -your favorite text editor to edit the file {\sf petidomo.conf}. +this is \file{/usr/local/etc}. There you will find two files: +\file{petidomo.conf-sample} and \file{petidomo.acl-sample}. Just +rename them to \file{petidomo.conf} and \file{petidomo.acl} +respectively and fire up your favorite text editor to edit the file +\file{petidomo.conf}. Uncomment the options ``Hostname'', ``AdminPassword'', and ``MTA'' and set the values correctly. ``Hostname'' should be the fully qualified @@ -370,8 +371,8 @@ chose pretty much any text you like, just make sure you remember it. The ``MTA'' setting will usually be alright the way it is. You may want to check whether sendmail does actually live at this path; on -some Unixes, it is not installed at {\sf /usr/sbin/sendmail}, but at -{\sf /usr/lib/sendmail}. Change the setting if this is the case. You +some Unixes, it is not installed at \file{/usr/sbin/sendmail}, but at +\file{/usr/lib/sendmail}. Change the setting if this is the case. You can ignore all other settings right now. Come back and configure those once you have read the apropriate sections of this manual. If you're an experienced Unix wizard, the comments in the config file will @@ -402,8 +403,8 @@ Once you sent the e-mail, sendmail will start up Petidomo and feed the mail text into it for processing. If you take a look at the syslogfile -containing the {\sf LOG\_MAIL} facility now --- this is usally {\sf -/var/log/messages} or {\sf /var/log/maillog} ---, you will find that +containing the LOG\_MAIL facility now --- this is usally +\file{/var/log/messages} or \file{/var/log/maillog} ---, you will find that Petidomo logged entries there that look pretty much like the following ones. The backslash (``\verb#\#'') characters at the end of some of these lines denote that the line has been wrapped for readability. In @@ -434,9 +435,10 @@ As you can see, Petidomo logged how it was started, where it is expecting its master config file and under which user- and group id it is running. Then it logs that it has received a HELP request. This -request will be answered by sending the file {\sf -/usr/local/share/petidomo/help} back to the person who requested help, -and if everthing worked, you will now find that mail in your mail box. +request will be answered by sending the file +\file{/usr/local/share/petidomo/help} back to the person who requested +help, and if everthing worked, you will now find that mail in your +mail box. If something went wrong, Petidomo will tell you what went wrong. So, please fix the problem and try again. In 99\% of all cases, the error @@ -494,7 +496,7 @@ List Manager!} In case any of the benefits promised above stays away, please consult -paragraphs 11 and 12 of the file {\sf COPYING} included in this +paragraphs 11 and 12 of the file \file{COPYING} included in this distribution. \chapter{Configuring Petidomo} @@ -1054,7 +1056,7 @@ name of the list, which's subscriber list should be dumped. In ``approve'' mode, this parameter is ignored. -\item[{-}-masterconf={\sf /path/to/petidomo.conf}] +\item[{-}-masterconf=\file{/path/to/petidomo.conf}] Using this parameter you can tell Petidomo to use a different location for the master config file than the one that has been compiled in. From ossp-cvs-owner@ossp.org Sun Feb 18 02:03:30 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f1I13T186040; Sun, 18 Feb 2001 02:03:29 +0100 (CET) Date: Sun, 18 Feb 2001 02:03:29 +0100 (CET) Message-Id: <200102180103.f1I13T186040@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/petidomo INSTALL Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 18-Feb-2001 02:03:29 Branch: HEAD Handle: 2001021801032800 Modified files: ossp-pkg/petidomo INSTALL Log: Added text-only version of the installation instructions. Summary: Revision Changes Path 1.2 +433 -5 ossp-pkg/petidomo/INSTALL ____________________________________________________________________________ Index: ossp-pkg/petidomo/INSTALL ============================================================ $ cvs diff -u -r1.1 -r1.2 INSTALL --- ossp-pkg/petidomo/INSTALL 2001/01/20 14:00:32 1.1 +++ ossp-pkg/petidomo/INSTALL 2001/02/18 01:03:28 1.2 @@ -1,8 +1,436 @@ + Installing Petidomo - INSTALL - ======= +The installation of the Petidomo Mailing List Manager is simple and +straight forward; do not be scared by the length of this document. +There are many different ways and options how to install it and I have +tried my best to cover *all* of them. If you are not interested in +every little detail, you will be able to skim over most of the text +here. - $ ./configure --prefix=/path/to/petidomo - $ make - $ make install + Peter Simons + +Building the Binaries +===================== + +Untar the source archive of Petidomo in a directory of your choice +like /usr/local/src or your home directory. This will create a +directory called petidomo-VERSION, where the "VERSION" part is called +exactly as in the file name of the tar archive. Change into this +directory. + +Now you have to run the configure script + + ./configure + +which will determine the characteristics of your system and create the +files required to actually build Petidomo. You may provide several +parameters to the script. The interesting ones, including the default +values if unspecified, are: + + --help + Display the complete list of command line options. + + --prefix + The the PREFIX for all following paths. The default is + /usr/local. + + --exec-prefix + Set the EPREFIX for all following paths. This is useful in + case you want to install binaries into a different directory + hierarchy than normal text files, but usually the EPREFIX is + identical to PREFIX. The default is PREFIX. + + --bindir + Set the directory where the binaries should be installed. The + default is EPREFIX/bin. + + --libexecdir + Set the directory where executables should be installed that + will be called by Petidomo but not by the user directly (like + posting filters). The default is EPREFIX/libexec. + + --datadir + Set the directory where read-only architecture-independent + data files should be installed (like the help file). The + default is PREFIX/share. + + --sysconfdir + Set the directory where read-only configuration files should + be installed. The default is PREFIX/etc. + + --localstatedir + Set the directory where modifiable data files should be + installed (like the approve-queue or the mailing list config + files). The default is PREFIX/var. + + --mandir + Set the directory where man documentation files should be + installed. The default is PREFIX/man. + +Please note that the directories you specify here are only the default +settings that are compiled into Petidomo. You can modify *all* paths +at run-time via the command line and through the configuration files. +So don't waste to much time figuring out what you want here, you can +change anything later without having to recompile Petidomo. + +Finally, here is an example output of the configuration script when +run without any parameters on a Linux machine: + + simons@peti:~/projects/petidomo-4.0b1$ ./configure + Configuring OSSP Petidomo, Version 4.0b1 (18-Jan-2001) + creating cache ./config.cache + checking for gcc... gcc + checking whether the C compiler (gcc ) works... yes + checking whether the C compiler (gcc ) is a cross-compiler... no + checking whether we are using GNU C... yes + checking whether gcc accepts -g... yes + checking for ranlib... ranlib + checking for flex... flex + checking for yywrap in -lfl... yes + checking for bison... bison -y + checking size of unsigned short... 2 + checking size of unsigned int... 4 + checking size of unsigned long... 4 + checking how to run the C preprocessor... gcc -E + checking for ANSI C header files... yes + checking for ssize_t... yes + updating cache ./config.cache + creating ./config.status + creating Makefile + +Often, you may want to pass certain flags to the compiler or the +linker to modify the building process. To achieve this, you can set +certain environment variables before calling the configure script. +These variables are: + + CC + The name of the C compiler to use. + + CPPFLAGS + Flags to pass to the preprocesser before compiling a source + code file. + + CFLAGS + Flags to pass to the compiler when compiling a C source code + file. + + LDFLAGS + Flags to pass to the linker when linking the binaries. + +I personally find this useful to raise the level of compiler +optimization or to add linker flags that tell the linker to strip +unnecessary symbols from the binaries. To achive these effects, I call +the configure script like this: + + CFLAGS=-O3 LDFLAGS=-s ./configure + +Anyway, once the configure script has been run, just call + + make + +to start the building process. Petidomo has been tested with various +flavours of the make(1) utility and all of them seem to work fine. If +in doubt, try GNU Make, which is available from ftp.gnu.org. + +Petidomo has also been built using parallel builds. This is useful if +you have a multi-processer system. You can do this with most make +utilities by adding the flag "-j4" with "4" being the number of +processes you want to spawn simultaneously. Please note, though, that +some make utilities have problems with the rules that translate the +yacc-modules included in Petidomo correctly when building in parallel. +If you experience any trouble, just build it conventionally and you +should be fine. + + +Installing the Binaries +======================= + +To install the software to your system, all you have to do is execute + + make install + +This will copy the Petidomo binary, the posting filters included in +the distribution, the sample config files and the manual pages into +the directories you chose at configure time earlier. If you're a +first-time user, you may also want to execute + + make install-testlist + +which will create a sample mailing list called "testlist" for you. + +Assuming you used the default paths when running configure, the +install process will create the follwing directories, respectively +copy the following files to your system: + + /usr/local/ + /usr/local/bin/ + /usr/local/bin/petidomo + /usr/local/bin/petidomo-approve + /usr/local/bin/petidomo-kickout + /usr/local/etc/ + /usr/local/etc/petidomo.acl-sample + /usr/local/etc/petidomo.conf-sample + /usr/local/libexec/ + /usr/local/libexec/petidomo/ + /usr/local/libexec/petidomo/insert-name-in-subject.sh + /usr/local/libexec/petidomo/pgp-decrypt.sh + /usr/local/libexec/petidomo/pgp-encrypt.sh + /usr/local/libexec/petidomo/rfc2369.sh + /usr/local/man/ + /usr/local/man/man1/ + /usr/local/man/man1/petidomo.1 + /usr/local/share/ + /usr/local/share/petidomo/ + /usr/local/share/petidomo/help + /usr/local/var/ + /usr/local/var/petidomo/ + /usr/local/var/petidomo/ack-queue/ + /usr/local/var/petidomo/index + /usr/local/var/petidomo/lists/ + +If you run the "install-testlist" target, the following +directory/files will be created additionally: + + /usr/local/var/petidomo/lists/testlist/ + /usr/local/var/petidomo/lists/testlist/config + /usr/local/var/petidomo/lists/testlist/acl + /usr/local/var/petidomo/lists/testlist/list + + +Configuring Sendmail +==================== + +Before you can use Petidomo, you have to configure sendmail so that it +knows about Petidomo -- I assume that you have sendmail installed +already. If you are using an MTA other than sendmail, you are on your +own from here on, I am afraid. Any users who have successfully +installed Petidomo on a qmail-, vmailer-, or postfix-based system are +more than welcome to contribute to this documentation to help other +users. + +To run Petidomo via sendmail -- what is what you want to do --, you +have to create apropriate aliases for it. You can do this by adding +the folling lines to your aliases file, which usually resides in +/etc/aliases or, with newer sendmail versions, in /etc/mail/aliases: + + petidomo-manager: postmaster + petidomo: "|/usr/local/bin/petidomo --mode=listserv" + petidomo-approve: "|/usr/local/bin/petidomo --mode=approve" + +In case you installed the Petidomo binary to some other location, you +will have to change the paths here apropriately of course. You may +also chose that mail for the "petidomo-manager" should go to some +different address than "postmaster", if that suits your needs better; +the main point is that somebody actually *reads* what arrives there. + +If executed the "install-testlist" target earlier and thus have the +example mailing list from the distribution installed, you may also +want to add the lines: + + testlist: "|/usr/local/bin/petidomo --mode=deliver testlist" + testlist-request: "|/usr/local/bin/petidomo --mode=listserv testlist" + testlist-owner: petidomo-manager + +Having done all this, execute the newaliases(1) utility to rebuild +sendmail's internal database. Your changes will not have any effect +unless you do this. + + +Configuring the File Permissions +================================ + +The final step, before Petidomo is successfully installed, is to set +the right permissions to the installation directories and installed +files. Unfortunately, the installation process can not do this +automatically; you have to chose what permissions are "right" +yourself. If works like this: Petidomo will be called from sendmail, +thanks to the aliases you just created. That means, that sendmail +determines under what user to start Petidomo. In 99% of all +configurations I have ever seen, that user is "daemon", but it *may* +be something else, so we better figure it out for sure. + +Add the line + + foobar: "/tmp/foobar-mail" + +to your aliases file and execute newaliases(1). Then send an e-mail to +the address "foobar". The contents of this mail will be stored in the +file /tmp/foobar-mail then and we are interested in the user who owns +this file: + + root@peti:/# sendmail -v foobar , \ + relay=simons@localhost + petidomo[8706]: Petidomo 4.0b1 (18-Jan-2001) starting up; \ + mode=listserv, listname=, \ + masterconf=/usr/local/etc/petidomo.conf, \ + approved=false, ruid=2, euid=2, gid=2, egid=2 + petidomo[8706]: simons@peti.cryp.to: help + sendmail[8707]: f1CIHX508707: from=petidomo-manager@peti.cryp.to, \ + size=2091, class=-100, nrcpts=1, \ + msgid=<200102121817.f1CIHX508707@peti.cryp.to>, \ + relay=daemon@localhost + sendmail[8705]: f1CIHWJ08705: \ + to="|/usr/local/bin/petidomo --mode=listserv", \ + ctladdr=petidomo (2/0), delay=00:00:01, xdelay=00:00:01, \ + mailer=prog, pri=30005, dsn=2.0.0, stat=Sent + sendmail[8709]: f1CIHX508707: to=simons@peti.cryp.to, delay=00:00:00, \ + xdelay=00:00:00, mailer=local, pri=212091, dsn=2.0.0, stat=Sent + +As you can see, Petidomo logged how it was started, where it is +expecting its master config file and under which user- and group id it +is running. Then it logs that it has received a HELP request. This +request will be answered by sending the file +/usr/local/share/petidomo/help back to the person who requested help, +and if everthing worked, you will now find that mail in your mail box. + +If something went wrong, Petidomo will tell you what went wrong. So, +please fix the problem and try again. In 99% of all cases, the error +will say something like "opening file XYZ failed: permission denied". +Then all you have to do is to make sure that the user under which +Petidomo has been started (you have the numeric id in the logfile) has +read access to that file. If the user has but Petidomo keeps +complaining, check, whether that user has access to the directory at +all! + +Those of you who executed the "install-testlist" target earlier in +the "Building the Binaries" chapter may also want to test whether +this mailing list is working. To do so, send another mail to Petidomo +and put the command "subscribe YOUR-ADDRESS testlist" in the mail +body -- without the quotes! "YOUR-ADDRESS" naturally means that you +should insert your e-mail address here. This command will subscribe +your e-mail address to the "testlist" mailing list; you should +receive a confirmation about that via e-mail within moments. Once that +is accomplished, send another e-mail to the "testlist" address on +your system. The e-mail may look like whatever you want. + +Within seconds, you should get the mail back from the mailing list +server -- and so will all other addresses that are subscribed to the +list. My personal test mail looked like this: + + From testlist-owner@peti.cryp.to Mon Feb 12 19:43:56 2001 + Received: (from daemon@localhost) + by peti.cryp.to id f1CIhuA08872 for simons@peti.cryp.to; + Mon, 12 Feb 2001 19:43:56 +0100 + Received: (from simons@localhost) + by peti.cryp.to id f1CIhJY08853 for testlist; + Mon, 12 Feb 2001 19:43:19 +0100 + Date: Mon, 12 Feb 2001 19:43:19 +0100 + From: Peter Simons + Message-Id: <200102121843.f1CIhJY08853@peti.cryp.to> + Subject: Petidomo absolutely rules the known earth! + Reply-To: testlist@peti.cryp.to + Sender: testlist-owner@peti.cryp.to + Precedence: list + + It does ... + +If this all worked for you, you have a your Petidomo installation up +and running. Men will envy you and women will desire you -- unless, of +course, you *are* a woman, then it is vice versa. You will be able to +stop smoking any time you want, you may eat anything you like and as +much as you like, but you will never gain a single pound. Your sex +life will improve dramatically, your boss will like you, your hard +drives will never crash and your Internet connections will always be +fast. All this, thanks to the wonders of the Petidomo Mailing List +Manager! + +In case any of the benefits promised above stays away, please consult +paragraphs 11 and 12 of the file COPYING included in this +distribution. From ossp-cvs-owner@ossp.org Sat Mar 3 15:45:07 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f23Ej6603114; Sat, 3 Mar 2001 15:45:06 +0100 (CET) Date: Sat, 3 Mar 2001 15:45:06 +0100 (CET) Message-Id: <200103031445.f23Ej6603114@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/jitterbug COPYING INSTALL Makefile.in README acco... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 03-Mar-2001 15:45:06 Branch: VENDOR Handle: 1970010101000000 Touched files: (Branch: VENDOR) ossp-pkg/jitterbug COPYING INSTALL Makefile.in README acconfig.h cgi.c config.guess config.h.in config.sub configure configure.in html.c html.h includes.h jconfig.h jitterbug.c jitterbug.h list.c loadparm.c lock.c match.c mkproto.awk new_message.c notify.c proto.h pulldown.c search.c smtp.c snprintf.c util.c version.h vslprintf.c Log: Import of Jitterbug 20010303 [Release Tag: JITTERBUG_20010303] Summary: Revision Changes Path ____________________________________________________________________________ From ossp-cvs-owner@ossp.org Sat Mar 3 15:46:39 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f23EkcR03251; Sat, 3 Mar 2001 15:46:38 +0100 (CET) Date: Sat, 3 Mar 2001 15:46:38 +0100 (CET) Message-Id: <200103031446.f23EkcR03251@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/jitterbug shtool Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 03-Mar-2001 15:46:38 Branch: HEAD Handle: 2001030314463800 Modified files: ossp-pkg/jitterbug shtool Log: Update GNU shtool Summary: Revision Changes Path 1.2 +46 -38 ossp-pkg/jitterbug/shtool ____________________________________________________________________________ Index: ossp-pkg/jitterbug/shtool ============================================================ $ cvs diff -u -r1.1 -r1.2 shtool --- ossp-pkg/jitterbug/shtool 2000/05/31 19:58:04 1.1 +++ ossp-pkg/jitterbug/shtool 2001/03/03 14:46:38 1.2 @@ -1,13 +1,13 @@ #!/bin/sh ## ## GNU shtool -- The GNU Portable Shell Tool -## Copyright (c) 1994-2000 Ralf S. Engelschall +## Copyright (c) 1994-2001 Ralf S. Engelschall ## ## See http://www.gnu.org/software/shtool/ for more information. ## See ftp://ftp.gnu.org/gnu/shtool/ for latest version. ## -## Version 1.4.9 (16-Apr-2000) -## Ingredients: 5/17 available modules +## Version: 1.5.2 (27-Feb-2001) +## Contents: 5/17 available modules ## ## @@ -55,7 +55,7 @@ ## arx Extended archive command ## slo Separate linker options by library class ## scpp Sharing C Pre-Processor -## version Generate and maintain a version information file +## version Maintain a version information file ## path Deal with program paths ## @@ -65,8 +65,8 @@ exit 1 fi if [ ".$1" = ".-h" -o ".$1" = ".--help" ]; then - echo "This is GNU shtool, version 1.4.9 (16-Apr-2000)" - echo "Copyright (c) 1994-2000 Ralf S. Engelschall " + echo "This is GNU shtool, version 1.5.2 (27-Feb-2001)" + echo "Copyright (c) 1994-2001 Ralf S. Engelschall " echo "Report bugs to " echo '' echo "Usage: shtool [] [ [] []]" @@ -75,11 +75,12 @@ 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 [] []:' echo ' echo [-n] [-e] [ ...]' echo ' install [-v] [-t] [-c] [-C] [-s] [-m] [-o] [-g]' - echo ' [-e] [ ...] ' + echo ' [-e] [ ...] ' echo ' mkdir [-t] [-f] [-p] [-m] [ ...]' echo ' fixperm [-v] [-t] [ ...]' echo ' tarball [-t] [-v] [-o ] [-c ] [-d ] [-u' @@ -97,16 +98,20 @@ echo ' slo [-p] -- -L -l [-L -l ...]' echo ' scpp [-v] [-p] [-f] [-o] [-t] [-M]' echo ' [-D] [-C] [ ...]' - echo ' version [-l] [-n] [-p] [-s] [-i]' - echo ' [-d] ' + echo ' version [-l] [-n] [-p] [-s] [-e]' + echo ' [-i] [-d] ' echo ' path [-s] [-r] [-d] [-b] [-m] [-p] [ ...]' echo '' exit 0 fi if [ ".$1" = ".-v" -o ".$1" = ."--version" ]; then - echo "GNU shtool 1.4.9 (16-Apr-2000)" + echo "GNU shtool 1.5.2 (27-Feb-2001)" exit 0 fi +if [ ".$1" = ".-r" -o ".$1" = ."--recreate" ]; then + shtoolize -oshtool echo install mkdir fixperm tarball + exit 0 +fi if [ ".$1" = ".-d" -o ".$1" = ."--debug" ]; then shift set -x @@ -142,15 +147,15 @@ ;; install ) str_tool="install" - str_usage="[-v] [-t] [-c] [-C] [-s] [-m] [-o] [-g] [-e] [ ...] " + str_usage="[-v] [-t] [-c] [-C] [-s] [-m] [-o] [-g] [-e] [ ...] " arg_spec="2+" - opt_spec="v.t.c.C.s.m:o:g:e:" + opt_spec="v.t.c.C.s.m:o:g:e+" opt_v=no opt_t=no opt_c=no opt_C=no opt_s=no - opt_m="" + opt_m="0755" opt_o="" opt_g="" opt_e="" @@ -335,6 +340,7 @@ tmpfile="$tmpdir/.shtool.$$" rm -f $tmpfile >/dev/null 2>&1 touch $tmpfile + chmod 600 $tmpfile fi ## @@ -346,7 +352,7 @@ echo ) ## ## echo -- Print string with optional construct expansion - ## Copyright (c) 1998-2000 Ralf S. Engelschall + ## Copyright (c) 1998-2001 Ralf S. Engelschall ## Originally written for WML as buildinfo ## @@ -569,7 +575,7 @@ install ) ## ## install -- Install a program, script or datafile - ## Copyright (c) 1997-2000 Ralf S. Engelschall + ## Copyright (c) 1997-2001 Ralf S. Engelschall ## Originally written for shtool ## @@ -599,19 +605,13 @@ for src in $srcs; do dst=$dstpath - # If destination is a directory, append the input filename + # if destination is a directory, append the input filename if [ $dstisdir = 1 ]; then dstfile=`echo "$src" | sed -e 's;.*/\([^/]*\)$;\1;'` dst="$dst/$dstfile" fi - # Add a possible extension to src and dst - if [ ".$opt_e" != . ]; then - src="$src$opt_e" - dst="$dst$opt_e" - fi - - # Check for correct arguments + # check for correct arguments if [ ".$src" = ".$dst" ]; then echo "$msgprefix:Warning: source and destination are the same - skipped" 1>&2 continue @@ -621,18 +621,18 @@ continue fi - # Make a temp file name in the destination directory + # make a temp file name in the destination directory dsttmp=`echo $dst |\ sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;' -e 's;^$;.;' \ -e "s;\$;/#INST@$$#;"` - # Verbosity + # verbosity if [ ".$opt_v" = .yes ]; then echo "$src -> $dst" 1>&2 fi - # Copy or move the file name to the temp name - # (because we might be not allowed to change the source) + # copy or move the file name to the temp name + # (because we might be not allowed to change the source) if [ ".$opt_C" = .yes ]; then opt_c=yes fi @@ -648,8 +648,16 @@ mv $src $dsttmp || exit $? fi - # Adjust the target file - # (we do chmod last to preserve setuid bits) + # adjust the target file + if [ ".$opt_e" != . ]; then + sed='sed' + for e in $opt_e; do + sed="$sed -e '$e'" + done + cp $dsttmp $dsttmp.old + eval "$sed <$dsttmp.old >$dsttmp" || exit $? + rm -f $dsttmp.old + fi if [ ".$opt_s" = .yes ]; then if [ ".$opt_t" = .yes ]; then echo "strip $dsttmp" 1>&2 @@ -668,14 +676,14 @@ fi chgrp $opt_g $dsttmp || exit $? fi - if [ ".$opt_m" != . ]; then + if [ ".$opt_m" != ".-" ]; then if [ ".$opt_t" = .yes ]; then echo "chmod $opt_m $dsttmp" 1>&2 fi chmod $opt_m $dsttmp || exit $? fi - # Determine whether to do a quick install + # determine whether to do a quick install # (has to be done _after_ the strip was already done) quick=no if [ ".$opt_C" = .yes ]; then @@ -686,7 +694,7 @@ fi fi - # Finally install the file to the real destination + # finally, install the file to the real destination if [ $quick = yes ]; then if [ ".$opt_t" = .yes ]; then echo "rm -f $dsttmp" 1>&2 @@ -704,7 +712,7 @@ mkdir ) ## ## mkdir -- Make one or more directories - ## Copyright (c) 1996-2000 Ralf S. Engelschall + ## Copyright (c) 1996-2001 Ralf S. Engelschall ## Originally written for public domain by Noah Friedman ## Cleaned up and enhanced for shtool ## @@ -713,7 +721,7 @@ for p in ${1+"$@"}; do # if the directory already exists... if [ -d "$p" ]; then - if [ ".$opt_f" = .no ] && [ ".$opt_p" = .no ]; then + if [ ".$opt_f" = .no -a ".$opt_p" = .no ]; then echo "$msgprefix:Error: directory already exists: $p" 1>&2 errstatus=1 break @@ -763,7 +771,7 @@ fixperm ) ## ## fixperm -- Fix file permissions inside a source tree - ## Copyright (c) 1996-2000 Ralf S. Engelschall + ## Copyright (c) 1996-2001 Ralf S. Engelschall ## Originally written for ePerl ## @@ -819,7 +827,7 @@ tarball ) ## ## tarball -- Roll distribution tarballs - ## Copyright (c) 1999-2000 Ralf S. Engelschall + ## Copyright (c) 1999-2001 Ralf S. Engelschall ## Originally written for shtool ## @@ -845,7 +853,7 @@ for tool in `echo $tools | sed -e 's/,/ /g'`; do # iterate over paths for path in $paths; do - if [ $minusx "$path/$tool" ] && [ ! -d "$path/$tool" ]; then + if [ $minusx "$path/$tool" -a ! -d "$path/$tool" ]; then eval "prg_${prg}=\"$path/$tool\"" break fi @@ -871,7 +879,7 @@ if [ ".$opt_t" = .yes ]; then echo "(cd $src && $prg_find . -type f -depth -print) | sed -e 's:^\\.\$::' -e 's:^\\./::' | cat $exclude >>$tmpfile.lst" 1>&2 fi - (cd $src && find . -type f -depth -print) |\ + (cd $src && $prg_find . -type f -depth -print) |\ sed -e 's:^\.$::' -e 's:^\./::' | eval cat $exclude >>$tmpfile.lst else if [ ".$opt_t" = .yes ]; then From ossp-cvs-owner@ossp.org Sat Mar 3 16:01:59 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f23F1wC04367; Sat, 3 Mar 2001 16:01:58 +0100 (CET) Date: Sat, 3 Mar 2001 16:01:58 +0100 (CET) Message-Id: <200103031501.f23F1wC04367@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/jitterbug .configure snprintf.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 03-Mar-2001 16:01:58 Branch: HEAD Handle: 2001030315015800 Modified files: ossp-pkg/jitterbug .configure snprintf.c Log: Get rid of warnings Summary: Revision Changes Path 1.2 +1 -1 ossp-pkg/jitterbug/.configure 1.2 +1 -0 ossp-pkg/jitterbug/snprintf.c ____________________________________________________________________________ Index: ossp-pkg/jitterbug/.configure ============================================================ $ cvs diff -u -r1.1 -r1.2 .configure --- ossp-pkg/jitterbug/.configure 2000/05/31 20:02:59 1.1 +++ ossp-pkg/jitterbug/.configure 2001/03/03 15:01:58 1.2 @@ -1,5 +1,5 @@ : -CC=egcc \ +CC=gcc \ CFLAGS="-pipe -O2 -pedantic -Wall -Wshadow -Wpointer-arith -Wcast-align -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline" \ ./configure \ --prefix=/sw/pkg/jitterbug \ Index: ossp-pkg/jitterbug/snprintf.c ============================================================ $ cvs diff -u -r1.1.1.1 -r1.2 snprintf.c --- ossp-pkg/jitterbug/snprintf.c 2000/05/31 19:54:30 1.1.1.1 +++ ossp-pkg/jitterbug/snprintf.c 2001/03/03 15:01:58 1.2 @@ -739,6 +739,7 @@ #else /* keep compilers happy about empty files */ + void dummy_snprintf(void); void dummy_snprintf(void) {} #endif /* !HAVE_SNPRINTF */ From ossp-cvs-owner@ossp.org Sat Mar 3 17:03:26 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f23G3Qa09221; Sat, 3 Mar 2001 17:03:26 +0100 (CET) Date: Sat, 3 Mar 2001 17:03:26 +0100 (CET) Message-Id: <200103031603.f23G3Qa09221@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/jitterbug Makefile.in README.OSSP jitterbug.c jit... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 03-Mar-2001 17:03:26 Branch: HEAD Handle: 2001030316032500 Modified files: ossp-pkg/jitterbug Makefile.in README.OSSP jitterbug.c jitterbug.h Log: Allow 'jitterbug ' Summary: Revision Changes Path 1.7 +7 -7 ossp-pkg/jitterbug/Makefile.in 1.7 +5 -0 ossp-pkg/jitterbug/README.OSSP 1.7 +5 -0 ossp-pkg/jitterbug/jitterbug.c 1.9 +1 -0 ossp-pkg/jitterbug/jitterbug.h ____________________________________________________________________________ Index: ossp-pkg/jitterbug/Makefile.in ============================================================ $ cvs diff -u -r1.6 -r1.7 Makefile.in --- ossp-pkg/jitterbug/Makefile.in 2000/06/01 10:23:27 1.6 +++ ossp-pkg/jitterbug/Makefile.in 2001/03/03 16:03:25 1.7 @@ -2,6 +2,7 @@ # Makefile for Jitterbug # +DESTDIR = prefix = @prefix@ exec_prefix = @prefix@ bindir = @bindir@ @@ -38,13 +39,12 @@ rm -f config.cache config.log config.status install: - $(SHTOOL) mkdir -f -p -m 755 $(prefix) - $(SHTOOL) mkdir -f -p -m 755 $(bindir) - $(SHTOOL) mkdir -f -p -m 755 $(sysconfdir) - $(SHTOOL) mkdir -f -p -m 755 $(sysconfdir) - $(SHTOOL) install -c -s -m 755 jitterbug $(bindir)/jitterbug-web - $(SHTOOL) install -c -s -m 755 new_message $(bindir)/jitterbug-mail - $(SHTOOL) install -c -m 644 jitterbug.txt $(sysconfdir)/jitterbug.txt + $(SHTOOL) mkdir -f -p -m 755 $(DESTDIR)$(prefix) + $(SHTOOL) mkdir -f -p -m 755 $(DESTDIR)$(bindir) + $(SHTOOL) mkdir -f -p -m 755 $(DESTDIR)$(sysconfdir) + $(SHTOOL) install -c -s -m 755 jitterbug $(DESTDIR)$(bindir)/jitterbug-web + $(SHTOOL) install -c -s -m 755 new_message $(DESTDIR)$(bindir)/jitterbug-mail + $(SHTOOL) install -c -m 644 jitterbug.txt $(DESTDIR)$(sysconfdir)/jitterbug.txt dist: distclean @V=`sed " in addition to renaming + "jitterbug" to "". + [Origin: Ralf S. Engelschall] + Index: ossp-pkg/jitterbug/jitterbug.c ============================================================ $ cvs diff -u -r1.6 -r1.7 jitterbug.c --- ossp-pkg/jitterbug/jitterbug.c 2000/06/02 15:42:06 1.6 +++ ossp-pkg/jitterbug/jitterbug.c 2001/03/03 16:03:25 1.7 @@ -2240,6 +2240,11 @@ { char *s; +#ifdef OSSP_PATCH_ARGV + if (argc == 2) + load_config(argv[1]); + else +#endif load_config(argv[0]); /* we must do this before reading anything from the client! */ Index: ossp-pkg/jitterbug/jitterbug.h ============================================================ $ cvs diff -u -r1.8 -r1.9 jitterbug.h --- ossp-pkg/jitterbug/jitterbug.h 2000/06/02 15:42:06 1.8 +++ ossp-pkg/jitterbug/jitterbug.h 2001/03/03 16:03:25 1.9 @@ -54,5 +54,6 @@ #define OSSP_PATCH_SANITY #define OSSP_PATCH_COSMETICS #define OSSP_PATCH_BETTERPRNUM +#define OSSP_PATCH_ARGV #endif From ossp-cvs-owner@ossp.org Sat Apr 21 10:14:08 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f3L8E7s05053; Sat, 21 Apr 2001 10:14:07 +0200 (CEST) Date: Sat, 21 Apr 2001 10:14:07 +0200 (CEST) Message-Id: <200104210814.f3L8E7s05053@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/cvs shtool Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 21-Apr-2001 10:14:07 Branch: HEAD Handle: 2001042109140600 Modified files: ossp-pkg/cvs shtool Log: *** empty log message *** Summary: Revision Changes Path 1.6 +47 -38 ossp-pkg/cvs/shtool ____________________________________________________________________________ Index: ossp-pkg/cvs/shtool ============================================================ $ cvs diff -u -r1.5 -r1.6 shtool --- ossp-pkg/cvs/shtool 2000/09/01 16:08:16 1.5 +++ ossp-pkg/cvs/shtool 2001/04/21 08:14:06 1.6 @@ -1,12 +1,12 @@ #!/bin/sh ## ## GNU shtool -- The GNU Portable Shell Tool -## Copyright (c) 1994-2000 Ralf S. Engelschall +## Copyright (c) 1994-2001 Ralf S. Engelschall ## ## See http://www.gnu.org/software/shtool/ for more information. ## See ftp://ftp.gnu.org/gnu/shtool/ for latest version. ## -## Version: 1.5.1 (29-Jul-2000) +## Version: 1.5.3 (19-Apr-2001) ## Contents: 5/17 available modules ## @@ -26,7 +26,7 @@ ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, ## USA, or contact Ralf S. Engelschall . ## -## Notice: Given that you include this file verbatim into your own +## 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 @@ -65,8 +65,8 @@ exit 1 fi if [ ".$1" = ".-h" -o ".$1" = ".--help" ]; then - echo "This is GNU shtool, version 1.5.1 (29-Jul-2000)" - echo "Copyright (c) 1994-2000 Ralf S. Engelschall " + echo "This is GNU shtool, version 1.5.3 (19-Apr-2001)" + echo "Copyright (c) 1994-2001 Ralf S. Engelschall " echo "Report bugs to " echo '' echo "Usage: shtool [] [ [] []]" @@ -80,11 +80,11 @@ echo 'Available [] []:' echo ' echo [-n] [-e] [ ...]' echo ' install [-v] [-t] [-c] [-C] [-s] [-m] [-o] [-g]' - echo ' [-e] [ ...] ' + echo ' [-e] [ ...] ' echo ' mkdir [-t] [-f] [-p] [-m] [ ...]' echo ' fixperm [-v] [-t] [ ...]' - echo ' tarball [-t] [-v] [-o ] [-c ] [-d ] [-u' - echo ' ] [-g ] [-e ] [ ...]' + echo ' tarball [-t] [-v] [-o] [-c] [-d] [-u]' + echo ' [-g] [-e] [ ...]' echo '' echo 'Not available (because module was not built-in):' echo ' mdate [-n] [-z] [-s] [-d] [-f] [-o] ' @@ -105,7 +105,7 @@ exit 0 fi if [ ".$1" = ".-v" -o ".$1" = ."--version" ]; then - echo "GNU shtool 1.5.1 (29-Jul-2000)" + echo "GNU shtool 1.5.3 (19-Apr-2001)" exit 0 fi if [ ".$1" = ".-r" -o ".$1" = ."--recreate" ]; then @@ -147,15 +147,15 @@ ;; install ) str_tool="install" - str_usage="[-v] [-t] [-c] [-C] [-s] [-m] [-o] [-g] [-e] [ ...] " + str_usage="[-v] [-t] [-c] [-C] [-s] [-m] [-o] [-g] [-e] [ ...] " arg_spec="2+" - opt_spec="v.t.c.C.s.m:o:g:e:" + opt_spec="v.t.c.C.s.m:o:g:e+" opt_v=no opt_t=no opt_c=no opt_C=no opt_s=no - opt_m="" + opt_m="0755" opt_o="" opt_g="" opt_e="" @@ -180,7 +180,7 @@ ;; tarball ) str_tool="tarball" - str_usage="[-t] [-v] [-o ] [-c ] [-d ] [-u ] [-g ] [-e ] [ ...]" + str_usage="[-t] [-v] [-o] [-c] [-d] [-u] [-g] [-e] [ ...]" gen_tmpfile=yes arg_spec="1+" opt_spec="t.v.o:c:d:u:g:e:" @@ -340,6 +340,7 @@ tmpfile="$tmpdir/.shtool.$$" rm -f $tmpfile >/dev/null 2>&1 touch $tmpfile + chmod 600 $tmpfile fi ## @@ -351,7 +352,7 @@ echo ) ## ## echo -- Print string with optional construct expansion - ## Copyright (c) 1998-2000 Ralf S. Engelschall + ## Copyright (c) 1998-2001 Ralf S. Engelschall ## Originally written for WML as buildinfo ## @@ -574,7 +575,7 @@ install ) ## ## install -- Install a program, script or datafile - ## Copyright (c) 1997-2000 Ralf S. Engelschall + ## Copyright (c) 1997-2001 Ralf S. Engelschall ## Originally written for shtool ## @@ -604,19 +605,13 @@ for src in $srcs; do dst=$dstpath - # If destination is a directory, append the input filename + # if destination is a directory, append the input filename if [ $dstisdir = 1 ]; then dstfile=`echo "$src" | sed -e 's;.*/\([^/]*\)$;\1;'` dst="$dst/$dstfile" fi - # Add a possible extension to src and dst - if [ ".$opt_e" != . ]; then - src="$src$opt_e" - dst="$dst$opt_e" - fi - - # Check for correct arguments + # check for correct arguments if [ ".$src" = ".$dst" ]; then echo "$msgprefix:Warning: source and destination are the same - skipped" 1>&2 continue @@ -626,18 +621,18 @@ continue fi - # Make a temp file name in the destination directory + # make a temp file name in the destination directory dsttmp=`echo $dst |\ sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;' -e 's;^$;.;' \ -e "s;\$;/#INST@$$#;"` - # Verbosity + # verbosity if [ ".$opt_v" = .yes ]; then echo "$src -> $dst" 1>&2 fi - # Copy or move the file name to the temp name - # (because we might be not allowed to change the source) + # copy or move the file name to the temp name + # (because we might be not allowed to change the source) if [ ".$opt_C" = .yes ]; then opt_c=yes fi @@ -653,8 +648,16 @@ mv $src $dsttmp || exit $? fi - # Adjust the target file - # (we do chmod last to preserve setuid bits) + # adjust the target file + if [ ".$opt_e" != . ]; then + sed='sed' + for e in $opt_e; do + sed="$sed -e '$e'" + done + cp $dsttmp $dsttmp.old + eval "$sed <$dsttmp.old >$dsttmp" || exit $? + rm -f $dsttmp.old + fi if [ ".$opt_s" = .yes ]; then if [ ".$opt_t" = .yes ]; then echo "strip $dsttmp" 1>&2 @@ -673,14 +676,14 @@ fi chgrp $opt_g $dsttmp || exit $? fi - if [ ".$opt_m" != . ]; then + if [ ".$opt_m" != ".-" ]; then if [ ".$opt_t" = .yes ]; then echo "chmod $opt_m $dsttmp" 1>&2 fi chmod $opt_m $dsttmp || exit $? fi - # Determine whether to do a quick install + # determine whether to do a quick install # (has to be done _after_ the strip was already done) quick=no if [ ".$opt_C" = .yes ]; then @@ -691,7 +694,7 @@ fi fi - # Finally install the file to the real destination + # finally, install the file to the real destination if [ $quick = yes ]; then if [ ".$opt_t" = .yes ]; then echo "rm -f $dsttmp" 1>&2 @@ -709,7 +712,7 @@ mkdir ) ## ## mkdir -- Make one or more directories - ## Copyright (c) 1996-2000 Ralf S. Engelschall + ## Copyright (c) 1996-2001 Ralf S. Engelschall ## Originally written for public domain by Noah Friedman ## Cleaned up and enhanced for shtool ## @@ -718,7 +721,7 @@ for p in ${1+"$@"}; do # if the directory already exists... if [ -d "$p" ]; then - if [ ".$opt_f" = .no ] && [ ".$opt_p" = .no ]; then + if [ ".$opt_f" = .no -a ".$opt_p" = .no ]; then echo "$msgprefix:Error: directory already exists: $p" 1>&2 errstatus=1 break @@ -732,6 +735,12 @@ echo "mkdir $p" 1>&2 fi mkdir $p || errstatus=$? + if [ ".$opt_m" != . ]; then + if [ ".$opt_t" = .yes ]; then + echo "chmod $opt_m $p" 1>&2 + fi + chmod $opt_m $p || errstatus=$? + fi else # the smart situation set fnord `echo ":$p" |\ @@ -768,7 +777,7 @@ fixperm ) ## ## fixperm -- Fix file permissions inside a source tree - ## Copyright (c) 1996-2000 Ralf S. Engelschall + ## Copyright (c) 1996-2001 Ralf S. Engelschall ## Originally written for ePerl ## @@ -824,7 +833,7 @@ tarball ) ## ## tarball -- Roll distribution tarballs - ## Copyright (c) 1999-2000 Ralf S. Engelschall + ## Copyright (c) 1999-2001 Ralf S. Engelschall ## Originally written for shtool ## @@ -850,7 +859,7 @@ for tool in `echo $tools | sed -e 's/,/ /g'`; do # iterate over paths for path in $paths; do - if [ $minusx "$path/$tool" ] && [ ! -d "$path/$tool" ]; then + if [ $minusx "$path/$tool" -a ! -d "$path/$tool" ]; then eval "prg_${prg}=\"$path/$tool\"" break fi @@ -876,7 +885,7 @@ if [ ".$opt_t" = .yes ]; then echo "(cd $src && $prg_find . -type f -depth -print) | sed -e 's:^\\.\$::' -e 's:^\\./::' | cat $exclude >>$tmpfile.lst" 1>&2 fi - (cd $src && find . -type f -depth -print) |\ + (cd $src && $prg_find . -type f -depth -print) |\ sed -e 's:^\.$::' -e 's:^\./::' | eval cat $exclude >>$tmpfile.lst else if [ ".$opt_t" = .yes ]; then From ossp-cvs-owner@ossp.org Fri Apr 27 14:12:30 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f3RCCSx06612; Fri, 27 Apr 2001 14:12:28 +0200 (CEST) Date: Fri, 27 Apr 2001 14:12:28 +0200 (CEST) Message-Id: <200104271212.f3RCCSx06612@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/str str_format.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 27-Apr-2001 14:12:28 Branch: HEAD Handle: 2001042713122800 Modified files: ossp-pkg/str str_format.c Log: *** empty log message *** Summary: Revision Changes Path 1.21 +39 -14 ossp-pkg/str/str_format.c ____________________________________________________________________________ Index: ossp-pkg/str/str_format.c ============================================================ $ cvs diff -u -r1.20 -r1.21 str_format.c --- ossp-pkg/str/str_format.c 2000/03/01 07:51:30 1.20 +++ ossp-pkg/str/str_format.c 2001/04/27 12:12:28 1.21 @@ -113,9 +113,10 @@ #define NDIG 80 /* - * convert string to decimal. the number of digits is specified by - * ndigit decpt is set to the position of the decimal point sign is set - * to 0 for positive, 1 for negative. buf must have at least NDIG bytes. + * Convert decimal number to its string representation. The number of + * digits is specified by ndigit decpt is set to the position of the + * decimal point sign is set to 0 for positive, 1 for negative. buf must + * have at least NDIG bytes. */ #define str_ecvt(arg,ndigits,decpt,sign,buf) \ @@ -152,9 +153,9 @@ /* Do integer part */ if (fi != 0) { p1 = &buf[NDIG]; - while (fi != 0) { + while (fi != 0 && p1 > &buf[0]) { fj = modf(fi / 10, &fi); - *--p1 = (int) ((fj + .03) * 10) + '0'; + *--p1 = (int)((fj + .03) * 10) + '0'; r2++; } while (p1 < &buf[NDIG]) @@ -200,7 +201,7 @@ } } *p = NUL; - return (buf); + return buf; } static char * @@ -265,7 +266,7 @@ if (p2[-1] == '.' && !altform) p2--; *p2 = NUL; - return (buf); + return buf; } /* @@ -293,10 +294,10 @@ */ #define NUM(c) ((c) - '0') #define STR_TO_DEC(str, num) { \ - num = NUM( *str++ ); \ + num = NUM(*str++); \ while (str_isdigit(*(str))) { \ num *= 10 ; \ - num += NUM( *str++ ) ; \ + num += NUM(*str++) ; \ } \ } @@ -328,8 +329,8 @@ * Increase length. Set the has_prefix flag. */ #define PREFIX(str, length, ch) \ - *--str = ch; \ - length++; \ + *--str = ch; \ + length++; \ has_prefix = TRUE /* @@ -863,9 +864,9 @@ case 'e': case 'E': fp_num = va_arg(ap, double); - /* We use &num_buf[ 1 ], so that we have room for the sign */ + /* We use &num_buf[1], so that we have room for the sign */ s = conv_fp(*fmt, fp_num, alternate_form, - (adjust_precision == FALSE) ? FLOAT_DIGITS : precision, + (adjust_precision == FALSE) ? FLOAT_DIGITS : precision, &is_negative, &num_buf[1], &s_len); if (is_negative) prefix_char = '-'; @@ -875,6 +876,7 @@ prefix_char = ' '; break; + /* Double Floating Point (style 2) */ case 'g': case 'G': @@ -882,7 +884,7 @@ precision = FLOAT_DIGITS; else if (precision == 0) precision = 1; - /* We use &num_buf[ 1 ], so that we have room for the sign */ + /* We use &num_buf[1], so that we have room for the sign */ s = str_gcvt(va_arg(ap, double), precision, &num_buf[1], alternate_form); if (*s == '-') @@ -1076,4 +1078,27 @@ va_end(ap); return rv; } + +#if 0 /* still don't know whether it fits into API */ +char *str_aprintf(const char *fmt, ...) +{ + va_list ap; + char *s; + int rv; + + va_start(ap, fmt); + rv = str_format_va(NULL, -1, fmt, ap); + va_end(ap); + if (rv == -1) + return NULL; + if ((s = malloc(rv+1)) == NULL) + return NULL; + va_start(ap, fmt); + rv = str_format_va(s, rv+1, fmt, ap); + va_end(ap); + if (rv == -1) + return NULL; + return s; +} +#endif From ossp-cvs-owner@ossp.org Fri Apr 27 14:22:23 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f3RCMMl07556; Fri, 27 Apr 2001 14:22:22 +0200 (CEST) Date: Fri, 27 Apr 2001 14:22:22 +0200 (CEST) Message-Id: <200104271222.f3RCMMl07556@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/str .configure ChangeLog TODO shtool str.3 str_fo... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 27-Apr-2001 14:22:22 Branch: HEAD Handle: 2001042713222100 Modified files: ossp-pkg/str .configure ChangeLog TODO shtool str.3 str_format.c Log: *** empty log message *** Summary: Revision Changes Path 1.5 +1 -1 ossp-pkg/str/.configure 1.28 +7 -1 ossp-pkg/str/ChangeLog 1.21 +2 -0 ossp-pkg/str/TODO 1.6 +48 -39 ossp-pkg/str/shtool 1.33 +270 -398 ossp-pkg/str/str.3 1.22 +49 -30 ossp-pkg/str/str_format.c ____________________________________________________________________________ Index: ossp-pkg/str/.configure ============================================================ $ cvs diff -u -r1.4 -r1.5 .configure --- ossp-pkg/str/.configure 2000/01/16 15:19:44 1.4 +++ ossp-pkg/str/.configure 2001/04/27 12:22:21 1.5 @@ -1,2 +1,2 @@ : -CC=egcc ./configure --enable-debug --prefix=/sw/pkg/str "$@" +CC=cc ./configure --enable-debug --prefix=/sw/pkg/str "$@" Index: ossp-pkg/str/ChangeLog ============================================================ $ cvs diff -u -r1.27 -r1.28 ChangeLog --- ossp-pkg/str/ChangeLog 2000/11/20 19:48:39 1.27 +++ ossp-pkg/str/ChangeLog 2001/04/27 12:22:21 1.28 @@ -9,7 +9,13 @@ ChangeLog - Changes between 0.9.4 and 0.9.5 (14-Jul-2000 to xx-Nov-2000): + Changes between 0.9.4 and 0.9.5 (14-Jul-2000 to xx-May-2001): + + *) Upgrade to GNU shtool 1.5.3. + [Ralf S. Engelschall] + + *) Fixed handling of NaN and Inf values in str_format.c + [Lukas Schroeder ] *) Fix unsigned vs. signed problem in str_span.c. [Joseph Heenan ] Index: ossp-pkg/str/TODO ============================================================ $ cvs diff -u -r1.20 -r1.21 TODO --- ossp-pkg/str/TODO 2000/07/03 09:38:16 1.20 +++ ossp-pkg/str/TODO 2001/04/27 12:22:21 1.21 @@ -10,6 +10,8 @@ o look at printf ideas from ../stdio/printf!! o look at ../strnatcmp + o dynamic strings + o aprintf() variant of str_format (see end of str_format.c!) The following *have* to be done before 1.0.0: Index: ossp-pkg/str/shtool ============================================================ $ cvs diff -u -r1.5 -r1.6 shtool --- ossp-pkg/str/shtool 2000/11/20 19:48:39 1.5 +++ ossp-pkg/str/shtool 2001/04/27 12:22:21 1.6 @@ -1,12 +1,12 @@ #!/bin/sh ## ## GNU shtool -- The GNU Portable Shell Tool -## Copyright (c) 1994-2000 Ralf S. Engelschall +## Copyright (c) 1994-2001 Ralf S. Engelschall ## ## See http://www.gnu.org/software/shtool/ for more information. ## See ftp://ftp.gnu.org/gnu/shtool/ for latest version. ## -## Version: 1.5.1 (29-Jul-2000) +## Version: 1.5.3 (19-Apr-2001) ## Contents: 6/17 available modules ## @@ -26,7 +26,7 @@ ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, ## USA, or contact Ralf S. Engelschall . ## -## Notice: Given that you include this file verbatim into your own +## 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 @@ -65,8 +65,8 @@ exit 1 fi if [ ".$1" = ".-h" -o ".$1" = ".--help" ]; then - echo "This is GNU shtool, version 1.5.1 (29-Jul-2000)" - echo "Copyright (c) 1994-2000 Ralf S. Engelschall " + echo "This is GNU shtool, version 1.5.3 (19-Apr-2001)" + echo "Copyright (c) 1994-2001 Ralf S. Engelschall " echo "Report bugs to " echo '' echo "Usage: shtool [] [ [] []]" @@ -80,11 +80,11 @@ echo 'Available [] []:' echo ' echo [-n] [-e] [ ...]' echo ' install [-v] [-t] [-c] [-C] [-s] [-m] [-o] [-g]' - echo ' [-e] [ ...] ' + echo ' [-e] [ ...] ' echo ' mkdir [-t] [-f] [-p] [-m] [ ...]' echo ' fixperm [-v] [-t] [ ...]' - echo ' tarball [-t] [-v] [-o ] [-c ] [-d ] [-u' - echo ' ] [-g ] [-e ] [ ...]' + echo ' tarball [-t] [-v] [-o] [-c] [-d] [-u]' + echo ' [-g] [-e] [ ...]' echo ' version [-l] [-n] [-p] [-s] [-e]' echo ' [-i] [-d] ' echo '' @@ -105,7 +105,7 @@ exit 0 fi if [ ".$1" = ".-v" -o ".$1" = ."--version" ]; then - echo "GNU shtool 1.5.1 (29-Jul-2000)" + echo "GNU shtool 1.5.3 (19-Apr-2001)" exit 0 fi if [ ".$1" = ".-r" -o ".$1" = ."--recreate" ]; then @@ -147,15 +147,15 @@ ;; install ) str_tool="install" - str_usage="[-v] [-t] [-c] [-C] [-s] [-m] [-o] [-g] [-e] [ ...] " + str_usage="[-v] [-t] [-c] [-C] [-s] [-m] [-o] [-g] [-e] [ ...] " arg_spec="2+" - opt_spec="v.t.c.C.s.m:o:g:e:" + opt_spec="v.t.c.C.s.m:o:g:e+" opt_v=no opt_t=no opt_c=no opt_C=no opt_s=no - opt_m="" + opt_m="0755" opt_o="" opt_g="" opt_e="" @@ -180,7 +180,7 @@ ;; tarball ) str_tool="tarball" - str_usage="[-t] [-v] [-o ] [-c ] [-d ] [-u ] [-g ] [-e ] [ ...]" + str_usage="[-t] [-v] [-o] [-c] [-d] [-u] [-g] [-e] [ ...]" gen_tmpfile=yes arg_spec="1+" opt_spec="t.v.o:c:d:u:g:e:" @@ -353,6 +353,7 @@ tmpfile="$tmpdir/.shtool.$$" rm -f $tmpfile >/dev/null 2>&1 touch $tmpfile + chmod 600 $tmpfile fi ## @@ -364,7 +365,7 @@ echo ) ## ## echo -- Print string with optional construct expansion - ## Copyright (c) 1998-2000 Ralf S. Engelschall + ## Copyright (c) 1998-2001 Ralf S. Engelschall ## Originally written for WML as buildinfo ## @@ -587,7 +588,7 @@ install ) ## ## install -- Install a program, script or datafile - ## Copyright (c) 1997-2000 Ralf S. Engelschall + ## Copyright (c) 1997-2001 Ralf S. Engelschall ## Originally written for shtool ## @@ -617,19 +618,13 @@ for src in $srcs; do dst=$dstpath - # If destination is a directory, append the input filename + # if destination is a directory, append the input filename if [ $dstisdir = 1 ]; then dstfile=`echo "$src" | sed -e 's;.*/\([^/]*\)$;\1;'` dst="$dst/$dstfile" fi - # Add a possible extension to src and dst - if [ ".$opt_e" != . ]; then - src="$src$opt_e" - dst="$dst$opt_e" - fi - - # Check for correct arguments + # check for correct arguments if [ ".$src" = ".$dst" ]; then echo "$msgprefix:Warning: source and destination are the same - skipped" 1>&2 continue @@ -639,18 +634,18 @@ continue fi - # Make a temp file name in the destination directory + # make a temp file name in the destination directory dsttmp=`echo $dst |\ sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;' -e 's;^$;.;' \ -e "s;\$;/#INST@$$#;"` - # Verbosity + # verbosity if [ ".$opt_v" = .yes ]; then echo "$src -> $dst" 1>&2 fi - # Copy or move the file name to the temp name - # (because we might be not allowed to change the source) + # copy or move the file name to the temp name + # (because we might be not allowed to change the source) if [ ".$opt_C" = .yes ]; then opt_c=yes fi @@ -666,8 +661,16 @@ mv $src $dsttmp || exit $? fi - # Adjust the target file - # (we do chmod last to preserve setuid bits) + # adjust the target file + if [ ".$opt_e" != . ]; then + sed='sed' + for e in $opt_e; do + sed="$sed -e '$e'" + done + cp $dsttmp $dsttmp.old + eval "$sed <$dsttmp.old >$dsttmp" || exit $? + rm -f $dsttmp.old + fi if [ ".$opt_s" = .yes ]; then if [ ".$opt_t" = .yes ]; then echo "strip $dsttmp" 1>&2 @@ -686,14 +689,14 @@ fi chgrp $opt_g $dsttmp || exit $? fi - if [ ".$opt_m" != . ]; then + if [ ".$opt_m" != ".-" ]; then if [ ".$opt_t" = .yes ]; then echo "chmod $opt_m $dsttmp" 1>&2 fi chmod $opt_m $dsttmp || exit $? fi - # Determine whether to do a quick install + # determine whether to do a quick install # (has to be done _after_ the strip was already done) quick=no if [ ".$opt_C" = .yes ]; then @@ -704,7 +707,7 @@ fi fi - # Finally install the file to the real destination + # finally, install the file to the real destination if [ $quick = yes ]; then if [ ".$opt_t" = .yes ]; then echo "rm -f $dsttmp" 1>&2 @@ -722,7 +725,7 @@ mkdir ) ## ## mkdir -- Make one or more directories - ## Copyright (c) 1996-2000 Ralf S. Engelschall + ## Copyright (c) 1996-2001 Ralf S. Engelschall ## Originally written for public domain by Noah Friedman ## Cleaned up and enhanced for shtool ## @@ -731,7 +734,7 @@ for p in ${1+"$@"}; do # if the directory already exists... if [ -d "$p" ]; then - if [ ".$opt_f" = .no ] && [ ".$opt_p" = .no ]; then + if [ ".$opt_f" = .no -a ".$opt_p" = .no ]; then echo "$msgprefix:Error: directory already exists: $p" 1>&2 errstatus=1 break @@ -745,6 +748,12 @@ echo "mkdir $p" 1>&2 fi mkdir $p || errstatus=$? + if [ ".$opt_m" != . ]; then + if [ ".$opt_t" = .yes ]; then + echo "chmod $opt_m $p" 1>&2 + fi + chmod $opt_m $p || errstatus=$? + fi else # the smart situation set fnord `echo ":$p" |\ @@ -781,7 +790,7 @@ fixperm ) ## ## fixperm -- Fix file permissions inside a source tree - ## Copyright (c) 1996-2000 Ralf S. Engelschall + ## Copyright (c) 1996-2001 Ralf S. Engelschall ## Originally written for ePerl ## @@ -837,7 +846,7 @@ tarball ) ## ## tarball -- Roll distribution tarballs - ## Copyright (c) 1999-2000 Ralf S. Engelschall + ## Copyright (c) 1999-2001 Ralf S. Engelschall ## Originally written for shtool ## @@ -863,7 +872,7 @@ for tool in `echo $tools | sed -e 's/,/ /g'`; do # iterate over paths for path in $paths; do - if [ $minusx "$path/$tool" ] && [ ! -d "$path/$tool" ]; then + if [ $minusx "$path/$tool" -a ! -d "$path/$tool" ]; then eval "prg_${prg}=\"$path/$tool\"" break fi @@ -889,7 +898,7 @@ if [ ".$opt_t" = .yes ]; then echo "(cd $src && $prg_find . -type f -depth -print) | sed -e 's:^\\.\$::' -e 's:^\\./::' | cat $exclude >>$tmpfile.lst" 1>&2 fi - (cd $src && find . -type f -depth -print) |\ + (cd $src && $prg_find . -type f -depth -print) |\ sed -e 's:^\.$::' -e 's:^\./::' | eval cat $exclude >>$tmpfile.lst else if [ ".$opt_t" = .yes ]; then @@ -1000,7 +1009,7 @@ version ) ## ## version -- Maintain a version information file - ## Copyright (c) 1994-2000 Ralf S. Engelschall + ## Copyright (c) 1994-2001 Ralf S. Engelschall ## Originally written for ePerl, rewritten from scratch for shtool ## Index: ossp-pkg/str/str.3 ============================================================ $ cvs diff -u -r1.32 -r1.33 str.3 --- ossp-pkg/str/str.3 2000/07/14 15:24:16 1.32 +++ ossp-pkg/str/str.3 2001/04/27 12:22:21 1.33 @@ -1,9 +1,9 @@ -.rn '' }` -''' $RCSfile$$Revision$$Date$ -''' -''' $Log$ -''' -.de Sh +.\" Automatically generated by Pod::Man version 1.02 +.\" Sun Dec 31 12:23:40 2000 +.\" +.\" Standard preamble: +.\" ====================================================================== +.de Sh \" Subsection heading .br .if t .Sp .ne 5 @@ -11,150 +11,106 @@ \fB\\$1\fR .PP .. -.de Sp +.de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. -.de Ip +.de Ip \" List item .br .ie \\n(.$>=3 .ne \\$3 .el .ne 3 .IP "\\$1" \\$2 .. -.de Vb +.de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. -.de Ve +.de Ve \" End verbatim text .ft R .fi .. -''' -''' -''' Set up \*(-- to give an unbreakable dash; -''' string Tr holds user defined translation string. -''' Bell System Logo is used as a dummy character. -''' +.\" Set up some character translations and predefined strings. \*(-- will +.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left +.\" double quote, and \*(R" will give a right double quote. | will give a +.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used +.\" to do unbreakable dashes and therefore won't be available. \*(C` and +.\" \*(C' expand to `' in nroff, nothing in troff, for use with C<> .tr \(*W-|\(bv\*(Tr +.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)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch -.if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch -.ds L" "" -.ds R" "" -''' \*(M", \*(S", \*(N" and \*(T" are the equivalent of -''' \*(L" and \*(R", except that they are used on ".xx" lines, -''' such as .IP and .SH, which do another additional levels of -''' double-quote interpretation -.ds M" """ -.ds S" """ -.ds N" """"" -.ds T" """"" -.ds L' ' -.ds R' ' -.ds M' ' -.ds S' ' -.ds N' ' -.ds T' ' +. ds -- \(*W- +. ds PI pi +. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch +. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch +. ds L" "" +. ds R" "" +. ds C` ` +. ds C' ' 'br\} .el\{\ -.ds -- \(em\| -.tr \*(Tr -.ds L" `` -.ds R" '' -.ds M" `` -.ds S" '' -.ds N" `` -.ds T" '' -.ds L' ` -.ds R' ' -.ds M' ` -.ds S' ' -.ds N' ` -.ds T' ' -.ds PI \(*p +. ds -- \|\(em\| +. ds PI \(*p +. ds L" `` +. ds R" '' 'br\} -.\" If the F register is turned on, we'll generate -.\" index entries out stderr for the following things: -.\" TH Title -.\" SH Header -.\" Sh Subsection -.\" Ip Item -.\" X<> Xref (embedded -.\" Of course, you have to process the output yourself -.\" in some meaninful fashion. -.if \nF \{ -.de IX -.tm Index:\\$1\t\\n%\t"\\$2" -.. -.nr % 0 -.rr F +.\" +.\" If the F register is turned on, we'll generate index entries on stderr +.\" for titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and +.\" index entries marked with X<> in POD. Of course, you'll have to process +.\" the output yourself in some meaningful fashion. +.if \nF \{\ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" +. . +. nr % 0 +. rr F .\} -.TH str 3 "14-Jul-2000" "Str 0.9.5" "String Library" -.UC -.if n .hy 0 +.\" +.\" For nroff, turn off justification. Always turn off hyphenation; it +.\" makes way too many mistakes in technical documents. +.hy 0 .if n .na -.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' -.de CQ \" put $1 in typewriter font -.ft CW -'if n "\c -'if t \\&\\$1\c -'if n \\&\\$1\c -'if n \&" -\\&\\$2 \\$3 \\$4 \\$5 \\$6 \\$7 -'.ft R -.. -.\" @(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2 -. \" AM - accent mark definitions +.\" +.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). +.\" Fear. Run. Save yourself. No user-serviceable parts. .bd B 3 -. \" fudge factors for nroff and troff +. \" fudge factors for nroff and troff .if n \{\ -. ds #H 0 -. ds #V .8m -. ds #F .3m -. ds #[ \f1 -. ds #] \fP +. 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 #[ \& -. ds #] \& +. ds #H ((1u-(\\\\n(.fu%2u))*.13m) +. ds #V .6m +. ds #F 0 +. ds #[ \& +. ds #] \& .\} -. \" simple accents for nroff and troff +. \" simple accents for nroff and troff .if n \{\ -. ds ' \& -. ds ` \& -. ds ^ \& -. ds , \& -. ds ~ ~ -. ds ? ? -. ds ! ! -. ds / -. ds q +. ds ' \& +. ds ` \& +. ds ^ \& +. ds , \& +. ds ~ ~ +. ds / .\} .if t \{\ -. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" -. 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 ? \s-2c\h'-\w'c'u*7/10'\u\h'\*(#H'\zi\d\s+2\h'\w'c'u*8/10' -. ds ! \s-2\(or\s+2\h'-\w'\(or'u'\v'-.8m'.\v'.8m' -. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' -. ds q o\h'-\w'o'u*8/10'\s-4\v'.4m'\z\(*i\v'-.4m'\s+4\h'\w'o'u*8/10' +. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" +. 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' .\} -. \" troff and (daisy-wheel) nroff accents +. \" 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 v \\k:\h'-(\\n(.wu*9/10-\*(#H)'\v'-\*(#V'\*(#[\s-4v\s0\v'\*(#V'\h'|\\n:u'\*(#] -.ds _ \\k:\h'-(\\n(.wu*9/10-\*(#H+(\*(#F*2/3))'\v'-.4m'\z\(hy\v'.4m'\h'|\\n:u' -.ds . \\k:\h'-(\\n(.wu*8/10)'\v'\*(#V*4/10'\z.\v'-\*(#V*4/10'\h'|\\n:u' -.ds 3 \*(#[\v'.2m'\s-2\&3\s0\v'-.2m'\*(#] .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' @@ -162,124 +118,134 @@ .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 -.ds oe o\h'-(\w'o'u*4/10)'e -.ds Oe O\h'-(\w'O'u*4/10)'E -. \" corrections for vroff +. \" 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' -. \" for low resolution devices (crt and lpr) +. \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ -. ds : e -. ds 8 ss -. ds v \h'-1'\o'\(aa\(ga' -. ds _ \h'-1'^ -. ds . \h'-1'. -. ds 3 3 -. 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 -. ds oe oe -. ds Oe OE +. 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 +.\" ====================================================================== +.\" +.IX Title "str 3" +.TH str 3 "14-Jul-2000" "Str 0.9.5" "String Library" +.UC .SH "NAME" -\fBStr\fR \- String Library +\&\fBStr\fR \- String Library .SH "VERSION" -Str 0.9.5 (14-Jul-2000) +.IX Header "VERSION" +Str \s-10.9.5 (14-Jul-2000)\s0 .SH "SYNOPSIS" -\fBstr_len\fR, -\fBstr_copy\fR, -\fBstr_dup\fR, -\fBstr_concat\fR, -\fBstr_splice\fR, -\fBstr_compare\fR, -\fBstr_span\fR, -\fBstr_locate\fR, -\fBstr_token\fR, -\fBstr_parse\fR, -\fBstr_format\fR, -\fBstr_hash\fR, -\fBstr_base64\fR. +.IX Header "SYNOPSIS" +\&\fBstr_len\fR, +\&\fBstr_copy\fR, +\&\fBstr_dup\fR, +\&\fBstr_concat\fR, +\&\fBstr_splice\fR, +\&\fBstr_compare\fR, +\&\fBstr_span\fR, +\&\fBstr_locate\fR, +\&\fBstr_token\fR, +\&\fBstr_parse\fR, +\&\fBstr_format\fR, +\&\fBstr_hash\fR, +\&\fBstr_base64\fR. .SH "DESCRIPTION" -The \fBStr\fR library is a generic string library written in ANSI C which +.IX Header "DESCRIPTION" +The \fBStr\fR library is a generic string library written in \s-1ANSI\s0 C which provides functions for handling, matching, parsing, searching and -formatting of C strings. So it can be considered as a superset of POSIX -\fIstring\fR\|(3), but its main intention is to provide a more convinient and -compact API plus a more generalized functionality. +formatting of C strings. So it can be considered as a superset of \s-1POSIX\s0 +\&\fIstring\fR\|(3), but its main intention is to provide a more convinient and +compact \s-1API\s0 plus a more generalized functionality. .SH "FUNCTIONS" -The following functions are provided by the \fBStr\fR API: +.IX Header "FUNCTIONS" +The following functions are provided by the \fBStr\fR \s-1API:\s0 .Ip "str_size_t \fBstr_len\fR(const char *\fIs\fR);" 4 +.IX Item "str_size_t str_len(const char *s);" This function determines the length of string \fIs\fR, i.e., the number -of characters starting at \fIs\fR that precede the terminating \f(CWNUL\fR -character. It returns \f(CWNULL\fR if \fIs\fR is \f(CWNULL\fR. +of characters starting at \fIs\fR that precede the terminating \f(CW\*(C`NUL\*(C'\fR +character. It returns \f(CW\*(C`NULL\*(C'\fR if \fIs\fR is \f(CW\*(C`NULL\*(C'\fR. .Ip "char *\fBstr_copy\fR(char *\fIs\fR, const char *\fIt\fR, size_t \fIn\fR);" 4 +.IX Item "char *str_copy(char *s, const char *t, size_t n);" This copies the characters in string \fIt\fR into the string \fIs\fR, but never more -than \fIn\fR characters (if \fIn\fR is greater than \f(CW0\fR). The two involved strings -can overlap and the characters in \fIs\fR are always \f(CWNUL\fR\-terminated. The +than \fIn\fR characters (if \fIn\fR is greater than \f(CW\*(C`0\*(C'\fR). The two involved strings +can overlap and the characters in \fIs\fR are always \f(CW\*(C`NUL\*(C'\fR\-terminated. The string \fIs\fR has to be large enough to hold all characters to be copied. -function returns \f(CWNULL\fR if \fIs\fR or \fIt\fR are \f(CWNULL\fR. Else it returns the -pointer to the written \f(CWNUL\fR\-terminating character in \fIs\fR. +function returns \f(CW\*(C`NULL\*(C'\fR if \fIs\fR or \fIt\fR are \f(CW\*(C`NULL\*(C'\fR. Else it returns the +pointer to the written \f(CW\*(C`NUL\*(C'\fR\-terminating character in \fIs\fR. .Ip "char *\fBstr_dup\fR(const char *\fIs\fR, str_size_t \fIn\fR);" 4 +.IX Item "char *str_dup(const char *s, str_size_t n);" This returns a copy of the characters in string \fIs\fR, but never more than \fIn\fR -characters if \fIn\fR is greater than \f(CW0\fR. It returns \f(CWNULL\fR if \fIs\fR is -\f(CWNULL\fR. The returned string has to be deallocated later with \fIfree\fR\|(3). +characters if \fIn\fR is greater than \f(CW\*(C`0\*(C'\fR. It returns \f(CW\*(C`NULL\*(C'\fR if \fIs\fR is +\&\f(CW\*(C`NULL\*(C'\fR. The returned string has to be deallocated later with \fIfree\fR\|(3). .Ip "char *\fBstr_concat\fR(char *\fIs\fR, ...);" 4 +.IX Item "char *str_concat(char *s, ...);" This functions concatenates the characters of all string arguments into a new -allocated string and returns this new string. If \fIs\fR is \f(CWNULL\fR the function -returns \f(CWNULL\fR. Else it returns the pointer to the written final -\f(CWNUL\fR\-terminating character in \fIs\fR. The returned string later has to be +allocated string and returns this new string. If \fIs\fR is \f(CW\*(C`NULL\*(C'\fR the function +returns \f(CW\*(C`NULL\*(C'\fR. Else it returns the pointer to the written final +\&\f(CW\*(C`NUL\*(C'\fR\-terminating character in \fIs\fR. The returned string later has to be deallicated with \fIfree\fR\|(3). .Ip "char *\fBstr_splice\fR(char *\fIs\fR, str_size_t \fIoff\fR, str_size_t \fIn\fR, char *\fIt\fR, str_size_t \fIm\fR);" 4 +.IX Item "char *str_splice(char *s, str_size_t off, str_size_t n, char *t, str_size_t m);" This splices the string \fIt\fR into string \fIs\fR, i.e., the \fIn\fR characters at offset \fIoff\fR in \fIs\fR are removed and at their location the string -\fIt\fR is inserted (or just the first \fIm\fR characters of \fIt\fR if \fIm\fR is -greater than \f(CW0\fR). It returns \f(CWNULL\fR if \fIs\fR or \fIt\fR are \f(CWNULL\fR. +\&\fIt\fR is inserted (or just the first \fIm\fR characters of \fIt\fR if \fIm\fR is +greater than \f(CW\*(C`0\*(C'\fR). It returns \f(CW\*(C`NULL\*(C'\fR if \fIs\fR or \fIt\fR are \f(CW\*(C`NULL\*(C'\fR. Else the string \fIs\fR is returned. The function supports also the situation where \fIt\fR is a sub-string of \fIs\fR as long as the area -\fIs+off\fR...\fIs+off+n\fR and \fIt\fR...\fIt+m\fR do not overlap. The caller +\&\fIs+off\fR...\fIs+off+n\fR and \fIt\fR...\fIt+m\fR do not overlap. The caller always has to make sure that enough room exists in \fIs\fR. .Ip "int \fBstr_compare\fR(const char *\fIs\fR, const char *\fIt\fR, str_size_t \fIn\fR, int \fImode\fR);" 4 +.IX Item "int str_compare(const char *s, const char *t, str_size_t n, int mode);" This performs a lexicographical comparison of the two strings \fIs\fR and \fIt\fR (but never compares more than \fIn\fR characters of them) -and returns one of three return values: a value lower than \f(CW0\fR if -\fIs\fR is lexicographically lower than \fIt\fR, a vlue of exactly \f(CW0\fR -if \fIs\fR and \fIt\fR are equal and a value greater than \f(CW0\fR if \fIs\fR is -lexicographically higher than \fIt\fR. Per default (\fImode\fR is \f(CW0\fR) the -comparison is case-sensitive, but if \f(CWSTR_NOCASE\fR is used for \fImode\fR +and returns one of three return values: a value lower than \f(CW\*(C`0\*(C'\fR if +\&\fIs\fR is lexicographically lower than \fIt\fR, a vlue of exactly \f(CW\*(C`0\*(C'\fR +if \fIs\fR and \fIt\fR are equal and a value greater than \f(CW\*(C`0\*(C'\fR if \fIs\fR is +lexicographically higher than \fIt\fR. Per default (\fImode\fR is \f(CW\*(C`0\*(C'\fR) the +comparison is case-sensitive, but if \f(CW\*(C`STR_NOCASE\*(C'\fR is used for \fImode\fR the comparison is done in a case-insensitive way. .Ip "char *\fBstr_span\fR(const char *\fIs\fR, size_t \fIn\fR, const char *\fIcharset\fR, int \fImode\fR);" 4 +.IX Item "char *str_span(const char *s, size_t n, const char *charset, int mode);" This functions spans a string \fIs\fR according to the characters specified in -\fIcharset\fR. If \fImode\fR is \f(CW0\fR, this means that \fIs\fR is spanned from left to -right starting at \fIs\fR (and ending either when reaching the terminating \f(CWNUL\fR +\&\fIcharset\fR. If \fImode\fR is \f(CW\*(C`0\*(C'\fR, this means that \fIs\fR is spanned from left to +right starting at \fIs\fR (and ending either when reaching the terminating \f(CW\*(C`NUL\*(C'\fR character or already after \fIn\fR spanned characters) as long as the characters of \fIs\fR are contained in \fIcharset\fR. .Sp -Alternatively one can use a \fImode\fR of \f(CWSTR_COMPLEMENT\fR to indicate that \fIs\fR +Alternatively one can use a \fImode\fR of \f(CW\*(C`STR_COMPLEMENT\*(C'\fR to indicate that \fIs\fR is spanned as long as the characters of \fIs\fR are \fInot\fR contained in -\fIcharset\fR, i.e., \fIcharset\fR then specifies the complement of the spanning +\&\fIcharset\fR, i.e., \fIcharset\fR then specifies the complement of the spanning characters. .Sp -In both cases one can additionally \*(L"or\*(R" (with the C operator ``\f(CW|\fR'') -\f(CWSTR_RIGHT\fR into \fImode\fR to indicate that the spanning is done right to -left starting at the terminating \f(CWNUL\fR character of \fIs\fR (and ending +In both cases one can additionally \*(L"or\*(R" (with the C operator ``\f(CW\*(C`|\*(C'\fR'') +\&\f(CW\*(C`STR_RIGHT\*(C'\fR into \fImode\fR to indicate that the spanning is done right to +left starting at the terminating \f(CW\*(C`NUL\*(C'\fR character of \fIs\fR (and ending either when reaching \fIs\fR or already after \fIn\fR spanned characters). .Ip "char *\fBstr_locate\fR(const char *\fIs\fR, str_size_t \fIn\fR, const char *\fIt\fR);" 4 +.IX Item "char *str_locate(const char *s, str_size_t n, const char *t);" This functions searches for the (smaller) string \fIt\fR inside (larger) string -\fIs\fR. If \fIn\fR is not \f(CW0\fR, the search is performed only inside the first \fIn\fR +\&\fIs\fR. If \fIn\fR is not \f(CW\*(C`0\*(C'\fR, the search is performed only inside the first \fIn\fR characters of \fIs\fR. .Ip "char *\fBstr_token\fR(char **\fIs\fR, const char *\fIdelim\fR, const char *\fIquote\fR, const char *\fIcomment\fR, int \fImode\fR);" 4 +.IX Item "char *str_token(char **s, const char *delim, const char *quote, const char *comment, int mode);" This function considers the string \fIs\fR to consist of a sequence of zero or more text tokens separated by spans of one or more characters from the separator string \fIdelim\fR. However, text between matched pairs of quotemarks (characters in \fIquote\fR) is treated as plain text, never as delimiter (separator) text. Each call of this function returns a pointer to the first character of the first token of \fIs\fR. The token is -\f(CWNUL\fR\-terminated, i.e., the string \fIs\fR is processed in a destructive +\&\f(CW\*(C`NUL\*(C'\fR\-terminated, i.e., the string \fIs\fR is processed in a destructive way. If there are quotation marks or escape sequences, the input string is rewritten with quoted sections and escape sequences properly interpreted. @@ -289,39 +255,40 @@ subsequent calls with the same pointer variable \fIs\fR will start processing from the position immediately after the last returned token. In this way subsequent calls will work through the string \fIs\fR until no -tokens remain. When no token remains in \fIs\fR, \f(CWNULL\fR is returned. The +tokens remain. When no token remains in \fIs\fR, \f(CW\*(C`NULL\*(C'\fR is returned. The string of token separators (\fIdelim\fR) and the string of quote characters (\fIquote\fR) may be changed from call to call. .Sp If a character in the string \fIs\fR is not quoted or escaped, and is in the -\fIcomment\fR set, then it is overwritten with a \f(CWNUL\fR character and the rest of +\&\fIcomment\fR set, then it is overwritten with a \f(CW\*(C`NUL\*(C'\fR character and the rest of the string is ignored. The characters to be used as quote characters are specified in the \fIquote\fR set, and must be used in balanced pairs. If there is more than one flavor of quote character, one kind of quote character may be used to quote another kind. If an unbalanced quote is found, the function silently act as if one had been placed at the end of the input string. The -\fIdelim\fR and \fIquote\fR strings must be disjoint, i.e., they have to share +\&\fIdelim\fR and \fIquote\fR strings must be disjoint, i.e., they have to share no characters. .Sp The \fImode\fR argument can be used to modify the processing of the string -(default for \fImode\fR is \f(CW0\fR): \f(CWSTR_STRIPQUOTES\fR forces \fIquote\fR -characters to be stripped from quoted tokens; \f(CWSTR_BACKSLASHESC\fR +(default for \fImode\fR is \f(CW\*(C`0\*(C'\fR): \f(CW\*(C`STR_STRIPQUOTES\*(C'\fR forces \fIquote\fR +characters to be stripped from quoted tokens; \f(CW\*(C`STR_BACKSLASHESC\*(C'\fR enables the interpretation (and expansion) of backslash escape sequences -(`\fB\ex\fR') through \s-1ANSI\s0\-C rules; \f(CWSTR_SKIPDELIMS\fR forces that after the -terminating \f(CWNUL\fR is written and the token returned, further delimiters +(`\fB\ex\fR') through \s-1ANSI-C\s0 rules; \f(CW\*(C`STR_SKIPDELIMS\*(C'\fR forces that after the +terminating \f(CW\*(C`NUL\*(C'\fR is written and the token returned, further delimiters are skipped (this allows one to make sure that the delimiters for one word don't become part of the next word if one change delimiters -between calls); and \f(CWSTR_TRIGRAPHS\fR enables the recognition and +between calls); and \f(CW\*(C`STR_TRIGRAPHS\*(C'\fR enables the recognition and expansion of \s-1ANSI\s0 C Trigraph sequences (as a side effect this enables -\f(CWSTR_BACKSLASHESC\fR, too). +\&\f(CW\*(C`STR_BACKSLASHESC\*(C'\fR, too). .Ip "int \fBstr_parse\fR(const char *\fIs\fR, const char *\fIpop\fR, ...);" 4 +.IX Item "int str_parse(const char *s, const char *pop, ...);" This parses the string \fIs\fR according to the parsing operation specified -by \fIpop\fR. If the parsing operation succeeds, \f(CWTRUE\fR is returned. Else -\f(CWFALSE\fR is returned. +by \fIpop\fR. If the parsing operation succeeds, \f(CW\*(C`TRUE\*(C'\fR is returned. Else +\&\f(CW\*(C`FALSE\*(C'\fR is returned. .Sp The \fIpop\fR string usually has one of the following two syntax variants: -`\fBm\fR \fIdelim\fR \fIregex\fR \fIdelim\fR \fIflags\fR*\*(R' (for matching operations) -and `\fBs\fR \fIdelim\fR \fIregex\fR \fIdelim\fR \fIsubst\fR \fIdelim\fR \fIflags\fR*\*(R' (for +`\fBm\fR \fIdelim\fR \fIregex\fR \fIdelim\fR \fIflags\fR*' (for matching operations) +and `\fBs\fR \fIdelim\fR \fIregex\fR \fIdelim\fR \fIsubst\fR \fIdelim\fR \fIflags\fR*' (for substitution operations). For more details about the syntax variants and semantic of the \fIpop\fR argument see section \fB\s-1GORY\s0 \s-1DETAILS\s0, Parsing Specification\fR below. The syntax of the \fIregex\fR part in \fIpop\fR is @@ -329,10 +296,11 @@ complete and gory details see \fIperlre\fR\|(1). A brief summary you can find under section \fB\s-1GORY\s0 \s-1DETAILS\s0, Perl Regular Expressions\fR below. .Ip "int \fBstr_format\fR(char *\fIs\fR, str_size_t \fIn\fR, const char *\fIfmt\fR, ...);" 4 +.IX Item "int str_format(char *s, str_size_t n, const char *fmt, ...);" This formats a new string according to \fIfmt\fR and optionally following arguments and writes it into the string \fIs\fR, but never more than \fIn\fR characters at all. It returns the number of written characters. If \fIs\fR is -\f(CWNULL\fR it just calculates the number of characters which would be written. +\&\f(CW\*(C`NULL\*(C'\fR it just calculates the number of characters which would be written. .Sp The function generates the output string under the control of the \fIfmt\fR format string that specifies how subsequent arguments (or arguments accessed @@ -346,40 +314,44 @@ introduced by the character \fB%\fR. The arguments must correspond properly (after type promotion) with the conversion specifier. Which conversion specifications are supported are described in detail under \fB\s-1GORY\s0 -\s-1DETAILS\s0, Format Specification\fR below. +\&\s-1DETAILS\s0, Format Specification\fR below. .Ip "unsigned long \fBstr_hash\fR(const char *\fIs\fR, str_size_t \fIn\fR, int \fImode\fR);" 4 +.IX Item "unsigned long str_hash(const char *s, str_size_t n, int mode);" This function calculates a hash value of string \fIs\fR (or of its first \fIn\fR -characters if \fIn\fR is equal to \f(CW0\fR). The following hashing functions +characters if \fIn\fR is equal to \f(CW\*(C`0\*(C'\fR). The following hashing functions are supported and can be selected with \fImode\fR: \s-1STR_HASH_DJBX33\s0 (Daniel J. Berstein, Times 33 Hash with Addition), \s-1STR_HASH_BJDDJ\s0 (Bob Jenkins, Dr. Dobbs Journal), and \s-1STR_HASH_MACRC32\s0 (Mark Adler, Cyclic -Redundancy Check with 32-Bit). This function is intended for fast use +Redundancy Check with 32\-Bit). This function is intended for fast use in hashing algorithms and \fInot\fR for use as cryptographically strong message digests. .Ip "int \fBstr_base64\fR(char *\fIs\fR, str_size_t \fIn\fR, unsigned char *\fIucp\fR, str_size_t \fIucn\fR, int \fImode\fR);" 4 +.IX Item "int str_base64(char *s, str_size_t n, unsigned char *ucp, str_size_t ucn, int mode);" This function Base64 encodes \fIucn\fR bytes starting at \fIucp\fR and writes the resulting string into \fIs\fR (but never more than \fIn\fR characters are -written). The \fImode\fR for this operation has to be \f(CWSTR_BASE64_ENCODE\fR. -Additionally one can \s-1OR\s0 the value \f(CWSTR_BASE64_STRICT\fR to enable strict +written). The \fImode\fR for this operation has to be \f(CW\*(C`STR_BASE64_ENCODE\*(C'\fR. +Additionally one can \s-1OR\s0 the value \f(CW\*(C`STR_BASE64_STRICT\*(C'\fR to enable strict encoding where after every 72th output character a newline character is inserted. The function returns the number of output characters written. -If \fIs\fR is \f(CWNULL\fR the function just calculates the number of required +If \fIs\fR is \f(CW\*(C`NULL\*(C'\fR the function just calculates the number of required output characters. .Sp -Alternatively, if \fImode\fR is \f(CWSTR_BASE64_DECODE\fR the string \fIs\fR (or -the first \fIn\fR characters only if \fIn\fR is not \f(CW0\fR) is decoded and the -output bytes written at \fIucp\fR. Again, if \fIucp\fR is \f(CWNULL\fR only the +Alternatively, if \fImode\fR is \f(CW\*(C`STR_BASE64_DECODE\*(C'\fR the string \fIs\fR (or +the first \fIn\fR characters only if \fIn\fR is not \f(CW\*(C`0\*(C'\fR) is decoded and the +output bytes written at \fIucp\fR. Again, if \fIucp\fR is \f(CW\*(C`NULL\*(C'\fR only the number of required output bytes are calculated. .SH "GORY DETAILS" +.IX Header "GORY DETAILS" In this part of the documentation more complex topics are documented in detail. .Sh "Perl Regular Expressions" +.IX Subsection "Perl Regular Expressions" The regular expressions used in \fBStr\fR are more or less Perl compatible (they are provided by a stripped down and built-in version of the -\fI\s-1PCRE\s0\fR library). So the syntax description in \fIperlre\fR\|(1) applies +\&\fI\s-1PCRE\s0\fR library). So the syntax description in \fIperlre\fR\|(1) applies and don't has to be repeated here again. For a deeper understanding and details you should have a look at the book `\fIMastering Regular -Expressions\fR\*(R' (see also the \fIperlbook\fR\|(1) manpage) by \fIJeffrey Friedl\fR. +Expressions\fR' (see also the \fIperlbook\fR\|(1) manpage) by \fIJeffrey Friedl\fR. For convinience reasons we give you only a brief summary of Perl compatible regular expressions: .PP @@ -465,74 +437,84 @@ \& (?imsx-imsx) One or more embedded pattern-match modifiers .Ve .Sh "Parsing Specification" +.IX Subsection "Parsing Specification" The \fBstr_parse\fR(const char *\fIs\fR, const char *\fIpop\fR, ...) function is a very flexible but complex one. The argument \fIs\fR is the string on which the parsing operation specified by argument \fIpop\fR is applied. -The parsing semantics are highly influenced by Perl's `\fB=~\fR\*(R' matching +The parsing semantics are highly influenced by Perl's `\fB=~\fR' matching operator, because one of the main goals of \fIstr_parse\fR\|(3) is to allow one to rewrite typical Perl matching constructs into C. .PP Now to the gory details. In general, the \fIpop\fR argument of \fIstr_parse\fR\|(3) has one of the following two syntax variants: -.Ip "\fBMatching:\fR `\fBm\fR \fIdelim\fR \fIregex\fR \fIdelim\fR \fIflags\fR*': " 4 +.Ip "\fBMatching:\fR `\fBm\fR \fIdelim\fR \fIregex\fR \fIdelim\fR \fIflags\fR*':" 4 +.IX Item "Matching: `m delim regex delim flags*':" This matches \fIs\fR against the Perl-style regular expression \fIregex\fR under the control of zero or more \fIflags\fR which control the parsing -semantics. The stripped down \fIpop\fR syntax `\fIregex\fR\*(R' is equivalent to -`\fBm/\fR\fIregex\fR\fB/\fR\*(R'. +semantics. The stripped down \fIpop\fR syntax `\fIregex\fR' is equivalent to +`\fBm/\fR\fIregex\fR\fB/\fR'. .Sp For each grouping pair of parenthesis in \fIregex\fR, the text in \fIs\fR which was grouped by the parenthesis is extracted into new strings. These per default are allocated as seperate strings and returned to the -caller through following `\fBchar **\fR\*(R' arguments. The caller is required +caller through following `\fBchar **\fR' arguments. The caller is required to \fIfree\fR\|(3) them later. -.Ip "\fBSubstitution:\fR `\fBs\fR \fIdelim\fR \fIregex\fR \fIdelim\fR \fIsubst\fR \fIdelim\fR \fIflags\fR*': " 4 +.Ip "\fBSubstitution:\fR `\fBs\fR \fIdelim\fR \fIregex\fR \fIdelim\fR \fIsubst\fR \fIdelim\fR \fIflags\fR*':" 4 +.IX Item "Substitution: `s delim regex delim subst delim flags*':" This matches \fIs\fR against the Perl-style regular expression \fIregex\fR under the control of zero or more \fIflags\fR which control the parsing semantics. As a result of the operation, a new string formed which consists of \fIs\fR but with the part which matched \fIregex\fR replaced by -\fIsubst\fR. The result string is returned to the caller through a `\fBchar -**\fR\*(R' argument. The caller is required to \fIfree\fR\|(3) this later. +\&\fIsubst\fR. The result string is returned to the caller through a `\fBchar +**\fR' argument. The caller is required to \fIfree\fR\|(3) this later. .Sp For each grouping pair of parenthesis in \fIregex\fR, the text in \fIs\fR which was grouped by the parenthesis is extracted into new strings -and can be referenced for expansion via `\fB$n\fR\*(R' (n=1,..) in \fIsubst\fR. -Additionally any \fIstr_format\fR\|(3) style `\fB%\fR\*(R' constructs in \fIsubst\fR are +and can be referenced for expansion via `\fB$n\fR' (n=1,..) in \fIsubst\fR. +Additionally any \fIstr_format\fR\|(3) style `\fB%\fR' constructs in \fIsubst\fR are expanded through additional caller supplied arguments. .PP The following \fIflags\fR are supported: .Ip "\fBb\fR" 4 -If the \fIbundle\fR flag `\fBb\fR\*(R' is specified, the extracted strings are +.IX Item "b" +If the \fIbundle\fR flag `\fBb\fR' is specified, the extracted strings are bundled together into a single chunk of memory and its address is -returned to the caller with a additional `\fBchar **\fR\*(R' argument which has +returned to the caller with a additional `\fBchar **\fR' argument which has to preceed the regular string arguments. The caller then has to \fIfree\fR\|(3) only this chunk of memory in order to free all extracted strings at once. .Ip "\fBi\fR" 4 -If the case-\fIinsensitive\fR flag `\fBi\fR\*(R' is specified, \fIregex\fR +.IX Item "i" +If the case-\fIinsensitive\fR flag `\fBi\fR' is specified, \fIregex\fR is matched in case-insensitive way. .Ip "\fBo\fR" 4 -If the \fIonce\fR flag `\fBo\fR\*(R' is specified, this indicates to the \fBStr\fR +.IX Item "o" +If the \fIonce\fR flag `\fBo\fR' is specified, this indicates to the \fBStr\fR library that the whole \fIpop\fR string is constant and that its internal pre-processing (it is compiled into a deterministic finite automaton (\s-1DFA\s0) internally) has to be done only once (the \fBStr\fR library then caches the \s-1DFA\s0 which corresponds to the \fIpop\fR argument). .Ip "\fBx\fR" 4 -If the \fIextended\fR flag `\fBx\fR\*(R' is specified, the \fIregex\fR's legibility +.IX Item "x" +If the \fIextended\fR flag `\fBx\fR' is specified, the \fIregex\fR's legibility is extended by permitting embedded whitespace and comments to allow one to write down complex regular expressions more cleary and even in a documented way. .Ip "\fBm\fR" 4 -If the \fImultiple\fR lines flag `\fBm\fR\*(R' is specified, the string \fIs\fR is +.IX Item "m" +If the \fImultiple\fR lines flag `\fBm\fR' is specified, the string \fIs\fR is treated as multiple lines. That is, this changes the regular expression -meta characters `\fB^\fR\*(R' and `\fB$\fR\*(R' from matching at only the very start +meta characters `\fB^\fR' and `\fB$\fR' from matching at only the very start or end of the string \fIs\fR to the start or end of any line anywhere within the string \fIs\fR. .Ip "\fBs\fR" 4 -If the \fIsingle\fR line flag `\fBs\fR\*(R' is specified, the string \fIs\fR is +.IX Item "s" +If the \fIsingle\fR line flag `\fBs\fR' is specified, the string \fIs\fR is treated as single line. That is, this changes the regular expression -meta character `\fB.\fR\*(R' to match any character whatsoever, even a newline, +meta character `\fB.\fR' to match any character whatsoever, even a newline, which it normally would not match. .SH "CONVERSION SPECIFICATION" +.IX Header "CONVERSION SPECIFICATION" In the format string of \fIstr_format\fR\|(3) each conversion specification is introduced by the character \fB%\fR. After the \fB%\fR, the following appear in sequence: @@ -546,7 +528,7 @@ Zero or more of the following flags: .Sp A \fB#\fR character specifying that the value should be converted to an -``alternate form'\*(R'. For \fBc\fR, \fBd\fR, \fBi\fR, \fBn\fR, \fBp\fR, \fBs\fR, and \fBu\fR, +``alternate form''. For \fBc\fR, \fBd\fR, \fBi\fR, \fBn\fR, \fBp\fR, \fBs\fR, and \fBu\fR, conversions, this option has no effect. For \fBo\fR conversions, the precision of the number is increased to force the first character of the output string to a zero (except if a zero value is printed with an explicit precision of @@ -557,21 +539,21 @@ conversions only if a digit follows). For \fBg\fR and \fBG\fR conversions, trailing zeros are not removed from the result as they would otherwise be. .Sp -A zero `\fB0\fR\*(R' character specifying zero padding. For all conversions except -\fBn\fR, the converted value is padded on the left with zeros rather than blanks. +A zero `\fB0\fR' character specifying zero padding. For all conversions except +\&\fBn\fR, the converted value is padded on the left with zeros rather than blanks. If a precision is given with a numeric conversion (\fBd\fR, \fBi\fR, \fBo\fR, \fBu\fR, -\fBi\fR, \fBx\fR, and \fBX\fR), the `\fB0\fR\*(R' flag is ignored. +\&\fBi\fR, \fBx\fR, and \fBX\fR), the `\fB0\fR' flag is ignored. .Sp -A negative field width flag `\fB\-\fR\*(R' indicates the converted value is to be left +A negative field width flag `\fB-\fR' indicates the converted value is to be left adjusted on the field boundary. Except for \fBn\fR conversions, the converted value is padded on the right with blanks, rather than on the left with blanks -or zeros. A `\fB\-\fR\*(R' overrides a `\fB0\fR\*(R' if both are given. +or zeros. A `\fB-\fR' overrides a `\fB0\fR' if both are given. .Sp A space, specifying that a blank should be left before a positive number produced by a signed conversion (\fBd\fR, \fBe\fR, \fBE\fR, \fBf\fR, \fBg\fR, \fBG\fR, or \fBi\fR). .Sp -A `\fB+\fR\*(R' character specifying that a sign always be placed before a number -produced by a signed conversion. A `\fB+\fR\*(R' overrides a space if both are used. +A `\fB+\fR' character specifying that a sign always be placed before a number +produced by a signed conversion. A `\fB+\fR' overrides a space if both are used. .Ip "o" 4 An optional decimal digit string specifying a minimum field width. If the converted value has fewer characters than the field width, it will @@ -579,38 +561,38 @@ flag has been given) to fill out the field width. .Ip "o" 4 -An optional precision, in the form of a period `\fB.\fR\*(R' followed by an +An optional precision, in the form of a period `\fB.\fR' followed by an optional digit string. If the digit string is omitted, the precision is taken as zero. This gives the minimum number of digits to appear for -\fBd\fR, \fBi\fR, \fBo\fR, \fBu\fR, \fBx\fR, and \fBX\fR conversions, the number of digits +\&\fBd\fR, \fBi\fR, \fBo\fR, \fBu\fR, \fBx\fR, and \fBX\fR conversions, the number of digits to appear after the decimal-point for \fBe\fR, \fBE\fR, and \fBf\fR conversions, the maximum number of significant digits for \fBg\fR and \fBG\fR conversions, or the maximum number of characters to be printed from a string for \fBs\fR conversions. .Ip "o" 4 The optional character \fBh\fR, specifying that a following \fBd\fR, \fBi\fR, \fBo\fR, -\fBu\fR, \fBx\fR, or \fBX\fR conversion corresponds to a `\f(CWshort int\fR\*(R' or `\f(CWunsigned -short int\fR\*(R' argument, or that a following \fBn\fR conversion corresponds to a -pointer to a `\f(CWshort int\fR argument. +\&\fBu\fR, \fBx\fR, or \fBX\fR conversion corresponds to a `\f(CW\*(C`short int\*(C'\fR' or `\f(CW\*(C`unsigned +short int\*(C'\fR' argument, or that a following \fBn\fR conversion corresponds to a +pointer to a `\f(CW\*(C`short int\*(C'\fR argument. .Ip "o" 4 The optional character \fBl\fR (ell) specifying that a following \fBd\fR, \fBi\fR, -\fBo\fR, \fBu\fR, \fBx\fR, or \fBX\fR conversion applies to a pointer to a `\f(CWlong int\fR\*(R' -or `\f(CWunsigned long int\fR\*(R' argument, or that a following \fBn\fR conversion -corresponds to a pointer to a `\f(CWlong int\fR argument. +\&\fBo\fR, \fBu\fR, \fBx\fR, or \fBX\fR conversion applies to a pointer to a `\f(CW\*(C`long int\*(C'\fR' +or `\f(CW\*(C`unsigned long int\*(C'\fR' argument, or that a following \fBn\fR conversion +corresponds to a pointer to a `\f(CW\*(C`long int\*(C'\fR argument. .Ip "o" 4 The optional character \fBq\fR, specifying that a following \fBd\fR, \fBi\fR, \fBo\fR, -\fBu\fR, \fBx\fR, or \fBX\fR conversion corresponds to a `\f(CWquad int\fR\*(R' or `\f(CWunsigned -quad int\fR\*(R' argument, or that a following \fBn\fR conversion corresponds to a -pointer to a `\f(CWquad int\fR\*(R' argument. +\&\fBu\fR, \fBx\fR, or \fBX\fR conversion corresponds to a `\f(CW\*(C`quad int\*(C'\fR' or `\f(CW\*(C`unsigned +quad int\*(C'\fR' argument, or that a following \fBn\fR conversion corresponds to a +pointer to a `\f(CW\*(C`quad int\*(C'\fR' argument. .Ip "o" 4 The character \fBL\fR specifying that a following \fBe\fR, \fBE\fR, \fBf\fR, \fBg\fR, or \fBG\fR -conversion corresponds to a `\f(CWlong double\fR\*(R' argument. +conversion corresponds to a `\f(CW\*(C`long double\*(C'\fR' argument. .Ip "o" 4 A character that specifies the type of conversion to be applied. .PP -A field width or precision, or both, may be indicated by an asterisk `\fB*\fR\*(R' or -an asterisk followed by one or more decimal digits and a `\fB$\fR\*(R' instead of a -digit string. In this case, an `\f(CWint\fR\*(R' argument supplies the field width or +A field width or precision, or both, may be indicated by an asterisk `\fB*\fR' or +an asterisk followed by one or more decimal digits and a `\fB$\fR' instead of a +digit string. In this case, an `\f(CW\*(C`int\*(C'\fR' argument supplies the field width or precision. A negative field width is treated as a left adjustment flag followed by a positive field width; a negative precision is treated as though it were missing. If a single format directive mixes positional (`\fBnn$\fR') and @@ -618,34 +600,39 @@ .PP The conversion specifiers and their meanings are: .Ip "\fBdiouxX\fR" 4 -The `\f(CWint\fR\*(R' (or appropriate variant) argument is converted to signed decimal +.IX Item "diouxX" +The `\f(CW\*(C`int\*(C'\fR' (or appropriate variant) argument is converted to signed decimal (\fBd\fR and \fBi\fR), unsigned octal (\fBo\fR), unsigned decimal (\fBu\fR), or unsigned hexadecimal (\fBx\fR and \fBX\fR) notation. The letters \fBabcdef\fR are used for \fBx\fR conversions; the letters \fB\s-1ABCDEF\s0\fR are used for \fBX\fR conversions. The precision, if any, gives the minimum number of digits that must appear; if the converted value requires fewer digits, it is padded on the left with zeros. .Ip "\fB\s-1DOU\s0\fR" 4 -The `\f(CWlong int\fR argument is converted to signed decimal, unsigned octal, or +.IX Item "DOU" +The `\f(CW\*(C`long int\*(C'\fR argument is converted to signed decimal, unsigned octal, or unsigned decimal, as if the format had been \fBld\fR, \fBlo\fR, or \fBlu\fR respectively. These conversion characters are deprecated, and will eventually disappear. .Ip "\fBeE\fR" 4 -The `\f(CWdouble\fR\*(R' argument is rounded and converted in the style -`[\-]d.ddd\fBe\fR+\-dd\*(R' where there is one digit before the decimal-point character +.IX Item "eE" +The `\f(CW\*(C`double\*(C'\fR' argument is rounded and converted in the style +`[\-]d.ddd\fBe\fR+\-dd' where there is one digit before the decimal-point character and the number of digits after it is equal to the precision; if the precision is missing, it is taken as 6; if the precision is zero, no decimal-point character appears. An \fBE\fR conversion uses the letter \fBE\fR (rather than \fBe\fR) to introduce the exponent. The exponent always contains at least two digits; if the value is zero, the exponent is 00. .Ip "\fBf\fR" 4 -The `\f(CWdouble\fR\*(R' argument is rounded and converted to decimal notation in the -style `[\-]ddd.ddd>\*(R' where the number of digits after the decimal-point +.IX Item "f" +The `\f(CW\*(C`double\*(C'\fR' argument is rounded and converted to decimal notation in the +style `[\-]ddd.ddd>' where the number of digits after the decimal-point character is equal to the precision specification. If the precision is missing, it is taken as 6; if the precision is explicitly zero, no decimal-point character appears. If a decimal point appears, at least one digit appears before it. .Ip "\fBg\fR" 4 -The `\f(CWdouble\fR\*(R' argument is converted in style \fBf\fR or \fBe\fR (or \fBE\fR for \fBG\fR +.IX Item "g" +The `\f(CW\*(C`double\*(C'\fR' argument is converted in style \fBf\fR or \fBe\fR (or \fBE\fR for \fBG\fR conversions). The precision specifies the number of significant digits. If the precision is missing, 6 digits are given; if the precision is zero, it is treated as 1. Style \fBe\fR is used if the exponent from its conversion is less @@ -653,34 +640,40 @@ from the fractional part of the result; a decimal point appears only if it is followed by at least one digit. .Ip "\fBc\fR" 4 -The `\f(CWint\fR\*(R' argument is converted to an `\f(CWunsigned char\fR, and the resulting +.IX Item "c" +The `\f(CW\*(C`int\*(C'\fR' argument is converted to an `\f(CW\*(C`unsigned char\*(C'\fR, and the resulting character is written. .Ip "\fBs\fR" 4 -The `\f(CWchar *\fR\*(R' argument is expected to be a pointer to an array of character +.IX Item "s" +The `\f(CW\*(C`char *\*(C'\fR' argument is expected to be a pointer to an array of character type (pointer to a string). Characters from the array are written up to (but -not including) a terminating \f(CWNUL\fR character; if a precision is specified, no +not including) a terminating \f(CW\*(C`NUL\*(C'\fR character; if a precision is specified, no more than the number specified are written. If a precision is given, no null character need be present; if the precision is not specified, or is greater -than the size of the array, the array must contain a terminating \f(CWNUL\fR +than the size of the array, the array must contain a terminating \f(CW\*(C`NUL\*(C'\fR character. .Ip "\fBp\fR" 4 -The `\f(CWvoid *\fR pointer argument is printed in hexadecimal (as if by `\fB%#x\fR\*(R' -or `\f(CW%#lx\fR). +.IX Item "p" +The `\f(CW\*(C`void *\*(C'\fR pointer argument is printed in hexadecimal (as if by `\fB%#x\fR' +or `\f(CW\*(C`%#lx\*(C'\fR). .Ip "\fBn\fR" 4 +.IX Item "n" The number of characters written so far is stored into the integer indicated -by the `\f(CWint *\fR\*(R' (or variant) pointer argument. No argument is converted. +by the `\f(CW\*(C`int *\*(C'\fR' (or variant) pointer argument. No argument is converted. .Ip "\fB%\fR" 4 -A `\fB%\fR\*(R' is written. No argument is converted. The complete conversion +.IX Item "%" +A `\fB%\fR' is written. No argument is converted. The complete conversion specification is `\fB%%\fR. .PP In no case does a non-existent or small field width cause truncation of a field; if the result of a conversion is wider than the field width, the field is expanded to contain the conversion result. .SH "EXAMPLES" +.IX Header "EXAMPLES" In the following a few snippets of selected use cases of \fBStr\fR are presented: .Ip "\fBSplice a String into Another\fR" 4 -.Sp +.IX Item "Splice a String into Another" .Vb 5 \& char *v1 = "foo bar quux"; \& char *v2 = "baz"; @@ -689,7 +682,7 @@ \& .... .Ve .Ip "\fBTokenize a String\fR" 4 -.Sp +.IX Item "Tokenize a String" .Vb 10 \& char *var = " foo \et " bar 'baz'" q'uu'x #comment"; \& char *tok, *p; @@ -703,7 +696,7 @@ \& } .Ve .Ip "\fBMatch a String\fR" 4 -.Sp +.IX Item "Match a String" .Vb 5 \& char *var = "foo:bar"; \& if (str_parse(var, "^.+?:.+$/)) { @@ -712,7 +705,7 @@ \& } .Ve .Ip "\fBMatch a String and Go Ahead with Details\fR" 4 -.Sp +.IX Item "Match a String and Go Ahead with Details" .Vb 10 \& char *var = "foo:bar"; \& char *cp, *v1, *v2; @@ -726,7 +719,7 @@ \& } .Ve .Ip "\fBSubstitute Text in a String\fR" 4 -.Sp +.IX Item "Substitute Text in a String" .Vb 8 \& char *var = "foo:bar"; \& char *subst = "quux"; @@ -738,7 +731,7 @@ \& free(new); .Ve .Ip "\fBFormat a String\fR" 4 -.Sp +.IX Item "Format a String" .Vb 6 \& char *v0 = "abc..."; /* length not guessable */ \& char *v1 = "foo"; @@ -756,145 +749,24 @@ \& free(cp); .Ve .SH "SEE ALSO" -\fIstring\fR\|(3), \fIprintf\fR\|(3), \fIperlre\fR\|(1). +.IX Header "SEE ALSO" +\&\fIstring\fR\|(3), \fIprintf\fR\|(3), \fIperlre\fR\|(1). .SH "HISTORY" +.IX Header "HISTORY" The \fBStr\fR library was written in November and December 1999 by Ralf S. Engelschall. As building blocks various existing code was used and recycled: for the \fIstr_token\fR\|(3) implementation an anchient \fIstrtok\fR\|(3) flavor from William Deich 1991 was cleaned up and adjusted. As the background parsing engine for \fIstr_parse\fR\|(3) a heavily stripped down -version of Philip Hazel's PCRE 2.08 library was used. The \fIstr_format\fR\|(3) -implementation was based on Panos Tsirigotis\*(R' \fIsprintf\fR\|(3) code as +version of Philip Hazel's \s-1PCRE\s0 2.08 library was used. The \fIstr_format\fR\|(3) +implementation was based on Panos Tsirigotis' \fIsprintf\fR\|(3) code as adjusted by the Apache Software Foundation 1998. The formatting engine was stripped down and enhanced to support internal extensions which were required by \fIstr_format\fR\|(3) and \fIstr_parse\fR\|(3). .SH "AUTHOR" -.PP +.IX Header "AUTHOR" .Vb 3 \& Ralf S. Engelschall \& rse@engelschall.com \& www.engelschall.com .Ve - -.rn }` '' -.IX Title "str 3" -.IX Name "B - String Library" - -.IX Header "NAME" - -.IX Header "VERSION" - -.IX Header "SYNOPSIS" - -.IX Header "DESCRIPTION" - -.IX Header "FUNCTIONS" - -.IX Item "str_size_t \fBstr_len\fR(const char *\fIs\fR);" - -.IX Item "char *\fBstr_copy\fR(char *\fIs\fR, const char *\fIt\fR, size_t \fIn\fR);" - -.IX Item "char *\fBstr_dup\fR(const char *\fIs\fR, str_size_t \fIn\fR);" - -.IX Item "char *\fBstr_concat\fR(char *\fIs\fR, ...);" - -.IX Item "char *\fBstr_splice\fR(char *\fIs\fR, str_size_t \fIoff\fR, str_size_t \fIn\fR, char *\fIt\fR, str_size_t \fIm\fR);" - -.IX Item "int \fBstr_compare\fR(const char *\fIs\fR, const char *\fIt\fR, str_size_t \fIn\fR, int \fImode\fR);" - -.IX Item "char *\fBstr_span\fR(const char *\fIs\fR, size_t \fIn\fR, const char *\fIcharset\fR, int \fImode\fR);" - -.IX Item "char *\fBstr_locate\fR(const char *\fIs\fR, str_size_t \fIn\fR, const char *\fIt\fR);" - -.IX Item "char *\fBstr_token\fR(char **\fIs\fR, const char *\fIdelim\fR, const char *\fIquote\fR, const char *\fIcomment\fR, int \fImode\fR);" - -.IX Item "int \fBstr_parse\fR(const char *\fIs\fR, const char *\fIpop\fR, ...);" - -.IX Item "int \fBstr_format\fR(char *\fIs\fR, str_size_t \fIn\fR, const char *\fIfmt\fR, ...);" - -.IX Item "unsigned long \fBstr_hash\fR(const char *\fIs\fR, str_size_t \fIn\fR, int \fImode\fR);" - -.IX Item "int \fBstr_base64\fR(char *\fIs\fR, str_size_t \fIn\fR, unsigned char *\fIucp\fR, str_size_t \fIucn\fR, int \fImode\fR);" - -.IX Header "GORY DETAILS" - -.IX Subsection "Perl Regular Expressions" - -.IX Subsection "Parsing Specification" - -.IX Item "\fBMatching:\fR `\fBm\fR \fIdelim\fR \fIregex\fR \fIdelim\fR \fIflags\fR*': " - -.IX Item "\fBSubstitution:\fR `\fBs\fR \fIdelim\fR \fIregex\fR \fIdelim\fR \fIsubst\fR \fIdelim\fR \fIflags\fR*': " - -.IX Item "\fBb\fR" - -.IX Item "\fBi\fR" - -.IX Item "\fBo\fR" - -.IX Item "\fBx\fR" - -.IX Item "\fBm\fR" - -.IX Item "\fBs\fR" - -.IX Header "CONVERSION SPECIFICATION" - -.IX Item "o" - -.IX Item "o" - -.IX Item "o" - -.IX Item "o" - -.IX Item "o" - -.IX Item "o" - -.IX Item "o" - -.IX Item "o" - -.IX Item "o" - -.IX Item "\fBdiouxX\fR" - -.IX Item "\fB\s-1DOU\s0\fR" - -.IX Item "\fBeE\fR" - -.IX Item "\fBf\fR" - -.IX Item "\fBg\fR" - -.IX Item "\fBc\fR" - -.IX Item "\fBs\fR" - -.IX Item "\fBp\fR" - -.IX Item "\fBn\fR" - -.IX Item "\fB%\fR" - -.IX Header "EXAMPLES" - -.IX Item "\fBSplice a String into Another\fR" - -.IX Item "\fBTokenize a String\fR" - -.IX Item "\fBMatch a String\fR" - -.IX Item "\fBMatch a String and Go Ahead with Details\fR" - -.IX Item "\fBSubstitute Text in a String\fR" - -.IX Item "\fBFormat a String\fR" - -.IX Header "SEE ALSO" - -.IX Header "HISTORY" - -.IX Header "AUTHOR" - Index: ossp-pkg/str/str_format.c ============================================================ $ cvs diff -u -r1.21 -r1.22 str_format.c --- ossp-pkg/str/str_format.c 2001/04/27 12:12:28 1.21 +++ ossp-pkg/str/str_format.c 2001/04/27 12:22:21 1.22 @@ -864,42 +864,61 @@ case 'e': case 'E': fp_num = va_arg(ap, double); - /* We use &num_buf[1], so that we have room for the sign */ - s = conv_fp(*fmt, fp_num, alternate_form, - (adjust_precision == FALSE) ? FLOAT_DIGITS : precision, - &is_negative, &num_buf[1], &s_len); - if (is_negative) - prefix_char = '-'; - else if (print_sign) - prefix_char = '+'; - else if (print_blank) - prefix_char = ' '; + if (isnan(fp_num)) { + s = "NaN"; + s_len = 3; + } + else if (isinf(fp_num)) { + s = "Inf"; + s_len = 3; + } + else { + /* use &num_buf[1], so that we have room for the sign */ + s = conv_fp(*fmt, fp_num, alternate_form, + (adjust_precision == FALSE) ? FLOAT_DIGITS : precision, + &is_negative, &num_buf[1], &s_len); + if (is_negative) + prefix_char = '-'; + else if (print_sign) + prefix_char = '+'; + else if (print_blank) + prefix_char = ' '; + } break; - /* Double Floating Point (style 2) */ case 'g': case 'G': - if (adjust_precision == FALSE) - precision = FLOAT_DIGITS; - else if (precision == 0) - precision = 1; - /* We use &num_buf[1], so that we have room for the sign */ - s = str_gcvt(va_arg(ap, double), precision, &num_buf[1], - alternate_form); - if (*s == '-') - prefix_char = *s++; - else if (print_sign) - prefix_char = '+'; - else if (print_blank) - prefix_char = ' '; - s_len = str_len(s); - if (alternate_form && (q = str_span(s, 0, ".", 0)) == NULL) { - s[s_len++] = '.'; - s[s_len] = NUL; /* delimit for following str_span() */ + fp_num = va_arg(ap, double); + if (isnan(fp_num)) { + s = "NaN"; + s_len = 3; + } + else if (isinf(fp_num)) { + s = "Inf"; + s_len = 3; + } + else { + if (adjust_precision == FALSE) + precision = FLOAT_DIGITS; + else if (precision == 0) + precision = 1; + /* use &num_buf[1], so that we have room for the sign */ + s = str_gcvt(fp_num, precision, &num_buf[1], alternate_form); + if (*s == '-') + prefix_char = *s++; + else if (print_sign) + prefix_char = '+'; + else if (print_blank) + prefix_char = ' '; + s_len = str_len(s); + if (alternate_form && (q = str_span(s, 0, ".", 0)) == NULL) { + s[s_len++] = '.'; + s[s_len] = NUL; /* delimit for following str_span() */ + } + if (*fmt == 'G' && (q = str_span(s, 0, "e", 0)) != NULL) + *q = 'E'; } - if (*fmt == 'G' && (q = str_span(s, 0, "e", 0)) != NULL) - *q = 'E'; break; /* Single Character */ From ossp-cvs-owner@ossp.org Fri Apr 27 14:24:54 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f3RCOr007919; Fri, 27 Apr 2001 14:24:53 +0200 (CEST) Date: Fri, 27 Apr 2001 14:24:53 +0200 (CEST) Message-Id: <200104271224.f3RCOr007919@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/str str_format.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 27-Apr-2001 14:24:53 Branch: HEAD Handle: 2001042713245200 Modified files: ossp-pkg/str str_format.c Log: *** empty log message *** Summary: Revision Changes Path 1.23 +1 -1 ossp-pkg/str/str_format.c ____________________________________________________________________________ Index: ossp-pkg/str/str_format.c ============================================================ $ cvs diff -u -r1.22 -r1.23 str_format.c --- ossp-pkg/str/str_format.c 2001/04/27 12:22:21 1.22 +++ ossp-pkg/str/str_format.c 2001/04/27 12:24:52 1.23 @@ -83,7 +83,7 @@ * FreeBSD version which took it from GNU libc-4.6.27 and modified it * to be thread safe. The whole code was finally cleaned up, stripped * and extended by Ralf S. Engelschall for use inside the Str library. - * Especially and Apache and network specific kludges were removed again + * Especially any Apache and network specific kludges were removed again * and instead the formatting engine now can be extended by the caller * on-the-fly. */ From ossp-cvs-owner@ossp.org Sat Apr 28 10:18:52 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f3S8Iqk21817; Sat, 28 Apr 2001 10:18:52 +0200 (CEST) Date: Sat, 28 Apr 2001 10:18:52 +0200 (CEST) Message-Id: <200104280818.f3S8Iqk21817@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/str configure configure.in str_config.h.in str_fo... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 28-Apr-2001 10:18:51 Branch: HEAD Handle: 2001042809185100 Modified files: ossp-pkg/str configure configure.in str_config.h.in str_format.c Log: *** empty log message *** Summary: Revision Changes Path 1.10 +61 -6 ossp-pkg/str/configure 1.9 +1 -0 ossp-pkg/str/configure.in 1.4 +9 -0 ossp-pkg/str/str_config.h.in 1.24 +8 -0 ossp-pkg/str/str_format.c ____________________________________________________________________________ Index: ossp-pkg/str/configure ============================================================ $ cvs diff -u -r1.9 -r1.10 configure --- ossp-pkg/str/configure 2000/07/14 11:04:42 1.9 +++ ossp-pkg/str/configure 2001/04/28 08:18:51 1.10 @@ -1480,14 +1480,69 @@ fi done +for ac_func in isnan isinf +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:1487: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:1515: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +fi +done + echo $ac_n "checking for modf""... $ac_c" 1>&6 -echo "configure:1486: checking for modf" >&5 +echo "configure:1541: checking for modf" >&5 if eval "test \"`echo '$''{'ac_cv_func_modf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1569: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_modf=yes" else @@ -1528,7 +1583,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for modf in -lm""... $ac_c" 1>&6 -echo "configure:1532: checking for modf in -lm" >&5 +echo "configure:1587: checking for modf in -lm" >&5 ac_lib_var=`echo m'_'modf | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1536,7 +1591,7 @@ ac_save_LIBS="$LIBS" LIBS="-lm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1606: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else Index: ossp-pkg/str/configure.in ============================================================ $ cvs diff -u -r1.8 -r1.9 configure.in --- ossp-pkg/str/configure.in 2000/07/14 11:04:42 1.8 +++ ossp-pkg/str/configure.in 2001/04/28 08:18:51 1.9 @@ -29,6 +29,7 @@ AC_CHECK_SIZEOF(void *, 4) AC_HAVE_FUNCS(memmove memset memcmp memchr) +AC_HAVE_FUNCS(isnan isinf) AC_CHECK_FUNC(modf, , AC_CHECK_LIB(m, modf)) Index: ossp-pkg/str/str_config.h.in ============================================================ $ cvs diff -u -r1.3 -r1.4 str_config.h.in --- ossp-pkg/str/str_config.h.in 1999/12/28 10:19:00 1.3 +++ ossp-pkg/str/str_config.h.in 2001/04/28 08:18:51 1.4 @@ -20,6 +20,12 @@ /* The number of bytes in a void *. */ #undef SIZEOF_VOID_P +/* Define if you have the isinf function. */ +#undef HAVE_ISINF + +/* Define if you have the isnan function. */ +#undef HAVE_ISNAN + /* Define if you have the memchr function. */ #undef HAVE_MEMCHR @@ -31,3 +37,6 @@ /* Define if you have the memset function. */ #undef HAVE_MEMSET + +/* Define if you have the m library (-lm). */ +#undef HAVE_LIBM Index: ossp-pkg/str/str_format.c ============================================================ $ cvs diff -u -r1.23 -r1.24 str_format.c --- ossp-pkg/str/str_format.c 2001/04/27 12:24:52 1.23 +++ ossp-pkg/str/str_format.c 2001/04/28 08:18:51 1.24 @@ -112,6 +112,14 @@ #define NUM_BUF_SIZE 512 #define NDIG 80 +/* compatibility */ +#if !defined(HAVE_ISNAN) +#define isnan(d) (0) +#endif +#if !defined(HAVE_ISINF) +#define isinf(d) (0) +#endif + /* * Convert decimal number to its string representation. The number of * digits is specified by ndigit decpt is set to the position of the From ossp-cvs-owner@ossp.org Fri May 4 15:25:20 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f44DPJ655905; Fri, 4 May 2001 15:25:19 +0200 (CEST) Date: Fri, 4 May 2001 15:25:19 +0200 (CEST) Message-Id: <200105041325.f44DPJ655905@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/shiela ChangeLog README VERSION shiela-install.po... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 04-May-2001 15:25:19 Branch: HEAD Handle: 2001050414251800 Modified files: ossp-pkg/shiela ChangeLog README VERSION shiela-install.pod shiela-install.sh shiela.pl shiela.pod shtool Log: Update for Shtool 1.5.3 and new version Summary: Revision Changes Path 1.3 +5 -0 ossp-pkg/shiela/ChangeLog 1.3 +1 -1 ossp-pkg/shiela/README 1.3 +1 -1 ossp-pkg/shiela/VERSION 1.3 +1 -1 ossp-pkg/shiela/shiela-install.pod 1.3 +1 -1 ossp-pkg/shiela/shiela-install.sh 1.4 +1 -1 ossp-pkg/shiela/shiela.pl 1.3 +1 -1 ossp-pkg/shiela/shiela.pod 1.4 +13 -7 ossp-pkg/shiela/shtool ____________________________________________________________________________ Index: ossp-pkg/shiela/ChangeLog ============================================================ $ cvs diff -u -r1.2 -r1.3 ChangeLog --- ossp-pkg/shiela/ChangeLog 2001/02/10 16:40:26 1.2 +++ ossp-pkg/shiela/ChangeLog 2001/05/04 13:25:18 1.3 @@ -9,6 +9,11 @@ ChangeLog + Changes between 0.9.1 and 0.9.2 (10-Feb-2001 to 04-May-2001): + + *) Upgraded to GNU shtool 1.5.3 + [Ralf S. Engelschall] + Changes between 0.9.0 and 0.9.1 (18-Jun-2000 to 10-Feb-2001): *) Upgraded to GNU shtool 1.5.2-pre. Index: ossp-pkg/shiela/README ============================================================ $ cvs diff -u -r1.2 -r1.3 README --- ossp-pkg/shiela/README 2001/02/10 16:40:26 1.2 +++ ossp-pkg/shiela/README 2001/05/04 13:25:18 1.3 @@ -7,7 +7,7 @@ OSSP Shiela - Access Control and Logging Facility for CVS Copyright (c) 2000 Ralf S. Engelschall - Version 0.9.1 (27-Jun-2000) + Version 0.9.2 (05-May-2001) Shiela is an access control and logging facility for use with the Concurrent Versions System (CVS). It is intended to be hooked into CVS's Index: ossp-pkg/shiela/VERSION ============================================================ $ cvs diff -u -r1.2 -r1.3 VERSION --- ossp-pkg/shiela/VERSION 2001/02/10 16:40:26 1.2 +++ ossp-pkg/shiela/VERSION 2001/05/04 13:25:18 1.3 @@ -1,3 +1,3 @@ - This is OSSP Shiela, Version 0.9.1 (27-Jun-2000) + This is OSSP Shiela, Version 0.9.2 (05-May-2001) Index: ossp-pkg/shiela/shiela-install.pod ============================================================ $ cvs diff -u -r1.2 -r1.3 shiela-install.pod --- ossp-pkg/shiela/shiela-install.pod 2001/02/10 16:40:26 1.2 +++ ossp-pkg/shiela/shiela-install.pod 2001/05/04 13:25:18 1.3 @@ -32,7 +32,7 @@ =head1 VERSION -B 0.9.1 (27-Jun-2000) +B 0.9.2 (05-May-2001) =head1 DESCRIPTION Index: ossp-pkg/shiela/shiela-install.sh ============================================================ $ cvs diff -u -r1.2 -r1.3 shiela-install.sh --- ossp-pkg/shiela/shiela-install.sh 2001/02/10 16:40:26 1.2 +++ ossp-pkg/shiela/shiela-install.sh 2001/05/04 13:25:18 1.3 @@ -25,7 +25,7 @@ ## shiela-install: Shiela repository install program (syntax: Bourne-Shell) ## -version="0.9.1" +version="0.9.2" prefix="@prefix@" bindir="@bindir@" Index: ossp-pkg/shiela/shiela.pl ============================================================ $ cvs diff -u -r1.3 -r1.4 shiela.pl --- ossp-pkg/shiela/shiela.pl 2001/02/10 16:40:26 1.3 +++ ossp-pkg/shiela/shiela.pl 2001/05/04 13:25:18 1.4 @@ -25,7 +25,7 @@ ## shiela: Shiela control program (syntax: Perl) ## -my $version = '0.9.1'; +my $version = '0.9.2'; require 5.005; Index: ossp-pkg/shiela/shiela.pod ============================================================ $ cvs diff -u -r1.2 -r1.3 shiela.pod --- ossp-pkg/shiela/shiela.pod 2001/02/10 16:40:26 1.2 +++ ossp-pkg/shiela/shiela.pod 2001/05/04 13:25:18 1.3 @@ -32,7 +32,7 @@ =head1 VERSION -B 0.9.1 (27-Jun-2000) +B 0.9.2 (05-May-2001) =head1 DESCRIPTION Index: ossp-pkg/shiela/shtool ============================================================ $ cvs diff -u -r1.3 -r1.4 shtool --- ossp-pkg/shiela/shtool 2001/02/10 16:40:26 1.3 +++ ossp-pkg/shiela/shtool 2001/05/04 13:25:18 1.4 @@ -6,7 +6,7 @@ ## See http://www.gnu.org/software/shtool/ for more information. ## See ftp://ftp.gnu.org/gnu/shtool/ for latest version. ## -## Version: 1.5.2 (05-Oct-2000) +## Version: 1.5.3 (19-Apr-2001) ## Contents: 7/17 available modules ## @@ -26,7 +26,7 @@ ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, ## USA, or contact Ralf S. Engelschall . ## -## Notice: Given that you include this file verbatim into your own +## 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 @@ -65,7 +65,7 @@ exit 1 fi if [ ".$1" = ".-h" -o ".$1" = ".--help" ]; then - echo "This is GNU shtool, version 1.5.2 (05-Oct-2000)" + echo "This is GNU shtool, version 1.5.3 (19-Apr-2001)" echo "Copyright (c) 1994-2001 Ralf S. Engelschall " echo "Report bugs to " echo '' @@ -83,8 +83,8 @@ echo ' [-e] [ ...] ' echo ' mkdir [-t] [-f] [-p] [-m] [ ...]' echo ' fixperm [-v] [-t] [ ...]' - echo ' tarball [-t] [-v] [-o ] [-c ] [-d ] [-u' - echo ' ] [-g ] [-e ] [ ...]' + echo ' tarball [-t] [-v] [-o] [-c] [-d] [-u]' + echo ' [-g] [-e] [ ...]' echo ' version [-l] [-n] [-p] [-s] [-e]' echo ' [-i] [-d] ' echo ' path [-s] [-r] [-d] [-b] [-m] [-p] [ ...]' @@ -105,7 +105,7 @@ exit 0 fi if [ ".$1" = ".-v" -o ".$1" = ."--version" ]; then - echo "GNU shtool 1.5.2 (05-Oct-2000)" + echo "GNU shtool 1.5.3 (19-Apr-2001)" exit 0 fi if [ ".$1" = ".-r" -o ".$1" = ."--recreate" ]; then @@ -180,7 +180,7 @@ ;; tarball ) str_tool="tarball" - str_usage="[-t] [-v] [-o ] [-c ] [-d ] [-u ] [-g ] [-e ] [ ...]" + str_usage="[-t] [-v] [-o] [-c] [-d] [-u] [-g] [-e] [ ...]" gen_tmpfile=yes arg_spec="1+" opt_spec="t.v.o:c:d:u:g:e:" @@ -761,6 +761,12 @@ echo "mkdir $p" 1>&2 fi mkdir $p || errstatus=$? + if [ ".$opt_m" != . ]; then + if [ ".$opt_t" = .yes ]; then + echo "chmod $opt_m $p" 1>&2 + fi + chmod $opt_m $p || errstatus=$? + fi else # the smart situation set fnord `echo ":$p" |\ @@ -1174,7 +1180,7 @@ vGNU="${name} ${triple} (${tim})" vWeb="${name}/${triple}" vSCCS="@(#)${name} ${triple} (${tim})" - vRCS="\$Id: shtool,v 1.3 2001/02/10 16:40:26 rse Exp ${name} ${triple} (${tim}) \$" + vRCS="\$Id: shtool,v 1.4 2001/05/04 13:25:18 rse Exp ${name} ${triple} (${tim}) \$" # determine string out of filename # (do NOT try to optimize this in any way because of portability) From ossp-cvs-owner@ossp.org Fri May 4 15:30:02 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f44DU1a57019; Fri, 4 May 2001 15:30:01 +0200 (CEST) Date: Fri, 4 May 2001 15:30:01 +0200 (CEST) Message-Id: <200105041330.f44DU1a57019@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/shiela shiela-install.sh Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 04-May-2001 15:30:01 Branch: HEAD Handle: 2001050414300000 Modified files: ossp-pkg/shiela shiela-install.sh Log: Update perl checks Summary: Revision Changes Path 1.4 +10 -11 ossp-pkg/shiela/shiela-install.sh ____________________________________________________________________________ Index: ossp-pkg/shiela/shiela-install.sh ============================================================ $ cvs diff -u -r1.3 -r1.4 shiela-install.sh --- ossp-pkg/shiela/shiela-install.sh 2001/05/04 13:25:18 1.3 +++ ossp-pkg/shiela/shiela-install.sh 2001/05/04 13:30:00 1.4 @@ -272,25 +272,24 @@ V_tool_perl="perl" rm -f $tmpfile touch $tmpfile - c=0 found=0 + pc=99 for dir in $paths; do dir=`echo $dir | sed -e 's;/*$;;'` - for perl in perl5 perl miniperl; do - if [ $minusx "$dir/$perl" ] && [ ! -d "$dir/$perl" ]; then - perl="$dir/$perl" - version=`$perl -v | grep version |\ - sed -e 's/.* version //' -e 's/ built.*//' -e 's/ with.*//'` - versionnum="`echo $version | sed -e 's/\.//g' -e 's/_//g'`" - versionnum=`expr $versionnum - $c` - echo "$versionnum $perl" >>$tmpfile + nc=99 + for name in perl perl5 miniperl; do + if [ $minusx "$dir/$name" -a ! -d "$dir/$name" ]; then + perl="$dir/$name" + pv=`$perl -e 'printf("%.3f", $]);'` + echo "$pv:$pc:$nc:$perl" >>$tmpfile found=1 fi + nc=`expr $nc - 1` done - c=`expr $c + 1` + pc=`expr $pc - 1` done if [ $found = 1 ]; then - V_tool_perl="`cat $tmpfile | sort -u | tail -1 | cut '-d ' -f2`" + V_tool_perl="`cat $tmpfile | sort -u | tail -1 | cut -d: -f4`" fi rm -f $tmpfile fi From ossp-cvs-owner@ossp.org Fri May 4 15:33:54 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f44DXrb57328; Fri, 4 May 2001 15:33:53 +0200 (CEST) Date: Fri, 4 May 2001 15:33:53 +0200 (CEST) Message-Id: <200105041333.f44DXrb57328@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/shiela ChangeLog shiela.pl Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 04-May-2001 15:33:53 Branch: HEAD Handle: 2001050414335300 Modified files: ossp-pkg/shiela ChangeLog shiela.pl Log: Accept CVS 1.11 and newer Summary: Revision Changes Path 1.4 +7 -0 ossp-pkg/shiela/ChangeLog 1.5 +1 -1 ossp-pkg/shiela/shiela.pl ____________________________________________________________________________ Index: ossp-pkg/shiela/ChangeLog ============================================================ $ cvs diff -u -r1.3 -r1.4 ChangeLog --- ossp-pkg/shiela/ChangeLog 2001/05/04 13:25:18 1.3 +++ ossp-pkg/shiela/ChangeLog 2001/05/04 13:33:53 1.4 @@ -11,6 +11,13 @@ Changes between 0.9.1 and 0.9.2 (10-Feb-2001 to 04-May-2001): + *) Make sure shiela accepts CVS 1.11 and newer, too. + [Ralf S. Engelschall] + + *) Adjusted shiela-install's Perl tool checks to use + the logic of GNU shtool' "path" command. + [Ralf S. Engelschall] + *) Upgraded to GNU shtool 1.5.3 [Ralf S. Engelschall] Index: ossp-pkg/shiela/shiela.pl ============================================================ $ cvs diff -u -r1.4 -r1.5 shiela.pl --- ossp-pkg/shiela/shiela.pl 2001/05/04 13:25:18 1.4 +++ ossp-pkg/shiela/shiela.pl 2001/05/04 13:33:53 1.5 @@ -193,7 +193,7 @@ $RT->{cvsvers} = $1 if ($v =~ m|Concurrent\s+Versions\s+System\s+\(CVS\)\s+([\d.]+)\s+|s); $RT->{cvsossp} = 0; $RT->{cvsossp} = 1 if ($v =~ m|OSSP|s); - die "$RT->{cvs} is not at least CVS 1.10" if ($RT->{cvsvers} !~ m|^1\.10|); + die "$RT->{cvs} is not at least CVS 1.10" if ($RT->{cvsvers} !~ m|^1\.1[0-9]|); $RT->{useserver} = 0; $RT->{useserver} = 1 if ($v =~ m|server|s); From ossp-cvs-owner@ossp.org Fri May 4 16:40:45 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f44Eeic01750; Fri, 4 May 2001 16:40:44 +0200 (CEST) Date: Fri, 4 May 2001 16:40:44 +0200 (CEST) Message-Id: <200105041440.f44Eeic01750@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/cvs README.OSSP Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 04-May-2001 16:40:44 Branch: HEAD Handle: 2001050415404400 Modified files: ossp-pkg/cvs README.OSSP Log: *** empty log message *** Summary: Revision Changes Path 1.49 +2 -2 ossp-pkg/cvs/README.OSSP ____________________________________________________________________________ Index: ossp-pkg/cvs/README.OSSP ============================================================ $ cvs diff -u -r1.48 -r1.49 README.OSSP --- ossp-pkg/cvs/README.OSSP 2000/08/12 10:57:58 1.48 +++ ossp-pkg/cvs/README.OSSP 2001/05/04 14:40:44 1.49 @@ -292,8 +292,8 @@ OSSP_PATCH_CVSUSER: This allows the Unix user OSSP_PATCH_CVSUSER_CALLER (per default - "cvs") to use the environment variable CVSUSER to override the login - name CVS uses to identify the caller. This is intended for use + "ossp-cvs") to use the environment variable CVSUSER to override the + login name CVS uses to identify the caller. This is intended for use with a CVS setuid wrapper program or for use manually by the CVS administrator. [Origin: Ralf S. Engelschall] From ossp-cvs-owner@ossp.org Fri May 4 17:06:57 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f44F6tV04457; Fri, 4 May 2001 17:06:55 +0200 (CEST) Date: Fri, 4 May 2001 17:06:55 +0200 (CEST) Message-Id: <200105041506.f44F6tV04457@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/shiela shiela.pl Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 04-May-2001 17:06:55 Branch: HEAD Handle: 2001050416065500 Modified files: ossp-pkg/shiela shiela.pl Log: add support for CVSUSER variable Summary: Revision Changes Path 1.6 +2 -2 ossp-pkg/shiela/shiela.pl ____________________________________________________________________________ Index: ossp-pkg/shiela/shiela.pl ============================================================ $ cvs diff -u -r1.5 -r1.6 shiela.pl --- ossp-pkg/shiela/shiela.pl 2001/05/04 13:33:53 1.5 +++ ossp-pkg/shiela/shiela.pl 2001/05/04 15:06:55 1.6 @@ -125,7 +125,7 @@ # supplied arguments $RT->{cvsroot} = $ENV{CVSROOT} || die 'unknown CVS root (set $CVSROOT variable)'; - $RT->{userid} = $ENV{LOGNAME} || $ENV{LOGUSER} || $ENV{USER} || die 'unknown CVS user'; + $RT->{userid} = $ENV{CVSUSER} || $ENV{LOGNAME} || $ENV{LOGUSER} || $ENV{USER} || die 'unknown CVS user'; # various directory paths $RT->{tmpdir} = $ENV{TMPDIR} || $ENV{TEMPDIR} || '/tmp'; @@ -146,7 +146,7 @@ # determine user information $RT->{username} = $CF->{Project}->{User}->{$RT->{userid}}->{name} || - die "unknown user `$RT->{userid}'"; + die "CVS user `$RT->{userid}' not found in Shiela configuration"; $RT->{usermail} = $CF->{Project}->{User}->{$RT->{userid}}->{mail} || "$RT->{userid}\@localhost"; From ossp-cvs-owner@ossp.org Fri May 4 17:29:16 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f44FTF206891; Fri, 4 May 2001 17:29:15 +0200 (CEST) Date: Fri, 4 May 2001 17:29:15 +0200 (CEST) Message-Id: <200105041529.f44FTF206891@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/cvs/src subr.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 04-May-2001 17:29:15 Branch: HEAD Handle: 2001050416291500 Modified files: ossp-pkg/cvs/src subr.c Log: Make CVSUSER working Summary: Revision Changes Path 1.10 +16 -14 ossp-pkg/cvs/src/subr.c ____________________________________________________________________________ Index: ossp-pkg/cvs/src/subr.c ============================================================ $ cvs diff -u -r1.9 -r1.10 subr.c --- ossp-pkg/cvs/src/subr.c 2000/08/27 15:05:24 1.9 +++ ossp-pkg/cvs/src/subr.c 2001/05/04 15:29:15 1.10 @@ -314,6 +314,22 @@ uid_t uid; #endif +#ifdef OSSP_PATCH_CVSUSER +#ifndef OSSP_PATCH_CVSUSER_CALLER +#define OSSP_PATCH_CVSUSER_CALLER "ossp-cvs" +#endif + uid = getuid(); + if ((pw = (struct passwd *)getpwnam(OSSP_PATCH_CVSUSER_CALLER)) != NULL) { + if (pw->pw_uid == uid) { + char *name; + if ((name = getenv("CVSUSER")) != NULL) { + cache = xstrdup(name); + return cache; + } + } + } +#endif + /* If there is a CVS username, return it. */ #ifdef AUTH_SERVER_SUPPORT if (CVS_Username != NULL) @@ -343,20 +359,6 @@ return cache; } } -#ifdef OSSP_PATCH_CVSUSER -#ifndef OSSP_PATCH_CVSUSER_CALLER -#define OSSP_PATCH_CVSUSER_CALLER "ossp-cvs" -#endif - if ((pw = (struct passwd *)getpwnam(OSSP_PATCH_CVSUSER_CALLER)) != NULL) { - if (pw->pw_uid == uid) { - char *name; - if ((name = getenv("CVSUSER")) != NULL) { - cache = xstrdup(name); - return cache; - } - } - } -#endif if ((pw = (struct passwd *) getpwuid (uid)) == NULL) { char uidname[20]; From ossp-cvs-owner@ossp.org Fri May 4 21:31:19 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f44JVIo31334; Fri, 4 May 2001 21:31:18 +0200 (CEST) Date: Fri, 4 May 2001 21:31:18 +0200 (CEST) Message-Id: <200105041931.f44JVIo31334@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/mm ChangeLog shtool Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 04-May-2001 21:31:18 Branch: HEAD Handle: 2001050420311700 Modified files: ossp-pkg/mm ChangeLog shtool Log: *** empty log message *** Summary: Revision Changes Path 1.27 +3 -3 ossp-pkg/mm/ChangeLog 1.23 +13 -7 ossp-pkg/mm/shtool ____________________________________________________________________________ Index: ossp-pkg/mm/ChangeLog ============================================================ $ cvs diff -u -r1.26 -r1.27 ChangeLog --- ossp-pkg/mm/ChangeLog 2001/01/29 20:31:50 1.26 +++ ossp-pkg/mm/ChangeLog 2001/05/04 19:31:17 1.27 @@ -16,14 +16,14 @@ Changes between 1.1.3 and 1.1.4 (01-Jul-2000 to xx-Jan-2001) + *) Upgraded to GNU shtool 1.5.3 + [Ralf S. Engelschall] + *) Removed variables from ANSI C function prototypes in mm.h to avoid any potential conflicts in advance. [Ralf S. Engelschall] *) Adjusted year in copyright messages for 2001. - [Ralf S. Engelschall] - - *) Upgraded to GNU shtool 1.5.2 [Ralf S. Engelschall] *) From Apache 2.0's MM patch set: Index: ossp-pkg/mm/shtool ============================================================ $ cvs diff -u -r1.22 -r1.23 shtool --- ossp-pkg/mm/shtool 2001/01/29 20:25:49 1.22 +++ ossp-pkg/mm/shtool 2001/05/04 19:31:17 1.23 @@ -6,7 +6,7 @@ ## See http://www.gnu.org/software/shtool/ for more information. ## See ftp://ftp.gnu.org/gnu/shtool/ for latest version. ## -## Version: 1.5.2 (05-Oct-2000) +## Version: 1.5.3 (19-Apr-2001) ## Contents: 6/17 available modules ## @@ -26,7 +26,7 @@ ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, ## USA, or contact Ralf S. Engelschall . ## -## Notice: Given that you include this file verbatim into your own +## 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 @@ -65,7 +65,7 @@ exit 1 fi if [ ".$1" = ".-h" -o ".$1" = ".--help" ]; then - echo "This is GNU shtool, version 1.5.2 (05-Oct-2000)" + echo "This is GNU shtool, version 1.5.3 (19-Apr-2001)" echo "Copyright (c) 1994-2001 Ralf S. Engelschall " echo "Report bugs to " echo '' @@ -83,8 +83,8 @@ echo ' [-e] [ ...] ' echo ' mkdir [-t] [-f] [-p] [-m] [ ...]' echo ' fixperm [-v] [-t] [ ...]' - echo ' tarball [-t] [-v] [-o ] [-c ] [-d ] [-u' - echo ' ] [-g ] [-e ] [ ...]' + echo ' tarball [-t] [-v] [-o] [-c] [-d] [-u]' + echo ' [-g] [-e] [ ...]' echo ' version [-l] [-n] [-p] [-s] [-e]' echo ' [-i] [-d] ' echo '' @@ -105,7 +105,7 @@ exit 0 fi if [ ".$1" = ".-v" -o ".$1" = ."--version" ]; then - echo "GNU shtool 1.5.2 (05-Oct-2000)" + echo "GNU shtool 1.5.3 (19-Apr-2001)" exit 0 fi if [ ".$1" = ".-r" -o ".$1" = ."--recreate" ]; then @@ -180,7 +180,7 @@ ;; tarball ) str_tool="tarball" - str_usage="[-t] [-v] [-o ] [-c ] [-d ] [-u ] [-g ] [-e ] [ ...]" + str_usage="[-t] [-v] [-o] [-c] [-d] [-u] [-g] [-e] [ ...]" gen_tmpfile=yes arg_spec="1+" opt_spec="t.v.o:c:d:u:g:e:" @@ -748,6 +748,12 @@ echo "mkdir $p" 1>&2 fi mkdir $p || errstatus=$? + if [ ".$opt_m" != . ]; then + if [ ".$opt_t" = .yes ]; then + echo "chmod $opt_m $p" 1>&2 + fi + chmod $opt_m $p || errstatus=$? + fi else # the smart situation set fnord `echo ":$p" |\ From ossp-cvs-owner@ossp.org Thu May 10 21:51:34 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f4AJpX249125; Thu, 10 May 2001 21:51:33 +0200 (CEST) Date: Thu, 10 May 2001 21:51:33 +0200 (CEST) Message-Id: <200105101951.f4AJpX249125@ossp.org> From: "OSSP Project Master" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: CVSROOT modules Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: OSSP Project Master Root: /e/ossp/cvs Email: ossp@ossp.org Module: CVSROOT Date: 10-May-2001 21:51:32 Branch: HEAD Handle: 2001051020513200 Modified files: CVSROOT modules Log: *** empty log message *** Summary: Revision Changes Path 1.23 +1 -0 CVSROOT/modules ____________________________________________________________________________ Index: CVSROOT/modules ============================================================ $ cvs diff -u -r1.22 -r1.23 modules --- CVSROOT/modules 2000/09/14 15:55:06 1.22 +++ CVSROOT/modules 2001/05/10 19:51:32 1.23 @@ -72,4 +72,5 @@ shiela ossp-pkg/shiela str ossp-pkg/str sugar ossp-pkg/sugar +l2 ossp-pkg/l2 From ossp-cvs-owner@ossp.org Thu May 10 22:00:32 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f4AK0VQ50372; Thu, 10 May 2001 22:00:31 +0200 (CEST) Date: Thu, 10 May 2001 22:00:31 +0200 (CEST) Message-Id: <200105102000.f4AK0VQ50372@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/l2 l2.3 l2.pod Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 10-May-2001 22:00:31 Branch: HEAD Handle: 2001051021003100 Modified files: ossp-pkg/l2 l2.3 l2.pod Log: get rid of old Str stuff Summary: Revision Changes Path 1.2 +5 -621 ossp-pkg/l2/l2.3 1.2 +11 -729 ossp-pkg/l2/l2.pod ____________________________________________________________________________ Index: ossp-pkg/l2/l2.3 ============================================================ $ cvs diff -u -r1.1.1.1 -r1.2 l2.3 --- ossp-pkg/l2/l2.3 2001/05/10 19:46:01 1.1.1.1 +++ ossp-pkg/l2/l2.3 2001/05/10 20:00:31 1.2 @@ -1,5 +1,5 @@ .\" Automatically generated by Pod::Man version 1.02 -.\" Tue May 8 21:21:11 2001 +.\" Thu May 10 22:00:18 2001 .\" .\" Standard preamble: .\" ====================================================================== @@ -141,632 +141,16 @@ .TH l2 3 "08-May-2001" "L2 0.1.0" "Logging Library" .UC .SH "NAME" -\&\fBStr\fR \- String Library +\&\fBL2\fR \- Logging Library .SH "VERSION" .IX Header "VERSION" -Str \s-10.1.0 (08-May-2001)\s0 +L2 L2_VERSION_STR .SH "SYNOPSIS" .IX Header "SYNOPSIS" -\&\fBstr_len\fR, -\&\fBstr_copy\fR, -\&\fBstr_dup\fR, -\&\fBstr_concat\fR, -\&\fBstr_splice\fR, -\&\fBstr_compare\fR, -\&\fBstr_span\fR, -\&\fBstr_locate\fR, -\&\fBstr_token\fR, -\&\fBstr_parse\fR, -\&\fBstr_format\fR, -\&\fBstr_hash\fR, -\&\fBstr_base64\fR. +\&... .SH "DESCRIPTION" .IX Header "DESCRIPTION" -The \fBStr\fR library is a generic string library written in \s-1ANSI\s0 C which -provides functions for handling, matching, parsing, searching and -formatting of C strings. So it can be considered as a superset of \s-1POSIX\s0 -\&\fIstring\fR\|(3), but its main intention is to provide a more convinient and -compact \s-1API\s0 plus a more generalized functionality. +The \fBL2\fR library is... .SH "FUNCTIONS" .IX Header "FUNCTIONS" The following functions are provided by the \fBStr\fR \s-1API:\s0 -.Ip "str_size_t \fBstr_len\fR(const char *\fIs\fR);" 4 -.IX Item "str_size_t str_len(const char *s);" -This function determines the length of string \fIs\fR, i.e., the number -of characters starting at \fIs\fR that precede the terminating \f(CW\*(C`NUL\*(C'\fR -character. It returns \f(CW\*(C`NULL\*(C'\fR if \fIs\fR is \f(CW\*(C`NULL\*(C'\fR. -.Ip "char *\fBstr_copy\fR(char *\fIs\fR, const char *\fIt\fR, size_t \fIn\fR);" 4 -.IX Item "char *str_copy(char *s, const char *t, size_t n);" -This copies the characters in string \fIt\fR into the string \fIs\fR, but never more -than \fIn\fR characters (if \fIn\fR is greater than \f(CW\*(C`0\*(C'\fR). The two involved strings -can overlap and the characters in \fIs\fR are always \f(CW\*(C`NUL\*(C'\fR\-terminated. The -string \fIs\fR has to be large enough to hold all characters to be copied. -function returns \f(CW\*(C`NULL\*(C'\fR if \fIs\fR or \fIt\fR are \f(CW\*(C`NULL\*(C'\fR. Else it returns the -pointer to the written \f(CW\*(C`NUL\*(C'\fR\-terminating character in \fIs\fR. -.Ip "char *\fBstr_dup\fR(const char *\fIs\fR, str_size_t \fIn\fR);" 4 -.IX Item "char *str_dup(const char *s, str_size_t n);" -This returns a copy of the characters in string \fIs\fR, but never more than \fIn\fR -characters if \fIn\fR is greater than \f(CW\*(C`0\*(C'\fR. It returns \f(CW\*(C`NULL\*(C'\fR if \fIs\fR is -\&\f(CW\*(C`NULL\*(C'\fR. The returned string has to be deallocated later with \fIfree\fR\|(3). -.Ip "char *\fBstr_concat\fR(char *\fIs\fR, ...);" 4 -.IX Item "char *str_concat(char *s, ...);" -This functions concatenates the characters of all string arguments into a new -allocated string and returns this new string. If \fIs\fR is \f(CW\*(C`NULL\*(C'\fR the function -returns \f(CW\*(C`NULL\*(C'\fR. Else it returns the pointer to the written final -\&\f(CW\*(C`NUL\*(C'\fR\-terminating character in \fIs\fR. The returned string later has to be -deallicated with \fIfree\fR\|(3). -.Ip "char *\fBstr_splice\fR(char *\fIs\fR, str_size_t \fIoff\fR, str_size_t \fIn\fR, char *\fIt\fR, str_size_t \fIm\fR);" 4 -.IX Item "char *str_splice(char *s, str_size_t off, str_size_t n, char *t, str_size_t m);" -This splices the string \fIt\fR into string \fIs\fR, i.e., the \fIn\fR characters -at offset \fIoff\fR in \fIs\fR are removed and at their location the string -\&\fIt\fR is inserted (or just the first \fIm\fR characters of \fIt\fR if \fIm\fR is -greater than \f(CW\*(C`0\*(C'\fR). It returns \f(CW\*(C`NULL\*(C'\fR if \fIs\fR or \fIt\fR are \f(CW\*(C`NULL\*(C'\fR. -Else the string \fIs\fR is returned. The function supports also the -situation where \fIt\fR is a sub-string of \fIs\fR as long as the area -\&\fIs+off\fR...\fIs+off+n\fR and \fIt\fR...\fIt+m\fR do not overlap. The caller -always has to make sure that enough room exists in \fIs\fR. -.Ip "int \fBstr_compare\fR(const char *\fIs\fR, const char *\fIt\fR, str_size_t \fIn\fR, int \fImode\fR);" 4 -.IX Item "int str_compare(const char *s, const char *t, str_size_t n, int mode);" -This performs a lexicographical comparison of the two strings \fIs\fR -and \fIt\fR (but never compares more than \fIn\fR characters of them) -and returns one of three return values: a value lower than \f(CW\*(C`0\*(C'\fR if -\&\fIs\fR is lexicographically lower than \fIt\fR, a vlue of exactly \f(CW\*(C`0\*(C'\fR -if \fIs\fR and \fIt\fR are equal and a value greater than \f(CW\*(C`0\*(C'\fR if \fIs\fR is -lexicographically higher than \fIt\fR. Per default (\fImode\fR is \f(CW\*(C`0\*(C'\fR) the -comparison is case-sensitive, but if \f(CW\*(C`STR_NOCASE\*(C'\fR is used for \fImode\fR -the comparison is done in a case-insensitive way. -.Ip "char *\fBstr_span\fR(const char *\fIs\fR, size_t \fIn\fR, const char *\fIcharset\fR, int \fImode\fR);" 4 -.IX Item "char *str_span(const char *s, size_t n, const char *charset, int mode);" -This functions spans a string \fIs\fR according to the characters specified in -\&\fIcharset\fR. If \fImode\fR is \f(CW\*(C`0\*(C'\fR, this means that \fIs\fR is spanned from left to -right starting at \fIs\fR (and ending either when reaching the terminating \f(CW\*(C`NUL\*(C'\fR -character or already after \fIn\fR spanned characters) as long as the characters -of \fIs\fR are contained in \fIcharset\fR. -.Sp -Alternatively one can use a \fImode\fR of \f(CW\*(C`STR_COMPLEMENT\*(C'\fR to indicate that \fIs\fR -is spanned as long as the characters of \fIs\fR are \fInot\fR contained in -\&\fIcharset\fR, i.e., \fIcharset\fR then specifies the complement of the spanning -characters. -.Sp -In both cases one can additionally \*(L"or\*(R" (with the C operator ``\f(CW\*(C`|\*(C'\fR'') -\&\f(CW\*(C`STR_RIGHT\*(C'\fR into \fImode\fR to indicate that the spanning is done right to -left starting at the terminating \f(CW\*(C`NUL\*(C'\fR character of \fIs\fR (and ending -either when reaching \fIs\fR or already after \fIn\fR spanned characters). -.Ip "char *\fBstr_locate\fR(const char *\fIs\fR, str_size_t \fIn\fR, const char *\fIt\fR);" 4 -.IX Item "char *str_locate(const char *s, str_size_t n, const char *t);" -This functions searches for the (smaller) string \fIt\fR inside (larger) string -\&\fIs\fR. If \fIn\fR is not \f(CW\*(C`0\*(C'\fR, the search is performed only inside the first \fIn\fR -characters of \fIs\fR. -.Ip "char *\fBstr_token\fR(char **\fIs\fR, const char *\fIdelim\fR, const char *\fIquote\fR, const char *\fIcomment\fR, int \fImode\fR);" 4 -.IX Item "char *str_token(char **s, const char *delim, const char *quote, const char *comment, int mode);" -This function considers the string \fIs\fR to consist of a sequence of -zero or more text tokens separated by spans of one or more characters -from the separator string \fIdelim\fR. However, text between matched pairs -of quotemarks (characters in \fIquote\fR) is treated as plain text, never -as delimiter (separator) text. Each call of this function returns a -pointer to the first character of the first token of \fIs\fR. The token is -\&\f(CW\*(C`NUL\*(C'\fR\-terminated, i.e., the string \fIs\fR is processed in a destructive -way. If there are quotation marks or escape sequences, the input -string is rewritten with quoted sections and escape sequences properly -interpreted. -.Sp -This function keeps track of its parsing position in the string between -separate calls by simply adjusting the callers \fIs\fR pointer, so that -subsequent calls with the same pointer variable \fIs\fR will start -processing from the position immediately after the last returned token. -In this way subsequent calls will work through the string \fIs\fR until no -tokens remain. When no token remains in \fIs\fR, \f(CW\*(C`NULL\*(C'\fR is returned. The -string of token separators (\fIdelim\fR) and the string of quote characters -(\fIquote\fR) may be changed from call to call. -.Sp -If a character in the string \fIs\fR is not quoted or escaped, and is in the -\&\fIcomment\fR set, then it is overwritten with a \f(CW\*(C`NUL\*(C'\fR character and the rest of -the string is ignored. The characters to be used as quote characters are -specified in the \fIquote\fR set, and must be used in balanced pairs. If there -is more than one flavor of quote character, one kind of quote character may be -used to quote another kind. If an unbalanced quote is found, the function -silently act as if one had been placed at the end of the input string. The -\&\fIdelim\fR and \fIquote\fR strings must be disjoint, i.e., they have to share -no characters. -.Sp -The \fImode\fR argument can be used to modify the processing of the string -(default for \fImode\fR is \f(CW\*(C`0\*(C'\fR): \f(CW\*(C`STR_STRIPQUOTES\*(C'\fR forces \fIquote\fR -characters to be stripped from quoted tokens; \f(CW\*(C`STR_BACKSLASHESC\*(C'\fR -enables the interpretation (and expansion) of backslash escape sequences -(`\fB\ex\fR') through \s-1ANSI-C\s0 rules; \f(CW\*(C`STR_SKIPDELIMS\*(C'\fR forces that after the -terminating \f(CW\*(C`NUL\*(C'\fR is written and the token returned, further delimiters -are skipped (this allows one to make sure that the delimiters for -one word don't become part of the next word if one change delimiters -between calls); and \f(CW\*(C`STR_TRIGRAPHS\*(C'\fR enables the recognition and -expansion of \s-1ANSI\s0 C Trigraph sequences (as a side effect this enables -\&\f(CW\*(C`STR_BACKSLASHESC\*(C'\fR, too). -.Ip "int \fBstr_parse\fR(const char *\fIs\fR, const char *\fIpop\fR, ...);" 4 -.IX Item "int str_parse(const char *s, const char *pop, ...);" -This parses the string \fIs\fR according to the parsing operation specified -by \fIpop\fR. If the parsing operation succeeds, \f(CW\*(C`TRUE\*(C'\fR is returned. Else -\&\f(CW\*(C`FALSE\*(C'\fR is returned. -.Sp -The \fIpop\fR string usually has one of the following two syntax variants: -`\fBm\fR \fIdelim\fR \fIregex\fR \fIdelim\fR \fIflags\fR*' (for matching operations) -and `\fBs\fR \fIdelim\fR \fIregex\fR \fIdelim\fR \fIsubst\fR \fIdelim\fR \fIflags\fR*' (for -substitution operations). For more details about the syntax variants -and semantic of the \fIpop\fR argument see section \fB\s-1GORY\s0 \s-1DETAILS\s0, Parsing -Specification\fR below. The syntax of the \fIregex\fR part in \fIpop\fR is -mostly equivalent to Perl 5's regular expression syntax. For the -complete and gory details see \fIperlre\fR\|(1). A brief summary you can find -under section \fB\s-1GORY\s0 \s-1DETAILS\s0, Perl Regular Expressions\fR below. -.Ip "int \fBstr_format\fR(char *\fIs\fR, str_size_t \fIn\fR, const char *\fIfmt\fR, ...);" 4 -.IX Item "int str_format(char *s, str_size_t n, const char *fmt, ...);" -This formats a new string according to \fIfmt\fR and optionally following -arguments and writes it into the string \fIs\fR, but never more than \fIn\fR -characters at all. It returns the number of written characters. If \fIs\fR is -\&\f(CW\*(C`NULL\*(C'\fR it just calculates the number of characters which would be written. -.Sp -The function generates the output string under the control of the \fIfmt\fR -format string that specifies how subsequent arguments (or arguments accessed -via the variable-length argument facilities of \fIstdarg\fR\|(3)) are converted for -output. -.Sp -The format string \fIfmt\fR is composed of zero or more directives: -ordinary characters (not \fB%\fR), which are copied unchanged to the output -stream; and conversion specifications, each of which results in fetching -zero or more subsequent arguments. Each conversion specification is -introduced by the character \fB%\fR. The arguments must correspond properly -(after type promotion) with the conversion specifier. Which conversion -specifications are supported are described in detail under \fB\s-1GORY\s0 -\&\s-1DETAILS\s0, Format Specification\fR below. -.Ip "unsigned long \fBstr_hash\fR(const char *\fIs\fR, str_size_t \fIn\fR, int \fImode\fR);" 4 -.IX Item "unsigned long str_hash(const char *s, str_size_t n, int mode);" -This function calculates a hash value of string \fIs\fR (or of its first \fIn\fR -characters if \fIn\fR is equal to \f(CW\*(C`0\*(C'\fR). The following hashing functions -are supported and can be selected with \fImode\fR: \s-1STR_HASH_DJBX33\s0 (Daniel -J. Berstein, Times 33 Hash with Addition), \s-1STR_HASH_BJDDJ\s0 (Bob -Jenkins, Dr. Dobbs Journal), and \s-1STR_HASH_MACRC32\s0 (Mark Adler, Cyclic -Redundancy Check with 32\-Bit). This function is intended for fast use -in hashing algorithms and \fInot\fR for use as cryptographically strong -message digests. -.Ip "int \fBstr_base64\fR(char *\fIs\fR, str_size_t \fIn\fR, unsigned char *\fIucp\fR, str_size_t \fIucn\fR, int \fImode\fR);" 4 -.IX Item "int str_base64(char *s, str_size_t n, unsigned char *ucp, str_size_t ucn, int mode);" -This function Base64 encodes \fIucn\fR bytes starting at \fIucp\fR and writes -the resulting string into \fIs\fR (but never more than \fIn\fR characters are -written). The \fImode\fR for this operation has to be \f(CW\*(C`STR_BASE64_ENCODE\*(C'\fR. -Additionally one can \s-1OR\s0 the value \f(CW\*(C`STR_BASE64_STRICT\*(C'\fR to enable strict -encoding where after every 72th output character a newline character is -inserted. The function returns the number of output characters written. -If \fIs\fR is \f(CW\*(C`NULL\*(C'\fR the function just calculates the number of required -output characters. -.Sp -Alternatively, if \fImode\fR is \f(CW\*(C`STR_BASE64_DECODE\*(C'\fR the string \fIs\fR (or -the first \fIn\fR characters only if \fIn\fR is not \f(CW\*(C`0\*(C'\fR) is decoded and the -output bytes written at \fIucp\fR. Again, if \fIucp\fR is \f(CW\*(C`NULL\*(C'\fR only the -number of required output bytes are calculated. -.SH "GORY DETAILS" -.IX Header "GORY DETAILS" -In this part of the documentation more complex topics are documented in -detail. -.Sh "Perl Regular Expressions" -.IX Subsection "Perl Regular Expressions" -The regular expressions used in \fBStr\fR are more or less Perl compatible -(they are provided by a stripped down and built-in version of the -\&\fI\s-1PCRE\s0\fR library). So the syntax description in \fIperlre\fR\|(1) applies -and don't has to be repeated here again. For a deeper understanding -and details you should have a look at the book `\fIMastering Regular -Expressions\fR' (see also the \fIperlbook\fR\|(1) manpage) by \fIJeffrey Friedl\fR. -For convinience reasons we give you only a brief summary of Perl -compatible regular expressions: -.PP -The following metacharacters have their standard \fIegrep\fR\|(1) meanings: -.PP -.Vb 7 -\& \e Quote the next metacharacter -\& ^ Match the beginning of the line -\& . Match any character (except newline) -\& $ Match the end of the line (or before newline at the end) -\& | Alternation -\& () Grouping -\& [] Character class -.Ve -The following standard quantifiers are recognized: -.PP -.Vb 12 -\& * Match 0 or more times (greedy) -\& *? Match 0 or more times (non greedy) -\& + Match 1 or more times (greedy) -\& +? Match 1 or more times (non greedy) -\& ? Match 1 or 0 times (greedy) -\& ?? Match 1 or 0 times (non greedy) -\& {n} Match exactly n times (greedy) -\& {n}? Match exactly n times (non greedy) -\& {n,} Match at least n times (greedy) -\& {n,}? Match at least n times (non greedy) -\& {n,m} Match at least n but not more than m times (greedy) -\& {n,m}? Match at least n but not more than m times (non greedy) -.Ve -The following backslash sequences are recognized: -.PP -.Vb 15 -\& \et Tab (HT, TAB) -\& \en Newline (LF, NL) -\& \er Return (CR) -\& \ef Form feed (FF) -\& \ea Alarm (bell) (BEL) -\& \ee Escape (think troff) (ESC) -\& \e033 Octal char -\& \ex1B Hex char -\& \ec[ Control char -\& \el Lowercase next char -\& \eu Uppercase next char -\& \eL Lowercase till \eE -\& \eU Uppercase till \eE -\& \eE End case modification -\& \eQ Quote (disable) pattern metacharacters till \eE -.Ve -The following non zero-width assertions are recognized: -.PP -.Vb 6 -\& \ew Match a "word" character (alphanumeric plus "_") -\& \eW Match a non-word character -\& \es Match a whitespace character -\& \eS Match a non-whitespace character -\& \ed Match a digit character -\& \eD Match a non-digit character -.Ve -The following zero-width assertions are recognized: -.PP -.Vb 6 -\& \eb Match a word boundary -\& \eB Match a non-(word boundary) -\& \eA Match only at beginning of string -\& \eZ Match only at end of string, or before newline at the end -\& \ez Match only at end of string -\& \eG Match only where previous m//g left off (works only with /g) -.Ve -The following regular expression extensions are recognized: -.PP -.Vb 11 -\& (?#text) An embedded comment -\& (?:pattern) This is for clustering, not capturing (simple) -\& (?imsx-imsx:pattern) This is for clustering, not capturing (full) -\& (?=pattern) A zero-width positive lookahead assertion -\& (?!pattern) A zero-width negative lookahead assertion -\& (?<=pattern) A zero-width positive lookbehind assertion -\& (?pattern) An "independent" subexpression -\& (?(cond)yes-re) Conditional expression (simple) -\& (?(cond)yes-re|no-re) Conditional expression (full) -\& (?imsx-imsx) One or more embedded pattern-match modifiers -.Ve -.Sh "Parsing Specification" -.IX Subsection "Parsing Specification" -The \fBstr_parse\fR(const char *\fIs\fR, const char *\fIpop\fR, ...) function -is a very flexible but complex one. The argument \fIs\fR is the string on -which the parsing operation specified by argument \fIpop\fR is applied. -The parsing semantics are highly influenced by Perl's `\fB=~\fR' matching -operator, because one of the main goals of \fIstr_parse\fR\|(3) is to allow one -to rewrite typical Perl matching constructs into C. -.PP -Now to the gory details. In general, the \fIpop\fR argument of \fIstr_parse\fR\|(3) -has one of the following two syntax variants: -.Ip "\fBMatching:\fR `\fBm\fR \fIdelim\fR \fIregex\fR \fIdelim\fR \fIflags\fR*':" 4 -.IX Item "Matching: `m delim regex delim flags*':" -This matches \fIs\fR against the Perl-style regular expression \fIregex\fR -under the control of zero or more \fIflags\fR which control the parsing -semantics. The stripped down \fIpop\fR syntax `\fIregex\fR' is equivalent to -`\fBm/\fR\fIregex\fR\fB/\fR'. -.Sp -For each grouping pair of parenthesis in \fIregex\fR, the text in \fIs\fR -which was grouped by the parenthesis is extracted into new strings. -These per default are allocated as seperate strings and returned to the -caller through following `\fBchar **\fR' arguments. The caller is required -to \fIfree\fR\|(3) them later. -.Ip "\fBSubstitution:\fR `\fBs\fR \fIdelim\fR \fIregex\fR \fIdelim\fR \fIsubst\fR \fIdelim\fR \fIflags\fR*':" 4 -.IX Item "Substitution: `s delim regex delim subst delim flags*':" -This matches \fIs\fR against the Perl-style regular expression \fIregex\fR -under the control of zero or more \fIflags\fR which control the parsing -semantics. As a result of the operation, a new string formed which -consists of \fIs\fR but with the part which matched \fIregex\fR replaced by -\&\fIsubst\fR. The result string is returned to the caller through a `\fBchar -**\fR' argument. The caller is required to \fIfree\fR\|(3) this later. -.Sp -For each grouping pair of parenthesis in \fIregex\fR, the text in \fIs\fR -which was grouped by the parenthesis is extracted into new strings -and can be referenced for expansion via `\fB$n\fR' (n=1,..) in \fIsubst\fR. -Additionally any \fIstr_format\fR\|(3) style `\fB%\fR' constructs in \fIsubst\fR are -expanded through additional caller supplied arguments. -.PP -The following \fIflags\fR are supported: -.Ip "\fBb\fR" 4 -.IX Item "b" -If the \fIbundle\fR flag `\fBb\fR' is specified, the extracted strings are -bundled together into a single chunk of memory and its address is -returned to the caller with a additional `\fBchar **\fR' argument which has -to preceed the regular string arguments. The caller then has to \fIfree\fR\|(3) -only this chunk of memory in order to free all extracted strings at -once. -.Ip "\fBi\fR" 4 -.IX Item "i" -If the case-\fIinsensitive\fR flag `\fBi\fR' is specified, \fIregex\fR -is matched in case-insensitive way. -.Ip "\fBo\fR" 4 -.IX Item "o" -If the \fIonce\fR flag `\fBo\fR' is specified, this indicates to the \fBStr\fR -library that the whole \fIpop\fR string is constant and that its internal -pre-processing (it is compiled into a deterministic finite automaton -(\s-1DFA\s0) internally) has to be done only once (the \fBStr\fR library then -caches the \s-1DFA\s0 which corresponds to the \fIpop\fR argument). -.Ip "\fBx\fR" 4 -.IX Item "x" -If the \fIextended\fR flag `\fBx\fR' is specified, the \fIregex\fR's legibility -is extended by permitting embedded whitespace and comments to allow one -to write down complex regular expressions more cleary and even in a -documented way. -.Ip "\fBm\fR" 4 -.IX Item "m" -If the \fImultiple\fR lines flag `\fBm\fR' is specified, the string \fIs\fR is -treated as multiple lines. That is, this changes the regular expression -meta characters `\fB^\fR' and `\fB$\fR' from matching at only the very start -or end of the string \fIs\fR to the start or end of any line anywhere -within the string \fIs\fR. -.Ip "\fBs\fR" 4 -.IX Item "s" -If the \fIsingle\fR line flag `\fBs\fR' is specified, the string \fIs\fR is -treated as single line. That is, this changes the regular expression -meta character `\fB.\fR' to match any character whatsoever, even a newline, -which it normally would not match. -.SH "CONVERSION SPECIFICATION" -.IX Header "CONVERSION SPECIFICATION" -In the format string of \fIstr_format\fR\|(3) each conversion specification is -introduced by the character \fB%\fR. After the \fB%\fR, the following appear -in sequence: -.Ip "o" 4 -An optional field, consisting of a decimal digit string followed by a \fB$\fR, -specifying the next argument to access. If this field is not provided, the -argument following the last argument accessed will be used. Arguments are -numbered starting at \fB1\fR. If unaccessed arguments in the format string are -interspersed with ones that are accessed the results will be indeterminate. -.Ip "o" 4 -Zero or more of the following flags: -.Sp -A \fB#\fR character specifying that the value should be converted to an -``alternate form''. For \fBc\fR, \fBd\fR, \fBi\fR, \fBn\fR, \fBp\fR, \fBs\fR, and \fBu\fR, -conversions, this option has no effect. For \fBo\fR conversions, the precision -of the number is increased to force the first character of the output string -to a zero (except if a zero value is printed with an explicit precision of -zero). For \fBx\fR and \fBX\fR conversions, a non-zero result has the string \fB0x\fR -(or \fB0X\fR for \fBX\fR conversions) prepended to it. For \fBe\fR, \fBE\fR, \fBf\fR, \fBg\fR, -and \fBG\fR, conversions, the result will always contain a decimal point, even if -no digits follow it (normally, a decimal point appears in the results of those -conversions only if a digit follows). For \fBg\fR and \fBG\fR conversions, trailing -zeros are not removed from the result as they would otherwise be. -.Sp -A zero `\fB0\fR' character specifying zero padding. For all conversions except -\&\fBn\fR, the converted value is padded on the left with zeros rather than blanks. -If a precision is given with a numeric conversion (\fBd\fR, \fBi\fR, \fBo\fR, \fBu\fR, -\&\fBi\fR, \fBx\fR, and \fBX\fR), the `\fB0\fR' flag is ignored. -.Sp -A negative field width flag `\fB-\fR' indicates the converted value is to be left -adjusted on the field boundary. Except for \fBn\fR conversions, the converted -value is padded on the right with blanks, rather than on the left with blanks -or zeros. A `\fB-\fR' overrides a `\fB0\fR' if both are given. -.Sp -A space, specifying that a blank should be left before a positive number -produced by a signed conversion (\fBd\fR, \fBe\fR, \fBE\fR, \fBf\fR, \fBg\fR, \fBG\fR, or \fBi\fR). -.Sp -A `\fB+\fR' character specifying that a sign always be placed before a number -produced by a signed conversion. A `\fB+\fR' overrides a space if both are used. -.Ip "o" 4 -An optional decimal digit string specifying a minimum field width. -If the converted value has fewer characters than the field width, it will -be padded with spaces on the left (or right, if the left-adjustment -flag has been given) to fill out -the field width. -.Ip "o" 4 -An optional precision, in the form of a period `\fB.\fR' followed by an -optional digit string. If the digit string is omitted, the precision is -taken as zero. This gives the minimum number of digits to appear for -\&\fBd\fR, \fBi\fR, \fBo\fR, \fBu\fR, \fBx\fR, and \fBX\fR conversions, the number of digits -to appear after the decimal-point for \fBe\fR, \fBE\fR, and \fBf\fR conversions, -the maximum number of significant digits for \fBg\fR and \fBG\fR conversions, -or the maximum number of characters to be printed from a string for \fBs\fR -conversions. -.Ip "o" 4 -The optional character \fBh\fR, specifying that a following \fBd\fR, \fBi\fR, \fBo\fR, -\&\fBu\fR, \fBx\fR, or \fBX\fR conversion corresponds to a `\f(CW\*(C`short int\*(C'\fR' or `\f(CW\*(C`unsigned -short int\*(C'\fR' argument, or that a following \fBn\fR conversion corresponds to a -pointer to a `\f(CW\*(C`short int\*(C'\fR argument. -.Ip "o" 4 -The optional character \fBl\fR (ell) specifying that a following \fBd\fR, \fBi\fR, -\&\fBo\fR, \fBu\fR, \fBx\fR, or \fBX\fR conversion applies to a pointer to a `\f(CW\*(C`long int\*(C'\fR' -or `\f(CW\*(C`unsigned long int\*(C'\fR' argument, or that a following \fBn\fR conversion -corresponds to a pointer to a `\f(CW\*(C`long int\*(C'\fR argument. -.Ip "o" 4 -The optional character \fBq\fR, specifying that a following \fBd\fR, \fBi\fR, \fBo\fR, -\&\fBu\fR, \fBx\fR, or \fBX\fR conversion corresponds to a `\f(CW\*(C`quad int\*(C'\fR' or `\f(CW\*(C`unsigned -quad int\*(C'\fR' argument, or that a following \fBn\fR conversion corresponds to a -pointer to a `\f(CW\*(C`quad int\*(C'\fR' argument. -.Ip "o" 4 -The character \fBL\fR specifying that a following \fBe\fR, \fBE\fR, \fBf\fR, \fBg\fR, or \fBG\fR -conversion corresponds to a `\f(CW\*(C`long double\*(C'\fR' argument. -.Ip "o" 4 -A character that specifies the type of conversion to be applied. -.PP -A field width or precision, or both, may be indicated by an asterisk `\fB*\fR' or -an asterisk followed by one or more decimal digits and a `\fB$\fR' instead of a -digit string. In this case, an `\f(CW\*(C`int\*(C'\fR' argument supplies the field width or -precision. A negative field width is treated as a left adjustment flag -followed by a positive field width; a negative precision is treated as though -it were missing. If a single format directive mixes positional (`\fBnn$\fR') and -non-positional arguments, the results are undefined. -.PP -The conversion specifiers and their meanings are: -.Ip "\fBdiouxX\fR" 4 -.IX Item "diouxX" -The `\f(CW\*(C`int\*(C'\fR' (or appropriate variant) argument is converted to signed decimal -(\fBd\fR and \fBi\fR), unsigned octal (\fBo\fR), unsigned decimal (\fBu\fR), or unsigned -hexadecimal (\fBx\fR and \fBX\fR) notation. The letters \fBabcdef\fR are used for \fBx\fR -conversions; the letters \fB\s-1ABCDEF\s0\fR are used for \fBX\fR conversions. The -precision, if any, gives the minimum number of digits that must appear; if the -converted value requires fewer digits, it is padded on the left with zeros. -.Ip "\fB\s-1DOU\s0\fR" 4 -.IX Item "DOU" -The `\f(CW\*(C`long int\*(C'\fR argument is converted to signed decimal, unsigned octal, or -unsigned decimal, as if the format had been \fBld\fR, \fBlo\fR, or \fBlu\fR -respectively. These conversion characters are deprecated, and will eventually -disappear. -.Ip "\fBeE\fR" 4 -.IX Item "eE" -The `\f(CW\*(C`double\*(C'\fR' argument is rounded and converted in the style -`[\-]d.ddd\fBe\fR+\-dd' where there is one digit before the decimal-point character -and the number of digits after it is equal to the precision; if the precision -is missing, it is taken as 6; if the precision is zero, no decimal-point -character appears. An \fBE\fR conversion uses the letter \fBE\fR (rather than \fBe\fR) -to introduce the exponent. The exponent always contains at least two digits; -if the value is zero, the exponent is 00. -.Ip "\fBf\fR" 4 -.IX Item "f" -The `\f(CW\*(C`double\*(C'\fR' argument is rounded and converted to decimal notation in the -style `[\-]ddd.ddd>' where the number of digits after the decimal-point -character is equal to the precision specification. If the precision is -missing, it is taken as 6; if the precision is explicitly zero, no -decimal-point character appears. If a decimal point appears, at least one -digit appears before it. -.Ip "\fBg\fR" 4 -.IX Item "g" -The `\f(CW\*(C`double\*(C'\fR' argument is converted in style \fBf\fR or \fBe\fR (or \fBE\fR for \fBG\fR -conversions). The precision specifies the number of significant digits. If -the precision is missing, 6 digits are given; if the precision is zero, it is -treated as 1. Style \fBe\fR is used if the exponent from its conversion is less -than \-4 or greater than or equal to the precision. Trailing zeros are removed -from the fractional part of the result; a decimal point appears only if it is -followed by at least one digit. -.Ip "\fBc\fR" 4 -.IX Item "c" -The `\f(CW\*(C`int\*(C'\fR' argument is converted to an `\f(CW\*(C`unsigned char\*(C'\fR, and the resulting -character is written. -.Ip "\fBs\fR" 4 -.IX Item "s" -The `\f(CW\*(C`char *\*(C'\fR' argument is expected to be a pointer to an array of character -type (pointer to a string). Characters from the array are written up to (but -not including) a terminating \f(CW\*(C`NUL\*(C'\fR character; if a precision is specified, no -more than the number specified are written. If a precision is given, no null -character need be present; if the precision is not specified, or is greater -than the size of the array, the array must contain a terminating \f(CW\*(C`NUL\*(C'\fR -character. -.Ip "\fBp\fR" 4 -.IX Item "p" -The `\f(CW\*(C`void *\*(C'\fR pointer argument is printed in hexadecimal (as if by `\fB%#x\fR' -or `\f(CW\*(C`%#lx\*(C'\fR). -.Ip "\fBn\fR" 4 -.IX Item "n" -The number of characters written so far is stored into the integer indicated -by the `\f(CW\*(C`int *\*(C'\fR' (or variant) pointer argument. No argument is converted. -.Ip "\fB%\fR" 4 -.IX Item "%" -A `\fB%\fR' is written. No argument is converted. The complete conversion -specification is `\fB%%\fR. -.PP -In no case does a non-existent or small field width cause truncation of a -field; if the result of a conversion is wider than the field width, the field -is expanded to contain the conversion result. -.SH "EXAMPLES" -.IX Header "EXAMPLES" -In the following a few snippets of selected use cases of \fBStr\fR are -presented: -.Ip "\fBSplice a String into Another\fR" 4 -.IX Item "Splice a String into Another" -.Vb 5 -\& char *v1 = "foo bar quux"; -\& char *v2 = "baz"; -\& str_splice(v1, 3, 5, v2, 0): -\& /* now we have v1 = "foobazquux" */ -\& .... -.Ve -.Ip "\fBTokenize a String\fR" 4 -.IX Item "Tokenize a String" -.Vb 10 -\& char *var = " foo \et " bar 'baz'" q'uu'x #comment"; -\& char *tok, *p; -\& p = var; -\& while ((tok = str_token(p, ":", "\e"'", "#", 0)) != NULL) { -\& /* here we enter three times: -\& 1. tok = "foo" -\& 2. tok = " bar 'baz'" -\& 3. tok = "quux" */ -\& ... -\& } -.Ve -.Ip "\fBMatch a String\fR" 4 -.IX Item "Match a String" -.Vb 5 -\& char *var = "foo:bar"; -\& if (str_parse(var, "^.+?:.+$/)) { -\& /* var matched */ -\& ... -\& } -.Ve -.Ip "\fBMatch a String and Go Ahead with Details\fR" 4 -.IX Item "Match a String and Go Ahead with Details" -.Vb 10 -\& char *var = "foo:bar"; -\& char *cp, *v1, *v2; -\& if (str_parse(var, "m/^(.+?):(.+)$/b", &cp, &v1, &v2)) { -\& ... -\& /* now we have: -\& cp = "foo\e0bar\e0" and v1 and v2 pointing -\& into it, i.e., v1 = "foo", v2 = "bar" */ -\& ... -\& free(cp); -\& } -.Ve -.Ip "\fBSubstitute Text in a String\fR" 4 -.IX Item "Substitute Text in a String" -.Vb 8 -\& char *var = "foo:bar"; -\& char *subst = "quux"; -\& char *new; -\& str_parse(var, "s/^(.+?):(.+)$/$1-%s-$2/", &new, subst); -\& ... -\& /* now we have: var = "foo:bar", new = "foo:quux:bar" */ -\& ... -\& free(new); -.Ve -.Ip "\fBFormat a String\fR" 4 -.IX Item "Format a String" -.Vb 6 -\& char *v0 = "abc..."; /* length not guessable */ -\& char *v1 = "foo"; -\& void *v2 = 0xDEAD; -\& int v3 = 42; -\& char *cp; -\& int n; -.Ve -.Vb 6 -\& n = str_format(NULL, 0, "%s|%5s-%x-%04d", v0, v1, v2, v3); -\& cp = malloc(n); -\& str_format(cp, n, "%s-%x-%04d", v1, v2, v3); -\& /* now we have cp = "abc...| foo-DEAD-0042" */ -\& ... -\& free(cp); -.Ve -.SH "SEE ALSO" -.IX Header "SEE ALSO" -\&\fIstring\fR\|(3), \fIprintf\fR\|(3), \fIperlre\fR\|(1). -.SH "HISTORY" -.IX Header "HISTORY" -The \fBStr\fR library was written in November and December 1999 by Ralf -S. Engelschall. As building blocks various existing code was used and -recycled: for the \fIstr_token\fR\|(3) implementation an anchient \fIstrtok\fR\|(3) -flavor from William Deich 1991 was cleaned up and adjusted. As the -background parsing engine for \fIstr_parse\fR\|(3) a heavily stripped down -version of Philip Hazel's \s-1PCRE\s0 2.08 library was used. The \fIstr_format\fR\|(3) -implementation was based on Panos Tsirigotis' \fIsprintf\fR\|(3) code as -adjusted by the Apache Software Foundation 1998. The formatting engine -was stripped down and enhanced to support internal extensions which were -required by \fIstr_format\fR\|(3) and \fIstr_parse\fR\|(3). -.SH "AUTHOR" -.IX Header "AUTHOR" -.Vb 3 -\& Ralf S. Engelschall -\& rse@engelschall.com -\& www.engelschall.com -.Ve Index: ossp-pkg/l2/l2.pod ============================================================ $ cvs diff -u -r1.1.1.1 -r1.2 l2.pod --- ossp-pkg/l2/l2.pod 2001/05/10 19:46:01 1.1.1.1 +++ ossp-pkg/l2/l2.pod 2001/05/10 20:00:31 1.2 @@ -1,9 +1,10 @@ ## -## Str - String Library -## Copyright (c) 1999-2000 Ralf S. Engelschall +## L2 - OSSP Logging Library +## Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) +## Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) ## -## This file is part of Str, a string handling and manipulation -## library which can be found at http://www.engelschall.com/sw/str/. +## This file is part of OSSP L2, a flexible logging library which +## can be found at http://www.ossp.com/pkg/l2/. ## ## Permission to use, copy, modify, and distribute this software for ## any purpose with or without fee is hereby granted, provided that @@ -22,750 +23,31 @@ ## 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. +## +## l2.pod: Unix manual page ## -## str.pod: Unix manual page -## - -# Parts of this manual page (the str_format description) is: -# -# Copyright (c) 1990, 1991, 1993 -# The Regents of the University of California. All rights reserved. -# -# This code is derived from software contributed to Berkeley by -# Chris Torek and the American National Standards Committee X3, -# on Information Processing Systems. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. All advertising materials mentioning features or use of this software -# must display the following acknowledgement: -# This product includes software developed by the University of -# California, Berkeley and its contributors. -# 4. Neither the name of the University nor the names of its contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -# SUCH DAMAGE. =pod =head1 NAME -B - String Library +B - Logging Library =head1 VERSION -Str STR_VERSION_STR +L2 L2_VERSION_STR =head1 SYNOPSIS -B, -B, -B, -B, -B, -B, -B, -B, -B, -B, -B, -B, -B. +... =head1 DESCRIPTION -The B library is a generic string library written in ANSI C which -provides functions for handling, matching, parsing, searching and -formatting of C strings. So it can be considered as a superset of POSIX -string(3), but its main intention is to provide a more convinient and -compact API plus a more generalized functionality. +The B library is... =head1 FUNCTIONS The following functions are provided by the B API: - -=over 4 - -=item str_size_t B(const char *I); - -This function determines the length of string I, i.e., the number -of characters starting at I that precede the terminating C -character. It returns C if I is C. - -=item char *B(char *I, const char *I, size_t I); - -This copies the characters in string I into the string I, but never more -than I characters (if I is greater than C<0>). The two involved strings -can overlap and the characters in I are always C-terminated. The -string I has to be large enough to hold all characters to be copied. -function returns C if I or I are C. Else it returns the -pointer to the written C-terminating character in I. - -=item char *B(const char *I, str_size_t I); - -This returns a copy of the characters in string I, but never more than I -characters if I is greater than C<0>. It returns C if I is -C. The returned string has to be deallocated later with free(3). - -=item char *B(char *I, ...); - -This functions concatenates the characters of all string arguments into a new -allocated string and returns this new string. If I is C the function -returns C. Else it returns the pointer to the written final -C-terminating character in I. The returned string later has to be -deallicated with free(3). - -=item char *B(char *I, str_size_t I, str_size_t I, char *I, str_size_t I); - -This splices the string I into string I, i.e., the I characters -at offset I in I are removed and at their location the string -I is inserted (or just the first I characters of I if I is -greater than C<0>). It returns C if I or I are C. -Else the string I is returned. The function supports also the -situation where I is a sub-string of I as long as the area -I...I and I...I do not overlap. The caller -always has to make sure that enough room exists in I. - -=item int B(const char *I, const char *I, str_size_t I, int I); - -This performs a lexicographical comparison of the two strings I -and I (but never compares more than I characters of them) -and returns one of three return values: a value lower than C<0> if -I is lexicographically lower than I, a vlue of exactly C<0> -if I and I are equal and a value greater than C<0> if I is -lexicographically higher than I. Per default (I is C<0>) the -comparison is case-sensitive, but if C is used for I -the comparison is done in a case-insensitive way. - -=item char *B(const char *I, size_t I, const char *I, int I); - -This functions spans a string I according to the characters specified in -I. If I is C<0>, this means that I is spanned from left to -right starting at I (and ending either when reaching the terminating C -character or already after I spanned characters) as long as the characters -of I are contained in I. - -Alternatively one can use a I of C to indicate that I -is spanned as long as the characters of I are I contained in -I, i.e., I then specifies the complement of the spanning -characters. - -In both cases one can additionally "or" (with the C operator ``C<|>'') -C into I to indicate that the spanning is done right to -left starting at the terminating C character of I (and ending -either when reaching I or already after I spanned characters). - -=item char *B(const char *I, str_size_t I, const char *I); - -This functions searches for the (smaller) string I inside (larger) string -I. If I is not C<0>, the search is performed only inside the first I -characters of I. - -=item char *B(char **I, const char *I, const char *I, const char *I, int I); - -This function considers the string I to consist of a sequence of -zero or more text tokens separated by spans of one or more characters -from the separator string I. However, text between matched pairs -of quotemarks (characters in I) is treated as plain text, never -as delimiter (separator) text. Each call of this function returns a -pointer to the first character of the first token of I. The token is -C-terminated, i.e., the string I is processed in a destructive -way. If there are quotation marks or escape sequences, the input -string is rewritten with quoted sections and escape sequences properly -interpreted. - -This function keeps track of its parsing position in the string between -separate calls by simply adjusting the callers I pointer, so that -subsequent calls with the same pointer variable I will start -processing from the position immediately after the last returned token. -In this way subsequent calls will work through the string I until no -tokens remain. When no token remains in I, C is returned. The -string of token separators (I) and the string of quote characters -(I) may be changed from call to call. - -If a character in the string I is not quoted or escaped, and is in the -I set, then it is overwritten with a C character and the rest of -the string is ignored. The characters to be used as quote characters are -specified in the I set, and must be used in balanced pairs. If there -is more than one flavor of quote character, one kind of quote character may be -used to quote another kind. If an unbalanced quote is found, the function -silently act as if one had been placed at the end of the input string. The -I and I strings must be disjoint, i.e., they have to share -no characters. - -The I argument can be used to modify the processing of the string -(default for I is C<0>): C forces I -characters to be stripped from quoted tokens; C -enables the interpretation (and expansion) of backslash escape sequences -(`B<\x>') through ANSI-C rules; C forces that after the -terminating C is written and the token returned, further delimiters -are skipped (this allows one to make sure that the delimiters for -one word don't become part of the next word if one change delimiters -between calls); and C enables the recognition and -expansion of ANSI C Trigraph sequences (as a side effect this enables -C, too). - -=item int B(const char *I, const char *I, ...); - -This parses the string I according to the parsing operation specified -by I. If the parsing operation succeeds, C is returned. Else -C is returned. - -The I string usually has one of the following two syntax variants: -`B I I I I*' (for matching operations) -and `B I I I I I I*' (for -substitution operations). For more details about the syntax variants -and semantic of the I argument see section B below. The syntax of the I part in I is -mostly equivalent to Perl 5's regular expression syntax. For the -complete and gory details see perlre(1). A brief summary you can find -under section B below. - -=item int B(char *I, str_size_t I, const char *I, ...); - -This formats a new string according to I and optionally following -arguments and writes it into the string I, but never more than I -characters at all. It returns the number of written characters. If I is -C it just calculates the number of characters which would be written. - -The function generates the output string under the control of the I -format string that specifies how subsequent arguments (or arguments accessed -via the variable-length argument facilities of stdarg(3)) are converted for -output. - -The format string I is composed of zero or more directives: -ordinary characters (not B<%>), which are copied unchanged to the output -stream; and conversion specifications, each of which results in fetching -zero or more subsequent arguments. Each conversion specification is -introduced by the character B<%>. The arguments must correspond properly -(after type promotion) with the conversion specifier. Which conversion -specifications are supported are described in detail under B below. - -=item unsigned long B(const char *I, str_size_t I, int I); - -This function calculates a hash value of string I (or of its first I -characters if I is equal to C<0>). The following hashing functions -are supported and can be selected with I: STR_HASH_DJBX33 (Daniel -J. Berstein, Times 33 Hash with Addition), STR_HASH_BJDDJ (Bob -Jenkins, Dr. Dobbs Journal), and STR_HASH_MACRC32 (Mark Adler, Cyclic -Redundancy Check with 32-Bit). This function is intended for fast use -in hashing algorithms and I for use as cryptographically strong -message digests. - -=item int B(char *I, str_size_t I, unsigned char *I, str_size_t I, int I); - -This function Base64 encodes I bytes starting at I and writes -the resulting string into I (but never more than I characters are -written). The I for this operation has to be C. -Additionally one can OR the value C to enable strict -encoding where after every 72th output character a newline character is -inserted. The function returns the number of output characters written. -If I is C the function just calculates the number of required -output characters. - -Alternatively, if I is C the string I (or -the first I characters only if I is not C<0>) is decoded and the -output bytes written at I. Again, if I is C only the -number of required output bytes are calculated. - -=back - -=head1 GORY DETAILS - -In this part of the documentation more complex topics are documented in -detail. - -=head2 Perl Regular Expressions - -The regular expressions used in B are more or less Perl compatible -(they are provided by a stripped down and built-in version of the -I library). So the syntax description in perlre(1) applies -and don't has to be repeated here again. For a deeper understanding -and details you should have a look at the book `I' (see also the perlbook(1) manpage) by I. -For convinience reasons we give you only a brief summary of Perl -compatible regular expressions: - -The following metacharacters have their standard egrep(1) meanings: - - \ Quote the next metacharacter - ^ Match the beginning of the line - . Match any character (except newline) - $ Match the end of the line (or before newline at the end) - | Alternation - () Grouping - [] Character class - -The following standard quantifiers are recognized: - - * Match 0 or more times (greedy) - *? Match 0 or more times (non greedy) - + Match 1 or more times (greedy) - +? Match 1 or more times (non greedy) - ? Match 1 or 0 times (greedy) - ?? Match 1 or 0 times (non greedy) - {n} Match exactly n times (greedy) - {n}? Match exactly n times (non greedy) - {n,} Match at least n times (greedy) - {n,}? Match at least n times (non greedy) - {n,m} Match at least n but not more than m times (greedy) - {n,m}? Match at least n but not more than m times (non greedy) - -The following backslash sequences are recognized: - - \t Tab (HT, TAB) - \n Newline (LF, NL) - \r Return (CR) - \f Form feed (FF) - \a Alarm (bell) (BEL) - \e Escape (think troff) (ESC) - \033 Octal char - \x1B Hex char - \c[ Control char - \l Lowercase next char - \u Uppercase next char - \L Lowercase till \E - \U Uppercase till \E - \E End case modification - \Q Quote (disable) pattern metacharacters till \E - -The following non zero-width assertions are recognized: - - \w Match a "word" character (alphanumeric plus "_") - \W Match a non-word character - \s Match a whitespace character - \S Match a non-whitespace character - \d Match a digit character - \D Match a non-digit character - -The following zero-width assertions are recognized: - - \b Match a word boundary - \B Match a non-(word boundary) - \A Match only at beginning of string - \Z Match only at end of string, or before newline at the end - \z Match only at end of string - \G Match only where previous m//g left off (works only with /g) - -The following regular expression extensions are recognized: - - (?#text) An embedded comment - (?:pattern) This is for clustering, not capturing (simple) - (?imsx-imsx:pattern) This is for clustering, not capturing (full) - (?=pattern) A zero-width positive lookahead assertion - (?!pattern) A zero-width negative lookahead assertion - (?<=pattern) A zero-width positive lookbehind assertion - (?pattern) An "independent" subexpression - (?(cond)yes-re) Conditional expression (simple) - (?(cond)yes-re|no-re) Conditional expression (full) - (?imsx-imsx) One or more embedded pattern-match modifiers - -=head2 Parsing Specification - -The B(const char *I, const char *I, ...) function -is a very flexible but complex one. The argument I is the string on -which the parsing operation specified by argument I is applied. -The parsing semantics are highly influenced by Perl's `B<=~>' matching -operator, because one of the main goals of str_parse(3) is to allow one -to rewrite typical Perl matching constructs into C. - -Now to the gory details. In general, the I argument of str_parse(3) -has one of the following two syntax variants: - -=over 4 - -=item B `B I I I I*': - -This matches I against the Perl-style regular expression I -under the control of zero or more I which control the parsing -semantics. The stripped down I syntax `I' is equivalent to -`BIB'. - -For each grouping pair of parenthesis in I, the text in I -which was grouped by the parenthesis is extracted into new strings. -These per default are allocated as seperate strings and returned to the -caller through following `B' arguments. The caller is required -to free(3) them later. - -=item B `B I I I I I I*': - -This matches I against the Perl-style regular expression I -under the control of zero or more I which control the parsing -semantics. As a result of the operation, a new string formed which -consists of I but with the part which matched I replaced by -I. The result string is returned to the caller through a `B' argument. The caller is required to free(3) this later. - -For each grouping pair of parenthesis in I, the text in I -which was grouped by the parenthesis is extracted into new strings -and can be referenced for expansion via `B<$n>' (n=1,..) in I. -Additionally any str_format(3) style `B<%>' constructs in I are -expanded through additional caller supplied arguments. - -=back - -The following I are supported: - -=over 4 - -=item B - -If the I flag `B' is specified, the extracted strings are -bundled together into a single chunk of memory and its address is -returned to the caller with a additional `B' argument which has -to preceed the regular string arguments. The caller then has to free(3) -only this chunk of memory in order to free all extracted strings at -once. - -=item B - -If the case-I flag `B' is specified, I -is matched in case-insensitive way. - -=item B - -If the I flag `B' is specified, this indicates to the B -library that the whole I string is constant and that its internal -pre-processing (it is compiled into a deterministic finite automaton -(DFA) internally) has to be done only once (the B library then -caches the DFA which corresponds to the I argument). - -=item B - -If the I flag `B' is specified, the I's legibility -is extended by permitting embedded whitespace and comments to allow one -to write down complex regular expressions more cleary and even in a -documented way. - -=item B - -If the I lines flag `B' is specified, the string I is -treated as multiple lines. That is, this changes the regular expression -meta characters `B<^>' and `B<$>' from matching at only the very start -or end of the string I to the start or end of any line anywhere -within the string I. - -=item B - -If the I line flag `B' is specified, the string I is -treated as single line. That is, this changes the regular expression -meta character `B<.>' to match any character whatsoever, even a newline, -which it normally would not match. - -=back - - -=head1 CONVERSION SPECIFICATION - -In the format string of str_format(3) each conversion specification is -introduced by the character B<%>. After the B<%>, the following appear -in sequence: - -=over 4 - -=item o - -An optional field, consisting of a decimal digit string followed by a B<$>, -specifying the next argument to access. If this field is not provided, the -argument following the last argument accessed will be used. Arguments are -numbered starting at B<1>. If unaccessed arguments in the format string are -interspersed with ones that are accessed the results will be indeterminate. - -=item o - -Zero or more of the following flags: - -A B<#> character specifying that the value should be converted to an -``alternate form''. For B, B, B, B, B

, B, and B, -conversions, this option has no effect. For B conversions, the precision -of the number is increased to force the first character of the output string -to a zero (except if a zero value is printed with an explicit precision of -zero). For B and B conversions, a non-zero result has the string B<0x> -(or B<0X> for B conversions) prepended to it. For B, B, B, B, -and B, conversions, the result will always contain a decimal point, even if -no digits follow it (normally, a decimal point appears in the results of those -conversions only if a digit follows). For B and B conversions, trailing -zeros are not removed from the result as they would otherwise be. - -A zero `B<0>' character specifying zero padding. For all conversions except -B, the converted value is padded on the left with zeros rather than blanks. -If a precision is given with a numeric conversion (B, B, B, B, -B, B, and B), the `B<0>' flag is ignored. - -A negative field width flag `B<->' indicates the converted value is to be left -adjusted on the field boundary. Except for B conversions, the converted -value is padded on the right with blanks, rather than on the left with blanks -or zeros. A `B<->' overrides a `B<0>' if both are given. - -A space, specifying that a blank should be left before a positive number -produced by a signed conversion (B, B, B, B, B, B, or B). - -A `B<+>' character specifying that a sign always be placed before a number -produced by a signed conversion. A `B<+>' overrides a space if both are used. - -=item o - -An optional decimal digit string specifying a minimum field width. -If the converted value has fewer characters than the field width, it will -be padded with spaces on the left (or right, if the left-adjustment -flag has been given) to fill out -the field width. - -=item o - -An optional precision, in the form of a period `B<.>' followed by an -optional digit string. If the digit string is omitted, the precision is -taken as zero. This gives the minimum number of digits to appear for -B, B, B, B, B, and B conversions, the number of digits -to appear after the decimal-point for B, B, and B conversions, -the maximum number of significant digits for B and B conversions, -or the maximum number of characters to be printed from a string for B -conversions. - -=item o - -The optional character B, specifying that a following B, B, B, -B, B, or B conversion corresponds to a `C' or `C' argument, or that a following B conversion corresponds to a -pointer to a `C argument. - -=item o - -The optional character B (ell) specifying that a following B, B, -B, B, B, or B conversion applies to a pointer to a `C' -or `C' argument, or that a following B conversion -corresponds to a pointer to a `C argument. - -=item o - -The optional character B, specifying that a following B, B, B, -B, B, or B conversion corresponds to a `C' or `C' argument, or that a following B conversion corresponds to a -pointer to a `C' argument. - -=item o - -The character B specifying that a following B, B, B, B, or B -conversion corresponds to a `C' argument. - -=item o - -A character that specifies the type of conversion to be applied. - -=back - -A field width or precision, or both, may be indicated by an asterisk `B<*>' or -an asterisk followed by one or more decimal digits and a `B<$>' instead of a -digit string. In this case, an `C' argument supplies the field width or -precision. A negative field width is treated as a left adjustment flag -followed by a positive field width; a negative precision is treated as though -it were missing. If a single format directive mixes positional (`B') and -non-positional arguments, the results are undefined. - -The conversion specifiers and their meanings are: - -=over 4 - -=item B - -The `C' (or appropriate variant) argument is converted to signed decimal -(B and B), unsigned octal (B), unsigned decimal (B), or unsigned -hexadecimal (B and B) notation. The letters B are used for B -conversions; the letters B are used for B conversions. The -precision, if any, gives the minimum number of digits that must appear; if the -converted value requires fewer digits, it is padded on the left with zeros. - -=item B - -The `C argument is converted to signed decimal, unsigned octal, or -unsigned decimal, as if the format had been B, B, or B -respectively. These conversion characters are deprecated, and will eventually -disappear. - -=item B - -The `C' argument is rounded and converted in the style -`[-]d.dddB+-dd' where there is one digit before the decimal-point character -and the number of digits after it is equal to the precision; if the precision -is missing, it is taken as 6; if the precision is zero, no decimal-point -character appears. An B conversion uses the letter B (rather than B) -to introduce the exponent. The exponent always contains at least two digits; -if the value is zero, the exponent is 00. - -=item B - -The `C' argument is rounded and converted to decimal notation in the -style `[-]ddd.ddd>' where the number of digits after the decimal-point -character is equal to the precision specification. If the precision is -missing, it is taken as 6; if the precision is explicitly zero, no -decimal-point character appears. If a decimal point appears, at least one -digit appears before it. - -=item B - -The `C' argument is converted in style B or B (or B for B -conversions). The precision specifies the number of significant digits. If -the precision is missing, 6 digits are given; if the precision is zero, it is -treated as 1. Style B is used if the exponent from its conversion is less -than -4 or greater than or equal to the precision. Trailing zeros are removed -from the fractional part of the result; a decimal point appears only if it is -followed by at least one digit. - -=item B - -The `C' argument is converted to an `C, and the resulting -character is written. - -=item B - -The `C' argument is expected to be a pointer to an array of character -type (pointer to a string). Characters from the array are written up to (but -not including) a terminating C character; if a precision is specified, no -more than the number specified are written. If a precision is given, no null -character need be present; if the precision is not specified, or is greater -than the size of the array, the array must contain a terminating C -character. - -=item B

- -The `C pointer argument is printed in hexadecimal (as if by `B<%#x>' -or `C<%#lx>). - -=item B - -The number of characters written so far is stored into the integer indicated -by the `C' (or variant) pointer argument. No argument is converted. - -=item B<%> - -A `B<%>' is written. No argument is converted. The complete conversion -specification is `B<%%>. - -=back - -In no case does a non-existent or small field width cause truncation of a -field; if the result of a conversion is wider than the field width, the field -is expanded to contain the conversion result. - -=head1 EXAMPLES - -In the following a few snippets of selected use cases of B are -presented: - -=over 4 - -=item B - - char *v1 = "foo bar quux"; - char *v2 = "baz"; - str_splice(v1, 3, 5, v2, 0): - /* now we have v1 = "foobazquux" */ - .... - -=item B - - char *var = " foo \t " bar 'baz'" q'uu'x #comment"; - char *tok, *p; - p = var; - while ((tok = str_token(p, ":", "\"'", "#", 0)) != NULL) { - /* here we enter three times: - 1. tok = "foo" - 2. tok = " bar 'baz'" - 3. tok = "quux" */ - ... - } - -=item B - - char *var = "foo:bar"; - if (str_parse(var, "^.+?:.+$/)) { - /* var matched */ - ... - } - -=item B - - char *var = "foo:bar"; - char *cp, *v1, *v2; - if (str_parse(var, "m/^(.+?):(.+)$/b", &cp, &v1, &v2)) { - ... - /* now we have: - cp = "foo\0bar\0" and v1 and v2 pointing - into it, i.e., v1 = "foo", v2 = "bar" */ - ... - free(cp); - } - -=item B - - char *var = "foo:bar"; - char *subst = "quux"; - char *new; - str_parse(var, "s/^(.+?):(.+)$/$1-%s-$2/", &new, subst); - ... - /* now we have: var = "foo:bar", new = "foo:quux:bar" */ - ... - free(new); - -=item B - - char *v0 = "abc..."; /* length not guessable */ - char *v1 = "foo"; - void *v2 = 0xDEAD; - int v3 = 42; - char *cp; - int n; - - n = str_format(NULL, 0, "%s|%5s-%x-%04d", v0, v1, v2, v3); - cp = malloc(n); - str_format(cp, n, "%s-%x-%04d", v1, v2, v3); - /* now we have cp = "abc...| foo-DEAD-0042" */ - ... - free(cp); - -=back - -=head1 SEE ALSO - -string(3), printf(3), perlre(1). - -=head1 HISTORY - -The B library was written in November and December 1999 by Ralf -S. Engelschall. As building blocks various existing code was used and -recycled: for the str_token(3) implementation an anchient strtok(3) -flavor from William Deich 1991 was cleaned up and adjusted. As the -background parsing engine for str_parse(3) a heavily stripped down -version of Philip Hazel's PCRE 2.08 library was used. The str_format(3) -implementation was based on Panos Tsirigotis' sprintf(3) code as -adjusted by the Apache Software Foundation 1998. The formatting engine -was stripped down and enhanced to support internal extensions which were -required by str_format(3) and str_parse(3). - -=head1 AUTHOR - - Ralf S. Engelschall - rse@engelschall.com - www.engelschall.com =cut From ossp-cvs-owner@ossp.org Thu May 10 22:01:11 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f4AK1A250453; Thu, 10 May 2001 22:01:10 +0200 (CEST) Date: Thu, 10 May 2001 22:01:10 +0200 (CEST) Message-Id: <200105102001.f4AK1A250453@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/l2 .cvsignore Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 10-May-2001 22:01:10 Branch: HEAD Handle: 2001051021011000 Added files: ossp-pkg/l2 .cvsignore Log: add .cvsignore Summary: Revision Changes Path 1.1 +7 -0 ossp-pkg/l2/.cvsignore ____________________________________________________________________________ Index: ossp-pkg/l2/.cvsignore ============================================================ $ cvs update -p -r1.1 .cvsignore config.status config.log config.cache Makefile l2_config.h l2-config l2_test From ossp-cvs-owner@ossp.org Fri May 11 19:07:55 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f4BH7rJ72464; Fri, 11 May 2001 19:07:53 +0200 (CEST) Date: Fri, 11 May 2001 19:07:53 +0200 (CEST) Message-Id: <200105111707.f4BH7rJ72464@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/l2 l2.h l2_ch_buffer.c l2_ch_fd.c l2_ch_file.c l2... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 11-May-2001 19:07:53 Branch: HEAD Handle: 2001051118075200 Modified files: ossp-pkg/l2 l2.h l2_ch_buffer.c l2_ch_fd.c l2_ch_file.c l2_ch_filter.c l2_ch_null.c l2_ch_pipe.c l2_ch_prefix.c l2_ch_socket.c l2_ch_syslog.c Log: Fill in channel handler template code. Summary: Revision Changes Path 1.2 +13 -0 ossp-pkg/l2/l2.h 1.2 +46 -0 ossp-pkg/l2/l2_ch_buffer.c 1.2 +46 -0 ossp-pkg/l2/l2_ch_fd.c 1.2 +68 -13 ossp-pkg/l2/l2_ch_file.c 1.2 +46 -0 ossp-pkg/l2/l2_ch_filter.c 1.2 +46 -0 ossp-pkg/l2/l2_ch_null.c 1.2 +46 -0 ossp-pkg/l2/l2_ch_pipe.c 1.2 +46 -0 ossp-pkg/l2/l2_ch_prefix.c 1.2 +46 -0 ossp-pkg/l2/l2_ch_socket.c 1.2 +46 -0 ossp-pkg/l2/l2_ch_syslog.c ____________________________________________________________________________ Index: ossp-pkg/l2/l2.h ============================================================ $ cvs diff -u -r1.1.1.1 -r1.2 l2.h --- ossp-pkg/l2/l2.h 2001/05/10 19:46:01 1.1.1.1 +++ ossp-pkg/l2/l2.h 2001/05/11 17:07:52 1.2 @@ -95,6 +95,19 @@ va_list ap ); +/* list of shipped (output) channel handlers */ +extern l2_handler_t l2_handler_null; +extern l2_handler_t l2_handler_fd; +extern l2_handler_t l2_handler_file; +extern l2_handler_t l2_handler_pipe; +extern l2_handler_t l2_handler_socket; +extern l2_handler_t l2_handler_syslog; + +/* list of shipped (filter) channel handlers */ +extern l2_handler_t l2_handler_filter; +extern l2_handler_t l2_handler_prefix; +extern l2_handler_t l2_handler_buffer; + /* channel operations */ l2_channel_t *l2_channel_create (l2_handler_t *h); l2_channel_t *l2_channel_stack (l2_channel_t *ch1, l2_channel_t *ch2); Index: ossp-pkg/l2/l2_ch_buffer.c ============================================================ $ cvs diff -u -r1.1.1.1 -r1.2 l2_ch_buffer.c --- ossp-pkg/l2/l2_ch_buffer.c 2001/05/10 19:46:01 1.1.1.1 +++ ossp-pkg/l2/l2_ch_buffer.c 2001/05/11 17:07:52 1.2 @@ -30,3 +30,49 @@ #include "l2.h" #include "l2_p.h" +static int hook_create(l2_context_t *ctx) +{ + return L2_OK; +} + +static int hook_configure(l2_context_t *ctx, const char *fmt, va_list ap) +{ + return L2_OK; +} + +static int hook_open(l2_context_t *ctx, l2_channel_t *below) +{ + return L2_OK; +} + +static int hook_write(l2_context_t *ctx, l2_channel_t *below, + const char *buf, size_t buf_size) +{ + return L2_OK; +} + +static int hook_flush(l2_context_t *ctx, l2_channel_t *below) +{ + return L2_OK; +} + +static int hook_close(l2_context_t *ctx, l2_channel_t *below) +{ + return L2_OK; +} + +static int hook_destroy(l2_context_t *ctx) +{ + return L2_OK; +} + +l2_handler_t l2_handler_buffer = { + hook_create, + hook_configure, + hook_open, + hook_write, + hook_flush, + hook_close, + hook_destroy +}; + Index: ossp-pkg/l2/l2_ch_fd.c ============================================================ $ cvs diff -u -r1.1.1.1 -r1.2 l2_ch_fd.c --- ossp-pkg/l2/l2_ch_fd.c 2001/05/10 19:46:01 1.1.1.1 +++ ossp-pkg/l2/l2_ch_fd.c 2001/05/11 17:07:52 1.2 @@ -30,3 +30,49 @@ #include "l2.h" #include "l2_p.h" +static int hook_create(l2_context_t *ctx) +{ + return L2_OK; +} + +static int hook_configure(l2_context_t *ctx, const char *fmt, va_list ap) +{ + return L2_OK; +} + +static int hook_open(l2_context_t *ctx, l2_channel_t *below) +{ + return L2_OK; +} + +static int hook_write(l2_context_t *ctx, l2_channel_t *below, + const char *buf, size_t buf_size) +{ + return L2_OK; +} + +static int hook_flush(l2_context_t *ctx, l2_channel_t *below) +{ + return L2_OK; +} + +static int hook_close(l2_context_t *ctx, l2_channel_t *below) +{ + return L2_OK; +} + +static int hook_destroy(l2_context_t *ctx) +{ + return L2_OK; +} + +l2_handler_t l2_handler_fd = { + hook_create, + hook_configure, + hook_open, + hook_write, + hook_flush, + hook_close, + hook_destroy +}; + Index: ossp-pkg/l2/l2_ch_file.c ============================================================ $ cvs diff -u -r1.1.1.1 -r1.2 l2_ch_file.c --- ossp-pkg/l2/l2_ch_file.c 2001/05/10 19:46:01 1.1.1.1 +++ ossp-pkg/l2/l2_ch_file.c 2001/05/11 17:07:52 1.2 @@ -1,23 +1,78 @@ +/* +** L2 - OSSP Logging Library +** Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) +** Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) +** +** This file is part of OSSP L2, a flexible logging library which +** can be found at http://www.ossp.com/pkg/l2/. +** +** 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. +** +** l2_ch_file.c: file channel implementation +*/ #include "l2.h" #include "l2_p.h" -#if 0 +static int hook_create(l2_context_t *ctx) +{ + return L2_OK; +} -int l2_file_create(l2_channel_t *ch) +static int hook_configure(l2_context_t *ctx, const char *fmt, va_list ap) { - return; + return L2_OK; } -l2_handler_t l2_handler_file { - l2_file_create, - l2_file_configure, - l2_file_open, - l2_file_write, - l2_file_flush, - l2_file_close, - l2_file_destroy -}; +static int hook_open(l2_context_t *ctx, l2_channel_t *below) +{ + return L2_OK; +} + +static int hook_write(l2_context_t *ctx, l2_channel_t *below, + const char *buf, size_t buf_size) +{ + return L2_OK; +} + +static int hook_flush(l2_context_t *ctx, l2_channel_t *below) +{ + return L2_OK; +} + +static int hook_close(l2_context_t *ctx, l2_channel_t *below) +{ + return L2_OK; +} -#endif +static int hook_destroy(l2_context_t *ctx) +{ + return L2_OK; +} + +l2_handler_t l2_handler_file = { + hook_create, + hook_configure, + hook_open, + hook_write, + hook_flush, + hook_close, + hook_destroy +}; Index: ossp-pkg/l2/l2_ch_filter.c ============================================================ $ cvs diff -u -r1.1.1.1 -r1.2 l2_ch_filter.c --- ossp-pkg/l2/l2_ch_filter.c 2001/05/10 19:46:01 1.1.1.1 +++ ossp-pkg/l2/l2_ch_filter.c 2001/05/11 17:07:52 1.2 @@ -30,3 +30,49 @@ #include "l2.h" #include "l2_p.h" +static int hook_create(l2_context_t *ctx) +{ + return L2_OK; +} + +static int hook_configure(l2_context_t *ctx, const char *fmt, va_list ap) +{ + return L2_OK; +} + +static int hook_open(l2_context_t *ctx, l2_channel_t *below) +{ + return L2_OK; +} + +static int hook_write(l2_context_t *ctx, l2_channel_t *below, + const char *buf, size_t buf_size) +{ + return L2_OK; +} + +static int hook_flush(l2_context_t *ctx, l2_channel_t *below) +{ + return L2_OK; +} + +static int hook_close(l2_context_t *ctx, l2_channel_t *below) +{ + return L2_OK; +} + +static int hook_destroy(l2_context_t *ctx) +{ + return L2_OK; +} + +l2_handler_t l2_handler_filter = { + hook_create, + hook_configure, + hook_open, + hook_write, + hook_flush, + hook_close, + hook_destroy +}; + Index: ossp-pkg/l2/l2_ch_null.c ============================================================ $ cvs diff -u -r1.1.1.1 -r1.2 l2_ch_null.c --- ossp-pkg/l2/l2_ch_null.c 2001/05/10 19:46:01 1.1.1.1 +++ ossp-pkg/l2/l2_ch_null.c 2001/05/11 17:07:52 1.2 @@ -30,3 +30,49 @@ #include "l2.h" #include "l2_p.h" +static int hook_create(l2_context_t *ctx) +{ + return L2_OK; +} + +static int hook_configure(l2_context_t *ctx, const char *fmt, va_list ap) +{ + return L2_OK; +} + +static int hook_open(l2_context_t *ctx, l2_channel_t *below) +{ + return L2_OK; +} + +static int hook_write(l2_context_t *ctx, l2_channel_t *below, + const char *buf, size_t buf_size) +{ + return L2_OK; +} + +static int hook_flush(l2_context_t *ctx, l2_channel_t *below) +{ + return L2_OK; +} + +static int hook_close(l2_context_t *ctx, l2_channel_t *below) +{ + return L2_OK; +} + +static int hook_destroy(l2_context_t *ctx) +{ + return L2_OK; +} + +l2_handler_t l2_handler_null = { + hook_create, + hook_configure, + hook_open, + hook_write, + hook_flush, + hook_close, + hook_destroy +}; + Index: ossp-pkg/l2/l2_ch_pipe.c ============================================================ $ cvs diff -u -r1.1.1.1 -r1.2 l2_ch_pipe.c --- ossp-pkg/l2/l2_ch_pipe.c 2001/05/10 19:46:01 1.1.1.1 +++ ossp-pkg/l2/l2_ch_pipe.c 2001/05/11 17:07:52 1.2 @@ -30,3 +30,49 @@ #include "l2.h" #include "l2_p.h" +static int hook_create(l2_context_t *ctx) +{ + return L2_OK; +} + +static int hook_configure(l2_context_t *ctx, const char *fmt, va_list ap) +{ + return L2_OK; +} + +static int hook_open(l2_context_t *ctx, l2_channel_t *below) +{ + return L2_OK; +} + +static int hook_write(l2_context_t *ctx, l2_channel_t *below, + const char *buf, size_t buf_size) +{ + return L2_OK; +} + +static int hook_flush(l2_context_t *ctx, l2_channel_t *below) +{ + return L2_OK; +} + +static int hook_close(l2_context_t *ctx, l2_channel_t *below) +{ + return L2_OK; +} + +static int hook_destroy(l2_context_t *ctx) +{ + return L2_OK; +} + +l2_handler_t l2_handler_pipe = { + hook_create, + hook_configure, + hook_open, + hook_write, + hook_flush, + hook_close, + hook_destroy +}; + Index: ossp-pkg/l2/l2_ch_prefix.c ============================================================ $ cvs diff -u -r1.1.1.1 -r1.2 l2_ch_prefix.c --- ossp-pkg/l2/l2_ch_prefix.c 2001/05/10 19:46:01 1.1.1.1 +++ ossp-pkg/l2/l2_ch_prefix.c 2001/05/11 17:07:52 1.2 @@ -30,3 +30,49 @@ #include "l2.h" #include "l2_p.h" +static int hook_create(l2_context_t *ctx) +{ + return L2_OK; +} + +static int hook_configure(l2_context_t *ctx, const char *fmt, va_list ap) +{ + return L2_OK; +} + +static int hook_open(l2_context_t *ctx, l2_channel_t *below) +{ + return L2_OK; +} + +static int hook_write(l2_context_t *ctx, l2_channel_t *below, + const char *buf, size_t buf_size) +{ + return L2_OK; +} + +static int hook_flush(l2_context_t *ctx, l2_channel_t *below) +{ + return L2_OK; +} + +static int hook_close(l2_context_t *ctx, l2_channel_t *below) +{ + return L2_OK; +} + +static int hook_destroy(l2_context_t *ctx) +{ + return L2_OK; +} + +l2_handler_t l2_handler_prefix = { + hook_create, + hook_configure, + hook_open, + hook_write, + hook_flush, + hook_close, + hook_destroy +}; + Index: ossp-pkg/l2/l2_ch_socket.c ============================================================ $ cvs diff -u -r1.1.1.1 -r1.2 l2_ch_socket.c --- ossp-pkg/l2/l2_ch_socket.c 2001/05/10 19:46:01 1.1.1.1 +++ ossp-pkg/l2/l2_ch_socket.c 2001/05/11 17:07:52 1.2 @@ -30,3 +30,49 @@ #include "l2.h" #include "l2_p.h" +static int hook_create(l2_context_t *ctx) +{ + return L2_OK; +} + +static int hook_configure(l2_context_t *ctx, const char *fmt, va_list ap) +{ + return L2_OK; +} + +static int hook_open(l2_context_t *ctx, l2_channel_t *below) +{ + return L2_OK; +} + +static int hook_write(l2_context_t *ctx, l2_channel_t *below, + const char *buf, size_t buf_size) +{ + return L2_OK; +} + +static int hook_flush(l2_context_t *ctx, l2_channel_t *below) +{ + return L2_OK; +} + +static int hook_close(l2_context_t *ctx, l2_channel_t *below) +{ + return L2_OK; +} + +static int hook_destroy(l2_context_t *ctx) +{ + return L2_OK; +} + +l2_handler_t l2_handler_socket = { + hook_create, + hook_configure, + hook_open, + hook_write, + hook_flush, + hook_close, + hook_destroy +}; + Index: ossp-pkg/l2/l2_ch_syslog.c ============================================================ $ cvs diff -u -r1.1.1.1 -r1.2 l2_ch_syslog.c --- ossp-pkg/l2/l2_ch_syslog.c 2001/05/10 19:46:01 1.1.1.1 +++ ossp-pkg/l2/l2_ch_syslog.c 2001/05/11 17:07:52 1.2 @@ -30,3 +30,49 @@ #include "l2.h" #include "l2_p.h" +static int hook_create(l2_context_t *ctx) +{ + return L2_OK; +} + +static int hook_configure(l2_context_t *ctx, const char *fmt, va_list ap) +{ + return L2_OK; +} + +static int hook_open(l2_context_t *ctx, l2_channel_t *below) +{ + return L2_OK; +} + +static int hook_write(l2_context_t *ctx, l2_channel_t *below, + const char *buf, size_t buf_size) +{ + return L2_OK; +} + +static int hook_flush(l2_context_t *ctx, l2_channel_t *below) +{ + return L2_OK; +} + +static int hook_close(l2_context_t *ctx, l2_channel_t *below) +{ + return L2_OK; +} + +static int hook_destroy(l2_context_t *ctx) +{ + return L2_OK; +} + +l2_handler_t l2_handler_syslog = { + hook_create, + hook_configure, + hook_open, + hook_write, + hook_flush, + hook_close, + hook_destroy +}; + From ossp-cvs-owner@ossp.org Fri May 11 20:37:27 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f4BIbP281607; Fri, 11 May 2001 20:37:25 +0200 (CEST) Date: Fri, 11 May 2001 20:37:25 +0200 (CEST) Message-Id: <200105111837.f4BIbP281607@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/l2 Makefile.in Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 11-May-2001 20:37:25 Branch: HEAD Handle: 2001051119372500 Modified files: ossp-pkg/l2 Makefile.in Log: Fix manpage substitution Summary: Revision Changes Path 1.2 +1 -1 ossp-pkg/l2/Makefile.in ____________________________________________________________________________ Index: ossp-pkg/l2/Makefile.in ============================================================ $ cvs diff -u -r1.1.1.1 -r1.2 Makefile.in --- ossp-pkg/l2/Makefile.in 2001/05/10 19:46:01 1.1.1.1 +++ ossp-pkg/l2/Makefile.in 2001/05/11 18:37:25 1.2 @@ -91,7 +91,7 @@ sed -e 's;.*(;;' -e 's;).*;;'`; \ $(POD2MAN) --section=$${SEC} --center="$${ONELINE}" \ --release="$$D" --date="$${NAME} $$V1" $(S)$${BASENAME}.pod |\ - sed -e "s;STR_VERSION_STR;$$V2;" >$${BASENAME}.$${SEC} + sed -e "s;L2_VERSION_STR;$$V2;" >$${BASENAME}.$${SEC} .SUFFIXES: .SUFFIXES: .c .o .lo From ossp-cvs-owner@ossp.org Fri May 11 20:42:46 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f4BIgi081985; Fri, 11 May 2001 20:42:44 +0200 (CEST) Date: Fri, 11 May 2001 20:42:44 +0200 (CEST) Message-Id: <200105111842.f4BIgi081985@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/l2 l2.m4 Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 11-May-2001 20:42:44 Branch: HEAD Handle: 2001051119424400 Modified files: ossp-pkg/l2 l2.m4 Log: fix alignment Summary: Revision Changes Path 1.2 +2 -2 ossp-pkg/l2/l2.m4 ____________________________________________________________________________ Index: ossp-pkg/l2/l2.m4 ============================================================ $ cvs diff -u -r1.1.1.1 -r1.2 l2.m4 --- ossp-pkg/l2/l2.m4 2001/05/10 19:46:01 1.1.1.1 +++ ossp-pkg/l2/l2.m4 2001/05/11 18:42:44 1.2 @@ -31,8 +31,8 @@ dnl ## dnl ## Synopsis: dnl ## AC_CHECK_L2([MIN-VERSION [, # minimum L2 version, e.g. 1.2.0 -dnl ## DEFAULT-WITH-L2 [, # default value for --with-l2 option -dnl ## DEFAULT-WITH-L2-TEST [,# default value for --with-l2-test option +dnl ## DEFAULT-WITH-L2 [, # default value for --with-l2 option +dnl ## DEFAULT-WITH-L2-TEST [, # default value for --with-l2-test option dnl ## EXTEND-VARS [, # whether CFLAGS/LDFLAGS/etc are extended dnl ## ACTION-IF-FOUND [, # action to perform if L2 was found dnl ## ACTION-IF-NOT-FOUND # action to perform if L2 was not found From ossp-cvs-owner@ossp.org Fri May 11 20:46:41 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f4BIkeO82456; Fri, 11 May 2001 20:46:40 +0200 (CEST) Date: Fri, 11 May 2001 20:46:40 +0200 (CEST) Message-Id: <200105111846.f4BIkeO82456@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/l2 configure configure.in Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 11-May-2001 20:46:39 Branch: HEAD Handle: 2001051119463900 Modified files: ossp-pkg/l2 configure configure.in Log: fix typo in company name (ops) Summary: Revision Changes Path 1.2 +2 -2 ossp-pkg/l2/configure 1.2 +2 -2 ossp-pkg/l2/configure.in ____________________________________________________________________________ Index: ossp-pkg/l2/configure ============================================================ $ cvs diff -u -r1.1.1.1 -r1.2 configure --- ossp-pkg/l2/configure 2001/05/10 19:46:01 1.1.1.1 +++ ossp-pkg/l2/configure 2001/05/11 18:46:39 1.2 @@ -1,6 +1,6 @@ #! /bin/sh -# From configure.in Revision: 1.2 +# From configure.in 1.0 @@ -44,7 +44,7 @@ # friendly header ;) echo "Configuring ${TB}L2${TN} (Logging Library), Version ${TB}${L2_VERSION_STR}${TN}" echo "Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) -Copyright (c) 2001 Cable & WIreless Deutschland (http://www.cw.com/de/)" +Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/)" # additionally find out hex version L2_VERSION_HEX="`$ac_shtool version -l c -d hex $ac_srcdir/l2_version.c`" Index: ossp-pkg/l2/configure.in ============================================================ $ cvs diff -u -r1.1.1.1 -r1.2 configure.in --- ossp-pkg/l2/configure.in 2001/05/10 19:46:01 1.1.1.1 +++ ossp-pkg/l2/configure.in 2001/05/11 18:46:39 1.2 @@ -28,14 +28,14 @@ dnl ## AC_PREREQ(2.13)dnl -AC_REVISION($Revision: 1.1.1.1 $) +AC_REVISION(1.0) AC_INIT(README) AC_HEADLINE(dnl L2, Logging Library, dnl L2_VERSION, l2_version.c, dnl [Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) -Copyright (c) 2001 Cable & WIreless Deutschland (http://www.cw.com/de/)]) +Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/)]) AC_CONFIG_HEADER(l2_config.h) AC_PREFIX_DEFAULT(/usr/local) AC_PLATFORM(PLATFORM) From ossp-cvs-owner@ossp.org Fri May 11 21:53:46 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f4BJrjF88948; Fri, 11 May 2001 21:53:45 +0200 (CEST) Date: Fri, 11 May 2001 21:53:45 +0200 (CEST) Message-Id: <200105111953.f4BJrjF88948@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/shiela ChangeLog shiela.pl Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 11-May-2001 21:53:45 Branch: HEAD Handle: 2001051120534500 Modified files: ossp-pkg/shiela ChangeLog shiela.pl Log: *** empty log message *** Summary: Revision Changes Path 1.5 +3 -0 ossp-pkg/shiela/ChangeLog 1.7 +4 -2 ossp-pkg/shiela/shiela.pl ____________________________________________________________________________ Index: ossp-pkg/shiela/ChangeLog ============================================================ $ cvs diff -u -r1.4 -r1.5 ChangeLog --- ossp-pkg/shiela/ChangeLog 2001/05/04 13:33:53 1.4 +++ ossp-pkg/shiela/ChangeLog 2001/05/11 19:53:45 1.5 @@ -11,6 +11,9 @@ Changes between 0.9.1 and 0.9.2 (10-Feb-2001 to 04-May-2001): + *) Fixed meta character handling in regex matchings. + [Ralf S. Engelschall] + *) Make sure shiela accepts CVS 1.11 and newer, too. [Ralf S. Engelschall] Index: ossp-pkg/shiela/shiela.pl ============================================================ $ cvs diff -u -r1.6 -r1.7 shiela.pl --- ossp-pkg/shiela/shiela.pl 2001/05/04 15:06:55 1.6 +++ ossp-pkg/shiela/shiela.pl 2001/05/11 19:53:45 1.7 @@ -1182,7 +1182,8 @@ my @newfiles = (); foreach my $cvsfile (@cvsfiles) { my $branch = 'HEAD'; - if ($cvsstat =~ m|===+\nFile:\s+$cvsfile.+?Sticky Tag:\s+(\S+)|s) { + my $cvsfile_quoted = quotemeta($cvsfile); + if ($cvsstat =~ m|===+\nFile:\s+${cvsfile_quoted}.+?Sticky Tag:\s+(\S+)|s) { $branch = $1; $branch = 'HEAD' if ($branch eq '(none)'); } @@ -1746,7 +1747,8 @@ $e->{date} = $ID; $e->{delta} = $Id; $e->{diff} = ''; - $cvsdiff =~ s|\n\n(.+?\n)|$e->{diff} = $1, ''|se; + my $Is_quoted = quotemeta($Is); + $cvsdiff =~ s|\n\n(.+?\n)|$e->{diff} = $1, ''|se; $IN->{file}->{$Is} = $e; $handle_min = $ID if ($ID ne '' and (not defined($handle_min) or $handle_min > $ID)); $handle_max = $ID if ($ID ne '' and (not defined($handle_max) or $handle_max < $ID)); From ossp-cvs-owner@ossp.org Sat May 12 09:24:18 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f4C7OGg57217; Sat, 12 May 2001 09:24:16 +0200 (CEST) Date: Sat, 12 May 2001 09:24:16 +0200 (CEST) Message-Id: <200105120724.f4C7OGg57217@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/shiela shiela.pl Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 12-May-2001 09:24:16 Branch: HEAD Handle: 2001051208241600 Modified files: ossp-pkg/shiela shiela.pl Log: More quotemeta required Summary: Revision Changes Path 1.8 +2 -1 ossp-pkg/shiela/shiela.pl ____________________________________________________________________________ Index: ossp-pkg/shiela/shiela.pl ============================================================ $ cvs diff -u -r1.7 -r1.8 shiela.pl --- ossp-pkg/shiela/shiela.pl 2001/05/11 19:53:45 1.7 +++ ossp-pkg/shiela/shiela.pl 2001/05/12 07:24:16 1.8 @@ -1672,8 +1672,9 @@ $d .= scalar $cvs->result; $cvs->close; } + my $Is_quoted = quotemeta($Is); $d =~ s|^Index:.+?\ndiff\s+.*?\n||s; - $d =~ s|^(---\s+)$Is(\s+)|$1$cvsdir/$Is$2|m; + $d =~ s|^(---\s+)${Is_quoted}(\s+)|$1$cvsdir/$Is$2|m; $d =~ s|^(\+\+\+\s+)$Is(\s+)|$1$cvsdir/$Is$2|m; $cvsdiff .= "\n" . From ossp-cvs-owner@ossp.org Sat May 12 09:26:55 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f4C7QtN57432; Sat, 12 May 2001 09:26:55 +0200 (CEST) Date: Sat, 12 May 2001 09:26:55 +0200 (CEST) Message-Id: <200105120726.f4C7QtN57432@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/shiela shiela.pl Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 12-May-2001 09:26:55 Branch: HEAD Handle: 2001051208265400 Modified files: ossp-pkg/shiela shiela.pl Log: more quoting Summary: Revision Changes Path 1.9 +8 -8 ossp-pkg/shiela/shiela.pl ____________________________________________________________________________ Index: ossp-pkg/shiela/shiela.pl ============================================================ $ cvs diff -u -r1.8 -r1.9 shiela.pl --- ossp-pkg/shiela/shiela.pl 2001/05/12 07:24:16 1.8 +++ ossp-pkg/shiela/shiela.pl 2001/05/12 07:26:54 1.9 @@ -1403,7 +1403,7 @@ print STDERR "cvs import: Ignoring this operation - don't expect log messages!\n"; exit(0); } - open(CVSS, "$RT->{cvs} -f -l -Q -n log -r$It $Is|"); + open(CVSS, "$RT->{cvs} -f -l -Q -n log -r$It '$Is'|"); $rcslog = $_ while (); close(CVSS); } @@ -1519,7 +1519,7 @@ my $rcslog = ''; if ($Io eq 'A' or $Io eq 'M') { if (not $RT->{useserver}) { - open(CVSS, "$RT->{cvs} -f -l -Q -n log -r$Iv $Is|"); + open(CVSS, "$RT->{cvs} -f -l -Q -n log -r$Iv '$Is'|"); $rcslog .= $_ while (); close(CVSS); } @@ -1579,7 +1579,7 @@ "============================================================\n" . "\$ cvs update -p -r$Iv $Is | uuencode $Is\n"; if (not $RT->{useserver}) { - open(CVSS, "$RT->{cvs} -f -l -Q -n update -p -r$Iv $Is | uuencode $Is |"); + open(CVSS, "$RT->{cvs} -f -l -Q -n update -p -r$Iv '$Is' | uuencode '$Is' |"); $cvsdiff .= $_ while (); close(CVSS); } @@ -1602,7 +1602,7 @@ "============================================================\n" . "\$ cvs update -p -r$Iv $Is\n"; if (not $RT->{useserver}) { - open(CVSS, "$RT->{cvs} -f -l -Q -n update -p -r$Iv $Is|"); + open(CVSS, "$RT->{cvs} -f -l -Q -n update -p -r$Iv '$Is'|"); $cvsdiff .= $_ while (); close(CVSS); } @@ -1629,8 +1629,8 @@ "\$ cvs update -p -r$Iv $Is >$Is.new\n" . "\$ diff -u $Is.old $Is.new\n"; if (not $RT->{useserver}) { - system("$RT->{cvs} -f -l -Q -n update -p -r$IV $Is | uuencode $Is >$Is.old"); - system("$RT->{cvs} -f -l -Q -n update -p -r$Iv $Is | uuencode $Is >$Is.new"); + system("$RT->{cvs} -f -l -Q -n update -p -r$IV '$Is' | uuencode '$Is' >$Is.old"); + system("$RT->{cvs} -f -l -Q -n update -p -r$Iv '$Is' | uuencode '$Is' >$Is.new"); } else { my $cvs = new CVS ($RT->{cvs}, $RT->{cvsroot}); @@ -1659,7 +1659,7 @@ # file was modified, so we show the changed contents only my $d = ''; if (not $RT->{useserver}) { - open(FP, "$RT->{cvs} -f -l -Q -n diff -u -r$IV -r$Iv $Is|"); + open(FP, "$RT->{cvs} -f -l -Q -n diff -u -r$IV -r$Iv '$Is'|"); $d .= $_ while (); close(FP); } @@ -1675,7 +1675,7 @@ my $Is_quoted = quotemeta($Is); $d =~ s|^Index:.+?\ndiff\s+.*?\n||s; $d =~ s|^(---\s+)${Is_quoted}(\s+)|$1$cvsdir/$Is$2|m; - $d =~ s|^(\+\+\+\s+)$Is(\s+)|$1$cvsdir/$Is$2|m; + $d =~ s|^(\+\+\+\s+)${Is_quoted}(\s+)|$1$cvsdir/$Is$2|m; $cvsdiff .= "\n" . "Index: $cvsdir/$Is\n" . From ossp-cvs-owner@ossp.org Sat May 12 11:27:26 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f4C9RNj67977; Sat, 12 May 2001 11:27:23 +0200 (CEST) Date: Sat, 12 May 2001 11:27:23 +0200 (CEST) Message-Id: <200105120927.f4C9RNj67977@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/l2 TODO Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 12-May-2001 11:27:23 Branch: HEAD Handle: 2001051210272300 Modified files: ossp-pkg/l2 TODO Log: update todo Summary: Revision Changes Path 1.2 +41 -24 ossp-pkg/l2/TODO ____________________________________________________________________________ Index: ossp-pkg/l2/TODO ============================================================ $ cvs diff -u -r1.1.1.1 -r1.2 TODO --- ossp-pkg/l2/TODO 2001/05/10 19:46:01 1.1.1.1 +++ ossp-pkg/l2/TODO 2001/05/12 09:27:23 1.2 @@ -1,7 +1,45 @@ -OSSP liblog -=========== +OSSP L2 +======= +TODO +---- + +- channel backends +- message formatting +- rc-file autoconfiguration +- C++ API +- documentation C API +- documentation C++ API + +BRAINSTORMING +------------- + +Channel Handler Configuration: +o l2_handler_null + - no configuration at all +o l2_handler_fd + - mode="unix|stdio" + - fd=int|FILE* +o l2_handler_file + - mode="unix|stdio" + - path=char* + - append="yes|no" +o l2_handler_pipe + - url="prg:/path/to/program" + - fd=int +o l2_handler_socket + - url="tcp://hostname:port" + - fd=int +o l2_handler_syslog + - ident=char* +o l2_handler_filter + - pattern=char* +o l2_handler_prefix + - prefix=char* +o l2_handler_buffer + - size=size_t + Braindump: - debugging is special case of logging - tracing is special case of debugging @@ -108,29 +146,9 @@ - Varargs: log ist nur wrapper fuer vlog -- Source Tree: - README .......... information about package - INSTALL ......... instructions for installation - LICENSE ......... license information - TODO ............ to-do list - ChangeLog ....... history of all changes - Makefile.in ..... build specification - configure.in .... GNU Autoconf script source - aclocal.m4 ...... GNU Autoconf internal macros - libtool ......... GNU Libtool utility - shtool .......... GNU Shtool utility - l2.m4 ........... GNU Autoconf public macro AC_L2() - l2-config.in .... configuration utility script - l2.h ............ C API definition - l2.c ............ C API+internals implementation - l2.hh ........... C++ API definition - l2.cc ........... C++ API implementation - l2.pod .......... Unix manual page source (POD format) - l2_test.c ....... Test application - - Error Handling: o log kein Return Code - o aber error callback function (dadrin in C++: throw, in C: exit) + o aber error callback function (dadrin in C++: throw, in C: exit) - Newline Handling: option fuer channel: \r, \r\n, \n oder gleich string @@ -150,7 +168,6 @@ der Präprocessor an einem eventuell vorhandenen Komma scheitert. Dies kann beim gcc durch Voranstellen von "##" vor dem "__VA_ARGS__" umgangen werden. Ouch. - Beide Erweiterungen sind derzeit nicht aktiv, wenn mit -ansi compiliert wird. Explizit anschalten läßt sich die standard-konforme Erweiterung über "-std=c9x", bzw. "-std=c99" bei neueren gccs. From ossp-cvs-owner@ossp.org Thu May 17 16:40:35 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f4HEeYp40544; Thu, 17 May 2001 16:40:34 +0200 (CEST) Date: Thu, 17 May 2001 16:40:34 +0200 (CEST) Message-Id: <200105171440.f4HEeYp40544@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/l2 Makefile.in l2_log.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 17-May-2001 16:40:34 Branch: HEAD Handle: 2001051715403400 Added files: ossp-pkg/l2 l2_log.c Modified files: ossp-pkg/l2 Makefile.in Log: Added l2_log.c module, which contains l2_stream_log() and l2_stream_vlog(). Summary: Revision Changes Path 1.4 +9 -8 ossp-pkg/l2/Makefile.in 1.1 +50 -0 ossp-pkg/l2/l2_log.c ____________________________________________________________________________ Index: ossp-pkg/l2/Makefile.in ============================================================ $ cvs diff -u -r1.3 -r1.4 Makefile.in --- ossp-pkg/l2/Makefile.in 2001/05/11 19:50:52 1.3 +++ ossp-pkg/l2/Makefile.in 2001/05/17 14:40:34 1.4 @@ -62,6 +62,7 @@ # list of library object files OBJS = \ + l2_log.lo \ l2_stream.lo \ l2_channel.lo \ l2_ch_fd.lo \ @@ -107,13 +108,13 @@ $(LIBTOOL) --mode=compile --quiet $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $< # default target -all: $(TARGET) +all: $(TARGET) # build libraries -libl2.la: $(OBJS) +libl2.la: $(OBJS) $(LIBTOOL) --mode=link --quiet $(CC) -o libl2.la $(OBJS) -rpath $(libdir) \ -version-info `$(SHTOOL) version -l c -d libtool l2_version.c` -libl2++.la: $(OBJS) l2++.lo +libl2++.la: $(OBJS) l2++.lo $(LIBTOOL) --mode=link --quiet $(CC) -o libl2++.la $(OBJS) l2++.lo -rpath $(libdir) \ -version-info `$(SHTOOL) version -l c -d libtool l2_version.c` @@ -168,7 +169,7 @@ libl2++.la $(DESTDIR)$(libdir)/libl2++.la # perform standard uninstallation procedure -uninstall: +uninstall: $(MAKE) $(MFLAGS) @UNINSTALL_CXX@ uninstall-c uninstall-std uninstall-cxx: @$(LIBTOOL) --mode=uninstall $(RM) $(DESTDIR)$(libdir)/libl2++.la @@ -188,7 +189,7 @@ $(RMDIR) $(DESTDIR)$(includedir) $(RMDIR) $(DESTDIR)$(bindir) -# remove everything which can be regenerated +# remove everything which can be regenerated # by "make all" clean: $(RM) *.lo *.o @@ -196,8 +197,8 @@ -$(RMDIR) .libs >/dev/null 2>&1 || $(TRUE) $(RM) $(TARGET_LIBS) $(RM) $(TARGET_TESTS) - -# remove everything which can be regenerated + +# remove everything which can be regenerated # by "./configure && make all" distclean: clean $(RM) l2-config @@ -206,7 +207,7 @@ $(RM) libtool $(RM) Makefile -# remove everything which can be regenerated +# remove everything which can be regenerated # by "autoconf && autoheader && ./configure && make all" realclean: distclean $(RM) configure Index: ossp-pkg/l2/l2_log.c ============================================================ $ cvs update -p -r1.1 l2_log.c /* ** L2 - OSSP Logging Library ** Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) ** Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) ** ** This file is part of OSSP L2, a flexible logging library which ** can be found at http://www.ossp.com/pkg/l2/. ** ** 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. ** ** l2.c: internal C implementation ** */ #include "l2.h" #include "l2_p.h" void l2_stream_log(l2_stream_t *st, unsigned int log_level, const char* fmt, ...) { va_list ap; va_start(ap, fmt); l2_stream_vlog(st, log_level, fmt, ap); va_end(ap); } void l2_stream_vlog(l2_stream_t *st, unsigned int log_level, const char* fmt, va_list ap) { size_t i, len; len = vsnprintf(st->message, L2_MAX_MSGSIZE, fmt, ap); for (i = 0; i <= L2_MAX_CHANNELS && st->channels[i]; ++i) st->channels[i]->handler.write(&st->channels[i]->context, st->channels[i]->below, st->message, len); } From ossp-cvs-owner@ossp.org Thu May 17 16:41:32 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f4HEfUp40644; Thu, 17 May 2001 16:41:30 +0200 (CEST) Date: Thu, 17 May 2001 16:41:30 +0200 (CEST) Message-Id: <200105171441.f4HEfUp40644@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/l2 l2_p.h Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 17-May-2001 16:41:30 Branch: HEAD Handle: 2001051715413000 Modified files: ossp-pkg/l2 l2_p.h Log: Added missing "_st" suffix to the declaration of the l2_stream structure. Summary: Revision Changes Path 1.2 +1 -1 ossp-pkg/l2/l2_p.h ____________________________________________________________________________ Index: ossp-pkg/l2/l2_p.h ============================================================ $ cvs diff -u -r1.1.1.1 -r1.2 l2_p.h --- ossp-pkg/l2/l2_p.h 2001/05/10 19:46:01 1.1.1.1 +++ ossp-pkg/l2/l2_p.h 2001/05/17 14:41:30 1.2 @@ -49,7 +49,7 @@ l2_formatter_t callback; } l2_format_t; -struct l2_stream { +struct l2_stream_st { unsigned int levelmask; char message[L2_MAX_MSGSIZE]; l2_channel_t *channels[L2_MAX_CHANNELS]; From ossp-cvs-owner@ossp.org Thu May 17 16:42:02 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f4HEg1940708; Thu, 17 May 2001 16:42:01 +0200 (CEST) Date: Thu, 17 May 2001 16:42:01 +0200 (CEST) Message-Id: <200105171442.f4HEg1940708@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/l2 l2_ch_syslog.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 17-May-2001 16:42:01 Branch: HEAD Handle: 2001051715420000 Modified files: ossp-pkg/l2 l2_ch_syslog.c Log: Implemented write() method of the syslog handler. Summary: Revision Changes Path 1.3 +6 -3 ossp-pkg/l2/l2_ch_syslog.c ____________________________________________________________________________ Index: ossp-pkg/l2/l2_ch_syslog.c ============================================================ $ cvs diff -u -r1.2 -r1.3 l2_ch_syslog.c --- ossp-pkg/l2/l2_ch_syslog.c 2001/05/11 17:07:52 1.2 +++ ossp-pkg/l2/l2_ch_syslog.c 2001/05/17 14:42:00 1.3 @@ -30,6 +30,8 @@ #include "l2.h" #include "l2_p.h" +#include + static int hook_create(l2_context_t *ctx) { return L2_OK; @@ -45,11 +47,12 @@ return L2_OK; } -static int hook_write(l2_context_t *ctx, l2_channel_t *below, +static int hook_write(l2_context_t *ctx, l2_channel_t *below, const char *buf, size_t buf_size) -{ + { + syslog(LOG_INFO, buf); return L2_OK; -} + } static int hook_flush(l2_context_t *ctx, l2_channel_t *below) { From ossp-cvs-owner@ossp.org Thu May 17 16:42:24 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f4HEgN940762; Thu, 17 May 2001 16:42:23 +0200 (CEST) Date: Thu, 17 May 2001 16:42:23 +0200 (CEST) Message-Id: <200105171442.f4HEgN940762@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/l2 l2_test.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 17-May-2001 16:42:23 Branch: HEAD Handle: 2001051715422300 Modified files: ossp-pkg/l2 l2_test.c Log: Wrote a small test program for the library. Summary: Revision Changes Path 1.3 +48 -3 ossp-pkg/l2/l2_test.c ____________________________________________________________________________ Index: ossp-pkg/l2/l2_test.c ============================================================ $ cvs diff -u -r1.2 -r1.3 l2_test.c --- ossp-pkg/l2/l2_test.c 2001/05/12 07:23:06 1.2 +++ ossp-pkg/l2/l2_test.c 2001/05/17 14:42:23 1.3 @@ -27,10 +27,55 @@ ** l2_test.c: C API test suite */ +#include #include "l2.h" int main(int argc, char *argv[]) -{ - return 0; -} + { + l2_channel_t* log_channel; + l2_stream_t* log_stream; + + /* Create the channel. */ + + setbuf(stdout, 0); + printf("Creating channel ... "); + log_channel = l2_channel_create(&l2_handler_syslog); + if (log_channel == 0) + { + fprintf(stderr, "Can't create my log channel!\n"); + return 1; + } + printf("done\n"); + + /* Create the stream and attach the channel to it. */ + + printf("Creating stream ... "); + log_stream = l2_stream_create(); + if (log_stream == 0) + { + fprintf(stderr, "Can't create my log stream!\n"); + return 1; + } + printf("done\n"); + printf("Attaching channel to stream ... "); + if (!l2_stream_channel(log_stream, log_channel, -1)) + { + fprintf(stderr, "Can't attach channel to log stream!\n"); + return 1; + } + printf("done\n"); + /* Log an example message. */ + + printf("Writing log message ... "); + l2_stream_log(log_stream, -1, "%cstream = 0x%lx, channel = 0x%lx%c", '"', log_stream, log_channel, '"'); + printf("done\n"); + + /* Clean up. */ + + printf("Destroying stream ... "); + l2_stream_destroy(log_stream); + printf("done\n"); + + return 0; + } From ossp-cvs-owner@ossp.org Thu May 17 16:43:28 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f4HEhRv40870; Thu, 17 May 2001 16:43:27 +0200 (CEST) Date: Thu, 17 May 2001 16:43:27 +0200 (CEST) Message-Id: <200105171443.f4HEhRv40870@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/l2 l2_stream.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 17-May-2001 16:43:27 Branch: HEAD Handle: 2001051715432600 Modified files: ossp-pkg/l2 l2_stream.c Log: Implemented l2_stream_create(), l2_stream_destroy(), and l2_stream_channel(). Summary: Revision Changes Path 1.2 +29 -0 ossp-pkg/l2/l2_stream.c ____________________________________________________________________________ Index: ossp-pkg/l2/l2_stream.c ============================================================ $ cvs diff -u -r1.1.1.1 -r1.2 l2_stream.c --- ossp-pkg/l2/l2_stream.c 2001/05/10 19:46:01 1.1.1.1 +++ ossp-pkg/l2/l2_stream.c 2001/05/17 14:43:26 1.2 @@ -31,3 +31,32 @@ #include "l2.h" #include "l2_p.h" +l2_stream_t* l2_stream_create(void) + { + l2_stream_t *st; + st = (l2_stream_t *)malloc(sizeof(l2_stream_t)); + if (!st) + return NULL; + memset(st, 0, sizeof(l2_stream_t)); + return st; + } + +void l2_stream_destroy(l2_stream_t* st) + { + size_t i; + for (i = 0; i <= L2_MAX_CHANNELS && st->channels[i]; ++i) + l2_channel_destroy(st->channels[i]); + for (i = 0; i <= L2_MAX_FORMATTERS && st->formatters[i]; ++i) + free(st->formatters[i]); + } + +l2_stream_t* l2_stream_channel(l2_stream_t *st, l2_channel_t *ch, unsigned int levelmask) + { + size_t i; + for (i = 0; i <= L2_MAX_CHANNELS && st->channels[i]; ++i) + ; + if (i == L2_MAX_CHANNELS) + return 0; /* Array is full. */ + st->channels[i] = ch; + return st; + } From ossp-cvs-owner@ossp.org Sat May 19 12:23:35 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f4JANXF86606; Sat, 19 May 2001 12:23:33 +0200 (CEST) Date: Sat, 19 May 2001 12:23:33 +0200 (CEST) Message-Id: <200105191023.f4JANXF86606@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/l2 TODO Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 19-May-2001 12:23:33 Branch: HEAD Handle: 2001051911233200 Modified files: ossp-pkg/l2 TODO Log: Remember timeplan Summary: Revision Changes Path 1.3 +17 -0 ossp-pkg/l2/TODO ____________________________________________________________________________ Index: ossp-pkg/l2/TODO ============================================================ $ cvs diff -u -r1.2 -r1.3 TODO --- ossp-pkg/l2/TODO 2001/05/12 09:27:23 1.2 +++ ossp-pkg/l2/TODO 2001/05/19 10:23:32 1.3 @@ -2,6 +2,23 @@ OSSP L2 ======= +Timeplan +-------- + +o M1 (14.05.2001) + - fixed C API + - established build environment +o M2 (21.05.2001) + - implemented C API + - fixed C++ API +o M3 (11.06.2001) + - implemented C++ API + - documented C API + - documented C++ API + - release version 0.9.0 +o M4 (25.06.2001) + - release version 1.0.0 + TODO ---- From ossp-cvs-owner@ossp.org Sat May 19 21:01:16 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f4JJ1Dr40018; Sat, 19 May 2001 21:01:13 +0200 (CEST) Date: Sat, 19 May 2001 21:01:13 +0200 (CEST) Message-Id: <200105191901.f4JJ1Dr40018@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/l2 Makefile.in Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 19-May-2001 21:01:13 Branch: HEAD Handle: 2001051920011300 Modified files: ossp-pkg/l2 Makefile.in Log: fix 'make clean' Summary: Revision Changes Path 1.5 +1 -0 ossp-pkg/l2/Makefile.in ____________________________________________________________________________ Index: ossp-pkg/l2/Makefile.in ============================================================ $ cvs diff -u -r1.4 -r1.5 Makefile.in --- ossp-pkg/l2/Makefile.in 2001/05/17 14:40:34 1.4 +++ ossp-pkg/l2/Makefile.in 2001/05/19 19:01:13 1.5 @@ -52,6 +52,7 @@ RM = rm -f RMDIR = rmdir POD2MAN = pod2man +TRUE = true SHTOOL = ./shtool LIBTOOL = ./libtool From ossp-cvs-owner@ossp.org Sat May 19 22:08:32 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f4JK8Vl46057; Sat, 19 May 2001 22:08:31 +0200 (CEST) Date: Sat, 19 May 2001 22:08:31 +0200 (CEST) Message-Id: <200105192008.f4JK8Vl46057@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/l2 Makefile.in l2.h l2_p.h l2_param.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 19-May-2001 22:08:30 Branch: HEAD Handle: 2001051921083000 Added files: ossp-pkg/l2 l2_param.c Modified files: ossp-pkg/l2 Makefile.in l2.h l2_p.h Log: the "int l2_channel_configure(l2_channel_t *ch, const char *fmt, ...);" beast was my idea, so it is fair to also provide the necessary tool for implementing the underlying handler functions. Here it is, l2_param_parse(). Summary: Revision Changes Path 1.6 +1 -0 ossp-pkg/l2/Makefile.in 1.3 +47 -2 ossp-pkg/l2/l2.h 1.3 +19 -0 ossp-pkg/l2/l2_p.h 1.1 +101 -0 ossp-pkg/l2/l2_param.c ____________________________________________________________________________ Index: ossp-pkg/l2/Makefile.in ============================================================ $ cvs diff -u -r1.5 -r1.6 Makefile.in --- ossp-pkg/l2/Makefile.in 2001/05/19 19:01:13 1.5 +++ ossp-pkg/l2/Makefile.in 2001/05/19 20:08:30 1.6 @@ -66,6 +66,7 @@ l2_log.lo \ l2_stream.lo \ l2_channel.lo \ + l2_param.lo \ l2_ch_fd.lo \ l2_ch_file.lo \ l2_ch_pipe.lo \ Index: ossp-pkg/l2/l2.h ============================================================ $ cvs diff -u -r1.2 -r1.3 l2.h --- ossp-pkg/l2/l2.h 2001/05/11 17:07:52 1.2 +++ ossp-pkg/l2/l2.h 2001/05/19 20:08:30 1.3 @@ -30,18 +30,33 @@ #ifndef __L2_H__ #define __L2_H__ +/* include standard environment we are based on */ +#include #include #include #include +/* counterbalance poor standard environments */ +#ifndef NULL +#define NULL (void *)0 +#endif +#ifndef FALSE +#define FALSE (0) +#endif +#ifndef TRUE +#define TRUE (!FALSE) +#endif + /* forward declarations for opaque data structures */ union l2_context_un; +struct l2_param_st; struct l2_stream_st; struct l2_channel_st; struct l2_handler_st; /* corresponding data types for data structures */ typedef union l2_context_un l2_context_t; +typedef struct l2_param_st l2_param_t; typedef struct l2_handler_st l2_handler_t; typedef struct l2_stream_st l2_stream_t; typedef struct l2_channel_st l2_channel_t; @@ -64,16 +79,43 @@ L2_ERROR } l2_error_t; -/* context union for callbacks */ +/* context union for storing data */ union l2_context_un { + char c; + short s; int i; long l; float f; double d; - void *vp; char *cp; + void *vp; +}; + +/* list of types for storing data */ +typedef enum { + L2_TYPE_CHAR, + L2_TYPE_SHORT, + L2_TYPE_INT, + L2_TYPE_LONG, + L2_TYPE_FLOAT, + L2_TYPE_DOUBLE, + L2_TYPE_CHARPTR, + L2_TYPE_VOIDPTR +} l2_type_t; + +/* parameter specification */ +struct l2_param_st { + char *name; + l2_type_t type; + void *store; }; +/* parameter constructors */ +#define L2_PARAM_SET(pa,n,t,s) \ + pa.name = #n, pa.type = L2_TYPE_##t, pa.store = s +#define L2_PARAM_END(pa) \ + pa.name = NULL + /* channel handler specification structure */ struct l2_handler_st { int (*create) (l2_context_t *ctx); @@ -107,6 +149,9 @@ extern l2_handler_t l2_handler_filter; extern l2_handler_t l2_handler_prefix; extern l2_handler_t l2_handler_buffer; + +/* parameter operations */ +int l2_param_parse (l2_param_t p[], const char *fmt, va_list ap); /* channel operations */ l2_channel_t *l2_channel_create (l2_handler_t *h); Index: ossp-pkg/l2/l2_p.h ============================================================ $ cvs diff -u -r1.2 -r1.3 l2_p.h --- ossp-pkg/l2/l2_p.h 2001/05/17 14:41:30 1.2 +++ ossp-pkg/l2/l2_p.h 2001/05/19 20:08:30 1.3 @@ -56,5 +56,24 @@ l2_format_t *formatters[L2_MAX_FORMATTERS]; }; +/* variable argument handling taking care on argument passing conventions */ +#define _va_type_recv_char int +#define _va_type_cast_char char +#define _va_type_recv_short int +#define _va_type_cast_short short +#define _va_type_recv_int int +#define _va_type_cast_int int +#define _va_type_recv_long long +#define _va_type_cast_long long +#define _va_type_recv_float double +#define _va_type_cast_float double +#define _va_type_recv_double double +#define _va_type_cast_double double +#define _va_type_recv_charptr void * +#define _va_type_cast_charptr char * +#define _va_type_recv_voidptr void * +#define _va_type_cast_voidptr void * +#define va_get(ap,type) (_va_type_cast_##type)va_arg((ap),_va_type_recv_##type) + #endif /* __L2_P_H__ */ Index: ossp-pkg/l2/l2_param.c ============================================================ $ cvs update -p -r1.1 l2_param.c /* ** L2 - OSSP Logging Library ** Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) ** Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) ** ** This file is part of OSSP L2, a flexible logging library which ** can be found at http://www.ossp.com/pkg/l2/. ** ** 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. ** ** l2_param.c: parameter handling ** */ #include "l2.h" #include "l2_p.h" int l2_param_parse(l2_param_t pa[], const char *fmt, va_list ap) { const char *cpB, *cpE; const char *cpC, *cpG; int ok; int i; cpE = fmt; while (*cpE != '\0') { /* determine begin of parameter name */ cpB = cpE; while (*cpB == ',') cpB++; /* determine end of parameter name */ cpE = cpB; while (*cpE != ',' && *cpE != '\0') cpE++; /* try to match with configured parameters */ ok = FALSE; for (i = 0; pa[i].name != NULL; i++) { cpC = pa[i].name; cpG = cpB; while (*cpC != '\0' && cpG < cpE) { if (*cpC != *cpG) break; cpC++; cpG++; } if (*cpC == '\0' && cpG == cpE) { /* parameter matched, so store value */ switch (pa[i].type) { case L2_TYPE_CHAR: *(char *)(pa[i].store) = va_get(ap, char); break; case L2_TYPE_SHORT: *(short *)(pa[i].store) = va_get(ap, short); break; case L2_TYPE_INT: *(int *)(pa[i].store) = va_get(ap, int); break; case L2_TYPE_LONG: *(long *)(pa[i].store) = va_get(ap, long); break; case L2_TYPE_FLOAT: *(float *)(pa[i].store) = va_get(ap, float); break; case L2_TYPE_DOUBLE: *(double *)(pa[i].store) = va_get(ap, double); break; case L2_TYPE_CHARPTR: *(char **)(pa[i].store) = va_get(ap, charptr); break; case L2_TYPE_VOIDPTR: *(void **)(pa[i].store) = va_get(ap, voidptr); break; } ok = TRUE; break; } } if (!ok) return L2_ERROR; } return L2_OK; } From ossp-cvs-owner@ossp.org Sat May 19 22:14:16 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f4JKEF846494; Sat, 19 May 2001 22:14:15 +0200 (CEST) Date: Sat, 19 May 2001 22:14:15 +0200 (CEST) Message-Id: <200105192014.f4JKEF846494@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/l2 l2_ch_file.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 19-May-2001 22:14:15 Branch: HEAD Handle: 2001051921141500 Modified files: ossp-pkg/l2 l2_ch_file.c Log: Give us a clue how the handler functions actually should look now that we have l2_param_parse() and friends available. So to help Peti in approaching milestone 2 for Monday, I felt free to implement l2_handler_file for us, based on raw Unix I/O. Summary: Revision Changes Path 1.3 +134 -5 ossp-pkg/l2/l2_ch_file.c ____________________________________________________________________________ Index: ossp-pkg/l2/l2_ch_file.c ============================================================ $ cvs diff -u -r1.2 -r1.3 l2_ch_file.c --- ossp-pkg/l2/l2_ch_file.c 2001/05/11 17:07:52 1.2 +++ ossp-pkg/l2/l2_ch_file.c 2001/05/19 20:14:15 1.3 @@ -30,42 +30,171 @@ #include "l2.h" #include "l2_p.h" +#include +#include +#include + +/* declare private channel configuration */ +typedef struct { + int fd; + char *path; + int append; + long perm; +} l2_ch_file_t; + +/* create channel */ static int hook_create(l2_context_t *ctx) { + l2_ch_file_t *cfg; + + /* allocate private channel configuration */ + if ((cfg = (l2_ch_file_t *)malloc(sizeof(l2_ch_file_t))) == NULL) + return L2_ERROR; + + /* initialize configuration with reasonable defaults */ + cfg->fd = -1; + cfg->path = NULL; + cfg->append = TRUE; + cfg->perm = (S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH); + + /* link private channel configuration into channel context */ + ctx->vp = cfg; + return L2_OK; } +/* configure channel */ static int hook_configure(l2_context_t *ctx, const char *fmt, va_list ap) { - return L2_OK; + l2_ch_file_t *cfg; + l2_param_t pa[3]; + l2_error_t rv; + + /* parameter checks */ + if (ctx == NULL) + return L2_ERROR; + if ((cfg = (l2_ch_file_t *)ctx->vp) == NULL) + return L2_ERROR; + + /* feed and call generic parameter parsing engine */ + L2_PARAM_SET(pa[0], path, CHARPTR, &cfg->path); + L2_PARAM_SET(pa[1], append, INT, &cfg->append); + L2_PARAM_SET(pa[1], perm, LONG, &cfg->perm); + L2_PARAM_END(pa[2]); + rv = l2_param_parse(pa, fmt, ap); + + return rv; } -static int hook_open(l2_context_t *ctx, l2_channel_t *below) +/* open channel */ +static int hook_open(l2_context_t *ctx, l2_channel_t *downstream) { + l2_ch_file_t *cfg; + int mode; + + /* parameter checks */ + if (ctx == NULL) + return L2_ERROR; + if ((cfg = (l2_ch_file_t *)ctx->vp) == NULL) + return L2_ERROR; + if (cfg->path == NULL) + return L2_ERROR; + + /* open channel file */ + mode = O_WRONLY|O_CREAT; + if (cfg->append) + mode |= O_APPEND; + if ((cfg->fd = open(cfg->path, mode, cfg->perm)) == -1) + return L2_ERROR; + + /* optionally open downstream channel, too */ + if (downstream != NULL) + if (l2_channel_open(downstream) == L2_ERROR) + return L2_ERROR; + return L2_OK; } -static int hook_write(l2_context_t *ctx, l2_channel_t *below, +/* write to channel */ +static int hook_write(l2_context_t *ctx, l2_channel_t *downstream, const char *buf, size_t buf_size) { + l2_ch_file_t *cfg; + + /* parameter checks */ + if (ctx == NULL) + return L2_ERROR; + if ((cfg = (l2_ch_file_t *)ctx->vp) == NULL) + return L2_ERROR; + if (cfg->fd == -1) + return L2_ERROR; + + /* write message to channel file */ + if (write(cfg->fd, buf, buf_size) == -1) + return L2_ERROR; + + /* optionally write to downstream channel, too */ + if (downstream != NULL) + if (l2_channel_write(downstream, buf, buf_size) == L2_ERROR) + return L2_ERROR; + return L2_OK; } -static int hook_flush(l2_context_t *ctx, l2_channel_t *below) +/* flush channel */ +static int hook_flush(l2_context_t *ctx, l2_channel_t *downstream) { + /* NOP for this channel, because Unix I/O files are unbuffered! */ + + /* optionally flush downstream channel, too */ + if (downstream != NULL) + if (l2_channel_flush(downstream) == L2_ERROR) + return L2_ERROR; + return L2_OK; } -static int hook_close(l2_context_t *ctx, l2_channel_t *below) +/* close channel */ +static int hook_close(l2_context_t *ctx, l2_channel_t *downstream) { + l2_ch_file_t *cfg; + + /* optionally close downstream channel, too */ + if (downstream != NULL) + if (l2_channel_close(downstream) == L2_ERROR) + return L2_ERROR; + + /* parameter checks */ + if (ctx == NULL) + return L2_ERROR; + if ((cfg = (l2_ch_file_t *)ctx->vp) == NULL) + return L2_ERROR; + if (cfg->fd == -1) + return L2_ERROR; + + /* close channel file */ + close(cfg->fd); + cfg->fd = -1; + return L2_OK; } +/* destroy channel */ static int hook_destroy(l2_context_t *ctx) { + /* parameter checks */ + if (ctx == NULL) + return L2_ERROR; + if (ctx->vp == NULL) + return L2_ERROR; + + /* destroy channel configuration */ + free(ctx->vp); + return L2_OK; } +/* exported channel handler structure */ l2_handler_t l2_handler_file = { hook_create, hook_configure, From ossp-cvs-owner@ossp.org Mon May 21 21:29:02 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f4LJT1e04367; Mon, 21 May 2001 21:29:01 +0200 (CEST) Date: Mon, 21 May 2001 21:29:01 +0200 (CEST) Message-Id: <200105211929.f4LJT1e04367@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/l2 shtool Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 21-May-2001 21:29:01 Branch: HEAD Handle: 2001052120290100 Modified files: ossp-pkg/l2 shtool Log: Update GNU shtool to version 1.5.3 Summary: Revision Changes Path 1.2 +70 -60 ossp-pkg/l2/shtool ____________________________________________________________________________ Index: ossp-pkg/l2/shtool ============================================================ $ cvs diff -u -r1.1.1.1 -r1.2 shtool --- ossp-pkg/l2/shtool 2001/05/10 19:46:01 1.1.1.1 +++ ossp-pkg/l2/shtool 2001/05/21 19:29:01 1.2 @@ -1,12 +1,12 @@ #!/bin/sh ## ## GNU shtool -- The GNU Portable Shell Tool -## Copyright (c) 1994-2000 Ralf S. Engelschall +## Copyright (c) 1994-2001 Ralf S. Engelschall ## ## See http://www.gnu.org/software/shtool/ for more information. ## See ftp://ftp.gnu.org/gnu/shtool/ for latest version. ## -## Version: 1.5.1 (29-Jul-2000) +## Version: 1.5.3 (19-Apr-2001) ## Contents: all available modules ## @@ -26,7 +26,7 @@ ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, ## USA, or contact Ralf S. Engelschall . ## -## Notice: Given that you include this file verbatim into your own +## 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 @@ -63,8 +63,8 @@ exit 1 fi if [ ".$1" = ".-h" -o ".$1" = ".--help" ]; then - echo "This is GNU shtool, version 1.5.1 (29-Jul-2000)" - echo "Copyright (c) 1994-2000 Ralf S. Engelschall " + echo "This is GNU shtool, version 1.5.3 (19-Apr-2001)" + echo "Copyright (c) 1994-2001 Ralf S. Engelschall " echo "Report bugs to " echo '' echo "Usage: shtool [] [ [] []]" @@ -82,13 +82,13 @@ echo ' prop [-p]' echo ' move [-v] [-t] [-e] [-p] ' echo ' install [-v] [-t] [-c] [-C] [-s] [-m] [-o] [-g]' - echo ' [-e] [ ...] ' + echo ' [-e] [ ...] ' echo ' mkdir [-t] [-f] [-p] [-m]

[ ...]' echo ' mkln [-t] [-f] [-s] [ ...] ' echo ' mkshadow [-v] [-t] [-a] ' echo ' fixperm [-v] [-t] [ ...]' - echo ' tarball [-t] [-v] [-o ] [-c ] [-d ] [-u' - echo ' ] [-g ] [-e ] [ ...]' + echo ' tarball [-t] [-v] [-o] [-c] [-d] [-u]' + echo ' [-g] [-e] [ ...]' echo ' guessos ' echo ' arx [-t] [-C] [ ...]' echo ' slo [-p] -- -L -l [-L -l ...]' @@ -101,7 +101,7 @@ exit 0 fi if [ ".$1" = ".-v" -o ".$1" = ."--version" ]; then - echo "GNU shtool 1.5.1 (29-Jul-2000)" + echo "GNU shtool 1.5.3 (19-Apr-2001)" exit 0 fi if [ ".$1" = ".-r" -o ".$1" = ."--recreate" ]; then @@ -182,15 +182,15 @@ ;; install ) str_tool="install" - str_usage="[-v] [-t] [-c] [-C] [-s] [-m] [-o] [-g] [-e] [ ...] " + str_usage="[-v] [-t] [-c] [-C] [-s] [-m] [-o] [-g] [-e] [ ...] " arg_spec="2+" - opt_spec="v.t.c.C.s.m:o:g:e:" + opt_spec="v.t.c.C.s.m:o:g:e+" opt_v=no opt_t=no opt_c=no opt_C=no opt_s=no - opt_m="" + opt_m="0755" opt_o="" opt_g="" opt_e="" @@ -233,7 +233,7 @@ ;; tarball ) str_tool="tarball" - str_usage="[-t] [-v] [-o ] [-c ] [-d ] [-u ] [-g ] [-e ] [ ...]" + str_usage="[-t] [-v] [-o] [-c] [-d] [-u] [-g] [-e] [ ...]" gen_tmpfile=yes arg_spec="1+" opt_spec="t.v.o:c:d:u:g:e:" @@ -455,6 +455,7 @@ tmpfile="$tmpdir/.shtool.$$" rm -f $tmpfile >/dev/null 2>&1 touch $tmpfile + chmod 600 $tmpfile fi ## @@ -466,7 +467,7 @@ echo ) ## ## echo -- Print string with optional construct expansion - ## Copyright (c) 1998-2000 Ralf S. Engelschall + ## Copyright (c) 1998-2001 Ralf S. Engelschall ## Originally written for WML as buildinfo ## @@ -814,7 +815,7 @@ table ) ## ## table -- Pretty-print a field-separated list as a table - ## Copyright (c) 1998-2000 Ralf S. Engelschall + ## Copyright (c) 1998-2001 Ralf S. Engelschall ## Originally written for Apache ## @@ -878,7 +879,7 @@ prop ) ## ## prop -- Display progress with a running propeller - ## Copyright (c) 1998-2000 Ralf S. Engelschall + ## Copyright (c) 1998-2001 Ralf S. Engelschall ## Originally written for mod_ssl ## @@ -923,7 +924,7 @@ move ) ## ## move -- Move files with simultaneous substitution - ## Copyright (c) 1999-2000 Ralf S. Engelschall + ## Copyright (c) 1999-2001 Ralf S. Engelschall ## Originally written for shtool ## @@ -1015,7 +1016,7 @@ install ) ## ## install -- Install a program, script or datafile - ## Copyright (c) 1997-2000 Ralf S. Engelschall + ## Copyright (c) 1997-2001 Ralf S. Engelschall ## Originally written for shtool ## @@ -1045,19 +1046,13 @@ for src in $srcs; do dst=$dstpath - # If destination is a directory, append the input filename + # if destination is a directory, append the input filename if [ $dstisdir = 1 ]; then dstfile=`echo "$src" | sed -e 's;.*/\([^/]*\)$;\1;'` dst="$dst/$dstfile" fi - # Add a possible extension to src and dst - if [ ".$opt_e" != . ]; then - src="$src$opt_e" - dst="$dst$opt_e" - fi - - # Check for correct arguments + # check for correct arguments if [ ".$src" = ".$dst" ]; then echo "$msgprefix:Warning: source and destination are the same - skipped" 1>&2 continue @@ -1067,18 +1062,18 @@ continue fi - # Make a temp file name in the destination directory + # make a temp file name in the destination directory dsttmp=`echo $dst |\ sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;' -e 's;^$;.;' \ -e "s;\$;/#INST@$$#;"` - # Verbosity + # verbosity if [ ".$opt_v" = .yes ]; then echo "$src -> $dst" 1>&2 fi - # Copy or move the file name to the temp name - # (because we might be not allowed to change the source) + # copy or move the file name to the temp name + # (because we might be not allowed to change the source) if [ ".$opt_C" = .yes ]; then opt_c=yes fi @@ -1094,8 +1089,16 @@ mv $src $dsttmp || exit $? fi - # Adjust the target file - # (we do chmod last to preserve setuid bits) + # adjust the target file + if [ ".$opt_e" != . ]; then + sed='sed' + for e in $opt_e; do + sed="$sed -e '$e'" + done + cp $dsttmp $dsttmp.old + eval "$sed <$dsttmp.old >$dsttmp" || exit $? + rm -f $dsttmp.old + fi if [ ".$opt_s" = .yes ]; then if [ ".$opt_t" = .yes ]; then echo "strip $dsttmp" 1>&2 @@ -1114,14 +1117,14 @@ fi chgrp $opt_g $dsttmp || exit $? fi - if [ ".$opt_m" != . ]; then + if [ ".$opt_m" != ".-" ]; then if [ ".$opt_t" = .yes ]; then echo "chmod $opt_m $dsttmp" 1>&2 fi chmod $opt_m $dsttmp || exit $? fi - # Determine whether to do a quick install + # determine whether to do a quick install # (has to be done _after_ the strip was already done) quick=no if [ ".$opt_C" = .yes ]; then @@ -1132,7 +1135,7 @@ fi fi - # Finally install the file to the real destination + # finally, install the file to the real destination if [ $quick = yes ]; then if [ ".$opt_t" = .yes ]; then echo "rm -f $dsttmp" 1>&2 @@ -1150,7 +1153,7 @@ mkdir ) ## ## mkdir -- Make one or more directories - ## Copyright (c) 1996-2000 Ralf S. Engelschall + ## Copyright (c) 1996-2001 Ralf S. Engelschall ## Originally written for public domain by Noah Friedman ## Cleaned up and enhanced for shtool ## @@ -1159,7 +1162,7 @@ for p in ${1+"$@"}; do # if the directory already exists... if [ -d "$p" ]; then - if [ ".$opt_f" = .no ] && [ ".$opt_p" = .no ]; then + if [ ".$opt_f" = .no -a ".$opt_p" = .no ]; then echo "$msgprefix:Error: directory already exists: $p" 1>&2 errstatus=1 break @@ -1173,6 +1176,12 @@ echo "mkdir $p" 1>&2 fi mkdir $p || errstatus=$? + if [ ".$opt_m" != . ]; then + if [ ".$opt_t" = .yes ]; then + echo "chmod $opt_m $p" 1>&2 + fi + chmod $opt_m $p || errstatus=$? + fi else # the smart situation set fnord `echo ":$p" |\ @@ -1209,7 +1218,7 @@ mkln ) ## ## mkln -- Make link with calculation of relative paths - ## Copyright (c) 1999-2000 Ralf S. Engelschall + ## Copyright (c) 1999-2001 Ralf S. Engelschall ## Originally written for shtool ## @@ -1287,12 +1296,12 @@ # split away a common prefix prefix="" - if [ ".$srcdir" = ".$dstdir" ] && [ ".$srcdir" != . ]; then + if [ ".$srcdir" = ".$dstdir" -a ".$srcdir" != . ]; then prefix="$srcdir/" srcdir="" dstdir="" else - while [ ".$srcdir" != . ] && [ ".$dstdir" != . ]; do + while [ ".$srcdir" != . -a ".$dstdir" != . ]; do presrc=`echo $srcdir | sed -e 's;^\([^/]*\)/.*;\1;'` predst=`echo $dstdir | sed -e 's;^\([^/]*\)/.*;\1;'` if [ ".$presrc" != ".$predst" ]; then @@ -1348,7 +1357,7 @@ mkshadow ) ## ## mkshadow -- Make a shadow tree through symbolic links - ## Copyright (c) 1998-2000 Ralf S. Engelschall + ## Copyright (c) 1998-2001 Ralf S. Engelschall ## Originally written for Apache ## @@ -1465,7 +1474,7 @@ fixperm ) ## ## fixperm -- Fix file permissions inside a source tree - ## Copyright (c) 1996-2000 Ralf S. Engelschall + ## Copyright (c) 1996-2001 Ralf S. Engelschall ## Originally written for ePerl ## @@ -1521,7 +1530,7 @@ tarball ) ## ## tarball -- Roll distribution tarballs - ## Copyright (c) 1999-2000 Ralf S. Engelschall + ## Copyright (c) 1999-2001 Ralf S. Engelschall ## Originally written for shtool ## @@ -1547,7 +1556,7 @@ for tool in `echo $tools | sed -e 's/,/ /g'`; do # iterate over paths for path in $paths; do - if [ $minusx "$path/$tool" ] && [ ! -d "$path/$tool" ]; then + if [ $minusx "$path/$tool" -a ! -d "$path/$tool" ]; then eval "prg_${prg}=\"$path/$tool\"" break fi @@ -1573,7 +1582,7 @@ if [ ".$opt_t" = .yes ]; then echo "(cd $src && $prg_find . -type f -depth -print) | sed -e 's:^\\.\$::' -e 's:^\\./::' | cat $exclude >>$tmpfile.lst" 1>&2 fi - (cd $src && find . -type f -depth -print) |\ + (cd $src && $prg_find . -type f -depth -print) |\ sed -e 's:^\.$::' -e 's:^\./::' | eval cat $exclude >>$tmpfile.lst else if [ ".$opt_t" = .yes ]; then @@ -1747,6 +1756,7 @@ ;; HP-UX:*) HPUXVER=`echo ${RELEASE}|sed -e 's/[^.]*.[0B]*//'` + MACHINE=`echo ${MACHINE}|sed -e 's:/:_:'` echo "${MACHINE}-hp-hpux${HPUXVER}"; exit 0 ;; IRIX:*) @@ -1930,7 +1940,7 @@ arx ) ## ## arx -- Extended archive command - ## Copyright (c) 1999-2000 Ralf S. Engelschall + ## Copyright (c) 1999-2001 Ralf S. Engelschall ## Originally written for shtool ## @@ -2008,7 +2018,7 @@ slo ) ## ## slo -- Separate linker options by library class - ## Copyright (c) 1998-2000 Ralf S. Engelschall + ## Copyright (c) 1998-2001 Ralf S. Engelschall ## Originally written for Apache ## @@ -2057,7 +2067,7 @@ LIBS_DSO='' # for each library... - OIFS="$IFS" IFS=':' + OIFS="$IFS"; IFS=':' for lib in $LIBS; do [ ".$lib" = . ] && continue @@ -2067,14 +2077,14 @@ found_dir='' # for each directory... - OIFS2="$IFS" IFS=":$DIFS" + OIFS2="$IFS"; IFS=":$DIFS" for dir in ${DIRS} switch-to-defdirs ${DIRS_DEFAULT}; do [ ".$dir" = . ] && continue [ ".$dir" = .switch-to-defdirs ] && found_indefdir=yes [ ! -d $dir ] && continue # search the file - OIFS3="$IFS" IFS="$DIFS" + OIFS3="$IFS"; IFS="$DIFS" for file in '' `cd $dir && ls lib${lib}.* 2>/dev/null`; do [ ".$file" = . ] && continue case $file in @@ -2123,7 +2133,7 @@ IFS="$OIFS" # also pass-through unused dirs even if it's useless - OIFS="$IFS" IFS=':' + OIFS="$IFS"; IFS=':' for dir in $DIRS; do dirlist="${DIRS_OBJ}:${DIRS_PIC}:${DIRS_DSO}:" if [ ".`echo \"$dirlist\" | fgrep :$dir:`" = . ]; then @@ -2134,7 +2144,7 @@ # reassemble the options but separated by type for type in OBJ PIC DSO; do - OIFS="$IFS" IFS=':' + OIFS="$IFS"; IFS=':' eval "libs=\"\$LIBS_${type}\"" opts='' for lib in $libs; do @@ -2164,7 +2174,7 @@ scpp ) ## ## scpp -- Sharing C Pre-Processor - ## Copyright (c) 1999-2000 Ralf S. Engelschall + ## Copyright (c) 1999-2001 Ralf S. Engelschall ## Originally written for GNU Pth ## @@ -2377,7 +2387,7 @@ version ) ## ## version -- Maintain a version information file - ## Copyright (c) 1994-2000 Ralf S. Engelschall + ## Copyright (c) 1994-2001 Ralf S. Engelschall ## Originally written for ePerl, rewritten from scratch for shtool ## @@ -2535,7 +2545,7 @@ vGNU="${name} ${triple} (${tim})" vWeb="${name}/${triple}" vSCCS="@(#)${name} ${triple} (${tim})" - vRCS="\$Id: shtool,v 1.1.1.1 2001/05/10 19:46:01 rse Exp ${name} ${triple} (${tim}) \$" + vRCS="\$Id: shtool,v 1.2 2001/05/21 19:29:01 rse Exp ${name} ${triple} (${tim}) \$" # determine string out of filename # (do NOT try to optimize this in any way because of portability) @@ -2655,7 +2665,7 @@ path ) ## ## path -- Deal with program paths - ## Copyright (c) 1998-2000 Ralf S. Engelschall + ## Copyright (c) 1998-2001 Ralf S. Engelschall ## Originally written for Apache ## @@ -2705,7 +2715,7 @@ # MAGIC SITUATION # Perl Interpreter (perl) - if [ ".$opt_m" = .yes ] && [ ".$namelist" = .perl ]; then + if [ ".$opt_m" = .yes -a ".$namelist" = .perl ]; then rm -f $tmpfile touch $tmpfile found=0 @@ -2714,7 +2724,7 @@ dir=`echo $dir | sed -e 's;/*$;;'` nc=99 for name in perl perl5 miniperl; do - if [ $minusx "$dir/$name" ] && [ ! -d "$dir/$name" ]; then + if [ $minusx "$dir/$name" -a ! -d "$dir/$name" ]; then perl="$dir/$name" pv=`$perl -e 'printf("%.3f", $]);'` echo "$pv:$pc:$nc:$perl" >>$tmpfile @@ -2735,7 +2745,7 @@ # MAGIC SITUATION # C pre-processor (cpp) - if [ ".$opt_m" = .yes ] && [ ".$namelist" = .cpp ]; then + if [ ".$opt_m" = .yes -a ".$namelist" = .cpp ]; then echo >$tmpfile.c "#include " echo >>$tmpfile.c "Syntax Error" # 1. try the standard cc -E approach @@ -2751,7 +2761,7 @@ # 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 "$path/cpp" ] && [ ! -d "$path/cpp" ]; then + if [ $minusx "$path/cpp" -a ! -d "$path/cpp" ]; then cpp="$path/cpp" break fi @@ -2780,7 +2790,7 @@ # iterate over paths for path in $paths; do path=`echo $path | sed -e 's;/*$;;'` - if [ $minusx "$path/$name" ] && [ ! -d "$path/$name" ]; then + if [ $minusx "$path/$name" -a ! -d "$path/$name" ]; then if [ ".$opt_s" != .yes ]; then echo "$path/$name" fi From ossp-cvs-owner@ossp.org Mon May 21 22:15:14 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f4LKFBI10352; Mon, 21 May 2001 22:15:11 +0200 (CEST) Date: Mon, 21 May 2001 22:15:11 +0200 (CEST) Message-Id: <200105212015.f4LKFBI10352@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/l2 l2_ch_file.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 21-May-2001 22:15:11 Branch: HEAD Handle: 2001052121151100 Modified files: ossp-pkg/l2 l2_ch_file.c Log: Simplify the file handler, because a NULL ctx cannot happen at all. Summary: Revision Changes Path 1.4 +0 -10 ossp-pkg/l2/l2_ch_file.c ____________________________________________________________________________ Index: ossp-pkg/l2/l2_ch_file.c ============================================================ $ cvs diff -u -r1.3 -r1.4 l2_ch_file.c --- ossp-pkg/l2/l2_ch_file.c 2001/05/19 20:14:15 1.3 +++ ossp-pkg/l2/l2_ch_file.c 2001/05/21 20:15:11 1.4 @@ -71,8 +71,6 @@ l2_error_t rv; /* parameter checks */ - if (ctx == NULL) - return L2_ERROR; if ((cfg = (l2_ch_file_t *)ctx->vp) == NULL) return L2_ERROR; @@ -93,8 +91,6 @@ int mode; /* parameter checks */ - if (ctx == NULL) - return L2_ERROR; if ((cfg = (l2_ch_file_t *)ctx->vp) == NULL) return L2_ERROR; if (cfg->path == NULL) @@ -122,8 +118,6 @@ l2_ch_file_t *cfg; /* parameter checks */ - if (ctx == NULL) - return L2_ERROR; if ((cfg = (l2_ch_file_t *)ctx->vp) == NULL) return L2_ERROR; if (cfg->fd == -1) @@ -165,8 +159,6 @@ return L2_ERROR; /* parameter checks */ - if (ctx == NULL) - return L2_ERROR; if ((cfg = (l2_ch_file_t *)ctx->vp) == NULL) return L2_ERROR; if (cfg->fd == -1) @@ -183,8 +175,6 @@ static int hook_destroy(l2_context_t *ctx) { /* parameter checks */ - if (ctx == NULL) - return L2_ERROR; if (ctx->vp == NULL) return L2_ERROR; From ossp-cvs-owner@ossp.org Tue May 22 16:36:07 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f4MEa5R47968; Tue, 22 May 2001 16:36:05 +0200 (CEST) Date: Tue, 22 May 2001 16:36:05 +0200 (CEST) Message-Id: <200105221436.f4MEa5R47968@ossp.org> From: "OSSP Project Master" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: CVSROOT modules Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: OSSP Project Master Root: /e/ossp/cvs Email: ossp@ossp.org Module: CVSROOT Date: 22-May-2001 16:36:05 Branch: HEAD Handle: 2001052215360500 Modified files: CVSROOT modules Log: add erpc Summary: Revision Changes Path 1.24 +1 -0 CVSROOT/modules ____________________________________________________________________________ Index: CVSROOT/modules ============================================================ $ cvs diff -u -r1.23 -r1.24 modules --- CVSROOT/modules 2001/05/10 19:51:32 1.23 +++ CVSROOT/modules 2001/05/22 14:36:05 1.24 @@ -73,4 +73,5 @@ str ossp-pkg/str sugar ossp-pkg/sugar l2 ossp-pkg/l2 +erpc ossp-pkg/erpc From ossp-cvs-owner@ossp.org Tue May 22 16:36:33 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f4MEaWc48033; Tue, 22 May 2001 16:36:32 +0200 (CEST) Date: Tue, 22 May 2001 16:36:32 +0200 (CEST) Message-Id: <200105221436.f4MEaWc48033@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/erpc TODO Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 22-May-2001 16:36:32 Branch: HEAD Handle: 2001052215363200 Added files: ossp-pkg/erpc TODO Log: add todo Summary: Revision Changes Path 1.1 +27 -0 ossp-pkg/erpc/TODO ____________________________________________________________________________ Index: ossp-pkg/erpc/TODO ============================================================ $ cvs update -p -r1.1 TODO Efficient RPC (E-RPC) ===================== Architecture: - libeprc - libserialize o M1 (peti) [11-Jun-2001] - evaluation (-> ideas) (checklist) - prototype (C++) o M2 (peti+rse) [02-Jul-2001] - design/architecture paper (authentication+encryption framework) (< 10KB Text + 1x Figure) - rpc protocol (ohne serialization) (< 5KB Text) - API specification (erpc.h, serial.h) o M3 (peti) - source tree - implementation o M4 (rse) - OSSP integration/adjustierung o M5 (peti) - documentation From ossp-cvs-owner@ossp.org Tue May 22 16:38:28 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f4MEcRw48195; Tue, 22 May 2001 16:38:27 +0200 (CEST) Date: Tue, 22 May 2001 16:38:27 +0200 (CEST) Message-Id: <200105221438.f4MEcRw48195@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/erpc TODO Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 22-May-2001 16:38:26 Branch: HEAD Handle: 2001052215382600 Modified files: ossp-pkg/erpc TODO Log: Removed unnecessary whitespace. Summary: Revision Changes Path 1.2 +1 -3 ossp-pkg/erpc/TODO ____________________________________________________________________________ Index: ossp-pkg/erpc/TODO ============================================================ $ cvs diff -u -r1.1 -r1.2 TODO --- ossp-pkg/erpc/TODO 2001/05/22 14:36:32 1.1 +++ ossp-pkg/erpc/TODO 2001/05/22 14:38:26 1.2 @@ -1,4 +1,3 @@ - Efficient RPC (E-RPC) ===================== @@ -9,7 +8,7 @@ o M1 (peti) [11-Jun-2001] - evaluation (-> ideas) (checklist) - - prototype + - prototype (C++) o M2 (peti+rse) [02-Jul-2001] - design/architecture paper (authentication+encryption framework) @@ -24,4 +23,3 @@ - OSSP integration/adjustierung o M5 (peti) - documentation - From ossp-cvs-owner@ossp.org Tue May 22 16:45:32 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f4MEjV849117; Tue, 22 May 2001 16:45:31 +0200 (CEST) Date: Tue, 22 May 2001 16:45:31 +0200 (CEST) Message-Id: <200105221445.f4MEjV849117@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/erpc EVAL Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 22-May-2001 16:45:31 Branch: HEAD Handle: 2001052215453100 Added files: ossp-pkg/erpc EVAL Log: *** empty log message *** Summary: Revision Changes Path 1.1 +53 -0 ossp-pkg/erpc/EVAL ____________________________________________________________________________ Index: ossp-pkg/erpc/EVAL ============================================================ $ cvs update -p -r1.1 EVAL Evaluation ========== o Spread http://www.spread.org/ o XML-RPC: http://www.xmlrpc.org/ http://www.focusresearch.com/gregor/sw/XPC/ http://xmlrpc-c.sourceforge.net/ o SunRPC rfc1050.txt rfc1057.txt rfc1790.txt rfc1831.txt rfc1833.txt rfc2203.txt rfc2695.txt o SRA Secure RPC Authentication for TELNET and FTP net.tamu.edu:pub/security/TAMU/ o RPC2 ftp://ftp.coda.cs.cmu.edu/pub/rpc2/ o MRPC http://www.tildeslash.org/mrpc.html http://www.tildeslash.org/mrpc/ o LinuxDoors http://www.rampant.org/doors/ o DCERPC ftp://gatekeeper.dec.com/pub/DEC/DCE/ RSE: ---- ORBit ...... nice ORBit 2.2 implementation in C, but undocumented FreeBSD .... the most clean RPC, but only RPCv1 SunRPC40 ... too old, FreeBSD's code is much more feature-full and portable, RPCv1 NetBSD ..... very similar to FreeBSD code with a few addons "long long", but less clean, RPCv1 tirpc ...... Transport Layer Independent RPC, but unportable and old RPC2 ....... nice concept, but neither RPCv1 nor RPC2 and requires LWP library and is also bundled strongly with it MRPC ....... modular architecture (tranport layer interchangeable), but depends on re2c and is implemented in cpp, neither RPCv1 nor RPCv2 XMLRPC ..... taugt nicht, nur nettes Konzept, keine C Implementierung, starker Overhead, etc. From ossp-cvs-owner@ossp.org Tue May 22 20:47:33 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f4MIlWW76935; Tue, 22 May 2001 20:47:32 +0200 (CEST) Date: Tue, 22 May 2001 20:47:32 +0200 (CEST) Message-Id: <200105221847.f4MIlWW76935@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/l2 Makefile.in l2.h l2_ch_file.c l2_channel.c l2_... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 22-May-2001 20:47:32 Branch: HEAD Handle: 19700101010000990553651 Modified files: ossp-pkg/l2 Makefile.in l2.h l2_ch_file.c l2_channel.c l2_stream.c Removed files: ossp-pkg/l2 l2_log.c l2_param.c Log: Simplify things by merging the parameter stuff into l2_channel.c and the l2_stream_t related things into l2_stream.c Summary: Revision Changes Path 1.7 +0 -2 ossp-pkg/l2/Makefile.in 1.4 +2 -2 ossp-pkg/l2/l2.h 1.5 +1 -1 ossp-pkg/l2/l2_ch_file.c 1.2 +68 -0 ossp-pkg/l2/l2_channel.c NONE +0 -0 ossp-pkg/l2/l2_log.c NONE +0 -0 ossp-pkg/l2/l2_param.c 1.3 +54 -19 ossp-pkg/l2/l2_stream.c ____________________________________________________________________________ Index: ossp-pkg/l2/Makefile.in ============================================================ $ cvs diff -u -r1.6 -r1.7 Makefile.in --- ossp-pkg/l2/Makefile.in 2001/05/19 20:08:30 1.6 +++ ossp-pkg/l2/Makefile.in 2001/05/22 18:47:31 1.7 @@ -63,10 +63,8 @@ # list of library object files OBJS = \ - l2_log.lo \ l2_stream.lo \ l2_channel.lo \ - l2_param.lo \ l2_ch_fd.lo \ l2_ch_file.lo \ l2_ch_pipe.lo \ Index: ossp-pkg/l2/l2.h ============================================================ $ cvs diff -u -r1.3 -r1.4 l2.h --- ossp-pkg/l2/l2.h 2001/05/19 20:08:30 1.3 +++ ossp-pkg/l2/l2.h 2001/05/22 18:47:31 1.4 @@ -151,17 +151,17 @@ extern l2_handler_t l2_handler_buffer; /* parameter operations */ -int l2_param_parse (l2_param_t p[], const char *fmt, va_list ap); /* channel operations */ l2_channel_t *l2_channel_create (l2_handler_t *h); -l2_channel_t *l2_channel_stack (l2_channel_t *ch1, l2_channel_t *ch2); int l2_channel_configure(l2_channel_t *ch, const char *fmt, ...); int l2_channel_open (l2_channel_t *ch); int l2_channel_write (l2_channel_t *ch, const char *buf, size_t bufsize); int l2_channel_flush (l2_channel_t *ch); int l2_channel_close (l2_channel_t *ch); int l2_channel_destroy (l2_channel_t *ch); +l2_channel_t *l2_channel_stack (l2_channel_t *ch1, l2_channel_t *ch2); +int l2_channel_setparams(l2_param_t p[], const char *fmt, va_list ap); /* stream operations */ l2_stream_t *l2_stream_create (void); Index: ossp-pkg/l2/l2_ch_file.c ============================================================ $ cvs diff -u -r1.4 -r1.5 l2_ch_file.c --- ossp-pkg/l2/l2_ch_file.c 2001/05/21 20:15:11 1.4 +++ ossp-pkg/l2/l2_ch_file.c 2001/05/22 18:47:31 1.5 @@ -79,7 +79,7 @@ L2_PARAM_SET(pa[1], append, INT, &cfg->append); L2_PARAM_SET(pa[1], perm, LONG, &cfg->perm); L2_PARAM_END(pa[2]); - rv = l2_param_parse(pa, fmt, ap); + rv = l2_channel_setparams(pa, fmt, ap); return rv; } Index: ossp-pkg/l2/l2_channel.c ============================================================ $ cvs diff -u -r1.1.1.1 -r1.2 l2_channel.c --- ossp-pkg/l2/l2_channel.c 2001/05/10 19:46:01 1.1.1.1 +++ ossp-pkg/l2/l2_channel.c 2001/05/22 18:47:31 1.2 @@ -134,3 +134,71 @@ return rv; } +int l2_channel_setparams(l2_param_t pa[], const char *fmt, va_list ap) +{ + const char *cpB, *cpE; + const char *cpC, *cpG; + int ok; + int i; + + cpE = fmt; + while (*cpE != '\0') { + /* determine begin of parameter name */ + cpB = cpE; + while (*cpB == ',') + cpB++; + + /* determine end of parameter name */ + cpE = cpB; + while (*cpE != ',' && *cpE != '\0') + cpE++; + + /* try to match with configured parameters */ + ok = FALSE; + for (i = 0; pa[i].name != NULL; i++) { + cpC = pa[i].name; + cpG = cpB; + while (*cpC != '\0' && cpG < cpE) { + if (*cpC != *cpG) + break; + cpC++; + cpG++; + } + if (*cpC == '\0' && cpG == cpE) { + /* parameter matched, so store value */ + switch (pa[i].type) { + case L2_TYPE_CHAR: + *(char *)(pa[i].store) = va_get(ap, char); + break; + case L2_TYPE_SHORT: + *(short *)(pa[i].store) = va_get(ap, short); + break; + case L2_TYPE_INT: + *(int *)(pa[i].store) = va_get(ap, int); + break; + case L2_TYPE_LONG: + *(long *)(pa[i].store) = va_get(ap, long); + break; + case L2_TYPE_FLOAT: + *(float *)(pa[i].store) = va_get(ap, float); + break; + case L2_TYPE_DOUBLE: + *(double *)(pa[i].store) = va_get(ap, double); + break; + case L2_TYPE_CHARPTR: + *(char **)(pa[i].store) = va_get(ap, charptr); + break; + case L2_TYPE_VOIDPTR: + *(void **)(pa[i].store) = va_get(ap, voidptr); + break; + } + ok = TRUE; + break; + } + } + if (!ok) + return L2_ERROR; + } + return L2_OK; +} + Index: ossp-pkg/l2/l2_stream.c ============================================================ $ cvs diff -u -r1.2 -r1.3 l2_stream.c --- ossp-pkg/l2/l2_stream.c 2001/05/17 14:43:26 1.2 +++ ossp-pkg/l2/l2_stream.c 2001/05/22 18:47:31 1.3 @@ -31,32 +31,67 @@ #include "l2.h" #include "l2_p.h" -l2_stream_t* l2_stream_create(void) - { +l2_stream_t *l2_stream_create(void) +{ l2_stream_t *st; - st = (l2_stream_t *)malloc(sizeof(l2_stream_t)); - if (!st) + + if ((st = (l2_stream_t *)malloc(sizeof(l2_stream_t))) == NULL) return NULL; memset(st, 0, sizeof(l2_stream_t)); return st; - } +} -void l2_stream_destroy(l2_stream_t* st) - { +l2_stream_t *l2_stream_channel(l2_stream_t *st, l2_channel_t *ch, unsigned int levelmask) +{ size_t i; - for (i = 0; i <= L2_MAX_CHANNELS && st->channels[i]; ++i) - l2_channel_destroy(st->channels[i]); - for (i = 0; i <= L2_MAX_FORMATTERS && st->formatters[i]; ++i) - free(st->formatters[i]); - } -l2_stream_t* l2_stream_channel(l2_stream_t *st, l2_channel_t *ch, unsigned int levelmask) - { - size_t i; - for (i = 0; i <= L2_MAX_CHANNELS && st->channels[i]; ++i) - ; + for (i = 0; i <= L2_MAX_CHANNELS && st->channels[i] != NULL; i++) + ; if (i == L2_MAX_CHANNELS) - return 0; /* Array is full. */ + return NULL; st->channels[i] = ch; return st; - } +} + +l2_stream_t *l2_stream_formatter(l2_stream_t *st, l2_formatter_t *cb, l2_context_t *ctx) +{ + return NULL; +} + +unsigned int l2_stream_levels(l2_stream_t *st, unsigned int levelmask) +{ + return 0; +} + +void l2_stream_log(l2_stream_t *st, unsigned int log_level, const char *fmt, ...) +{ + va_list ap; + va_start(ap, fmt); + l2_stream_vlog(st, log_level, fmt, ap); + va_end(ap); + return; +} + +void l2_stream_vlog(l2_stream_t *st, unsigned int log_level, const char *fmt, va_list ap) +{ + size_t i, len; + + len = vsnprintf(st->message, L2_MAX_MSGSIZE, fmt, ap); + for (i = 0; i <= L2_MAX_CHANNELS && st->channels[i] != NULL; i++) + st->channels[i]->handler.write(&st->channels[i]->context, + st->channels[i]->below, + st->message, len); + return; +} + +void l2_stream_destroy(l2_stream_t *st) +{ + size_t i; + + for (i = 0; i <= L2_MAX_CHANNELS && st->channels[i] != NULL; i++) + l2_channel_destroy(st->channels[i]); + for (i = 0; i <= L2_MAX_FORMATTERS && st->formatters[i] != NULL; i++) + free(st->formatters[i]); + return; +} + From ossp-cvs-owner@ossp.org Tue May 22 21:26:14 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f4MJQCK81080; Tue, 22 May 2001 21:26:12 +0200 (CEST) Date: Tue, 22 May 2001 21:26:12 +0200 (CEST) Message-Id: <200105221926.f4MJQCK81080@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/shiela ChangeLog shiela.pl Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 22-May-2001 21:26:12 Branch: HEAD Handle: 2001052220261200 Modified files: ossp-pkg/shiela ChangeLog shiela.pl Log: fix shiela for removed files Summary: Revision Changes Path 1.6 +3 -0 ossp-pkg/shiela/ChangeLog 1.10 +14 -2 ossp-pkg/shiela/shiela.pl ____________________________________________________________________________ Index: ossp-pkg/shiela/ChangeLog ============================================================ $ cvs diff -u -r1.5 -r1.6 ChangeLog --- ossp-pkg/shiela/ChangeLog 2001/05/11 19:53:45 1.5 +++ ossp-pkg/shiela/ChangeLog 2001/05/22 19:26:12 1.6 @@ -10,6 +10,9 @@ ChangeLog Changes between 0.9.1 and 0.9.2 (10-Feb-2001 to 04-May-2001): + + *) Fixed +d/-d output on removed files. + [Ralf S. Engelschall] *) Fixed meta character handling in regex matchings. [Ralf S. Engelschall] Index: ossp-pkg/shiela/shiela.pl ============================================================ $ cvs diff -u -r1.9 -r1.10 shiela.pl --- ossp-pkg/shiela/shiela.pl 2001/05/12 07:26:54 1.9 +++ ossp-pkg/shiela/shiela.pl 2001/05/22 19:26:12 1.10 @@ -1553,18 +1553,30 @@ $Id = 'BLOB'; } else { - if ($Io eq 'A' or $Io eq 'R') { + if ($Io eq 'A') { open(FP, "<$Is"); my $l = 0; $l++ while (); close(FP); - $Id = sprintf("+%d/-%d", ($Io eq 'A' ? $l : 0), ($Io eq 'A' ? 0 : $l)); + $Id = sprintf("+%d/-%d", $l, 0); } elsif ($Io eq 'M') { if ($rcslog =~ m|\ndate:.*lines:\s*([\d \t+-]+)|s) { $Id = $1; $Id =~ s|\s+|/|g; } + } + elsif ($Io eq 'R') { + my $cvs = new CVS ($RT->{cvs}, $RT->{cvsroot}); + $cvs->directory($cvsdir); + $cvs->entry($Is); + $cvs->arguments("-p", "-r$IV", $Is); + $cvs->send("update"); + my $f = scalar $cvs->result; + $cvs->close; + my $l = 0; + $f =~ s|\n|$l++|sge; + $Id = sprintf("+%d/-%d", 0, $l); } } From ossp-cvs-owner@ossp.org Tue May 22 22:00:14 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f4MK0CD84987; Tue, 22 May 2001 22:00:12 +0200 (CEST) Date: Tue, 22 May 2001 22:00:12 +0200 (CEST) Message-Id: <200105222000.f4MK0CD84987@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/l2 l2_ch_buffer.c l2_channel.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 22-May-2001 22:00:12 Branch: HEAD Handle: 2001052221001200 Modified files: ossp-pkg/l2 l2_ch_buffer.c l2_channel.c Log: Implement a first cut for a buffer channel (still untested). Summary: Revision Changes Path 1.3 +93 -6 ossp-pkg/l2/l2_ch_buffer.c 1.3 +4 -0 ossp-pkg/l2/l2_channel.c ____________________________________________________________________________ Index: ossp-pkg/l2/l2_ch_buffer.c ============================================================ $ cvs diff -u -r1.2 -r1.3 l2_ch_buffer.c --- ossp-pkg/l2/l2_ch_buffer.c 2001/05/11 17:07:52 1.2 +++ ossp-pkg/l2/l2_ch_buffer.c 2001/05/22 20:00:12 1.3 @@ -30,39 +30,126 @@ #include "l2.h" #include "l2_p.h" +#include + +typedef struct { + char *buf; + int bufpos; + int bufsize; +} l2_ch_buffer_t; + static int hook_create(l2_context_t *ctx) { + l2_ch_buffer_t *cfg; + + if ((cfg = (l2_ch_buffer_t *)malloc(sizeof(l2_ch_buffer_t))) == NULL) + return L2_ERROR; + cfg->buf = NULL; + cfg->bufpos = 0; + cfg->bufsize = 4096; + ctx->vp = cfg; return L2_OK; } static int hook_configure(l2_context_t *ctx, const char *fmt, va_list ap) { - return L2_OK; + l2_ch_buffer_t *cfg; + l2_param_t pa[3]; + l2_error_t rv; + + if ((cfg = (l2_ch_buffer_t *)ctx->vp) == NULL) + return L2_ERROR; + L2_PARAM_SET(pa[0], size, INT, &cfg->bufsize); + L2_PARAM_END(pa[2]); + rv = l2_channel_setparams(pa, fmt, ap); + if (cfg->bufsize < 0) + return L2_ERROR; + return rv; } -static int hook_open(l2_context_t *ctx, l2_channel_t *below) +static int hook_open(l2_context_t *ctx, l2_channel_t *downstream) { + l2_ch_buffer_t *cfg; + + if ((cfg = (l2_ch_buffer_t *)ctx->vp) == NULL) + return L2_ERROR; + if (cfg->bufsize > 0) { + if ((cfg->buf = malloc(cfg->bufsize)) == NULL) + return L2_ERROR; + cfg->bufpos = 0; + } + if (downstream != NULL) + if (l2_channel_open(downstream) == L2_ERROR) + return L2_ERROR; return L2_OK; } -static int hook_write(l2_context_t *ctx, l2_channel_t *below, - const char *buf, size_t buf_size) +static int hook_write(l2_context_t *ctx, l2_channel_t *downstream, + const char *buf, size_t bufsize) { + l2_ch_buffer_t *cfg; + + if ((cfg = (l2_ch_buffer_t *)ctx->vp) == NULL) + return L2_ERROR; + + if (bufsize > (cfg->bufsize - cfg->bufpos)) { + if (downstream != NULL) + if (l2_channel_write(downstream, cfg->buf, cfg->bufpos) == L2_ERROR) + return L2_ERROR; + cfg->bufpos = 0; + } + + memcpy(cfg->buf+cfg->bufpos, buf, bufsize); + cfg->bufpos += bufsize; + return L2_OK; } -static int hook_flush(l2_context_t *ctx, l2_channel_t *below) +static int hook_flush(l2_context_t *ctx, l2_channel_t *downstream) { + l2_ch_buffer_t *cfg; + + if ((cfg = (l2_ch_buffer_t *)ctx->vp) == NULL) + return L2_ERROR; + + if (cfg->bufpos > 0) { + if (downstream != NULL) + if (l2_channel_write(downstream, cfg->buf, cfg->bufpos) == L2_ERROR) + return L2_ERROR; + cfg->bufpos = 0; + } + + if (downstream != NULL) + if (l2_channel_flush(downstream) == L2_ERROR) + return L2_ERROR; return L2_OK; } -static int hook_close(l2_context_t *ctx, l2_channel_t *below) +static int hook_close(l2_context_t *ctx, l2_channel_t *downstream) { + l2_ch_buffer_t *cfg; + + if (downstream != NULL) + if (l2_channel_close(downstream) == L2_ERROR) + return L2_ERROR; + if ((cfg = (l2_ch_buffer_t *)ctx->vp) == NULL) + return L2_ERROR; + if (cfg->buf != NULL) { + free(cfg->buf); + cfg->buf = NULL; + } return L2_OK; } static int hook_destroy(l2_context_t *ctx) { + l2_ch_buffer_t *cfg; + + if ((cfg = (l2_ch_buffer_t *)ctx->vp) == NULL) + return L2_ERROR; + if (cfg->buf != NULL) + free(cfg->buf); + free(cfg); return L2_OK; } Index: ossp-pkg/l2/l2_channel.c ============================================================ $ cvs diff -u -r1.2 -r1.3 l2_channel.c --- ossp-pkg/l2/l2_channel.c 2001/05/22 18:47:31 1.2 +++ ossp-pkg/l2/l2_channel.c 2001/05/22 20:00:12 1.3 @@ -95,6 +95,10 @@ ch = ch->below; if (ch == NULL) return L2_ERROR; + if (buf == NULL) + return L2_ERROR; + if (bufsize == 0) + return L2_OK; return ch->handler.write(&ch->context, ch->below, buf, bufsize); } From ossp-cvs-owner@ossp.org Wed May 23 23:44:34 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f4NLiWi76548; Wed, 23 May 2001 23:44:32 +0200 (CEST) Date: Wed, 23 May 2001 23:44:32 +0200 (CEST) Message-Id: <200105232144.f4NLiWi76548@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/l2 TODO Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 23-May-2001 23:44:32 Branch: HEAD Handle: 2001052322443200 Modified files: ossp-pkg/l2 TODO Log: test commit Summary: Revision Changes Path 1.4 +1 -0 ossp-pkg/l2/TODO ____________________________________________________________________________ Index: ossp-pkg/l2/TODO ============================================================ $ cvs diff -u -r1.3 -r1.4 TODO --- ossp-pkg/l2/TODO 2001/05/19 10:23:32 1.3 +++ ossp-pkg/l2/TODO 2001/05/23 21:44:32 1.4 @@ -2,6 +2,7 @@ OSSP L2 ======= + Timeplan -------- From ossp-cvs-owner@ossp.org Thu May 24 11:40:31 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f4O9eTt64168; Thu, 24 May 2001 11:40:29 +0200 (CEST) Date: Thu, 24 May 2001 11:40:29 +0200 (CEST) Message-Id: <200105240940.f4O9eTt64168@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/l2 l2.h l2_ch_buffer.c l2_ch_file.c l2_channel.c ... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 24-May-2001 11:40:29 Branch: HEAD Handle: 2001052410402800 Modified files: ossp-pkg/l2 l2.h l2_ch_buffer.c l2_ch_file.c l2_channel.c l2_p.h Log: o rename l2_error_t to l2_result_t o introduce internal channel state for API robustness Summary: Revision Changes Path 1.5 +1 -1 ossp-pkg/l2/l2.h 1.4 +1 -1 ossp-pkg/l2/l2_ch_buffer.c 1.6 +1 -1 ossp-pkg/l2/l2_ch_file.c 1.4 +57 -24 ossp-pkg/l2/l2_channel.c 1.4 +7 -1 ossp-pkg/l2/l2_p.h ____________________________________________________________________________ Index: ossp-pkg/l2/l2.h ============================================================ $ cvs diff -u -r1.4 -r1.5 l2.h --- ossp-pkg/l2/l2.h 2001/05/22 18:47:31 1.4 +++ ossp-pkg/l2/l2.h 2001/05/24 09:40:28 1.5 @@ -77,7 +77,7 @@ typedef enum { L2_OK, L2_ERROR -} l2_error_t; +} l2_result_t; /* context union for storing data */ union l2_context_un { Index: ossp-pkg/l2/l2_ch_buffer.c ============================================================ $ cvs diff -u -r1.3 -r1.4 l2_ch_buffer.c --- ossp-pkg/l2/l2_ch_buffer.c 2001/05/22 20:00:12 1.3 +++ ossp-pkg/l2/l2_ch_buffer.c 2001/05/24 09:40:28 1.4 @@ -55,7 +55,7 @@ { l2_ch_buffer_t *cfg; l2_param_t pa[3]; - l2_error_t rv; + l2_result_t rv; if ((cfg = (l2_ch_buffer_t *)ctx->vp) == NULL) return L2_ERROR; Index: ossp-pkg/l2/l2_ch_file.c ============================================================ $ cvs diff -u -r1.5 -r1.6 l2_ch_file.c --- ossp-pkg/l2/l2_ch_file.c 2001/05/22 18:47:31 1.5 +++ ossp-pkg/l2/l2_ch_file.c 2001/05/24 09:40:28 1.6 @@ -68,7 +68,7 @@ { l2_ch_file_t *cfg; l2_param_t pa[3]; - l2_error_t rv; + l2_result_t rv; /* parameter checks */ if ((cfg = (l2_ch_file_t *)ctx->vp) == NULL) Index: ossp-pkg/l2/l2_channel.c ============================================================ $ cvs diff -u -r1.3 -r1.4 l2_channel.c --- ossp-pkg/l2/l2_channel.c 2001/05/22 20:00:12 1.3 +++ ossp-pkg/l2/l2_channel.c 2001/05/24 09:40:28 1.4 @@ -31,6 +31,8 @@ #include "l2.h" #include "l2_p.h" +#include + l2_channel_t *l2_channel_create(l2_handler_t *h) { l2_channel_t *ch; @@ -39,15 +41,10 @@ return NULL; if ((ch = (l2_channel_t *)malloc(sizeof(l2_channel_t))) == NULL) return NULL; - ch->below = NULL; - ch->context.vp = NULL; - ch->handler.create = h->create; - ch->handler.configure = h->configure; - ch->handler.open = h->open; - ch->handler.write = h->write; - ch->handler.flush = h->flush; - ch->handler.close = h->close; - ch->handler.destroy = h->destroy; + ch->state = L2_CHSTATE_CREATED; + ch->downstream = NULL; + memset(&ch->context, 0, sizeof(l2_context_t)); + memcpy(&ch->handler, h, sizeof(l2_handler_t)); if (ch->handler.create(&ch->context) == L2_ERROR) { free(ch); return NULL; @@ -58,9 +55,12 @@ l2_channel_t *l2_channel_stack(l2_channel_t *ch1, l2_channel_t *ch2) { if (ch1 == NULL || ch2 == NULL) + return NULL; + if ( ch1->state != L2_CHSTATE_CREATED + || ch2->state != L2_CHSTATE_CREATED) return NULL; - ch2->below = ch1; - return ch2; + ch1->downstream = ch2; + return ch1; } int l2_channel_configure(l2_channel_t *ch, const char *fmt, ...) @@ -70,6 +70,8 @@ if (ch == NULL || fmt == NULL) return L2_ERROR; + if (ch->state != L2_CHSTATE_CREATED) + return L2_ERROR; va_start(ap, fmt); rv = ch->handler.configure(&ch->context, fmt, ap); va_end(ap); @@ -78,62 +80,91 @@ int l2_channel_open(l2_channel_t *ch) { + l2_result_t rv; + if (ch == NULL) return L2_ERROR; + if (ch->state != L2_CHSTATE_CREATED) + return L2_ERROR; while (ch != NULL && ch->handler.open == NULL) - ch = ch->below; + ch = ch->downstream; if (ch == NULL) return L2_ERROR; - return ch->handler.open(&ch->context, ch->below); + rv = ch->handler.open(&ch->context, ch->downstream); + if (rv == L2_OK) + ch->state = L2_CHSTATE_OPENED; + return rv; } int l2_channel_write(l2_channel_t *ch, const char *buf, size_t bufsize) { - if (ch == NULL || buf == NULL || bufsize <= 0) - return L2_ERROR; - while (ch != NULL && ch->handler.write == NULL) - ch = ch->below; + l2_result_t rv; + if (ch == NULL) return L2_ERROR; + if (ch->state != L2_CHSTATE_OPENED) + return L2_ERROR; if (buf == NULL) return L2_ERROR; if (bufsize == 0) return L2_OK; - return ch->handler.write(&ch->context, ch->below, buf, bufsize); + while (ch != NULL && ch->handler.write == NULL) + ch = ch->downstream; + if (ch == NULL) + return L2_ERROR; + rv = ch->handler.write(&ch->context, ch->downstream, buf, bufsize); + return rv; } int l2_channel_flush(l2_channel_t *ch) { + l2_result_t rv; + if (ch == NULL) return L2_ERROR; + if (ch->state != L2_CHSTATE_OPENED) + return L2_ERROR; while (ch != NULL && ch->handler.flush == NULL) - ch = ch->below; + ch = ch->downstream; if (ch == NULL) return L2_ERROR; - return ch->handler.flush(&ch->context, ch->below); + rv = ch->handler.flush(&ch->context, ch->downstream); + return rv; } int l2_channel_close(l2_channel_t *ch) { + l2_result_t rv; + if (ch == NULL) return L2_ERROR; + if (ch->state != L2_CHSTATE_OPENED) + return L2_ERROR; while (ch != NULL && ch->handler.close == NULL) - ch = ch->below; + ch = ch->downstream; if (ch == NULL) return L2_ERROR; - return ch->handler.close(&ch->context, ch->below); + rv = ch->handler.close(&ch->context, ch->downstream); + if (rv == L2_OK) + ch->state = L2_CHSTATE_CREATED; + return rv; } int l2_channel_destroy(l2_channel_t *ch) { - int rv = L2_OK; + l2_result_t rv; if (ch == NULL) return L2_ERROR; + if (ch->state == L2_CHSTATE_OPENED) + if ((rv = l2_channel_close(ch)) != L2_OK) + return rv; while (ch != NULL && ch->handler.destroy == NULL) - ch = ch->below; + ch = ch->downstream; if (ch != NULL) rv = ch->handler.destroy(&ch->context); + else + rv = L2_OK; free(ch); return rv; } @@ -145,6 +176,8 @@ int ok; int i; + if (pa == NULL || fmt == NULL || ap == NULL) + return L2_ERROR; cpE = fmt; while (*cpE != '\0') { /* determine begin of parameter name */ Index: ossp-pkg/l2/l2_p.h ============================================================ $ cvs diff -u -r1.3 -r1.4 l2_p.h --- ossp-pkg/l2/l2_p.h 2001/05/19 20:08:30 1.3 +++ ossp-pkg/l2/l2_p.h 2001/05/24 09:40:28 1.4 @@ -37,8 +37,14 @@ #define L2_MAX_CHANNELS 128 #define L2_MAX_FORMATTERS 128 +typedef enum { + L2_CHSTATE_CREATED, + L2_CHSTATE_OPENED +} l2_chstate_t; + struct l2_channel_st { - l2_channel_t *below; + l2_chstate_t state; + l2_channel_t *downstream; l2_context_t context; l2_handler_t handler; }; From ossp-cvs-owner@ossp.org Sat May 26 10:02:58 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f4Q82ul65934; Sat, 26 May 2001 10:02:56 +0200 (CEST) Date: Sat, 26 May 2001 10:02:56 +0200 (CEST) Message-Id: <200105260802.f4Q82ul65934@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/l2 l2.h l2_ch_fd.c l2_ch_filter.c l2_ch_null.c l2... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 26-May-2001 10:02:56 Branch: HEAD Handle: 2001052609025500 Modified files: ossp-pkg/l2 l2.h l2_ch_fd.c l2_ch_filter.c l2_ch_null.c l2_ch_pipe.c l2_ch_prefix.c l2_ch_socket.c l2_ch_syslog.c l2_stream.c Log: change terminology: below -> downstream Summary: Revision Changes Path 1.6 +4 -4 ossp-pkg/l2/l2.h 1.3 +4 -4 ossp-pkg/l2/l2_ch_fd.c 1.3 +4 -4 ossp-pkg/l2/l2_ch_filter.c 1.3 +4 -4 ossp-pkg/l2/l2_ch_null.c 1.3 +4 -4 ossp-pkg/l2/l2_ch_pipe.c 1.3 +4 -4 ossp-pkg/l2/l2_ch_prefix.c 1.3 +4 -4 ossp-pkg/l2/l2_ch_socket.c 1.4 +4 -4 ossp-pkg/l2/l2_ch_syslog.c 1.4 +1 -1 ossp-pkg/l2/l2_stream.c ____________________________________________________________________________ Index: ossp-pkg/l2/l2.h ============================================================ $ cvs diff -u -r1.5 -r1.6 l2.h --- ossp-pkg/l2/l2.h 2001/05/24 09:40:28 1.5 +++ ossp-pkg/l2/l2.h 2001/05/26 08:02:55 1.6 @@ -120,10 +120,10 @@ struct l2_handler_st { int (*create) (l2_context_t *ctx); int (*configure)(l2_context_t *ctx, const char *fmt, va_list ap); - int (*open) (l2_context_t *ctx, l2_channel_t *below); - int (*write) (l2_context_t *ctx, l2_channel_t *below, const char *buf, size_t buf_size); - int (*flush) (l2_context_t *ctx, l2_channel_t *below); - int (*close) (l2_context_t *ctx, l2_channel_t *below); + int (*open) (l2_context_t *ctx, l2_channel_t *downstream); + int (*write) (l2_context_t *ctx, l2_channel_t *downstream, const char *buf, size_t buf_size); + int (*flush) (l2_context_t *ctx, l2_channel_t *downstream); + int (*close) (l2_context_t *ctx, l2_channel_t *downstream); int (*destroy) (l2_context_t *ctx); }; Index: ossp-pkg/l2/l2_ch_fd.c ============================================================ $ cvs diff -u -r1.2 -r1.3 l2_ch_fd.c --- ossp-pkg/l2/l2_ch_fd.c 2001/05/11 17:07:52 1.2 +++ ossp-pkg/l2/l2_ch_fd.c 2001/05/26 08:02:55 1.3 @@ -40,23 +40,23 @@ return L2_OK; } -static int hook_open(l2_context_t *ctx, l2_channel_t *below) +static int hook_open(l2_context_t *ctx, l2_channel_t *downstream) { return L2_OK; } -static int hook_write(l2_context_t *ctx, l2_channel_t *below, +static int hook_write(l2_context_t *ctx, l2_channel_t *downstream, const char *buf, size_t buf_size) { return L2_OK; } -static int hook_flush(l2_context_t *ctx, l2_channel_t *below) +static int hook_flush(l2_context_t *ctx, l2_channel_t *downstream) { return L2_OK; } -static int hook_close(l2_context_t *ctx, l2_channel_t *below) +static int hook_close(l2_context_t *ctx, l2_channel_t *downstream) { return L2_OK; } Index: ossp-pkg/l2/l2_ch_filter.c ============================================================ $ cvs diff -u -r1.2 -r1.3 l2_ch_filter.c --- ossp-pkg/l2/l2_ch_filter.c 2001/05/11 17:07:52 1.2 +++ ossp-pkg/l2/l2_ch_filter.c 2001/05/26 08:02:55 1.3 @@ -40,23 +40,23 @@ return L2_OK; } -static int hook_open(l2_context_t *ctx, l2_channel_t *below) +static int hook_open(l2_context_t *ctx, l2_channel_t *downstream) { return L2_OK; } -static int hook_write(l2_context_t *ctx, l2_channel_t *below, +static int hook_write(l2_context_t *ctx, l2_channel_t *downstream, const char *buf, size_t buf_size) { return L2_OK; } -static int hook_flush(l2_context_t *ctx, l2_channel_t *below) +static int hook_flush(l2_context_t *ctx, l2_channel_t *downstream) { return L2_OK; } -static int hook_close(l2_context_t *ctx, l2_channel_t *below) +static int hook_close(l2_context_t *ctx, l2_channel_t *downstream) { return L2_OK; } Index: ossp-pkg/l2/l2_ch_null.c ============================================================ $ cvs diff -u -r1.2 -r1.3 l2_ch_null.c --- ossp-pkg/l2/l2_ch_null.c 2001/05/11 17:07:52 1.2 +++ ossp-pkg/l2/l2_ch_null.c 2001/05/26 08:02:55 1.3 @@ -40,23 +40,23 @@ return L2_OK; } -static int hook_open(l2_context_t *ctx, l2_channel_t *below) +static int hook_open(l2_context_t *ctx, l2_channel_t *downstream) { return L2_OK; } -static int hook_write(l2_context_t *ctx, l2_channel_t *below, +static int hook_write(l2_context_t *ctx, l2_channel_t *downstream, const char *buf, size_t buf_size) { return L2_OK; } -static int hook_flush(l2_context_t *ctx, l2_channel_t *below) +static int hook_flush(l2_context_t *ctx, l2_channel_t *downstream) { return L2_OK; } -static int hook_close(l2_context_t *ctx, l2_channel_t *below) +static int hook_close(l2_context_t *ctx, l2_channel_t *downstream) { return L2_OK; } Index: ossp-pkg/l2/l2_ch_pipe.c ============================================================ $ cvs diff -u -r1.2 -r1.3 l2_ch_pipe.c --- ossp-pkg/l2/l2_ch_pipe.c 2001/05/11 17:07:52 1.2 +++ ossp-pkg/l2/l2_ch_pipe.c 2001/05/26 08:02:55 1.3 @@ -40,23 +40,23 @@ return L2_OK; } -static int hook_open(l2_context_t *ctx, l2_channel_t *below) +static int hook_open(l2_context_t *ctx, l2_channel_t *downstream) { return L2_OK; } -static int hook_write(l2_context_t *ctx, l2_channel_t *below, +static int hook_write(l2_context_t *ctx, l2_channel_t *downstream, const char *buf, size_t buf_size) { return L2_OK; } -static int hook_flush(l2_context_t *ctx, l2_channel_t *below) +static int hook_flush(l2_context_t *ctx, l2_channel_t *downstream) { return L2_OK; } -static int hook_close(l2_context_t *ctx, l2_channel_t *below) +static int hook_close(l2_context_t *ctx, l2_channel_t *downstream) { return L2_OK; } Index: ossp-pkg/l2/l2_ch_prefix.c ============================================================ $ cvs diff -u -r1.2 -r1.3 l2_ch_prefix.c --- ossp-pkg/l2/l2_ch_prefix.c 2001/05/11 17:07:52 1.2 +++ ossp-pkg/l2/l2_ch_prefix.c 2001/05/26 08:02:55 1.3 @@ -40,23 +40,23 @@ return L2_OK; } -static int hook_open(l2_context_t *ctx, l2_channel_t *below) +static int hook_open(l2_context_t *ctx, l2_channel_t *downstream) { return L2_OK; } -static int hook_write(l2_context_t *ctx, l2_channel_t *below, +static int hook_write(l2_context_t *ctx, l2_channel_t *downstream, const char *buf, size_t buf_size) { return L2_OK; } -static int hook_flush(l2_context_t *ctx, l2_channel_t *below) +static int hook_flush(l2_context_t *ctx, l2_channel_t *downstream) { return L2_OK; } -static int hook_close(l2_context_t *ctx, l2_channel_t *below) +static int hook_close(l2_context_t *ctx, l2_channel_t *downstream) { return L2_OK; } Index: ossp-pkg/l2/l2_ch_socket.c ============================================================ $ cvs diff -u -r1.2 -r1.3 l2_ch_socket.c --- ossp-pkg/l2/l2_ch_socket.c 2001/05/11 17:07:52 1.2 +++ ossp-pkg/l2/l2_ch_socket.c 2001/05/26 08:02:55 1.3 @@ -40,23 +40,23 @@ return L2_OK; } -static int hook_open(l2_context_t *ctx, l2_channel_t *below) +static int hook_open(l2_context_t *ctx, l2_channel_t *downstream) { return L2_OK; } -static int hook_write(l2_context_t *ctx, l2_channel_t *below, +static int hook_write(l2_context_t *ctx, l2_channel_t *downstream, const char *buf, size_t buf_size) { return L2_OK; } -static int hook_flush(l2_context_t *ctx, l2_channel_t *below) +static int hook_flush(l2_context_t *ctx, l2_channel_t *downstream) { return L2_OK; } -static int hook_close(l2_context_t *ctx, l2_channel_t *below) +static int hook_close(l2_context_t *ctx, l2_channel_t *downstream) { return L2_OK; } Index: ossp-pkg/l2/l2_ch_syslog.c ============================================================ $ cvs diff -u -r1.3 -r1.4 l2_ch_syslog.c --- ossp-pkg/l2/l2_ch_syslog.c 2001/05/17 14:42:00 1.3 +++ ossp-pkg/l2/l2_ch_syslog.c 2001/05/26 08:02:55 1.4 @@ -42,24 +42,24 @@ return L2_OK; } -static int hook_open(l2_context_t *ctx, l2_channel_t *below) +static int hook_open(l2_context_t *ctx, l2_channel_t *downstream) { return L2_OK; } -static int hook_write(l2_context_t *ctx, l2_channel_t *below, +static int hook_write(l2_context_t *ctx, l2_channel_t *downstream, const char *buf, size_t buf_size) { syslog(LOG_INFO, buf); return L2_OK; } -static int hook_flush(l2_context_t *ctx, l2_channel_t *below) +static int hook_flush(l2_context_t *ctx, l2_channel_t *downstream) { return L2_OK; } -static int hook_close(l2_context_t *ctx, l2_channel_t *below) +static int hook_close(l2_context_t *ctx, l2_channel_t *downstream) { return L2_OK; } Index: ossp-pkg/l2/l2_stream.c ============================================================ $ cvs diff -u -r1.3 -r1.4 l2_stream.c --- ossp-pkg/l2/l2_stream.c 2001/05/22 18:47:31 1.3 +++ ossp-pkg/l2/l2_stream.c 2001/05/26 08:02:55 1.4 @@ -79,7 +79,7 @@ len = vsnprintf(st->message, L2_MAX_MSGSIZE, fmt, ap); for (i = 0; i <= L2_MAX_CHANNELS && st->channels[i] != NULL; i++) st->channels[i]->handler.write(&st->channels[i]->context, - st->channels[i]->below, + st->channels[i]->downstream, st->message, len); return; } From ossp-cvs-owner@ossp.org Sat May 26 10:04:15 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f4Q84CK66060; Sat, 26 May 2001 10:04:12 +0200 (CEST) Date: Sat, 26 May 2001 10:04:12 +0200 (CEST) Message-Id: <200105260804.f4Q84CK66060@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/l2 l2.h l2_ch_syslog.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 26-May-2001 10:04:12 Branch: HEAD Handle: 2001052609041200 Modified files: ossp-pkg/l2 l2.h l2_ch_syslog.c Log: cleanup style Summary: Revision Changes Path 1.7 +2 -2 ossp-pkg/l2/l2.h 1.5 +2 -3 ossp-pkg/l2/l2_ch_syslog.c ____________________________________________________________________________ Index: ossp-pkg/l2/l2.h ============================================================ $ cvs diff -u -r1.6 -r1.7 l2.h --- ossp-pkg/l2/l2.h 2001/05/26 08:02:55 1.6 +++ ossp-pkg/l2/l2.h 2001/05/26 08:04:12 1.7 @@ -168,8 +168,8 @@ l2_stream_t *l2_stream_channel (l2_stream_t *st, l2_channel_t *ch, unsigned int levelmask); l2_stream_t *l2_stream_formatter (l2_stream_t *st, l2_formatter_t *cb, l2_context_t *ctx); unsigned int l2_stream_levels (l2_stream_t *st, unsigned int levelmask); -void l2_stream_log (l2_stream_t *st, unsigned int log_level, const char* fmt, ...); -void l2_stream_vlog (l2_stream_t *st, unsigned int log_level, const char* fmt, va_list ap); +void l2_stream_log (l2_stream_t *st, unsigned int log_level, const char *fmt, ...); +void l2_stream_vlog (l2_stream_t *st, unsigned int log_level, const char *fmt, va_list ap); void l2_stream_destroy (l2_stream_t *st); #endif /* __L2_H__ */ Index: ossp-pkg/l2/l2_ch_syslog.c ============================================================ $ cvs diff -u -r1.4 -r1.5 l2_ch_syslog.c --- ossp-pkg/l2/l2_ch_syslog.c 2001/05/26 08:02:55 1.4 +++ ossp-pkg/l2/l2_ch_syslog.c 2001/05/26 08:04:12 1.5 @@ -49,10 +49,9 @@ static int hook_write(l2_context_t *ctx, l2_channel_t *downstream, const char *buf, size_t buf_size) - { - syslog(LOG_INFO, buf); +{ return L2_OK; - } +} static int hook_flush(l2_context_t *ctx, l2_channel_t *downstream) { From ossp-cvs-owner@ossp.org Sat May 26 10:06:28 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f4Q86R866525; Sat, 26 May 2001 10:06:27 +0200 (CEST) Date: Sat, 26 May 2001 10:06:27 +0200 (CEST) Message-Id: <200105260806.f4Q86R866525@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/l2 TODO Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 26-May-2001 10:06:26 Branch: HEAD Handle: 2001052609062600 Modified files: ossp-pkg/l2 TODO Log: forget timestamps now that I've to do it myself and we are now in holiday for two weeks Summary: Revision Changes Path 1.5 +4 -4 ossp-pkg/l2/TODO ____________________________________________________________________________ Index: ossp-pkg/l2/TODO ============================================================ $ cvs diff -u -r1.4 -r1.5 TODO --- ossp-pkg/l2/TODO 2001/05/23 21:44:32 1.4 +++ ossp-pkg/l2/TODO 2001/05/26 08:06:26 1.5 @@ -6,18 +6,18 @@ Timeplan -------- -o M1 (14.05.2001) +o M1 - fixed C API - established build environment -o M2 (21.05.2001) +o M2 - implemented C API - fixed C++ API -o M3 (11.06.2001) +o M3 - implemented C++ API - documented C API - documented C++ API - release version 0.9.0 -o M4 (25.06.2001) +o M4 - release version 1.0.0 TODO From ossp-cvs-owner@ossp.org Sat May 26 10:07:57 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f4Q87uI66661; Sat, 26 May 2001 10:07:56 +0200 (CEST) Date: Sat, 26 May 2001 10:07:56 +0200 (CEST) Message-Id: <200105260807.f4Q87uI66661@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/l2 TODO Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 26-May-2001 10:07:56 Branch: HEAD Handle: 2001052609075500 Modified files: ossp-pkg/l2 TODO Log: remember things Summary: Revision Changes Path 1.6 +4 -8 ossp-pkg/l2/TODO ____________________________________________________________________________ Index: ossp-pkg/l2/TODO ============================================================ $ cvs diff -u -r1.5 -r1.6 TODO --- ossp-pkg/l2/TODO 2001/05/26 08:06:26 1.5 +++ ossp-pkg/l2/TODO 2001/05/26 08:07:55 1.6 @@ -20,15 +20,11 @@ o M4 - release version 1.0.0 -TODO ----- +ATTENTION +--------- -- channel backends -- message formatting -- rc-file autoconfiguration -- C++ API -- documentation C API -- documentation C++ API +o hook_write's should perhaps receive a nul-termined string + instead of buf+size, because syslog else has to re-buffer it. BRAINSTORMING ------------- From ossp-cvs-owner@ossp.org Tue Jun 12 13:29:13 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f5CBTBn10060; Tue, 12 Jun 2001 13:29:11 +0200 (CEST) Date: Tue, 12 Jun 2001 13:29:11 +0200 (CEST) Message-Id: <200106121129.f5CBTBn10060@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/erpc EVAL Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 12-Jun-2001 13:29:11 Branch: HEAD Handle: 2001061212291100 Modified files: ossp-pkg/erpc EVAL Log: Added template for description of the evaluated packages. Summary: Revision Changes Path 1.2 +14 -1 ossp-pkg/erpc/EVAL ____________________________________________________________________________ Index: ossp-pkg/erpc/EVAL ============================================================ $ cvs diff -u -r1.1 -r1.2 EVAL --- ossp-pkg/erpc/EVAL 2001/05/22 14:45:31 1.1 +++ ossp-pkg/erpc/EVAL 2001/06/12 11:29:11 1.2 @@ -2,6 +2,19 @@ Evaluation ========== +- Name, Autor, Jahr +- URL +- Sprache +- Veschreibung, Klassifizierung +- Bewertung: + - Stand-alone? + - Self-contained? + - Portabel? + - Code ist sauber? + - API ist orthogonal? +- Verwendete Protokolle +- Warum nehmen wir's nicht. + o Spread http://www.spread.org/ @@ -50,4 +63,4 @@ depends on re2c and is implemented in cpp, neither RPCv1 nor RPCv2 XMLRPC ..... taugt nicht, nur nettes Konzept, keine C Implementierung, starker Overhead, etc. - + From ossp-cvs-owner@ossp.org Tue Jun 12 15:14:49 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f5CDEmV22587; Tue, 12 Jun 2001 15:14:48 +0200 (CEST) Date: Tue, 12 Jun 2001 15:14:48 +0200 (CEST) Message-Id: <200106121314.f5CDEmV22587@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/erpc TODO Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 12-Jun-2001 15:14:48 Branch: HEAD Handle: 2001061214144800 Modified files: ossp-pkg/erpc TODO Log: Updated milestones. Summary: Revision Changes Path 1.3 +48 -14 ossp-pkg/erpc/TODO ____________________________________________________________________________ Index: ossp-pkg/erpc/TODO ============================================================ $ cvs diff -u -r1.2 -r1.3 TODO --- ossp-pkg/erpc/TODO 2001/05/22 14:38:26 1.2 +++ ossp-pkg/erpc/TODO 2001/06/12 13:14:48 1.3 @@ -1,25 +1,59 @@ -Efficient RPC (E-RPC) -===================== +Simple RPC +========== Architecture: -- libeprc -- libserialize +- Abstracted Message Passing Library: libamp +- eXtendable Data Serialization Library: libxds +- Simple Remote Procedure Call Library: libsrpc +TODO: + +- The server actually performing the function call has to interpret + the transferred data according to the functions prototype. This may + be done in one of the following ways: + + - All functions have the same prototype. The function may then be a + stub calling the actual function. These stubs can be generated + manually or semi-automatically. + + - Allow only a finite set of prototypes and switch according to the + function tye, like in eAPI in Apache. + + - Build function call dynamically using the Foreign Function Call + library. + +- The programmer should be able to specify whether his implementations + need guarantees of being called at least once, exactly once, etc. + + o M1 (peti) [11-Jun-2001] - evaluation (-> ideas) (checklist) - prototype (C++) -o M2 (peti+rse) [02-Jul-2001] + +o M2 (peti+rse) [25-Jun-2001] - design/architecture paper (authentication+encryption framework) (< 10KB Text + 1x Figure) - - rpc protocol (ohne serialization) - (< 5KB Text) - - API specification (erpc.h, serial.h) -o M3 (peti) - - source tree - - implementation -o M4 (rse) - - OSSP integration/adjustierung -o M5 (peti) + +o M3 (peti+rse) [9-Jul-2001] + - design libxds API + - design libamp API + - preliminary design libsrpc API + +o M4 (peti) + - implementation of libxds + - implementation of libamp + +o M5 (peti+rse) + - design libsrpc API and protocol + +o M6 (peti) + - implementation libsrpc + - implementation xxxd + +o M7 (peti) - documentation + +o M8 (rse) + - OSSP integration From ossp-cvs-owner@ossp.org Tue Jun 12 15:17:02 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f5CDH0i22928; Tue, 12 Jun 2001 15:17:00 +0200 (CEST) Date: Tue, 12 Jun 2001 15:17:00 +0200 (CEST) Message-Id: <200106121317.f5CDH0i22928@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/erpc EVAL Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 12-Jun-2001 15:17:00 Branch: HEAD Handle: 2001061214170000 Modified files: ossp-pkg/erpc EVAL Log: Added ffcall library to list of components to be evaluated. Summary: Revision Changes Path 1.3 +3 -0 ossp-pkg/erpc/EVAL ____________________________________________________________________________ Index: ossp-pkg/erpc/EVAL ============================================================ $ cvs diff -u -r1.2 -r1.3 EVAL --- ossp-pkg/erpc/EVAL 2001/06/12 11:29:11 1.2 +++ ossp-pkg/erpc/EVAL 2001/06/12 13:17:00 1.3 @@ -49,6 +49,9 @@ o DCERPC ftp://gatekeeper.dec.com/pub/DEC/DCE/ +o Foreign Function Call Library + http://clisp.cons.org/~haible/packages-ffcall.html + RSE: ---- From ossp-cvs-owner@ossp.org Tue Jun 12 15:45:35 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f5CDjZ226768; Tue, 12 Jun 2001 15:45:35 +0200 (CEST) Date: Tue, 12 Jun 2001 15:45:35 +0200 (CEST) Message-Id: <200106121345.f5CDjZ226768@ossp.org> From: "OSSP Project Master" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: CVSROOT modules Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: OSSP Project Master Root: /e/ossp/cvs Email: ossp@ossp.org Module: CVSROOT Date: 12-Jun-2001 15:45:35 Branch: HEAD Handle: 2001061214453400 Modified files: CVSROOT modules Log: erpc -> srpc Summary: Revision Changes Path 1.25 +1 -1 CVSROOT/modules ____________________________________________________________________________ Index: CVSROOT/modules ============================================================ $ cvs diff -u -r1.24 -r1.25 modules --- CVSROOT/modules 2001/05/22 14:36:05 1.24 +++ CVSROOT/modules 2001/06/12 13:45:34 1.25 @@ -73,5 +73,5 @@ str ossp-pkg/str sugar ossp-pkg/sugar l2 ossp-pkg/l2 -erpc ossp-pkg/erpc +srpc ossp-pkg/srpc From ossp-cvs-owner@ossp.org Tue Jun 19 17:50:12 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f5JFoAC50087; Tue, 19 Jun 2001 17:50:10 +0200 (CEST) Date: Tue, 19 Jun 2001 17:50:10 +0200 (CEST) Message-Id: <200106191550.f5JFoAC50087@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc EVAL Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 19-Jun-2001 17:50:10 Branch: HEAD Handle: 2001061916501000 Modified files: ossp-pkg/srpc EVAL Log: Added comments for the packages I evaluated: Spread, XML-RPC, RPC2, MRPC, LinuxDoors, ORBit, and TIRPC. Summary: Revision Changes Path 1.4 +88 -51 ossp-pkg/srpc/EVAL ____________________________________________________________________________ Index: ossp-pkg/srpc/EVAL ============================================================ $ cvs diff -u -r1.3 -r1.4 EVAL --- ossp-pkg/srpc/EVAL 2001/06/12 13:17:00 1.3 +++ ossp-pkg/srpc/EVAL 2001/06/19 15:50:10 1.4 @@ -1,28 +1,93 @@ + Evaluation + ========== -Evaluation -========== +o Spread, http://www.spread.org/ -- Name, Autor, Jahr -- URL -- Sprache -- Veschreibung, Klassifizierung -- Bewertung: - - Stand-alone? - - Self-contained? - - Portabel? - - Code ist sauber? - - API ist orthogonal? -- Verwendete Protokolle -- Warum nehmen wir's nicht. - -o Spread - http://www.spread.org/ - -o XML-RPC: - http://www.xmlrpc.org/ - http://www.focusresearch.com/gregor/sw/XPC/ - http://xmlrpc-c.sourceforge.net/ + Spread is a sophisticated framework for distributed computing. The + software itself is written in C and uses a design very similar to + SRPC's: It is split into a permanently running daemon and a link + library containing interface routines to that daemon to the + programmer. The daemon will maintain so called "groups", which + computers can join and leave. Furthermore the daemon provides group + communication services based on TCP, UDP or Multicast-UPD. Via this + communication services, the actual remote procedure calls are + implemented. + The software seems to be actively maintained, well-written and + documented, but unfortunately the following drawbacks kept us from + using it: + + - Spread's license prohibits any commercial use. + + - It is not possible for peers to communicate without the daemon. + + - The API for the programmer is somewhat messy. + + +o XML-RPC, http://www.xmlrpc.org/ + + XML-RPC is a standardized remote procedure call framework for which + several complying implementations exist. These implementations + provide support for the programming languages Perl, Python, Java, + C/C++, Lisp, PHP, Microsoft .NET, Tcl, Delphi, WebObjects and many + more. Remote procedure calls are encoded in a portable XML + representation and transferred via HTTP. + + The software seems to be popular and many resources dealing with + XML-RPC exist, but for us the massive XML encoding overhead was too + much. + + +o RPC2, http://www.coda.cs.cmu.edu/ + + This RPC mechanism is part of the CODA network file system, but it + can be used without the file system part. RPC2 consists of a link + library for the programmer and a stub generator, that will create + function descriptions, which the library can then use to call the + described function remotely. The whole approach is very clean and + minimalistic, but unfortunately, the code depends on liblwp -- a + user space threading library. While threading is certainly useful on + many occasions, we did not want to use a system that enforces + threading. In C++, for instance, the behavior of exceptions within a + thread are totally unspecified. Furthermore, user space threads do + not achieve the performance of kernel threads, nor are they + portable. + + +o MRPC, http://www.tildeslash.org/mrpc.html + + "Modular RPC" is a minimalistic remote procedure call mechanism + using a similar design as the original RPC: It consists of a code + generator that will encapsulate function definitions in such a way + that they can be called remotely with the functions provided in a + link library. The whole system is very lean and efficient, + marshaling is done automatically for most data types, and the + provided documentation is sufficient. + + Unfortunately, the whole system is written in C++ and can thus not + trivially be used in plain C or any other language. + + +o LinuxDoors, http://www.rampant.org/doors/ + + The author discontinued development of the package in May 2001. The + current version 0.9 is considered to be alpha quality software. + + +o ORBit, http://orbit-resource.sourceforge.net/ + + ORBit is a CORBA 2.2-compliant object request broker. Do I need to + say more? + + +o TIRPC, ftp://ftp.uu.net/networking/rpc/ + + The "Transport Independent RPC" package is derived from the original + SUN RPC and uses the TLI interface to access the network. + Unfortunately, TLI is not widely supported; sockets rule the + communication market. Thus, the package is not very useful for us. + + o SunRPC rfc1050.txt rfc1057.txt @@ -32,38 +97,10 @@ rfc2203.txt rfc2695.txt -o SRA - Secure RPC Authentication for TELNET and FTP - net.tamu.edu:pub/security/TAMU/ - -o RPC2 - ftp://ftp.coda.cs.cmu.edu/pub/rpc2/ - -o MRPC - http://www.tildeslash.org/mrpc.html - http://www.tildeslash.org/mrpc/ -o LinuxDoors - http://www.rampant.org/doors/ - o DCERPC ftp://gatekeeper.dec.com/pub/DEC/DCE/ + o Foreign Function Call Library http://clisp.cons.org/~haible/packages-ffcall.html - -RSE: ----- - -ORBit ...... nice ORBit 2.2 implementation in C, but undocumented -FreeBSD .... the most clean RPC, but only RPCv1 -SunRPC40 ... too old, FreeBSD's code is much more feature-full and portable, RPCv1 -NetBSD ..... very similar to FreeBSD code with a few addons "long long", but less clean, RPCv1 -tirpc ...... Transport Layer Independent RPC, but unportable and old -RPC2 ....... nice concept, but neither RPCv1 nor RPC2 and requires LWP library - and is also bundled strongly with it -MRPC ....... modular architecture (tranport layer interchangeable), but - depends on re2c and is implemented in cpp, neither RPCv1 nor RPCv2 -XMLRPC ..... taugt nicht, nur nettes Konzept, keine C Implementierung, - starker Overhead, etc. - From ossp-cvs-owner@ossp.org Tue Jun 19 19:07:10 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f5JH79I58959; Tue, 19 Jun 2001 19:07:09 +0200 (CEST) Date: Tue, 19 Jun 2001 19:07:09 +0200 (CEST) Message-Id: <200106191707.f5JH79I58959@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc EVAL Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 19-Jun-2001 19:07:09 Branch: HEAD Handle: 2001061918070800 Modified files: ossp-pkg/srpc EVAL Log: Add infos from the Spreads BOF at ApacheCon 2001 in Santa Clara Summary: Revision Changes Path 1.5 +5 -1 ossp-pkg/srpc/EVAL ____________________________________________________________________________ Index: ossp-pkg/srpc/EVAL ============================================================ $ cvs diff -u -r1.4 -r1.5 EVAL --- ossp-pkg/srpc/EVAL 2001/06/19 15:50:10 1.4 +++ ossp-pkg/srpc/EVAL 2001/06/19 17:07:08 1.5 @@ -17,7 +17,11 @@ documented, but unfortunately the following drawbacks kept us from using it: - - Spread's license prohibits any commercial use. + - Spread's license currently prohibits any commercial use. + But according to the authors (as of April 2001) they are providing + special license exceptions for Open Source projects and working on + moving Spread to a commercial split of from their University and + then releasing Spread under a real Open Source license. - It is not possible for peers to communicate without the daemon. From ossp-cvs-owner@ossp.org Tue Jun 19 19:08:57 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f5JH8uA59160; Tue, 19 Jun 2001 19:08:56 +0200 (CEST) Date: Tue, 19 Jun 2001 19:08:56 +0200 (CEST) Message-Id: <200106191708.f5JH8uA59160@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc EVAL Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 19-Jun-2001 19:08:56 Branch: HEAD Handle: 2001061918085500 Modified files: ossp-pkg/srpc EVAL Log: add more info from ApacheCon Summary: Revision Changes Path 1.6 +5 -0 ossp-pkg/srpc/EVAL ____________________________________________________________________________ Index: ossp-pkg/srpc/EVAL ============================================================ $ cvs diff -u -r1.5 -r1.6 EVAL --- ossp-pkg/srpc/EVAL 2001/06/19 17:07:08 1.5 +++ ossp-pkg/srpc/EVAL 2001/06/19 17:08:55 1.6 @@ -24,6 +24,11 @@ then releasing Spread under a real Open Source license. - It is not possible for peers to communicate without the daemon. + (RSE: I'm not sure about this. If I understood the Spread guys + correctly at ApacheCon 2001 it should be possible to run it + without the daemon or at least with an own application-dedicated + daemon instead of a system-dedicated daemon. We should check this + in details). - The API for the programmer is somewhat messy. From ossp-cvs-owner@ossp.org Tue Jun 19 19:13:42 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f5JHDfq59498; Tue, 19 Jun 2001 19:13:41 +0200 (CEST) Date: Tue, 19 Jun 2001 19:13:41 +0200 (CEST) Message-Id: <200106191713.f5JHDfq59498@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc EVAL Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 19-Jun-2001 19:13:41 Branch: HEAD Handle: 2001061918134000 Modified files: ossp-pkg/srpc EVAL Log: Add my notes about threading to not forget it Summary: Revision Changes Path 1.7 +4 -2 ossp-pkg/srpc/EVAL ____________________________________________________________________________ Index: ossp-pkg/srpc/EVAL ============================================================ $ cvs diff -u -r1.6 -r1.7 EVAL --- ossp-pkg/srpc/EVAL 2001/06/19 17:08:55 1.6 +++ ossp-pkg/srpc/EVAL 2001/06/19 17:13:40 1.7 @@ -60,8 +60,10 @@ threading. In C++, for instance, the behavior of exceptions within a thread are totally unspecified. Furthermore, user space threads do not achieve the performance of kernel threads, nor are they - portable. - + portable (RSE: Hmmmm... I'm not sure this really holds, because + evaluation showed that 1. user-space dispatching is usually faster + than dispatching in kernel-space and 2. GNU Pth proofed that + user-space threading can be done in a very portable way). o MRPC, http://www.tildeslash.org/mrpc.html From ossp-cvs-owner@ossp.org Wed Jun 20 14:28:23 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f5KCSM615338; Wed, 20 Jun 2001 14:28:22 +0200 (CEST) Date: Wed, 20 Jun 2001 14:28:22 +0200 (CEST) Message-Id: <200106201228.f5KCSM615338@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc EVAL Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 20-Jun-2001 14:28:22 Branch: HEAD Handle: 2001062013282200 Modified files: ossp-pkg/srpc EVAL Log: Made description of what Spread does more accurate after further testing. Summary: Revision Changes Path 1.8 +14 -14 ossp-pkg/srpc/EVAL ____________________________________________________________________________ Index: ossp-pkg/srpc/EVAL ============================================================ $ cvs diff -u -r1.7 -r1.8 EVAL --- ossp-pkg/srpc/EVAL 2001/06/19 17:13:40 1.7 +++ ossp-pkg/srpc/EVAL 2001/06/20 12:28:22 1.8 @@ -3,25 +3,25 @@ o Spread, http://www.spread.org/ - Spread is a sophisticated framework for distributed computing. The - software itself is written in C and uses a design very similar to - SRPC's: It is split into a permanently running daemon and a link - library containing interface routines to that daemon to the - programmer. The daemon will maintain so called "groups", which - computers can join and leave. Furthermore the daemon provides group - communication services based on TCP, UDP or Multicast-UPD. Via this - communication services, the actual remote procedure calls are - implemented. + Spread is a sophisticated message passing framework. The software + itself is written in C and uses a design very similar to SRPC's: It + is split into a permanently running daemon and a link library + containing interface routines to that daemon for the programmer. The + daemon will maintain so called "groups", which computers can join + and leave. Furthermore the daemon provides group communication + services based on TCP, UDP or Multicast-UPD. There is no actual RPC + functionality available, but implementing such a system on top of + Spread would be relatively trivial. The software seems to be actively maintained, well-written and documented, but unfortunately the following drawbacks kept us from using it: - - Spread's license currently prohibits any commercial use. - But according to the authors (as of April 2001) they are providing - special license exceptions for Open Source projects and working on - moving Spread to a commercial split of from their University and - then releasing Spread under a real Open Source license. + - Spread's license currently prohibits any commercial use, but + according to the authors (as of April 2001) they are providing + special license exceptions for Open Source projects and working + on moving Spread to a commercial split of from their University + and then releasing Spread under a real Open Source license. - It is not possible for peers to communicate without the daemon. (RSE: I'm not sure about this. If I understood the Spread guys From ossp-cvs-owner@ossp.org Wed Jun 20 21:16:41 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f5KJGeH72158; Wed, 20 Jun 2001 21:16:40 +0200 (CEST) Date: Wed, 20 Jun 2001 21:16:40 +0200 (CEST) Message-Id: <200106201916.f5KJGeH72158@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc EVAL Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 20-Jun-2001 21:16:40 Branch: HEAD Handle: 2001062020164000 Modified files: ossp-pkg/srpc EVAL Log: Add XDS part for evaluation Summary: Revision Changes Path 1.9 +15 -0 ossp-pkg/srpc/EVAL ____________________________________________________________________________ Index: ossp-pkg/srpc/EVAL ============================================================ $ cvs diff -u -r1.8 -r1.9 EVAL --- ossp-pkg/srpc/EVAL 2001/06/20 12:28:22 1.8 +++ ossp-pkg/srpc/EVAL 2001/06/20 19:16:40 1.9 @@ -115,3 +115,18 @@ o Foreign Function Call Library http://clisp.cons.org/~haible/packages-ffcall.html + + +Evaluation for XDS +================== + +o libbinio + http://members.home.net/mikpos/libbinio/ +o HiM + http://www.sama.ru/~despair/him/ +o pbio + ftp://ftp.cc.gatech.edu/pub/groups/systems/chaos/pbio/ +o SunRPC XDR + RFC1832 +o CORBA's IIOB(?) + From ossp-cvs-owner@ossp.org Wed Jun 20 21:18:25 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f5KJIOJ72301; Wed, 20 Jun 2001 21:18:24 +0200 (CEST) Date: Wed, 20 Jun 2001 21:18:24 +0200 (CEST) Message-Id: <200106201918.f5KJIOJ72301@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc EVAL Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 20-Jun-2001 21:18:24 Branch: HEAD Handle: 2001062020182400 Modified files: ossp-pkg/srpc EVAL Log: add XTL, fix name of CORBA beast Summary: Revision Changes Path 1.10 +4 -1 ossp-pkg/srpc/EVAL ____________________________________________________________________________ Index: ossp-pkg/srpc/EVAL ============================================================ $ cvs diff -u -r1.9 -r1.10 EVAL --- ossp-pkg/srpc/EVAL 2001/06/20 19:16:40 1.9 +++ ossp-pkg/srpc/EVAL 2001/06/20 19:18:24 1.10 @@ -128,5 +128,8 @@ ftp://ftp.cc.gatech.edu/pub/groups/systems/chaos/pbio/ o SunRPC XDR RFC1832 -o CORBA's IIOB(?) +o XTL + http://gsd.di.uminho.pt/jop/xtl/ +o CORBA GIOP CDR + ??? From ossp-cvs-owner@ossp.org Thu Jun 21 07:16:06 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f5L5G5I47253; Thu, 21 Jun 2001 07:16:05 +0200 (CEST) Date: Thu, 21 Jun 2001 07:16:05 +0200 (CEST) Message-Id: <200106210516.f5L5G5I47253@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc BRES TODO Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 21-Jun-2001 07:16:05 Branch: HEAD Handle: 2001062106160500 Added files: ossp-pkg/srpc BRES Modified files: ossp-pkg/srpc TODO Log: remember results from last ad-hoc brain-storming with team Summary: Revision Changes Path 1.1 +257 -0 ossp-pkg/srpc/BRES 1.4 +3 -26 ossp-pkg/srpc/TODO ____________________________________________________________________________ Index: ossp-pkg/srpc/BRES ============================================================ $ cvs update -p -r1.1 BRES BASIC RESEARCH AND BRAIN-STORMING ================================= - Architecture: - Abstracted Message Passing Library: libamp - eXtendable Data Serialization Library: libxds - Simple Remote Procedure Call Library: libsrpc - The server actually performing the function call has to interpret the transferred data according to the functions prototype. This may be done in one of the following ways: - All functions have the same prototype. The function may then be a stub calling the actual function. These stubs can be generated manually or semi-automatically. - Allow only a finite set of prototypes and switch according to the function tye, like in eAPI in Apache. - Build function call dynamically using the Foreign Function Call library. - reduce "int foo(int, foo_t *)" to "rpc_t foo(rpc_t)" mit rpc_t: void *, size_t because o constant function prototype on server-side (foreign function call problem!) o only application knows how to convert complex data structures (foo_t) into serialized octet-stream o greater flexibility in data transfer o rpc library complexity is reduced (on cost of application complexity) instead remote procedure call only message passing - auditing/logging: in XDS: nicht noetig in AMP: 3 levels: in API von MP und in backends und I/O dump mit Hilfe von Callbacks (L2!) - message passing / procedure call sepatered from data serialization - error semantics: transaction, ACID o exactly-once (== 1) bank transaction o at-least-once (>= 1) muss passieren, mehrfach tut nicht weh (seiteneffekte) SunRPC o at-most-once (<= 1) logging of not important data, video conferneces o reduncancy (> 1) data replication (rundancy) o quatsch (< 1 == 0) o cachable im Proxy - flexibility: o I/O functions overloading (Pth) o accept+handle, ... application handles server functionality and can fork, spawn, etc. - asynchronous vs. synchronous Ideee: intern immer asynchrouns aber in API wrapper function rpc_call == rpc_send+rpc_wait+rpc_result und auch rpc_abort trotzdem wird beide male ein timeout vorgesehen - AMP: backends local shm pipe unix socket network udp tcp ttcp - Fragmentation? - entweder AMP high-level aufgrund von backend-infos (MTU!) + Defragnmentierung - oder error aufgrund backend - Optimales Backend Protocol: - server akzepotiert N protocols - client requested M (<= N) protocols - library sucht optimalen raus (ev. abhaengig von der Message-Size) - Backend Protocols: - eventuell connection caching? - bei network problems reconnect - bei idle time shutdown + reconnect later - AMP: o optional authentication o optional packet signing - AMP+XDS: o optional encryption o optional compression - wo ist encryption und compression? in beiden mit callbacks vorsehen, da beide unabhaengig von einander imn Einsatz sein koennen! - XDS: o functionality: encoding decoding o Representation Differences - byte order (little vs. big endian) - character set (ASCII, Latin-1, Unicode, EBCDIC) - floating point (IEEEE ...) o Description: - self-describing (ASN.1) type+value - overhead + bei decode eine verification machen - non self-describing + no overhead + tut nicht weh, da xds_decode() sowieso parameter aufzaehlen muss o Welche Seite tut was: - send: into fixed set recv: from fixed set + filter/minitoring moeglich auf netzwerk seite - eventuell doppleter overhead (C+S:little endian, fixed set: big endian) - send: nothing, but append own type recv: into own set if type different + no overhead - no filtering easily possible o callbacks erlauben encoding/decoding of own data structures/types o backends: XDR (SunRPC) ASN.1 (X.509) XXX (CORBA) XML (XML-RPC) - Firewalls? Sollen die Filtern koennen Encryption nur von Data, nicht von Meta-Data - Proxies? - Sowohl AMP als auch XDR muessen backends von Application implementieren lassen! - bei AMP muessen Statistiken verfuegbar sein! - Rround-Trip-Time - Datandurchsatz (Throughput) siehe auch SNMP, Multilink PPP (MP+) - Denial Of Service auf Server Seite? - High-Level Library basierende auf AMP: - Service Location - Load Balancing - Fail Over - IPv6 in AMP unterstuetzen - Multicasting in AMP unterstuetzen (trivial I/O seitig, aber muss bei error semantics beruecksichtig werden) ========================================================================================= Examples: amp.h: typedef struct { void *data; size_t len; } amp_data_t; Server: #include "amp.h" #include "xds.h" #include "pth.h" amp_data_t foo(void *ctx, amp_data_t in) { amp_data_t out; xds_ctx_t *xds = (xds_ctx_t *)ctx; int i; char *cp; int rv; xds_decode(xds, in.data, in.len, "%d%s", &i, &cp); /* i und cp verarbeiten -> rv */ xds_encode(xds, &out, "%d", rv); return out; } amp_server_t *s; amp_connection_t *c; xds_ctx_t *xds; xds = xds_create(XDS_ASN1); s = amp_server_create(); amp_server_configure(s, AMP_LISTEN, "udp", "server1.de.cw.net", 12345); amp_server_configure(s, AMP_LISTEN, "tcp", "any" 12345); amp_server_configure(s, AMP_LISTEN, "unix", 12345); amp_server_configure(s, AMP_LISTEN, "shm", vp, vplen); amp_server_configure(s, AMP_ERROR_SEMANTIC, AMP_ATLEASTONCE); amp_server_configure(s, AMP_IOCB_ACCEPT, pth_accept); amp_server_configure(s, AMP_IOCB_LISTEN, pth_listen); amp_server_configure(s, AMP_IOCB_READ, pth_read); amp_server_configure(s, AMP_IOCB_WRITE, pth_write); : amp_server_register(s, "foo", foo, xds); amp_server_register(s, "bar", bar, NULL); amp_server_register(s, "baz", baz, NULL); amp_server_register(s, "quux", quux, NULL); amp_server_listen(s); /* synchronous */ amp_server_loop(s); /* asynchronous */ while ((c = amp_server_accept(s))) { pth_t *t; if ((t = pth_spawn(...)) == NULL) { amp_server_dispatch(c); } pth_wait(t); } amp_server_unlisten(s); amp_server_destroy(s); xds_destroy(xds); Client: amp_client_t *c; amp_connection_t *co; xds_ctx_t *xds; amp_data_t in, out; int i = ...; char *cp = ...; int rv; c = amp_client_create(); xds = xds_create(XDS_ASN1); amp_client_configure(c, AMP_CONNECT, "udp", "server1.de.cw.net", 12345); amp_client_configure(c, AMP_CONNECT, "tcp", "server1.de.cw.net", 12345); co = amp_client_connect(c); xds_encode(xds, in, "%d%s", i, cp); out = amp_client_call(co, "foo", in); xds_decode(xds, out, "%d", &rv); /* ... rv ... */ amp_client_disconnect(co); xds_destroy(xds); amp_client_destroy(c); Index: ossp-pkg/srpc/TODO ============================================================ $ cvs diff -u -r1.3 -r1.4 TODO --- ossp-pkg/srpc/TODO 2001/06/12 13:14:48 1.3 +++ ossp-pkg/srpc/TODO 2001/06/21 05:16:05 1.4 @@ -1,31 +1,7 @@ -Simple RPC -========== -Architecture: -- Abstracted Message Passing Library: libamp -- eXtendable Data Serialization Library: libxds -- Simple Remote Procedure Call Library: libsrpc +TODO LIST AND MILESTONES +======================== -TODO: - -- The server actually performing the function call has to interpret - the transferred data according to the functions prototype. This may - be done in one of the following ways: - - - All functions have the same prototype. The function may then be a - stub calling the actual function. These stubs can be generated - manually or semi-automatically. - - - Allow only a finite set of prototypes and switch according to the - function tye, like in eAPI in Apache. - - - Build function call dynamically using the Foreign Function Call - library. - -- The programmer should be able to specify whether his implementations - need guarantees of being called at least once, exactly once, etc. - - o M1 (peti) [11-Jun-2001] - evaluation (-> ideas) (checklist) @@ -57,3 +33,4 @@ o M8 (rse) - OSSP integration + From ossp-cvs-owner@ossp.org Tue Jun 26 13:43:52 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f5QBho151733; Tue, 26 Jun 2001 13:43:50 +0200 (CEST) Date: Tue, 26 Jun 2001 13:43:50 +0200 (CEST) Message-Id: <200106261143.f5QBho151733@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc EVAL Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 26-Jun-2001 13:43:50 Branch: HEAD Handle: 2001062612435000 Modified files: ossp-pkg/srpc EVAL Log: - Provide the version numbers for the packages we evaluated. - Enhanced description of Spread. - Added description of ORBit. - Added description of DCE RPC. Summary: Revision Changes Path 1.11 +30 -15 ossp-pkg/srpc/EVAL ____________________________________________________________________________ Index: ossp-pkg/srpc/EVAL ============================================================ $ cvs diff -u -r1.10 -r1.11 EVAL --- ossp-pkg/srpc/EVAL 2001/06/20 19:18:24 1.10 +++ ossp-pkg/srpc/EVAL 2001/06/26 11:43:50 1.11 @@ -1,7 +1,7 @@ Evaluation ========== -o Spread, http://www.spread.org/ +o Spread 3.15.2, http://www.spread.org/ Spread is a sophisticated message passing framework. The software itself is written in C and uses a design very similar to SRPC's: It @@ -24,15 +24,15 @@ and then releasing Spread under a real Open Source license. - It is not possible for peers to communicate without the daemon. - (RSE: I'm not sure about this. If I understood the Spread guys - correctly at ApacheCon 2001 it should be possible to run it - without the daemon or at least with an own application-dedicated - daemon instead of a system-dedicated daemon. We should check this - in details). - The API for the programmer is somewhat messy. + - No GNU autoconf, no install target. + - The I/O system is hardcoded into the library and cannot be + customized for our own needs. + + o XML-RPC, http://www.xmlrpc.org/ XML-RPC is a standardized remote procedure call framework for which @@ -64,8 +64,9 @@ evaluation showed that 1. user-space dispatching is usually faster than dispatching in kernel-space and 2. GNU Pth proofed that user-space threading can be done in a very portable way). + -o MRPC, http://www.tildeslash.org/mrpc.html +o MRPC 0.9.1, http://www.tildeslash.org/mrpc.html "Modular RPC" is a minimalistic remote procedure call mechanism using a similar design as the original RPC: It consists of a code @@ -79,18 +80,25 @@ trivially be used in plain C or any other language. -o LinuxDoors, http://www.rampant.org/doors/ +o LinuxDoors 0.9, http://www.rampant.org/doors/ The author discontinued development of the package in May 2001. The current version 0.9 is considered to be alpha quality software. -o ORBit, http://orbit-resource.sourceforge.net/ +o ORBit 0.5.8, http://orbit-resource.sourceforge.net/ - ORBit is a CORBA 2.2-compliant object request broker. Do I need to - say more? + ORBit implements the CORBA 2.2 protocol in order to provide RPC + services. The source code is written in C and has been licensed + under the GNU GPL for the general public. Considering the fact that + ORBit uses CORBA, it is very fast and efficient. ORBit allows + peer-to-peer communication without the use of a request broker and + comes with an "interface definition language" (IDL) that is used for + marshalling the parameters of remote function calls. + - Requires glib 1.2.1 or newer. + o TIRPC, ftp://ftp.uu.net/networking/rpc/ The "Transport Independent RPC" package is derived from the original @@ -108,9 +116,17 @@ rfc2203.txt rfc2695.txt + +o DCE RPC, ftp://gatekeeper.dec.com/pub/DEC/DCE/ -o DCERPC - ftp://gatekeeper.dec.com/pub/DEC/DCE/ + This package was developed by the Open Software Foundation (OSF) in + 1993. It appears not to have changed since then: there is no support + for GNU autoconf and consequently the build system fails miserably. + Furthermore, the package inherently depends on pthreads but seems to + call functions that are not part of the standard pthread + implementation. Our impression is that a lot of clean-up work would + be necessary before the package can even be compiled -- let alone be + tested. o Foreign Function Call Library @@ -125,11 +141,10 @@ o HiM http://www.sama.ru/~despair/him/ o pbio - ftp://ftp.cc.gatech.edu/pub/groups/systems/chaos/pbio/ + ftp://ftp.cc.gatech.edu/pub/groups/systems/chaos/pbio/ o SunRPC XDR RFC1832 o XTL http://gsd.di.uminho.pt/jop/xtl/ o CORBA GIOP CDR ??? - From ossp-cvs-owner@ossp.org Tue Jun 26 13:46:39 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f5QBkcn52117; Tue, 26 Jun 2001 13:46:38 +0200 (CEST) Date: Tue, 26 Jun 2001 13:46:38 +0200 (CEST) Message-Id: <200106261146.f5QBkcn52117@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc EVAL Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 26-Jun-2001 13:46:38 Branch: HEAD Handle: 2001062612463800 Modified files: ossp-pkg/srpc EVAL Log: Fixed spelling of "marshalling". Summary: Revision Changes Path 1.12 +1 -1 ossp-pkg/srpc/EVAL ____________________________________________________________________________ Index: ossp-pkg/srpc/EVAL ============================================================ $ cvs diff -u -r1.11 -r1.12 EVAL --- ossp-pkg/srpc/EVAL 2001/06/26 11:43:50 1.11 +++ ossp-pkg/srpc/EVAL 2001/06/26 11:46:38 1.12 @@ -73,7 +73,7 @@ generator that will encapsulate function definitions in such a way that they can be called remotely with the functions provided in a link library. The whole system is very lean and efficient, - marshaling is done automatically for most data types, and the + marshalling is done automatically for most data types, and the provided documentation is sufficient. Unfortunately, the whole system is written in C++ and can thus not From ossp-cvs-owner@ossp.org Tue Jun 26 14:24:30 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f5QCOSK56137; Tue, 26 Jun 2001 14:24:28 +0200 (CEST) Date: Tue, 26 Jun 2001 14:24:28 +0200 (CEST) Message-Id: <200106261224.f5QCOSK56137@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc architecture.fig Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 26-Jun-2001 14:24:28 Branch: HEAD Handle: 2001062613242800 Added files: ossp-pkg/srpc architecture.fig Log: Preliminary version of the architecture diagram. Summary: Revision Changes Path 1.1 +62 -0 ossp-pkg/srpc/architecture.fig ____________________________________________________________________________ Index: ossp-pkg/srpc/architecture.fig ============================================================ $ cvs update -p -r1.1 architecture.fig #FIG 3.2 Landscape Center Inches Letter 100.00 Single -2 1200 2 6 1575 5925 2925 7200 4 0 0 50 0 0 24 0.0000 2 255 1245 1627 6225 Abstract\001 4 0 0 50 0 0 24 0.0000 2 330 1305 1597 6645 Message\001 4 0 0 50 0 0 24 0.0000 2 330 1155 1672 7065 Passing\001 -6 6 4425 5925 6225 7125 4 0 0 50 0 0 24 0.0000 2 255 1665 4492 6225 Extendable\001 4 0 0 50 0 0 24 0.0000 2 255 690 4980 6645 Data\001 4 0 0 50 0 0 24 0.0000 2 255 1800 4425 7065 Serialization\001 -6 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 3975 7275 6750 7275 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 4650 10050 4650 7275 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 5325 7275 5325 10050 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 6000 7275 6000 10050 2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5 3975 10050 6750 10050 6750 5775 3975 5775 3975 10050 2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5 825 5625 6750 5625 6750 4725 825 4725 825 5625 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 825 7275 3600 7275 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 1500 10050 1500 7275 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 2175 7275 2175 10050 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 2850 7275 2850 10050 2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5 825 10050 3600 10050 3600 5775 825 5775 825 10050 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 7800 4725 7800 7275 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 8475 4725 8475 7275 2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5 7125 4725 9150 4725 9150 7275 7125 7275 7125 4725 2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5 825 4575 9150 4575 9150 3675 825 3675 825 4575 4 0 0 50 0 0 24 4.7124 2 255 720 5550 8100 XDS\001 4 0 0 50 0 0 24 4.7124 2 255 720 4200 8100 XTL\001 4 0 0 50 0 0 24 4.7124 2 255 705 4875 8100 HiM\001 4 0 0 50 0 0 24 4.7124 2 255 990 6225 8100 ASN.1\001 4 0 0 50 0 0 24 4.7124 2 255 705 1050 8100 TCP\001 4 0 0 50 0 0 24 4.7124 2 300 1050 1725 7950 T/TCP\001 4 0 0 50 0 0 24 4.7124 2 255 750 2400 8100 UDP\001 4 0 0 50 0 0 24 4.7124 2 255 1395 3075 7875 Multicast\001 4 0 0 50 0 0 24 0.0000 2 330 4545 1500 5250 Simple Remote Procedure Call\001 4 0 0 50 0 0 24 4.7124 2 255 1995 7425 5025 function A.so\001 4 0 0 50 0 0 24 4.7124 2 255 1980 8025 5025 function B.so\001 4 0 0 50 0 0 24 4.7124 2 255 1980 8625 5025 function C.so\001 4 0 0 50 0 0 24 0.0000 2 330 1965 4125 4275 srpc Daemon\001 From ossp-cvs-owner@ossp.org Wed Jun 27 23:07:38 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f5RL7a792634; Wed, 27 Jun 2001 23:07:36 +0200 (CEST) Date: Wed, 27 Jun 2001 23:07:36 +0200 (CEST) Message-Id: <200106272107.f5RL7a792634@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc EVAL Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 27-Jun-2001 23:07:36 Branch: HEAD Handle: 2001062722073600 Modified files: ossp-pkg/srpc EVAL Log: Now it's official: It's spelled "marshaling". I found it spelled that way in Richard Stevens book "Network Programming". Summary: Revision Changes Path 1.13 +2 -2 ossp-pkg/srpc/EVAL ____________________________________________________________________________ Index: ossp-pkg/srpc/EVAL ============================================================ $ cvs diff -u -r1.12 -r1.13 EVAL --- ossp-pkg/srpc/EVAL 2001/06/26 11:46:38 1.12 +++ ossp-pkg/srpc/EVAL 2001/06/27 21:07:36 1.13 @@ -73,7 +73,7 @@ generator that will encapsulate function definitions in such a way that they can be called remotely with the functions provided in a link library. The whole system is very lean and efficient, - marshalling is done automatically for most data types, and the + marshaling is done automatically for most data types, and the provided documentation is sufficient. Unfortunately, the whole system is written in C++ and can thus not @@ -94,7 +94,7 @@ ORBit uses CORBA, it is very fast and efficient. ORBit allows peer-to-peer communication without the use of a request broker and comes with an "interface definition language" (IDL) that is used for - marshalling the parameters of remote function calls. + marshaling the parameters of remote function calls. - Requires glib 1.2.1 or newer. From ossp-cvs-owner@ossp.org Wed Jun 27 23:10:03 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f5RLA1R92848; Wed, 27 Jun 2001 23:10:01 +0200 (CEST) Date: Wed, 27 Jun 2001 23:10:01 +0200 (CEST) Message-Id: <200106272110.f5RLA1R92848@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc EVAL Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 27-Jun-2001 23:10:01 Branch: HEAD Handle: 2001062722100100 Modified files: ossp-pkg/srpc EVAL Log: Added comment about SunRPC. Summary: Revision Changes Path 1.14 +5 -7 ossp-pkg/srpc/EVAL ____________________________________________________________________________ Index: ossp-pkg/srpc/EVAL ============================================================ $ cvs diff -u -r1.13 -r1.14 EVAL --- ossp-pkg/srpc/EVAL 2001/06/27 21:07:36 1.13 +++ ossp-pkg/srpc/EVAL 2001/06/27 21:10:01 1.14 @@ -108,13 +108,11 @@ o SunRPC - rfc1050.txt - rfc1057.txt - rfc1790.txt - rfc1831.txt - rfc1833.txt - rfc2203.txt - rfc2695.txt + + The "original". While the RPC mechanism itself is fine, proven and + widely available, the API for the programmer is insufficient: SunRPC + does not support any asynchronous message passing in a sensible way. + Furthermore, the standard dictates the use of XDR. o DCE RPC, ftp://gatekeeper.dec.com/pub/DEC/DCE/ From ossp-cvs-owner@ossp.org Thu Jun 28 13:45:15 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f5SBjEh98870; Thu, 28 Jun 2001 13:45:14 +0200 (CEST) Date: Thu, 28 Jun 2001 13:45:14 +0200 (CEST) Message-Id: <200106281145.f5SBjEh98870@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc architecture.fig Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 28-Jun-2001 13:45:14 Branch: HEAD Handle: 2001062812451400 Modified files: ossp-pkg/srpc architecture.fig Log: Moved the picture up in order to conserve space on the canvas. Summary: Revision Changes Path 1.2 +36 -36 ossp-pkg/srpc/architecture.fig ____________________________________________________________________________ Index: ossp-pkg/srpc/architecture.fig ============================================================ $ cvs diff -u -r1.1 -r1.2 architecture.fig --- ossp-pkg/srpc/architecture.fig 2001/06/26 12:24:28 1.1 +++ ossp-pkg/srpc/architecture.fig 2001/06/28 11:45:14 1.2 @@ -7,56 +7,56 @@ Single -2 1200 2 -6 1575 5925 2925 7200 -4 0 0 50 0 0 24 0.0000 2 255 1245 1627 6225 Abstract\001 -4 0 0 50 0 0 24 0.0000 2 330 1305 1597 6645 Message\001 -4 0 0 50 0 0 24 0.0000 2 330 1155 1672 7065 Passing\001 +6 900 2400 2250 3675 +4 0 0 50 0 0 24 0.0000 2 255 1245 952 2700 Abstract\001 +4 0 0 50 0 0 24 0.0000 2 330 1305 922 3120 Message\001 +4 0 0 50 0 0 24 0.0000 2 330 1155 997 3540 Passing\001 -6 -6 4425 5925 6225 7125 -4 0 0 50 0 0 24 0.0000 2 255 1665 4492 6225 Extendable\001 -4 0 0 50 0 0 24 0.0000 2 255 690 4980 6645 Data\001 -4 0 0 50 0 0 24 0.0000 2 255 1800 4425 7065 Serialization\001 +6 3750 2400 5550 3600 +4 0 0 50 0 0 24 0.0000 2 255 1665 3817 2700 Extendable\001 +4 0 0 50 0 0 24 0.0000 2 255 690 4305 3120 Data\001 +4 0 0 50 0 0 24 0.0000 2 255 1800 3750 3540 Serialization\001 -6 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 - 3975 7275 6750 7275 + 3300 3750 6075 3750 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 - 4650 10050 4650 7275 + 3975 6525 3975 3750 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 - 5325 7275 5325 10050 + 4650 3750 4650 6525 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 - 6000 7275 6000 10050 + 5325 3750 5325 6525 2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5 - 3975 10050 6750 10050 6750 5775 3975 5775 3975 10050 + 3300 6525 6075 6525 6075 2250 3300 2250 3300 6525 2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5 - 825 5625 6750 5625 6750 4725 825 4725 825 5625 + 150 2100 6075 2100 6075 1200 150 1200 150 2100 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 - 825 7275 3600 7275 + 150 3750 2925 3750 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1500 10050 1500 7275 + 825 6525 825 3750 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2175 7275 2175 10050 + 1500 3750 1500 6525 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2850 7275 2850 10050 + 2175 3750 2175 6525 2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5 - 825 10050 3600 10050 3600 5775 825 5775 825 10050 + 150 6525 2925 6525 2925 2250 150 2250 150 6525 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 - 7800 4725 7800 7275 + 7125 1200 7125 3750 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 - 8475 4725 8475 7275 + 7800 1200 7800 3750 2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5 - 7125 4725 9150 4725 9150 7275 7125 7275 7125 4725 + 6450 1200 8475 1200 8475 3750 6450 3750 6450 1200 2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5 - 825 4575 9150 4575 9150 3675 825 3675 825 4575 -4 0 0 50 0 0 24 4.7124 2 255 720 5550 8100 XDS\001 -4 0 0 50 0 0 24 4.7124 2 255 720 4200 8100 XTL\001 -4 0 0 50 0 0 24 4.7124 2 255 705 4875 8100 HiM\001 -4 0 0 50 0 0 24 4.7124 2 255 990 6225 8100 ASN.1\001 -4 0 0 50 0 0 24 4.7124 2 255 705 1050 8100 TCP\001 -4 0 0 50 0 0 24 4.7124 2 300 1050 1725 7950 T/TCP\001 -4 0 0 50 0 0 24 4.7124 2 255 750 2400 8100 UDP\001 -4 0 0 50 0 0 24 4.7124 2 255 1395 3075 7875 Multicast\001 -4 0 0 50 0 0 24 0.0000 2 330 4545 1500 5250 Simple Remote Procedure Call\001 -4 0 0 50 0 0 24 4.7124 2 255 1995 7425 5025 function A.so\001 -4 0 0 50 0 0 24 4.7124 2 255 1980 8025 5025 function B.so\001 -4 0 0 50 0 0 24 4.7124 2 255 1980 8625 5025 function C.so\001 -4 0 0 50 0 0 24 0.0000 2 330 1965 4125 4275 srpc Daemon\001 + 150 1050 8475 1050 8475 150 150 150 150 1050 +4 0 0 50 0 0 24 4.7124 2 255 720 4875 4575 XDS\001 +4 0 0 50 0 0 24 4.7124 2 255 720 3525 4575 XTL\001 +4 0 0 50 0 0 24 4.7124 2 255 705 4200 4575 HiM\001 +4 0 0 50 0 0 24 4.7124 2 255 990 5550 4575 ASN.1\001 +4 0 0 50 0 0 24 4.7124 2 255 705 375 4575 TCP\001 +4 0 0 50 0 0 24 4.7124 2 300 1050 1050 4425 T/TCP\001 +4 0 0 50 0 0 24 4.7124 2 255 750 1725 4575 UDP\001 +4 0 0 50 0 0 24 4.7124 2 255 1395 2400 4350 Multicast\001 +4 0 0 50 0 0 24 0.0000 2 330 4545 825 1725 Simple Remote Procedure Call\001 +4 0 0 50 0 0 24 4.7124 2 255 1995 6750 1500 function A.so\001 +4 0 0 50 0 0 24 4.7124 2 255 1980 7350 1500 function B.so\001 +4 0 0 50 0 0 24 4.7124 2 255 1980 7950 1500 function C.so\001 +4 0 0 50 0 0 24 0.0000 2 330 1965 3450 750 srpc Daemon\001 From ossp-cvs-owner@ossp.org Thu Jun 28 14:30:58 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f5SCUwa04859; Thu, 28 Jun 2001 14:30:58 +0200 (CEST) Date: Thu, 28 Jun 2001 14:30:58 +0200 (CEST) Message-Id: <200106281230.f5SCUwa04859@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds .cvsignore Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 28-Jun-2001 14:30:58 Branch: HEAD Handle: 2001062813305800 Added files: ossp-pkg/srpc/libxds .cvsignore Log: Ignore executable 'test'. Summary: Revision Changes Path 1.1 +1 -0 ossp-pkg/srpc/libxds/.cvsignore ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/.cvsignore ============================================================ $ cvs update -p -r1.1 .cvsignore test From ossp-cvs-owner@ossp.org Thu Jun 28 14:31:23 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f5SCVMp04916; Thu, 28 Jun 2001 14:31:22 +0200 (CEST) Date: Thu, 28 Jun 2001 14:31:22 +0200 (CEST) Message-Id: <200106281231.f5SCVMp04916@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds xds.h Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 28-Jun-2001 14:31:22 Branch: HEAD Handle: 2001062813312200 Added files: ossp-pkg/srpc/libxds xds.h Log: First attempt of an interface definition for the library. Summary: Revision Changes Path 1.1 +0 -0 ossp-pkg/srpc/libxds/xds.h ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/xds.h ============================================================ $ cvs update -p -r1.1 xds.h /* $Source: /e/ossp/cvs/ossp-pkg/srpc/libxds/xds.h,v $ $Revision: 1.1 $ Copyright (c) 2001 by Cable & Wireless Deutschland. 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 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 included license for more details. */ #ifndef __LIBXDS_H__ #define __LIBXDS_H__ #include typedef struct { } xds_ctx; xds_ctx* xds_init(void); void xds_destroy(xds_ctx* context); typedef int (*xds_formatter_cb)(char* buf, size_t buf_size, void* val); int xds_register(xds_ctx* context, const char* name, xds_formatter_cb callback); int xds_mashal(xds_ctx* context, const char* fmt, ...); int xds_snmashal(xds_ctx* context, char* buf, size_t buf_size, const char* fmt, ...); int xds_amashal(xds_ctx* context, char** buf_p, size_t buf_size, const char* fmt, ...); #endif /* !defined(__LIBXDS_H__) */ From ossp-cvs-owner@ossp.org Thu Jun 28 14:32:05 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f5SCW4J04998; Thu, 28 Jun 2001 14:32:04 +0200 (CEST) Date: Thu, 28 Jun 2001 14:32:04 +0200 (CEST) Message-Id: <200106281232.f5SCW4J04998@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds Makefile test.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 28-Jun-2001 14:32:04 Branch: HEAD Handle: 2001062813320400 Added files: ossp-pkg/srpc/libxds Makefile test.c Log: The build infrastructure for the libarary. Currently does not more than compile an empty test program in order to check the syntax of xds.h. Summary: Revision Changes Path 1.1 +28 -0 ossp-pkg/srpc/libxds/Makefile 1.1 +0 -0 ossp-pkg/srpc/libxds/test.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/Makefile ============================================================ $ cvs update -p -r1.1 Makefile # Build libxds and support/test programs. CC = gcc CXX = g++ WARNFLAGS = -Wall -ansi -pedantic OPTFLAGS = -O3 -pipe CPPFLAGS = CFLAGS = CXXFLAGS = LDFLAGS = -s .c.o: $(CC) $(CPPFLAGS) $(WARNFLAGS) $(OPTFLAGS) $(CFLAGS) -c $< .cpp.o: $(CXX) $(CPPFLAGS) $(WARNFLAGS) $(OPTFLAGS) $(CXXFLAGS) -c $< test: test.o $(CXX) $(LDFLAGS) -o $@ test.o clean:: rm -f test.o test # Dependencies test.o: test.c xds.h Index: ossp-pkg/srpc/libxds/test.c ============================================================ $ cvs update -p -r1.1 test.c /* $Source: /e/ossp/cvs/ossp-pkg/srpc/libxds/test.c,v $ $Revision: 1.1 $ Copyright (c) 2001 by Cable & Wireless Deutschland. 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 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 included license for more details. */ #include "xds.h" int main(int argc, char** argv) { return 0; } From ossp-cvs-owner@ossp.org Thu Jun 28 14:42:11 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f5SCgA705936; Thu, 28 Jun 2001 14:42:10 +0200 (CEST) Date: Thu, 28 Jun 2001 14:42:10 +0200 (CEST) Message-Id: <200106281242.f5SCgA705936@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds xds.h Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 28-Jun-2001 14:42:10 Branch: HEAD Handle: 2001062813421000 Modified files: ossp-pkg/srpc/libxds xds.h Log: Added mechanism for adding an array of formatter callbacks with one function call. Summary: Revision Changes Path 1.2 +13 -3 ossp-pkg/srpc/libxds/xds.h ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/xds.h ============================================================ $ cvs diff -u -r1.1 -r1.2 xds.h --- ossp-pkg/srpc/libxds/xds.h 2001/06/28 12:31:22 1.1 +++ ossp-pkg/srpc/libxds/xds.h 2001/06/28 12:42:10 1.2 @@ -1,6 +1,6 @@ /* $Source: /e/ossp/cvs/ossp-pkg/srpc/libxds/xds.h,v $ - $Revision: 1.1 $ + $Revision: 1.2 $ Copyright (c) 2001 by Cable & Wireless Deutschland. @@ -20,16 +20,26 @@ #include +typedef int (*xds_formatter_cb)(char* buf, size_t buf_size, void* val); +typedef struct + { + char* name; + xds_formatter_cb callback; + } +xds_formatter_cb_desc; + typedef struct { + xds_formatter_cb_desc* formatters; + size_t formatters_size; } xds_ctx; xds_ctx* xds_init(void); void xds_destroy(xds_ctx* context); -typedef int (*xds_formatter_cb)(char* buf, size_t buf_size, void* val); int xds_register(xds_ctx* context, const char* name, xds_formatter_cb callback); +int xds_vregister(xds_ctx* context, const xds_formatter_cb_desc* callbacks, size_t size); int xds_mashal(xds_ctx* context, const char* fmt, ...); int xds_snmashal(xds_ctx* context, char* buf, size_t buf_size, const char* fmt, ...); From ossp-cvs-owner@ossp.org Thu Jun 28 16:08:01 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f5SE80T16552; Thu, 28 Jun 2001 16:08:00 +0200 (CEST) Date: Thu, 28 Jun 2001 16:08:00 +0200 (CEST) Message-Id: <200106281408.f5SE80T16552@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc BRES Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 28-Jun-2001 16:08:00 Branch: HEAD Handle: 2001062815080000 Modified files: ossp-pkg/srpc BRES Log: Documented design decision against supporting complex data types in libxds. Summary: Revision Changes Path 1.2 +18 -6 ossp-pkg/srpc/BRES ____________________________________________________________________________ Index: ossp-pkg/srpc/BRES ============================================================ $ cvs diff -u -r1.1 -r1.2 BRES --- ossp-pkg/srpc/BRES 2001/06/21 05:16:05 1.1 +++ ossp-pkg/srpc/BRES 2001/06/28 14:08:00 1.2 @@ -7,6 +7,18 @@ - eXtendable Data Serialization Library: libxds - Simple Remote Procedure Call Library: libsrpc +- libxds does intentionally NOT support the concept of arrays and + structures ("sequence" and "record" in ASN.1-speak), because not all + encoding systems support structured data. Hence, someone who'd want + to decode the serialized buffer cannot rely on this information + actually being included in the encoded data. + + The only use of having these capabilities nonetheles would be that + the decode function could type-check the specification of what has + been received against the actual contents of the data. While this is + nice to have, we did not consider this to be reason enough to add + complexity to our interface and implementation. + - The server actually performing the function call has to interpret the transferred data according to the functions prototype. This may be done in one of the following ways: @@ -27,14 +39,14 @@ because o constant function prototype on server-side (foreign function call problem!) - o only application knows how to convert + o only application knows how to convert complex data structures (foo_t) into serialized octet-stream o greater flexibility in data transfer o rpc library complexity is reduced (on cost of application complexity) - instead remote procedure call + instead remote procedure call only message passing - auditing/logging: @@ -46,7 +58,7 @@ sepatered from data serialization - error semantics: - transaction, ACID + transaction, ACID o exactly-once (== 1) bank transaction o at-least-once (>= 1) muss passieren, mehrfach tut nicht weh (seiteneffekte) SunRPC o at-most-once (<= 1) logging of not important data, video conferneces @@ -61,7 +73,7 @@ - asynchronous vs. synchronous Ideee: intern immer asynchrouns - aber in API wrapper function + aber in API wrapper function rpc_call == rpc_send+rpc_wait+rpc_result und auch rpc_abort trotzdem wird beide male ein timeout vorgesehen @@ -135,7 +147,7 @@ - Firewalls? Sollen die Filtern koennen Encryption nur von Data, nicht von Meta-Data -- Proxies? +- Proxies? - Sowohl AMP als auch XDR muessen backends von Application implementieren lassen! @@ -153,7 +165,7 @@ - Fail Over - IPv6 in AMP unterstuetzen -- Multicasting in AMP unterstuetzen (trivial I/O seitig, +- Multicasting in AMP unterstuetzen (trivial I/O seitig, aber muss bei error semantics beruecksichtig werden) ========================================================================================= From ossp-cvs-owner@ossp.org Thu Jun 28 16:42:08 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f5SEg7421157; Thu, 28 Jun 2001 16:42:07 +0200 (CEST) Date: Thu, 28 Jun 2001 16:42:07 +0200 (CEST) Message-Id: <200106281442.f5SEg7421157@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds xds.h Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 28-Jun-2001 16:42:07 Branch: HEAD Handle: 2001062815420600 Modified files: ossp-pkg/srpc/libxds xds.h Log: Revised the interface after reviewing it with RSE. Summary: Revision Changes Path 1.3 +31 -22 ossp-pkg/srpc/libxds/xds.h ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/xds.h ============================================================ $ cvs diff -u -r1.2 -r1.3 xds.h --- ossp-pkg/srpc/libxds/xds.h 2001/06/28 12:42:10 1.2 +++ ossp-pkg/srpc/libxds/xds.h 2001/06/28 14:42:06 1.3 @@ -1,6 +1,6 @@ /* $Source: /e/ossp/cvs/ossp-pkg/srpc/libxds/xds.h,v $ - $Revision: 1.2 $ + $Revision: 1.3 $ Copyright (c) 2001 by Cable & Wireless Deutschland. @@ -19,30 +19,39 @@ #define __LIBXDS_H__ #include +#include -typedef int (*xds_formatter_cb)(char* buf, size_t buf_size, void* val); -typedef struct +struct xds_ctx; + +typedef int (*xds_fmt_cb_t)(struct xds_ctx* context, + void* fmt_context, + char* buf, size_t buf_size, + va_list val); + +struct fmt_cb { - char* name; - xds_formatter_cb callback; - } -xds_formatter_cb_desc; + char* name; + xds_fmt_cb_t callback; + void* fmt_context; + }; -typedef struct +struct xds_ctx { - xds_formatter_cb_desc* formatters; - size_t formatters_size; - } -xds_ctx; - -xds_ctx* xds_init(void); -void xds_destroy(xds_ctx* context); - -int xds_register(xds_ctx* context, const char* name, xds_formatter_cb callback); -int xds_vregister(xds_ctx* context, const xds_formatter_cb_desc* callbacks, size_t size); - -int xds_mashal(xds_ctx* context, const char* fmt, ...); -int xds_snmashal(xds_ctx* context, char* buf, size_t buf_size, const char* fmt, ...); -int xds_amashal(xds_ctx* context, char** buf_p, size_t buf_size, const char* fmt, ...); + struct fmt_cb* formatters; + }; +typedef struct xds_ctx xds_ctx_t; + +xds_ctx_t* xds_init(void); +void xds_destroy(xds_ctx_t* context); + +int xds_register(xds_ctx_t* context, + const char* name, xds_fmt_cb_t callback, + void* formatter_context); +int xds_unregister(xds_ctx_t* context, const char* name); + +int xds_encode(xds_ctx_t* context, char* buf, size_t buf_size, const char* fmt, ...); +char* xds_aencode(xds_ctx_t* context, const char* fmt, ...); + +int xds_decode(xds_ctx_t* context, const char* buf, const char* fmt, ...); #endif /* !defined(__LIBXDS_H__) */ From ossp-cvs-owner@ossp.org Thu Jun 28 17:25:25 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f5SFPOU26308; Thu, 28 Jun 2001 17:25:24 +0200 (CEST) Date: Thu, 28 Jun 2001 17:25:24 +0200 (CEST) Message-Id: <200106281525.f5SFPOU26308@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds xds.h Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 28-Jun-2001 17:25:24 Branch: HEAD Handle: 2001062816252300 Modified files: ossp-pkg/srpc/libxds xds.h Log: The API after the seconds review with RSE. Summary: Revision Changes Path 1.4 +12 -18 ossp-pkg/srpc/libxds/xds.h ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/xds.h ============================================================ $ cvs diff -u -r1.3 -r1.4 xds.h --- ossp-pkg/srpc/libxds/xds.h 2001/06/28 14:42:06 1.3 +++ ossp-pkg/srpc/libxds/xds.h 2001/06/28 15:25:23 1.4 @@ -1,6 +1,6 @@ /* $Source: /e/ossp/cvs/ossp-pkg/srpc/libxds/xds.h,v $ - $Revision: 1.3 $ + $Revision: 1.4 $ Copyright (c) 2001 by Cable & Wireless Deutschland. @@ -22,24 +22,12 @@ #include struct xds_ctx; +typedef struct xds_ctx xds_ctx_t; -typedef int (*xds_fmt_cb_t)(struct xds_ctx* context, +typedef int (*xds_fmt_cb_t)(xds_ctx_t* context, void* fmt_context, char* buf, size_t buf_size, - va_list val); - -struct fmt_cb - { - char* name; - xds_fmt_cb_t callback; - void* fmt_context; - }; - -struct xds_ctx - { - struct fmt_cb* formatters; - }; -typedef struct xds_ctx xds_ctx_t; + va_list args); xds_ctx_t* xds_init(void); void xds_destroy(xds_ctx_t* context); @@ -47,11 +35,17 @@ int xds_register(xds_ctx_t* context, const char* name, xds_fmt_cb_t callback, void* formatter_context); +int xds_register_xdr(xds_ctx_t* context); +int xds_register_xml(xds_ctx_t* context); +int xds_register_asn1(xds_ctx_t* context); int xds_unregister(xds_ctx_t* context, const char* name); -int xds_encode(xds_ctx_t* context, char* buf, size_t buf_size, const char* fmt, ...); -char* xds_aencode(xds_ctx_t* context, const char* fmt, ...); +char* xds_get_buffer(xds_ctx_t* context); +int xds_set_buffer(xds_ctx_t* context, char* buf, size_t buf_size); +int xds_encode(xds_ctx_t* context, const char* fmt, ...); int xds_decode(xds_ctx_t* context, const char* buf, const char* fmt, ...); +int xds_vdecode(xds_ctx_t* context, const char* buf, const char* fmt, va_list args); +int xds_vencode(xds_ctx_t* context, const char* fmt, va_list args); #endif /* !defined(__LIBXDS_H__) */ From ossp-cvs-owner@ossp.org Thu Jun 28 18:09:17 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f5SG9GH32130; Thu, 28 Jun 2001 18:09:16 +0200 (CEST) Date: Thu, 28 Jun 2001 18:09:16 +0200 (CEST) Message-Id: <200106281609.f5SG9GH32130@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds xds.h Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 28-Jun-2001 18:09:16 Branch: HEAD Handle: 2001062817091600 Modified files: ossp-pkg/srpc/libxds xds.h Log: And now we have the result of the third review ... Summary: Revision Changes Path 1.5 +21 -19 ossp-pkg/srpc/libxds/xds.h ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/xds.h ============================================================ $ cvs diff -u -r1.4 -r1.5 xds.h --- ossp-pkg/srpc/libxds/xds.h 2001/06/28 15:25:23 1.4 +++ ossp-pkg/srpc/libxds/xds.h 2001/06/28 16:09:16 1.5 @@ -1,6 +1,6 @@ /* $Source: /e/ossp/cvs/ossp-pkg/srpc/libxds/xds.h,v $ - $Revision: 1.4 $ + $Revision: 1.5 $ Copyright (c) 2001 by Cable & Wireless Deutschland. @@ -21,31 +21,33 @@ #include #include -struct xds_ctx; -typedef struct xds_ctx xds_ctx_t; +struct xds_st; +typedef struct xds_st xds_t; -typedef int (*xds_fmt_cb_t)(xds_ctx_t* context, +typedef int (*xds_fmt_cb_t)(xds_t* context, void* fmt_context, char* buf, size_t buf_size, va_list args); -xds_ctx_t* xds_init(void); -void xds_destroy(xds_ctx_t* context); +xds_t* xds_init(void); +void xds_destroy(xds_t* context); -int xds_register(xds_ctx_t* context, +int xds_register(xds_t* context, const char* name, xds_fmt_cb_t callback, void* formatter_context); -int xds_register_xdr(xds_ctx_t* context); -int xds_register_xml(xds_ctx_t* context); -int xds_register_asn1(xds_ctx_t* context); -int xds_unregister(xds_ctx_t* context, const char* name); - -char* xds_get_buffer(xds_ctx_t* context); -int xds_set_buffer(xds_ctx_t* context, char* buf, size_t buf_size); - -int xds_encode(xds_ctx_t* context, const char* fmt, ...); -int xds_decode(xds_ctx_t* context, const char* buf, const char* fmt, ...); -int xds_vdecode(xds_ctx_t* context, const char* buf, const char* fmt, va_list args); -int xds_vencode(xds_ctx_t* context, const char* fmt, va_list args); +int xds_register_xdr(xds_t* context); +int xds_register_xml(xds_t* context); +int xds_register_asn1(xds_t* context); +int xds_unregister(xds_t* context, const char* name); + +int xds_set_encode_buffer(xds_t* context, char* buf, size_t buf_size); +int xds_set_decode_buffer(xds_t* context, const char* buf); +int xds_get_encode_buffer(xds_t* context, char** buf, size_t* buf_size); + +int xds_encode(xds_t* context, const char* fmt, ...); +int xds_decode(xds_t* context, const char* buf, const char* fmt, ...); + +int xds_vencode(xds_t* context, const char* fmt, va_list args); +int xds_vdecode(xds_t* context, const char* fmt, va_list args); #endif /* !defined(__LIBXDS_H__) */ From ossp-cvs-owner@ossp.org Fri Jun 29 00:42:13 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f5SMgCi85044; Fri, 29 Jun 2001 00:42:12 +0200 (CEST) Date: Fri, 29 Jun 2001 00:42:12 +0200 (CEST) Message-Id: <200106282242.f5SMgCi85044@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds Makefile Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 29-Jun-2001 00:42:12 Branch: HEAD Handle: 2001062823421200 Modified files: ossp-pkg/srpc/libxds Makefile Log: Link test binary with CC, not CXX. Summary: Revision Changes Path 1.2 +1 -1 ossp-pkg/srpc/libxds/Makefile ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/Makefile ============================================================ $ cvs diff -u -r1.1 -r1.2 Makefile --- ossp-pkg/srpc/libxds/Makefile 2001/06/28 12:32:04 1.1 +++ ossp-pkg/srpc/libxds/Makefile 2001/06/28 22:42:12 1.2 @@ -18,7 +18,7 @@ $(CXX) $(CPPFLAGS) $(WARNFLAGS) $(OPTFLAGS) $(CXXFLAGS) -c $< test: test.o - $(CXX) $(LDFLAGS) -o $@ test.o + $(CC) $(LDFLAGS) -o $@ test.o clean:: rm -f test.o test From ossp-cvs-owner@ossp.org Fri Jun 29 15:55:49 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f5TDtln02320; Fri, 29 Jun 2001 15:55:47 +0200 (CEST) Date: Fri, 29 Jun 2001 15:55:47 +0200 (CEST) Message-Id: <200106291355.f5TDtln02320@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds xds.h Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 29-Jun-2001 15:55:47 Branch: HEAD Handle: 2001062914554700 Modified files: ossp-pkg/srpc/libxds xds.h Log: As we still discovered with Thomas yesterday, the xds_set_decode_buffer() really needs a "buf_size" argument. Because incoming (to be decoded) buffers are usually "input bufferes" which were received from external sources, so we cannot safely assume it really contains a correct encoding. Hence we have to provide a way in XDS to protect the library from segfaulting the application in case the buffer is destroyed and XDS still would like something to decode. Summary: Revision Changes Path 1.6 +2 -2 ossp-pkg/srpc/libxds/xds.h ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/xds.h ============================================================ $ cvs diff -u -r1.5 -r1.6 xds.h --- ossp-pkg/srpc/libxds/xds.h 2001/06/28 16:09:16 1.5 +++ ossp-pkg/srpc/libxds/xds.h 2001/06/29 13:55:47 1.6 @@ -1,6 +1,6 @@ /* $Source: /e/ossp/cvs/ossp-pkg/srpc/libxds/xds.h,v $ - $Revision: 1.5 $ + $Revision: 1.6 $ Copyright (c) 2001 by Cable & Wireless Deutschland. @@ -41,7 +41,7 @@ int xds_unregister(xds_t* context, const char* name); int xds_set_encode_buffer(xds_t* context, char* buf, size_t buf_size); -int xds_set_decode_buffer(xds_t* context, const char* buf); +int xds_set_decode_buffer(xds_t* context, const char* buf, size_t buf_size); int xds_get_encode_buffer(xds_t* context, char** buf, size_t* buf_size); int xds_encode(xds_t* context, const char* fmt, ...); From ossp-cvs-owner@ossp.org Fri Jun 29 15:58:55 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f5TDwsK02553; Fri, 29 Jun 2001 15:58:54 +0200 (CEST) Date: Fri, 29 Jun 2001 15:58:54 +0200 (CEST) Message-Id: <200106291358.f5TDwsK02553@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds xds.h Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 29-Jun-2001 15:58:54 Branch: HEAD Handle: 2001062914585300 Modified files: ossp-pkg/srpc/libxds xds.h Log: We still have not finally determined whether xds_decode() receives a particular buffer or whether the buffer is attached to the XDS handle, but nevertheless xds_vdecode() has to match xds_decode(), so currently we have to add "const char* buf" also to xds_vdecode() to make the API consistent up to now. Summary: Revision Changes Path 1.7 +2 -2 ossp-pkg/srpc/libxds/xds.h ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/xds.h ============================================================ $ cvs diff -u -r1.6 -r1.7 xds.h --- ossp-pkg/srpc/libxds/xds.h 2001/06/29 13:55:47 1.6 +++ ossp-pkg/srpc/libxds/xds.h 2001/06/29 13:58:53 1.7 @@ -1,6 +1,6 @@ /* $Source: /e/ossp/cvs/ossp-pkg/srpc/libxds/xds.h,v $ - $Revision: 1.6 $ + $Revision: 1.7 $ Copyright (c) 2001 by Cable & Wireless Deutschland. @@ -48,6 +48,6 @@ int xds_decode(xds_t* context, const char* buf, const char* fmt, ...); int xds_vencode(xds_t* context, const char* fmt, va_list args); -int xds_vdecode(xds_t* context, const char* fmt, va_list args); +int xds_vdecode(xds_t* context, const char* buf, const char* fmt, va_list args); #endif /* !defined(__LIBXDS_H__) */ From ossp-cvs-owner@ossp.org Mon Jul 2 14:18:58 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f62CIvt01662; Mon, 2 Jul 2001 14:18:57 +0200 (CEST) Date: Mon, 2 Jul 2001 14:18:57 +0200 (CEST) Message-Id: <200107021218.f62CIvt01662@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds xds.h Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 02-Jul-2001 14:18:57 Branch: HEAD Handle: 2001070213185700 Modified files: ossp-pkg/srpc/libxds xds.h Log: - The de-/encoding buffer is now of type "void*" rather than "char*". - getbuffer() and setbuffer() now expect a parameter xds_buf_flag_t, which tells them who owns the buffer. If the library owns it (XDS_GIFT set at setbuf()-time), the library performs dynamic buffer management. If the user owns the buffer, it is static in size. - xds_init() now ecpects a xds_mode_t parameter, telling it whether to initialize in encode or decode mode. - The xds_register_XXX() functions are gone. We will rather export the symbols of the callbacks so that the users can register the ones he needs himself. Summary: Revision Changes Path 1.8 +23 -17 ossp-pkg/srpc/libxds/xds.h ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/xds.h ============================================================ $ cvs diff -u -r1.7 -r1.8 xds.h --- ossp-pkg/srpc/libxds/xds.h 2001/06/29 13:58:53 1.7 +++ ossp-pkg/srpc/libxds/xds.h 2001/07/02 12:18:57 1.8 @@ -1,6 +1,6 @@ /* $Source: /e/ossp/cvs/ossp-pkg/srpc/libxds/xds.h,v $ - $Revision: 1.7 $ + $Revision: 1.8 $ Copyright (c) 2001 by Cable & Wireless Deutschland. @@ -26,28 +26,34 @@ typedef int (*xds_fmt_cb_t)(xds_t* context, void* fmt_context, - char* buf, size_t buf_size, + void* buf, + size_t buf_size, va_list args); -xds_t* xds_init(void); -void xds_destroy(xds_t* context); +typedef enum + { + XDS_ENCODE, + XDS_DECODE + } +xds_mode_t; + +typedef enum + { + XDS_LOAN, + XDS_GIFT + } +xds_buf_flag_t; -int xds_register(xds_t* context, - const char* name, xds_fmt_cb_t callback, - void* formatter_context); -int xds_register_xdr(xds_t* context); -int xds_register_xml(xds_t* context); -int xds_register_asn1(xds_t* context); +xds_t* xds_init(xds_mode_t); +void xds_destroy(xds_t* context); + +int xds_register(xds_t* context, const char* name, xds_fmt_cb_t callback, void* formatter_context); int xds_unregister(xds_t* context, const char* name); -int xds_set_encode_buffer(xds_t* context, char* buf, size_t buf_size); -int xds_set_decode_buffer(xds_t* context, const char* buf, size_t buf_size); -int xds_get_encode_buffer(xds_t* context, char** buf, size_t* buf_size); +int xds_set_buffer(xds_t* context, xds_buf_flag_t flag, void* buf, size_t buf_size); +int xds_get_buffer(xds_t* context, xds_buf_flag_t flag, void** buf, size_t* buf_size); int xds_encode(xds_t* context, const char* fmt, ...); -int xds_decode(xds_t* context, const char* buf, const char* fmt, ...); - -int xds_vencode(xds_t* context, const char* fmt, va_list args); -int xds_vdecode(xds_t* context, const char* buf, const char* fmt, va_list args); +int xds_decode(xds_t* context, const char* fmt, ...); #endif /* !defined(__LIBXDS_H__) */ From ossp-cvs-owner@ossp.org Mon Jul 2 14:19:39 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f62CJb302017; Mon, 2 Jul 2001 14:19:37 +0200 (CEST) Date: Mon, 2 Jul 2001 14:19:37 +0200 (CEST) Message-Id: <200107021219.f62CJb302017@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds Makefile Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 02-Jul-2001 14:19:37 Branch: HEAD Handle: 2001070213193700 Modified files: ossp-pkg/srpc/libxds Makefile Log: Remove the -s flag at LDFLAGS. Debugging output might actually be useful during development. Summary: Revision Changes Path 1.3 +1 -1 ossp-pkg/srpc/libxds/Makefile ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/Makefile ============================================================ $ cvs diff -u -r1.2 -r1.3 Makefile --- ossp-pkg/srpc/libxds/Makefile 2001/06/28 22:42:12 1.2 +++ ossp-pkg/srpc/libxds/Makefile 2001/07/02 12:19:37 1.3 @@ -9,7 +9,7 @@ CPPFLAGS = CFLAGS = CXXFLAGS = -LDFLAGS = -s +LDFLAGS = .c.o: $(CC) $(CPPFLAGS) $(WARNFLAGS) $(OPTFLAGS) $(CFLAGS) -c $< From ossp-cvs-owner@ossp.org Mon Jul 2 16:03:41 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f62E3dq16156; Mon, 2 Jul 2001 16:03:39 +0200 (CEST) Date: Mon, 2 Jul 2001 16:03:39 +0200 (CEST) Message-Id: <200107021403.f62E3dq16156@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds xds.h Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 02-Jul-2001 16:03:39 Branch: HEAD Handle: 2001070215033900 Modified files: ossp-pkg/srpc/libxds xds.h Log: The interface is final, beautiful and it will never ever be changed again. Consider this header file to be eternally valid. Summary: Revision Changes Path 1.9 +28 -29 ossp-pkg/srpc/libxds/xds.h ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/xds.h ============================================================ $ cvs diff -u -r1.8 -r1.9 xds.h --- ossp-pkg/srpc/libxds/xds.h 2001/07/02 12:18:57 1.8 +++ ossp-pkg/srpc/libxds/xds.h 2001/07/02 14:03:39 1.9 @@ -1,6 +1,6 @@ /* $Source: /e/ossp/cvs/ossp-pkg/srpc/libxds/xds.h,v $ - $Revision: 1.8 $ + $Revision: 1.9 $ Copyright (c) 2001 by Cable & Wireless Deutschland. @@ -21,39 +21,38 @@ #include #include -struct xds_st; -typedef struct xds_st xds_t; - -typedef int (*xds_fmt_cb_t)(xds_t* context, - void* fmt_context, - void* buf, - size_t buf_size, - va_list args); - -typedef enum +enum { - XDS_ENCODE, - XDS_DECODE - } -xds_mode_t; - -typedef enum - { - XDS_LOAN, - XDS_GIFT - } -xds_buf_flag_t; + XDS_OK = 0, + XDS_ERR_NO_MEM = -1, + XDS_ERR_OVERFLOW = -2, + XDS_ERR_INVALID_ARG = -3, + XDS_ERR_TYPE_MISMATCH = -4 + }; +typedef enum { XDS_ENCODE, XDS_DECODE } xds_mode_t; +typedef enum { XDS_LOAN, XDS_GIFT } xds_scope_t; + +struct xds_context; +typedef struct xds_context xds_t; + +typedef int (*xds_engine_t)(xds_t* xds, + void* engine_context, + void* buffer, + size_t buffer_size, + va_list args); xds_t* xds_init(xds_mode_t); -void xds_destroy(xds_t* context); +void xds_destroy(xds_t* xds); -int xds_register(xds_t* context, const char* name, xds_fmt_cb_t callback, void* formatter_context); -int xds_unregister(xds_t* context, const char* name); +int xds_register(xds_t* xds, const char* name, xds_engine_t engine, void* engine_context); +int xds_unregister(xds_t* xds, const char* name); -int xds_set_buffer(xds_t* context, xds_buf_flag_t flag, void* buf, size_t buf_size); -int xds_get_buffer(xds_t* context, xds_buf_flag_t flag, void** buf, size_t* buf_size); +int xds_setbuffer(xds_t* xds, xds_scope_t flag, void* buffer, size_t buffer_size); +int xds_getbuffer(xds_t* xds, xds_scope_t flag, void** buffer, size_t* buffer_size); -int xds_encode(xds_t* context, const char* fmt, ...); -int xds_decode(xds_t* context, const char* fmt, ...); +int xds_encode(xds_t* xds, const char* fmt, ...); +int xds_decode(xds_t* xds, const char* fmt, ...); +int xds_vencode(xds_t* xds, const char* fmt, va_list args); +int xds_vdecode(xds_t* xds, const char* fmt, va_list args); #endif /* !defined(__LIBXDS_H__) */ From ossp-cvs-owner@ossp.org Mon Jul 2 16:05:40 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f62E5dj16329; Mon, 2 Jul 2001 16:05:39 +0200 (CEST) Date: Mon, 2 Jul 2001 16:05:39 +0200 (CEST) Message-Id: <200107021405.f62E5dj16329@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds xds.h Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 02-Jul-2001 16:05:39 Branch: HEAD Handle: 2001070215053900 Modified files: ossp-pkg/srpc/libxds xds.h Log: Cosmetic changes in the indention. Summary: Revision Changes Path 1.10 +6 -6 ossp-pkg/srpc/libxds/xds.h ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/xds.h ============================================================ $ cvs diff -u -r1.9 -r1.10 xds.h --- ossp-pkg/srpc/libxds/xds.h 2001/07/02 14:03:39 1.9 +++ ossp-pkg/srpc/libxds/xds.h 2001/07/02 14:05:39 1.10 @@ -1,6 +1,6 @@ /* $Source: /e/ossp/cvs/ossp-pkg/srpc/libxds/xds.h,v $ - $Revision: 1.9 $ + $Revision: 1.10 $ Copyright (c) 2001 by Cable & Wireless Deutschland. @@ -23,10 +23,10 @@ enum { - XDS_OK = 0, - XDS_ERR_NO_MEM = -1, - XDS_ERR_OVERFLOW = -2, - XDS_ERR_INVALID_ARG = -3, + XDS_OK = 0, + XDS_ERR_NO_MEM = -1, + XDS_ERR_OVERFLOW = -2, + XDS_ERR_INVALID_ARG = -3, XDS_ERR_TYPE_MISMATCH = -4 }; typedef enum { XDS_ENCODE, XDS_DECODE } xds_mode_t; @@ -47,7 +47,7 @@ int xds_register(xds_t* xds, const char* name, xds_engine_t engine, void* engine_context); int xds_unregister(xds_t* xds, const char* name); -int xds_setbuffer(xds_t* xds, xds_scope_t flag, void* buffer, size_t buffer_size); +int xds_setbuffer(xds_t* xds, xds_scope_t flag, void* buffer, size_t buffer_size); int xds_getbuffer(xds_t* xds, xds_scope_t flag, void** buffer, size_t* buffer_size); int xds_encode(xds_t* xds, const char* fmt, ...); From ossp-cvs-owner@ossp.org Mon Jul 2 16:15:05 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f62EF4F17858; Mon, 2 Jul 2001 16:15:04 +0200 (CEST) Date: Mon, 2 Jul 2001 16:15:04 +0200 (CEST) Message-Id: <200107021415.f62EF4F17858@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds xds.h Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 02-Jul-2001 16:15:04 Branch: HEAD Handle: 2001070215150400 Modified files: ossp-pkg/srpc/libxds xds.h Log: Added the standard OSSP copyright header. Summary: Revision Changes Path 1.11 +20 -8 ossp-pkg/srpc/libxds/xds.h ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/xds.h ============================================================ $ cvs diff -u -r1.10 -r1.11 xds.h --- ossp-pkg/srpc/libxds/xds.h 2001/07/02 14:05:39 1.10 +++ ossp-pkg/srpc/libxds/xds.h 2001/07/02 14:15:04 1.11 @@ -1,18 +1,30 @@ /* - $Source: /e/ossp/cvs/ossp-pkg/srpc/libxds/xds.h,v $ - $Revision: 1.10 $ + XDS - OSSP Extensible Data Serialization Library + Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) + Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) - Copyright (c) 2001 by Cable & Wireless Deutschland. + This file is part of OSSP XDS, an extensible data serialization + library which can be found at http://www.ossp.com/pkg/xds/. 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 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 - included license for more details. + 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. + + xds.h: C API */ #ifndef __LIBXDS_H__ @@ -23,7 +35,7 @@ enum { - XDS_OK = 0, + XDS_OK = 0, XDS_ERR_NO_MEM = -1, XDS_ERR_OVERFLOW = -2, XDS_ERR_INVALID_ARG = -3, From ossp-cvs-owner@ossp.org Mon Jul 2 16:15:53 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f62EFpA17949; Mon, 2 Jul 2001 16:15:51 +0200 (CEST) Date: Mon, 2 Jul 2001 16:15:51 +0200 (CEST) Message-Id: <200107021415.f62EFpA17949@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds LICENSE Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 02-Jul-2001 16:15:51 Branch: HEAD Handle: 2001070215155100 Added files: ossp-pkg/srpc/libxds LICENSE Log: License for the XDS library. Summary: Revision Changes Path 1.1 +24 -0 ossp-pkg/srpc/libxds/LICENSE ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/LICENSE ============================================================ $ cvs update -p -r1.1 LICENSE XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) This file is part of OSSP XDS, an extensible data serialization library which can be found at http://www.ossp.com/pkg/xds/. 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. From ossp-cvs-owner@ossp.org Tue Jul 3 10:25:27 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f638PPE49171; Tue, 3 Jul 2001 10:25:25 +0200 (CEST) Date: Tue, 3 Jul 2001 10:25:25 +0200 (CEST) Message-Id: <200107030825.f638PPE49171@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds Makefile xds.h xds.pod Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 03-Jul-2001 10:25:25 Branch: HEAD Handle: 2001070309252400 Added files: ossp-pkg/srpc/libxds xds.pod Modified files: ossp-pkg/srpc/libxds Makefile xds.h Log: Added preliminary documentation for xds_init(), xds_destroy(), xds_register(), xds_unregister(), xds_setbuffer(), and xds_getbuffer(). Summary: Revision Changes Path 1.4 +7 -1 ossp-pkg/srpc/libxds/Makefile 1.12 +2 -1 ossp-pkg/srpc/libxds/xds.h 1.1 +98 -0 ossp-pkg/srpc/libxds/xds.pod ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/Makefile ============================================================ $ cvs diff -u -r1.3 -r1.4 Makefile --- ossp-pkg/srpc/libxds/Makefile 2001/07/02 12:19:37 1.3 +++ ossp-pkg/srpc/libxds/Makefile 2001/07/03 08:25:24 1.4 @@ -17,12 +17,18 @@ .cpp.o: $(CXX) $(CPPFLAGS) $(WARNFLAGS) $(OPTFLAGS) $(CXXFLAGS) -c $< +all: test xds.3 + test: test.o $(CC) $(LDFLAGS) -o $@ test.o +xds.3: xds.pod + pod2man --section=3 --center="XDS Library Programmer API " $< >$@ + clean:: rm -f test.o test + rm -f xds.3 # Dependencies -test.o: test.c xds.h +test.o: test.c xds.h Index: ossp-pkg/srpc/libxds/xds.h ============================================================ $ cvs diff -u -r1.11 -r1.12 xds.h --- ossp-pkg/srpc/libxds/xds.h 2001/07/02 14:15:04 1.11 +++ ossp-pkg/srpc/libxds/xds.h 2001/07/03 08:25:24 1.12 @@ -39,7 +39,8 @@ XDS_ERR_NO_MEM = -1, XDS_ERR_OVERFLOW = -2, XDS_ERR_INVALID_ARG = -3, - XDS_ERR_TYPE_MISMATCH = -4 + XDS_ERR_TYPE_MISMATCH = -4, + XDS_ERR_UNKNOW_ENGINE = -5 }; typedef enum { XDS_ENCODE, XDS_DECODE } xds_mode_t; typedef enum { XDS_LOAN, XDS_GIFT } xds_scope_t; Index: ossp-pkg/srpc/libxds/xds.pod ============================================================ $ cvs update -p -r1.1 xds.pod =pod =head1 NAME xds - eXtendable Data Serialization =head1 SYNOPSIS =head1 DESCRIPTION =over 4 =item xds_t* B(xds_mode_t I); Valid settings for I are B and B. If successful, a valid handle is returned -- B otherwise. If the routine fails, the system variable B is set apropriately. =item void B(xds_t* I); Free all internally allocated resources associated with this context. I must be a handle obtained by calling B. =item int B(xds_t* I, const char* I, xds_engine_t I, void* I); Register the function I as formatting engine in context I under the name I. The function must have the following prototype: int my_engine(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list args); It must gather its values from I and encode/decode them into I. The encoded/decoded representation must not take up more than I byte of memory, because that's the maximum I can hold. If the buffer is too small, I must return B. In case of no error, I must return B. The variable I is passed through to the function every time it is called; it is not touched in any way by the xds library. =item int B(xds_t* I, const char* I); Remove encoding/decoding engine I from context I. The function will return B if successful and B if I is not a registered engine. =item int B(xds_t* I, xds_scope_t I, void* I, size_t I); Encoding mode: Set internal buffer used in context I to I. The buffer has a capacity of I byte. I may be set to B or B. A "loaned" buffer is one that is owned by the application; xds will use it, but it will not B the buffer nor will it try to B it if it's too small. A buffer given to xds as a "gift" is henceforth owned by xds and may be Bd or Bed as the library sees fit. If I is B, I must be a pointer obtained from calling B or a comparable system routine. Calling B with a I of B will cause the xds library to allocate a buffer of its own. I is ignored in this case. Decoding mode: I contains the encoded representation of the data to be used for following B calls. The encoded data is I byte long. Unlike in encoding mode, such a buffer is not modified, hence there is no need to extend the buffer. If I is set to B, the library will B I when the context is destroyed. =item int B(xds_t* I, xds_scope_t flag, void** buffer, size_t* buffer_size); This routine will write the address and size of the internal buffer in context I to I and I. The I parameter determines who owns the buffer after that; setting I to B means that the buffer is owned by the xds library and that the user may not rely on its contents still being there after another xds library function call. Furthermore, calling B will flush the registered buffer, meaning that coming B calls will start at the beginning and potentially overwrite the buffer contents. Setting I to B means that the returned buffer is owned by the application programmer from now on, it is no longer modified or used in any way by the library. =item int B(xds_t* I, const char* I, ...); =item int B(xds_t* I, const char* I, ...); =item int B(xds_t* I, const char* I, va_list I); =item int B(xds_t* I, const char* I, va_list I); =back =cut From ossp-cvs-owner@ossp.org Tue Jul 3 11:38:27 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f639cQ259121; Tue, 3 Jul 2001 11:38:26 +0200 (CEST) Date: Tue, 3 Jul 2001 11:38:26 +0200 (CEST) Message-Id: <200107030938.f639cQ259121@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds .cvsignore Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 03-Jul-2001 11:38:26 Branch: HEAD Handle: 2001070310382500 Modified files: ossp-pkg/srpc/libxds .cvsignore Log: Ignore dependent file xds.3. Summary: Revision Changes Path 1.2 +1 -0 ossp-pkg/srpc/libxds/.cvsignore ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/.cvsignore ============================================================ $ cvs diff -u -r1.1 -r1.2 .cvsignore --- ossp-pkg/srpc/libxds/.cvsignore 2001/06/28 12:30:58 1.1 +++ ossp-pkg/srpc/libxds/.cvsignore 2001/07/03 09:38:25 1.2 @@ -1 +1,2 @@ +xds.3 test From ossp-cvs-owner@ossp.org Tue Jul 3 13:15:40 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f63BFd271498; Tue, 3 Jul 2001 13:15:39 +0200 (CEST) Date: Tue, 3 Jul 2001 13:15:39 +0200 (CEST) Message-Id: <200107031115.f63BFd271498@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds Makefile Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 03-Jul-2001 13:15:39 Branch: HEAD Handle: 2001070312153900 Modified files: ossp-pkg/srpc/libxds Makefile Log: Removed automatic variable use from xds.3 target because non-GNU make won't understand these reliably. Summary: Revision Changes Path 1.5 +1 -1 ossp-pkg/srpc/libxds/Makefile ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/Makefile ============================================================ $ cvs diff -u -r1.4 -r1.5 Makefile --- ossp-pkg/srpc/libxds/Makefile 2001/07/03 08:25:24 1.4 +++ ossp-pkg/srpc/libxds/Makefile 2001/07/03 11:15:39 1.5 @@ -23,7 +23,7 @@ $(CC) $(LDFLAGS) -o $@ test.o xds.3: xds.pod - pod2man --section=3 --center="XDS Library Programmer API " $< >$@ + pod2man --section=3 --center="XDS Library Programmer API " xds.pod >xds.3 clean:: rm -f test.o test From ossp-cvs-owner@ossp.org Tue Jul 3 13:36:24 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f63BaM773705; Tue, 3 Jul 2001 13:36:22 +0200 (CEST) Date: Tue, 3 Jul 2001 13:36:22 +0200 (CEST) Message-Id: <200107031136.f63BaM773705@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds xds.pod Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 03-Jul-2001 13:36:22 Branch: HEAD Handle: 2001070312362200 Modified files: ossp-pkg/srpc/libxds xds.pod Log: xds_register: - Documented valid characters for callback names. xds_setbuffer: - Documented return codes. - Clearified requirement of library-owned buffers coming from malloc. xds_encode: - Added documentation. Summary: Revision Changes Path 1.2 +39 -5 ossp-pkg/srpc/libxds/xds.pod ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/xds.pod ============================================================ $ cvs diff -u -r1.1 -r1.2 xds.pod --- ossp-pkg/srpc/libxds/xds.pod 2001/07/03 08:25:24 1.1 +++ ossp-pkg/srpc/libxds/xds.pod 2001/07/03 11:36:22 1.2 @@ -41,6 +41,9 @@ function every time it is called; it is not touched in any way by the xds library. +A valid name I for a callback function consists of an arbitrary +number of characters from the class [a-zA-Z0-9_-]. + =item int B(xds_t* I, const char* I); Remove encoding/decoding engine I from context I. The @@ -56,10 +59,10 @@ B the buffer nor will it try to B it if it's too small. A buffer given to xds as a "gift" is henceforth owned by xds and may be Bd or Bed as the library sees fit. If I is -B, I must be a pointer obtained from calling -B or a comparable system routine. Calling B -with a I of B will cause the xds library to allocate a -buffer of its own. I is ignored in this case. +B, I must be a pointer obtained from calling the +B API. Calling B with a I of B +will cause the xds library to allocate a buffer of its own. +I is ignored in this case. Decoding mode: I contains the encoded representation of the data to be used for following B calls. The encoded data is @@ -68,6 +71,11 @@ is set to B, the library will B I when the context is destroyed. +B returns one of the following codes signifying success +or failure: B (everything alright), B (failed +to allocate new internal buffers), and B +(arguments don't make sense). + =item int B(xds_t* I, xds_scope_t flag, void** buffer, size_t* buffer_size); This routine will write the address and size of the internal buffer in @@ -84,14 +92,40 @@ by the application programmer from now on, it is no longer modified or used in any way by the library. - =item int B(xds_t* I, const char* I, ...); +The B function call will encode an arbitrary number of values +into the chosen representation. The syntax is very similar to +B: As parameters, it requires the I handle obtained from +B, a format string I describing the following value +parameters, and an arbitrary number of actual values. + +The format string lists the names of the callback functions to be used +in order to format the values; it has the format "name name ...". The +names are delimited by any number of characters any of which is not +part of the character set allowed for function names here. Hence, you +can delimit the names by blanks, tabs, dollar signs or pretty much +anyting your want. + +B will return either B (everything OK), +B (failed allocating memory for intenal buffering), +B (can't expand internal buffer because it's owned +by the application), B (parameters don't make +sense), B (specified callback can't handle this +data type), and B (unknown call back name used +in I). + =item int B(xds_t* I, const char* I, ...); +Like B, only the other way round. + =item int B(xds_t* I, const char* I, va_list I); +See B. + =item int B(xds_t* I, const char* I, va_list I); + +See B. =back From ossp-cvs-owner@ossp.org Wed Jul 4 16:21:22 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f64ELLZ67532; Wed, 4 Jul 2001 16:21:21 +0200 (CEST) Date: Wed, 4 Jul 2001 16:21:21 +0200 (CEST) Message-Id: <200107041421.f64ELLZ67532@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds xds.pod Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 04-Jul-2001 16:21:21 Branch: HEAD Handle: 2001070415212000 Modified files: ossp-pkg/srpc/libxds xds.pod Log: Documented the return code of registered engines incorrectly: The enigne does not return XDS_OK but the number of bytes it wrote to the buffer. Summary: Revision Changes Path 1.3 +5 -4 ossp-pkg/srpc/libxds/xds.pod ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/xds.pod ============================================================ $ cvs diff -u -r1.2 -r1.3 xds.pod --- ossp-pkg/srpc/libxds/xds.pod 2001/07/03 11:36:22 1.2 +++ ossp-pkg/srpc/libxds/xds.pod 2001/07/04 14:21:20 1.3 @@ -36,10 +36,11 @@ I. The encoded/decoded representation must not take up more than I byte of memory, because that's the maximum I can hold. If the buffer is too small, I must return -B. In case of no error, I must return -B. The variable I is passed through to the -function every time it is called; it is not touched in any way by the -xds library. +B. In case of no error, I must return the +number of bytes it has written to the buffer. (Note that all xds error +defines are smaller than >0.) The variable I is passed +through to the function every time it is called; it is not touched in +any way by the xds library. A valid name I for a callback function consists of an arbitrary number of characters from the class [a-zA-Z0-9_-]. From ossp-cvs-owner@ossp.org Wed Jul 4 16:25:58 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f64EPv068288; Wed, 4 Jul 2001 16:25:57 +0200 (CEST) Date: Wed, 4 Jul 2001 16:25:57 +0200 (CEST) Message-Id: <200107041425.f64EPv068288@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds xds.pod Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 04-Jul-2001 16:25:57 Branch: HEAD Handle: 2001070415255700 Modified files: ossp-pkg/srpc/libxds xds.pod Log: Documented the need to free() a buffer obtained via xds_getbuffer with the XDS_GIFT flag set. Summary: Revision Changes Path 1.4 +2 -1 ossp-pkg/srpc/libxds/xds.pod ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/xds.pod ============================================================ $ cvs diff -u -r1.3 -r1.4 xds.pod --- ossp-pkg/srpc/libxds/xds.pod 2001/07/04 14:21:20 1.3 +++ ossp-pkg/srpc/libxds/xds.pod 2001/07/04 14:25:57 1.4 @@ -91,7 +91,8 @@ Setting I to B means that the returned buffer is owned by the application programmer from now on, it is no longer modified or -used in any way by the library. +used in any way by the library. The application must B the +buffer when it's not needed anymore. =item int B(xds_t* I, const char* I, ...); From ossp-cvs-owner@ossp.org Wed Jul 4 17:09:57 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f64F9uG73657; Wed, 4 Jul 2001 17:09:56 +0200 (CEST) Date: Wed, 4 Jul 2001 17:09:56 +0200 (CEST) Message-Id: <200107041509.f64F9uG73657@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds Makefile ossp-pkg/srpc/libxds/regress... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 04-Jul-2001 17:09:56 Branch: HEAD Handle: 2001070416095500 Added files: ossp-pkg/srpc/libxds/regression-tests .cvsignore .run-tests Makefile Modified files: ossp-pkg/srpc/libxds Makefile Log: Added regression test suite. Summary: Revision Changes Path 1.6 +3 -0 ossp-pkg/srpc/libxds/Makefile 1.1 +1 -0 ossp-pkg/srpc/libxds/regression-tests/.cvsignore 1.1 +37 -0 ossp-pkg/srpc/libxds/regression-tests/.run-tests 1.1 +30 -0 ossp-pkg/srpc/libxds/regression-tests/Makefile ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/Makefile ============================================================ $ cvs diff -u -r1.5 -r1.6 Makefile --- ossp-pkg/srpc/libxds/Makefile 2001/07/03 11:15:39 1.5 +++ ossp-pkg/srpc/libxds/Makefile 2001/07/04 15:09:55 1.6 @@ -29,6 +29,9 @@ rm -f test.o test rm -f xds.3 +check: + (cd regression-tests && $(MAKE) check) + # Dependencies test.o: test.c xds.h Index: ossp-pkg/srpc/libxds/regression-tests/.cvsignore ============================================================ $ cvs update -p -r1.1 .cvsignore *.log Index: ossp-pkg/srpc/libxds/regression-tests/.run-tests ============================================================ $ cvs update -p -r1.1 .run-tests #! /bin/sh if [ $# -lt 1 ]; then echo "Usage: $0 test1.exe [...]" exit 1; fi RESCOLUMN=30 numTests=0 numFails=0 for suite in $*; do tmp="${suite%%.exe}: " echo -n "$tmp" currpos=$(($RESCOLUMN-${#tmp})) while [ $currpos -gt 0 ]; do echo -n " " currpos=$(($currpos-1)) done numTests=$(($numTests+1)) eval ./$suite >${suite%%.exe}.log 2>&1 if [ $? -eq 0 ]; then echo OK else numFails=$(($numFails+1)) echo FAILED fi done echo echo "Summary: $numFails of $numTests tests failed ($(($numFails*100/$numTests))%)." if [ $numFails -eq 0 ]; then exit 0 else exit 1 fi Index: ossp-pkg/srpc/libxds/regression-tests/Makefile ============================================================ $ cvs update -p -r1.1 Makefile # Build and run the regression tests. CC = gcc WARNFLAGS = -Wall -ansi -pedantic OPTFLAGS = -O3 -pipe CPPFLAGS = CFLAGS = LDFLAGS = TESTS = test1.exe .SUFFIXES: .SUFFIXES: .c .exe .c.exe: $(CC) $(CPPFLAGS) $(WARNFLAGS) $(OPTFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $< .cpp.exe: $(CXX) $(CPPFLAGS) $(WARNFLAGS) $(OPTFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ $< all: $(TESTS) check: all ./.run-tests *.exe clean:: rm -f $(TESTS) *.log # Dependencies From ossp-cvs-owner@ossp.org Wed Jul 4 17:12:34 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f64FCVr74134; Wed, 4 Jul 2001 17:12:31 +0200 (CEST) Date: Wed, 4 Jul 2001 17:12:31 +0200 (CEST) Message-Id: <200107041512.f64FCVr74134@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds xds.pod Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 04-Jul-2001 17:12:31 Branch: HEAD Handle: 2001070416123100 Modified files: ossp-pkg/srpc/libxds xds.pod Log: The correct name is "extensible" rather than "extandable". Summary: Revision Changes Path 1.5 +1 -1 ossp-pkg/srpc/libxds/xds.pod ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/xds.pod ============================================================ $ cvs diff -u -r1.4 -r1.5 xds.pod --- ossp-pkg/srpc/libxds/xds.pod 2001/07/04 14:25:57 1.4 +++ ossp-pkg/srpc/libxds/xds.pod 2001/07/04 15:12:31 1.5 @@ -2,7 +2,7 @@ =head1 NAME -xds - eXtendable Data Serialization +xds - eXtensible Data Serialization =head1 SYNOPSIS From ossp-cvs-owner@ossp.org Wed Jul 4 17:25:40 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f64FPdq75896; Wed, 4 Jul 2001 17:25:39 +0200 (CEST) Date: Wed, 4 Jul 2001 17:25:39 +0200 (CEST) Message-Id: <200107041525.f64FPdq75896@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds xds.h Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 04-Jul-2001 17:25:39 Branch: HEAD Handle: 2001070416253800 Modified files: ossp-pkg/srpc/libxds xds.h Log: Fixed typo: The label XDS_ERR_UNKNOWN_ENGINE was spelled incorrectly. Summary: Revision Changes Path 1.13 +6 -6 ossp-pkg/srpc/libxds/xds.h ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/xds.h ============================================================ $ cvs diff -u -r1.12 -r1.13 xds.h --- ossp-pkg/srpc/libxds/xds.h 2001/07/03 08:25:24 1.12 +++ ossp-pkg/srpc/libxds/xds.h 2001/07/04 15:25:38 1.13 @@ -35,12 +35,12 @@ enum { - XDS_OK = 0, - XDS_ERR_NO_MEM = -1, - XDS_ERR_OVERFLOW = -2, - XDS_ERR_INVALID_ARG = -3, - XDS_ERR_TYPE_MISMATCH = -4, - XDS_ERR_UNKNOW_ENGINE = -5 + XDS_OK = 0, + XDS_ERR_NO_MEM = -1, + XDS_ERR_OVERFLOW = -2, + XDS_ERR_INVALID_ARG = -3, + XDS_ERR_TYPE_MISMATCH = -4, + XDS_ERR_UNKNOWN_ENGINE = -5 }; typedef enum { XDS_ENCODE, XDS_DECODE } xds_mode_t; typedef enum { XDS_LOAN, XDS_GIFT } xds_scope_t; From ossp-cvs-owner@ossp.org Wed Jul 4 17:55:08 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f64Ft6G79087; Wed, 4 Jul 2001 17:55:06 +0200 (CEST) Date: Wed, 4 Jul 2001 17:55:06 +0200 (CEST) Message-Id: <200107041555.f64Ft6G79087@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds/regression-tests Makefile core.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 04-Jul-2001 17:55:06 Branch: HEAD Handle: 2001070416550600 Added files: ossp-pkg/srpc/libxds/regression-tests core.c Modified files: ossp-pkg/srpc/libxds/regression-tests Makefile Log: Added first attempt of a regression test suite. Currently the library does not survive the very first test. :-) Summary: Revision Changes Path 1.2 +6 -6 ossp-pkg/srpc/libxds/regression-tests/Makefile 1.1 +75 -0 ossp-pkg/srpc/libxds/regression-tests/core.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/regression-tests/Makefile ============================================================ $ cvs diff -u -r1.1 -r1.2 Makefile --- ossp-pkg/srpc/libxds/regression-tests/Makefile 2001/07/04 15:09:55 1.1 +++ ossp-pkg/srpc/libxds/regression-tests/Makefile 2001/07/04 15:55:06 1.2 @@ -2,27 +2,27 @@ CC = gcc -WARNFLAGS = -Wall -ansi -pedantic +WARNFLAGS = -Wall -ansi -pedantic -Werror OPTFLAGS = -O3 -pipe CPPFLAGS = CFLAGS = -LDFLAGS = +LDFLAGS = -L.. -TESTS = test1.exe +TESTS = core.exe .SUFFIXES: .SUFFIXES: .c .exe .c.exe: - $(CC) $(CPPFLAGS) $(WARNFLAGS) $(OPTFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $< + $(CC) $(CPPFLAGS) $(WARNFLAGS) $(OPTFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $< -lxds .cpp.exe: - $(CXX) $(CPPFLAGS) $(WARNFLAGS) $(OPTFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ $< + $(CXX) $(CPPFLAGS) $(WARNFLAGS) $(OPTFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ $< -lxds all: $(TESTS) check: all - ./.run-tests *.exe + @./.run-tests $(TESTS) clean:: rm -f $(TESTS) *.log Index: ossp-pkg/srpc/libxds/regression-tests/core.c ============================================================ $ cvs update -p -r1.1 core.c /* XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) This file is part of OSSP XDS, an extensible data serialization library which can be found at http://www.ossp.com/pkg/xds/. 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. */ #include #include #include "../internal.h" int main() { xds_t* ctx[50]; size_t i; /* Open a bunch of contextes and close them again. */ for(i = 0; i < sizeof(ctx)/sizeof(xds_t*); ++i) { if (i % 2 == 0) ctx[i] = xds_init(XDS_ENCODE); else ctx[i] = xds_init(XDS_DECODE); if (ctx[i] == 0) { printf("Failed to initialize xds context: i = %d\n", i); return 1; } } for(i = 0; i < sizeof(ctx)/sizeof(xds_t*); ++i) xds_destroy(ctx[i]); /* Check how the library deals with errorneous arguments. */ if (xds_init((xds_mode_t)42) != NULL || errno != EINVAL) { printf("Called xds_init() with invalid mode but didn't get EINVAL.\n"); return 1; } /* Call xds_destroy() with an invalid context and see whether we survive that. */ xds_destroy(NULL); /* Everything went fine. */ return 0; } From ossp-cvs-owner@ossp.org Wed Jul 4 17:58:14 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f64FwDd79331; Wed, 4 Jul 2001 17:58:13 +0200 (CEST) Date: Wed, 4 Jul 2001 17:58:13 +0200 (CEST) Message-Id: <200107041558.f64FwDd79331@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds Makefile Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 04-Jul-2001 17:58:13 Branch: HEAD Handle: 2001070416581300 Modified files: ossp-pkg/srpc/libxds Makefile Log: Make sure libxds.a is built before starting the regression tests. Summary: Revision Changes Path 1.7 +15 -4 ossp-pkg/srpc/libxds/Makefile ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/Makefile ============================================================ $ cvs diff -u -r1.6 -r1.7 Makefile --- ossp-pkg/srpc/libxds/Makefile 2001/07/04 15:09:55 1.6 +++ ossp-pkg/srpc/libxds/Makefile 2001/07/04 15:58:13 1.7 @@ -2,6 +2,8 @@ CC = gcc CXX = g++ +AR = ar +RANLIB = ranlib WARNFLAGS = -Wall -ansi -pedantic OPTFLAGS = -O3 -pipe @@ -11,25 +13,34 @@ CXXFLAGS = LDFLAGS = +OBJS = decode.o destroy.o encode.o getbuffer.o init.o register.o \ + setbuffer.o unregister.o vdecode.o vencode.o + .c.o: $(CC) $(CPPFLAGS) $(WARNFLAGS) $(OPTFLAGS) $(CFLAGS) -c $< .cpp.o: $(CXX) $(CPPFLAGS) $(WARNFLAGS) $(OPTFLAGS) $(CXXFLAGS) -c $< + +all: libxds.a xds.3 test -all: test xds.3 +libxds.a: $(OBJS) + @rm -f $@ + $(AR) cr $@ $(OBJS) + $(RANLIB) $@ -test: test.o - $(CC) $(LDFLAGS) -o $@ test.o +test: test.o libxds.a + $(CC) $(LDFLAGS) -o $@ test.o -L. -lxds xds.3: xds.pod pod2man --section=3 --center="XDS Library Programmer API " xds.pod >xds.3 clean:: + @(cd regression-tests && $(MAKE) clean) rm -f test.o test rm -f xds.3 -check: +check: libxds.a (cd regression-tests && $(MAKE) check) # Dependencies From ossp-cvs-owner@ossp.org Wed Jul 4 17:58:53 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f64FwpX79463; Wed, 4 Jul 2001 17:58:51 +0200 (CEST) Date: Wed, 4 Jul 2001 17:58:51 +0200 (CEST) Message-Id: <200107041558.f64FwpX79463@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds decode.c destroy.c encode.c getbuffer... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 04-Jul-2001 17:58:51 Branch: HEAD Handle: 2001070416585100 Added files: ossp-pkg/srpc/libxds decode.c destroy.c encode.c getbuffer.c init.c register.c setbuffer.c unregister.c vdecode.c vencode.c Log: Added function stubs that return errors when called. Summary: Revision Changes Path 1.1 +33 -0 ossp-pkg/srpc/libxds/decode.c 1.1 +32 -0 ossp-pkg/srpc/libxds/destroy.c 1.1 +33 -0 ossp-pkg/srpc/libxds/encode.c 1.1 +33 -0 ossp-pkg/srpc/libxds/getbuffer.c 1.1 +35 -0 ossp-pkg/srpc/libxds/init.c 1.1 +33 -0 ossp-pkg/srpc/libxds/register.c 1.1 +33 -0 ossp-pkg/srpc/libxds/setbuffer.c 1.1 +33 -0 ossp-pkg/srpc/libxds/unregister.c 1.1 +33 -0 ossp-pkg/srpc/libxds/vdecode.c 1.1 +33 -0 ossp-pkg/srpc/libxds/vencode.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/decode.c ============================================================ $ cvs update -p -r1.1 decode.c /* XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) This file is part of OSSP XDS, an extensible data serialization library which can be found at http://www.ossp.com/pkg/xds/. 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. */ #include "internal.h" int xds_decode(xds_t* xds, const char* fmt, ...) { return XDS_ERR_INVALID_ARG; } Index: ossp-pkg/srpc/libxds/destroy.c ============================================================ $ cvs update -p -r1.1 destroy.c /* XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) This file is part of OSSP XDS, an extensible data serialization library which can be found at http://www.ossp.com/pkg/xds/. 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. */ #include "internal.h" void xds_destroy(xds_t* xds) { } Index: ossp-pkg/srpc/libxds/encode.c ============================================================ $ cvs update -p -r1.1 encode.c /* XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) This file is part of OSSP XDS, an extensible data serialization library which can be found at http://www.ossp.com/pkg/xds/. 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. */ #include "internal.h" int xds_encode(xds_t* xds, const char* fmt, ...) { return XDS_ERR_INVALID_ARG; } Index: ossp-pkg/srpc/libxds/getbuffer.c ============================================================ $ cvs update -p -r1.1 getbuffer.c /* XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) This file is part of OSSP XDS, an extensible data serialization library which can be found at http://www.ossp.com/pkg/xds/. 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. */ #include "internal.h" int xds_getbuffer(xds_t* xds, xds_scope_t flag, void** buffer, size_t* buffer_size) { return XDS_ERR_INVALID_ARG; } Index: ossp-pkg/srpc/libxds/init.c ============================================================ $ cvs update -p -r1.1 init.c /* XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) This file is part of OSSP XDS, an extensible data serialization library which can be found at http://www.ossp.com/pkg/xds/. 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. */ #include #include "internal.h" xds_t* xds_init(xds_mode_t mode) { xds_t* ctx = calloc(1, sizeof(struct xds_context)); return NULL; } Index: ossp-pkg/srpc/libxds/register.c ============================================================ $ cvs update -p -r1.1 register.c /* XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) This file is part of OSSP XDS, an extensible data serialization library which can be found at http://www.ossp.com/pkg/xds/. 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. */ #include "internal.h" int xds_register(xds_t* xds, const char* name, xds_engine_t engine, void* engine_context) { return XDS_ERR_INVALID_ARG; } Index: ossp-pkg/srpc/libxds/setbuffer.c ============================================================ $ cvs update -p -r1.1 setbuffer.c /* XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) This file is part of OSSP XDS, an extensible data serialization library which can be found at http://www.ossp.com/pkg/xds/. 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. */ #include "internal.h" int xds_setbuffer(xds_t* xds, xds_scope_t flag, void* buffer, size_t buffer_size) { return XDS_ERR_INVALID_ARG; } Index: ossp-pkg/srpc/libxds/unregister.c ============================================================ $ cvs update -p -r1.1 unregister.c /* XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) This file is part of OSSP XDS, an extensible data serialization library which can be found at http://www.ossp.com/pkg/xds/. 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. */ #include "internal.h" int xds_unregister(xds_t* xds, const char* name) { return XDS_ERR_UNKNOWN_ENGINE; } Index: ossp-pkg/srpc/libxds/vdecode.c ============================================================ $ cvs update -p -r1.1 vdecode.c /* XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) This file is part of OSSP XDS, an extensible data serialization library which can be found at http://www.ossp.com/pkg/xds/. 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. */ #include "internal.h" int xds_vdecode(xds_t* xds, const char* fmt, va_list args) { return XDS_ERR_INVALID_ARG; } Index: ossp-pkg/srpc/libxds/vencode.c ============================================================ $ cvs update -p -r1.1 vencode.c /* XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) This file is part of OSSP XDS, an extensible data serialization library which can be found at http://www.ossp.com/pkg/xds/. 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. */ #include "internal.h" int xds_vencode(xds_t* xds, const char* fmt, va_list args) { return XDS_ERR_INVALID_ARG; } From ossp-cvs-owner@ossp.org Wed Jul 4 18:05:07 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f64G56D80506; Wed, 4 Jul 2001 18:05:06 +0200 (CEST) Date: Wed, 4 Jul 2001 18:05:06 +0200 (CEST) Message-Id: <200107041605.f64G56D80506@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds internal.h Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 04-Jul-2001 18:05:06 Branch: HEAD Handle: 2001070417050600 Added files: ossp-pkg/srpc/libxds internal.h Log: This is our internal header which defines all the data structures that are opaque for the application developer. Summary: Revision Changes Path 1.1 +44 -0 ossp-pkg/srpc/libxds/internal.h ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/internal.h ============================================================ $ cvs update -p -r1.1 internal.h /* XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) This file is part of OSSP XDS, an extensible data serialization library which can be found at http://www.ossp.com/pkg/xds/. 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. internal.h: internal C API */ #ifndef __INTERNAL_H__ #define __INTERNAL_H__ #include "xds.h" struct xds_context { xds_mode_t mode; /* XDS_ENCODE or XDS_DECODE */ char* buffer; /* may be NULL if unallocated */ size_t buffer_size; /* physical size of the buffer */ size_t buffer_len; /* length of buffer's content */ }; #endif /* !defined(__INTERNAL_H__) */ From ossp-cvs-owner@ossp.org Wed Jul 4 18:06:10 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f64G69p80616; Wed, 4 Jul 2001 18:06:09 +0200 (CEST) Date: Wed, 4 Jul 2001 18:06:09 +0200 (CEST) Message-Id: <200107041606.f64G69p80616@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds Makefile Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 04-Jul-2001 18:06:08 Branch: HEAD Handle: 2001070417060800 Modified files: ossp-pkg/srpc/libxds Makefile Log: Updated dependencies. Summary: Revision Changes Path 1.8 +11 -1 ossp-pkg/srpc/libxds/Makefile ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/Makefile ============================================================ $ cvs diff -u -r1.7 -r1.8 Makefile --- ossp-pkg/srpc/libxds/Makefile 2001/07/04 15:58:13 1.7 +++ ossp-pkg/srpc/libxds/Makefile 2001/07/04 16:06:08 1.8 @@ -45,4 +45,14 @@ # Dependencies -test.o: test.c xds.h +decode.o: internal.h xds.h +destroy.o: internal.h xds.h +encode.o: internal.h xds.h +getbuffer.o: internal.h xds.h +init.o: internal.h xds.h +register.o: internal.h xds.h +setbuffer.o: internal.h xds.h +test.o: xds.h +unregister.o: internal.h xds.h +vdecode.o: internal.h xds.h +vencode.o: internal.h xds.h From ossp-cvs-owner@ossp.org Wed Jul 4 18:12:16 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f64GCEq81081; Wed, 4 Jul 2001 18:12:14 +0200 (CEST) Date: Wed, 4 Jul 2001 18:12:14 +0200 (CEST) Message-Id: <200107041612.f64GCEq81081@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds/regression-tests Makefile Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 04-Jul-2001 18:12:14 Branch: HEAD Handle: 2001070417121400 Modified files: ossp-pkg/srpc/libxds/regression-tests Makefile Log: Tests programs now depend on ../libxds.a. Summary: Revision Changes Path 1.3 +2 -0 ossp-pkg/srpc/libxds/regression-tests/Makefile ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/regression-tests/Makefile ============================================================ $ cvs diff -u -r1.2 -r1.3 Makefile --- ossp-pkg/srpc/libxds/regression-tests/Makefile 2001/07/04 15:55:06 1.2 +++ ossp-pkg/srpc/libxds/regression-tests/Makefile 2001/07/04 16:12:14 1.3 @@ -28,3 +28,5 @@ rm -f $(TESTS) *.log # Dependencies + +$(TESTS): ../libxds.a From ossp-cvs-owner@ossp.org Wed Jul 4 18:13:32 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f64GDVI81479; Wed, 4 Jul 2001 18:13:31 +0200 (CEST) Date: Wed, 4 Jul 2001 18:13:31 +0200 (CEST) Message-Id: <200107041613.f64GDVI81479@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds/regression-tests core.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 04-Jul-2001 18:13:31 Branch: HEAD Handle: 2001070417133000 Modified files: ossp-pkg/srpc/libxds/regression-tests core.c Log: Removed the tests that call xds fuctions with errorneous arguments, because the library right now uses assert() and thus terminates in case of invalid arguments.x Summary: Revision Changes Path 1.2 +2 -2 ossp-pkg/srpc/libxds/regression-tests/core.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/regression-tests/core.c ============================================================ $ cvs diff -u -r1.1 -r1.2 core.c --- ossp-pkg/srpc/libxds/regression-tests/core.c 2001/07/04 15:55:06 1.1 +++ ossp-pkg/srpc/libxds/regression-tests/core.c 2001/07/04 16:13:30 1.2 @@ -54,6 +54,7 @@ xds_destroy(ctx[i]); +#if 0 /* Check how the library deals with errorneous arguments. */ if (xds_init((xds_mode_t)42) != NULL || errno != EINVAL) @@ -62,12 +63,11 @@ return 1; } - /* Call xds_destroy() with an invalid context and see whether we survive that. */ xds_destroy(NULL); - +#endif /* Everything went fine. */ From ossp-cvs-owner@ossp.org Wed Jul 4 18:13:56 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f64GDup81546; Wed, 4 Jul 2001 18:13:56 +0200 (CEST) Date: Wed, 4 Jul 2001 18:13:56 +0200 (CEST) Message-Id: <200107041613.f64GDup81546@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds Makefile Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 04-Jul-2001 18:13:56 Branch: HEAD Handle: 2001070417135600 Modified files: ossp-pkg/srpc/libxds Makefile Log: Fixed clean target. Summary: Revision Changes Path 1.9 +2 -2 ossp-pkg/srpc/libxds/Makefile ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/Makefile ============================================================ $ cvs diff -u -r1.8 -r1.9 Makefile --- ossp-pkg/srpc/libxds/Makefile 2001/07/04 16:06:08 1.8 +++ ossp-pkg/srpc/libxds/Makefile 2001/07/04 16:13:56 1.9 @@ -37,8 +37,8 @@ clean:: @(cd regression-tests && $(MAKE) clean) - rm -f test.o test - rm -f xds.3 + rm -f $(OBJS) + rm -f libxds.a test.o test xds.3 check: libxds.a (cd regression-tests && $(MAKE) check) From ossp-cvs-owner@ossp.org Wed Jul 4 18:21:27 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f64GLQv82287; Wed, 4 Jul 2001 18:21:26 +0200 (CEST) Date: Wed, 4 Jul 2001 18:21:26 +0200 (CEST) Message-Id: <200107041621.f64GLQv82287@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds destroy.c init.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 04-Jul-2001 18:21:26 Branch: HEAD Handle: 2001070417212600 Modified files: ossp-pkg/srpc/libxds destroy.c init.c Log: Added preliminary implementations for xds_init() and xds_destroy(). Summary: Revision Changes Path 1.2 +8 -0 ossp-pkg/srpc/libxds/destroy.c 1.2 +26 -2 ossp-pkg/srpc/libxds/init.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/destroy.c ============================================================ $ cvs diff -u -r1.1 -r1.2 destroy.c --- ossp-pkg/srpc/libxds/destroy.c 2001/07/04 15:58:51 1.1 +++ ossp-pkg/srpc/libxds/destroy.c 2001/07/04 16:21:26 1.2 @@ -25,8 +25,16 @@ SUCH DAMAGE. */ +#include +#include +#include #include "internal.h" void xds_destroy(xds_t* xds) { + assert(xds != NULL); + if (xds != NULL) + { + free(xds); + } } Index: ossp-pkg/srpc/libxds/init.c ============================================================ $ cvs diff -u -r1.1 -r1.2 init.c --- ossp-pkg/srpc/libxds/init.c 2001/07/04 15:58:51 1.1 +++ ossp-pkg/srpc/libxds/init.c 2001/07/04 16:21:26 1.2 @@ -26,10 +26,34 @@ */ #include +#include +#include #include "internal.h" xds_t* xds_init(xds_mode_t mode) { - xds_t* ctx = calloc(1, sizeof(struct xds_context)); - return NULL; + xds_t* ctx; + + /* Sanity check parameter. */ + + assert(mode == XDS_ENCODE || mode == XDS_DECODE); + if (mode != XDS_ENCODE && mode != XDS_DECODE) + { + errno = EINVAL; + return NULL; + } + + /* Allocate context structure. */ + + ctx = calloc(1, sizeof(struct xds_context)); + if (ctx == NULL) + return NULL; /* errno is set by calloc() */ + + /* Set mode of operation in context. */ + + ctx->mode = mode; + + /* We are initialized. */ + + return ctx; } From ossp-cvs-owner@ossp.org Wed Jul 4 18:22:58 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f64GMvq82703; Wed, 4 Jul 2001 18:22:57 +0200 (CEST) Date: Wed, 4 Jul 2001 18:22:57 +0200 (CEST) Message-Id: <200107041622.f64GMvq82703@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds/regression-tests .run-tests Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 04-Jul-2001 18:22:57 Branch: HEAD Handle: 2001070417225700 Modified files: ossp-pkg/srpc/libxds/regression-tests .run-tests Log: Added nice (and arguably useless) tty output. Summary: Revision Changes Path 1.2 +2 -0 ossp-pkg/srpc/libxds/regression-tests/.run-tests ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/regression-tests/.run-tests ============================================================ $ cvs diff -u -r1.1 -r1.2 .run-tests --- ossp-pkg/srpc/libxds/regression-tests/.run-tests 2001/07/04 15:09:55 1.1 +++ ossp-pkg/srpc/libxds/regression-tests/.run-tests 2001/07/04 16:22:57 1.2 @@ -9,6 +9,8 @@ numTests=0 numFails=0 +echo Running test suite ... + for suite in $*; do tmp="${suite%%.exe}: " echo -n "$tmp" From ossp-cvs-owner@ossp.org Sun Jul 8 16:04:23 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f68E4LC75459; Sun, 8 Jul 2001 16:04:21 +0200 (CEST) Date: Sun, 8 Jul 2001 16:04:21 +0200 (CEST) Message-Id: <200107081404.f68E4LC75459@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds/regression-tests core.c xds-core.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 08-Jul-2001 16:04:21 Branch: HEAD Handle: 19700101010000994597461 Added files: ossp-pkg/srpc/libxds/regression-tests xds-core.c Removed files: ossp-pkg/srpc/libxds/regression-tests core.c Log: Renamed core.c to xds-core.c for consistency. Summary: Revision Changes Path NONE +0 -75 ossp-pkg/srpc/libxds/regression-tests/core.c 1.1 +74 -0 ossp-pkg/srpc/libxds/regression-tests/xds-core.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/regression-tests/xds-core.c ============================================================ $ cvs update -p -r1.1 xds-core.c /* XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) This file is part of OSSP XDS, an extensible data serialization library which can be found at http://www.ossp.com/pkg/xds/. 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. */ #include #include #include "../internal.h" int main() { xds_t* ctx[50]; size_t i; /* Open a bunch of contextes and close them again. */ for(i = 0; i < sizeof(ctx)/sizeof(xds_t*); ++i) { if (i % 2 == 0) ctx[i] = xds_init(XDS_ENCODE); else ctx[i] = xds_init(XDS_DECODE); if (ctx[i] == 0) { printf("Failed to initialize xds context: i = %d\n", i); return 1; } } for(i = 0; i < sizeof(ctx)/sizeof(xds_t*); ++i) xds_destroy(ctx[i]); #ifdef NDEBUG /* Check how the library deals with errorneous arguments. */ if (xds_init((xds_mode_t)42) != NULL || errno != EINVAL) { printf("Called xds_init() with invalid mode but didn't get EINVAL.\n"); return 1; } /* Call xds_destroy() with an invalid context and see whether we survive that. */ xds_destroy(NULL); #endif /* Everything went fine. */ return 0; } From ossp-cvs-owner@ossp.org Sun Jul 8 16:05:04 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f68E53p75543; Sun, 8 Jul 2001 16:05:03 +0200 (CEST) Date: Sun, 8 Jul 2001 16:05:03 +0200 (CEST) Message-Id: <200107081405.f68E53p75543@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds/regression-tests Makefile Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 08-Jul-2001 16:05:03 Branch: HEAD Handle: 2001070815050300 Modified files: ossp-pkg/srpc/libxds/regression-tests Makefile Log: - Added xds-find-engine and xds-register tests. - Made tests depend on ../libxds.a. Summary: Revision Changes Path 1.4 +4 -2 ossp-pkg/srpc/libxds/regression-tests/Makefile ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/regression-tests/Makefile ============================================================ $ cvs diff -u -r1.3 -r1.4 Makefile --- ossp-pkg/srpc/libxds/regression-tests/Makefile 2001/07/04 16:12:14 1.3 +++ ossp-pkg/srpc/libxds/regression-tests/Makefile 2001/07/08 14:05:03 1.4 @@ -8,7 +8,7 @@ CFLAGS = LDFLAGS = -L.. -TESTS = core.exe +TESTS = xds-core.exe xds-find-engine.exe xds-register.exe .SUFFIXES: .SUFFIXES: .c .exe @@ -24,9 +24,11 @@ check: all @./.run-tests $(TESTS) +../libxds.a: + (cd .. && $(MAKE) libxds.a) clean:: rm -f $(TESTS) *.log # Dependencies -$(TESTS): ../libxds.a +$(TESTS): ../libxds.a From ossp-cvs-owner@ossp.org Sun Jul 8 16:05:37 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f68E5Zp75611; Sun, 8 Jul 2001 16:05:35 +0200 (CEST) Date: Sun, 8 Jul 2001 16:05:35 +0200 (CEST) Message-Id: <200107081405.f68E5Zp75611@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds/regression-tests xds-find-engine.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 08-Jul-2001 16:05:35 Branch: HEAD Handle: 2001070815053500 Added files: ossp-pkg/srpc/libxds/regression-tests xds-find-engine.c Log: Test module for the xds_find_engine() function. Summary: Revision Changes Path 1.1 +150 -0 ossp-pkg/srpc/libxds/regression-tests/xds-find-engine.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/regression-tests/xds-find-engine.c ============================================================ $ cvs update -p -r1.1 xds-find-engine.c /* XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) This file is part of OSSP XDS, an extensible data serialization library which can be found at http://www.ossp.com/pkg/xds/. 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. */ #include #include "../internal.h" int main() { const engine_map_t engines[] = { { "alan", NULL, 0 }, { "berta", NULL, 0 }, { "caesar", NULL, 0 }, { "doris", NULL, 0 }, { "egon", NULL, 0 }, { "franziska", NULL, 0 }, { "gudrun", NULL, 0 }, { "heinz", NULL, 0 }, { "igor", NULL, 0 }, { "jamila", NULL, 0 }, { "karin", NULL, 0 }, { "louis", NULL, 0 }, }; size_t engines_len = sizeof(engines) / sizeof(engine_map_t); size_t pos; size_t i; /* Search for every single entry in the array and check the results. */ for (i = 0; i < engines_len; ++i) { if (!xds_find_engine(engines, engines_len, engines[i].name, &pos)) { printf("xds_find_engine() said '%s' wouldn't be in the array, but that's wrong.\n", engines[i].name); exit(1); } if (pos != i) { printf("xds_find_engine() would insert '%s' at position %d, but %d is correct.\n", engines[i].name, pos, i); exit(1); } } /* Search for non-existing name that would be inserted at the first position. */ if (xds_find_engine(engines, engines_len, "aaron", &pos)) { printf("xds_find_engine() said 'aaron' would be in the array, but that's wrong.\n"); exit(1); } if (pos != 0) { printf("xds_find_engine() would insert 'aaron' at position %d, but 0 is correct.\n", pos); exit(1); } /* Search for non-existing name that would be inserted at last position. */ if (xds_find_engine(engines, engines_len, "zerberos", &pos)) { printf("xds_find_engine() said 'zerberos' would be in the array, but that's wrong.\n"); exit(1); } if (pos != engines_len) { printf("xds_find_engine() would insert 'zerberos' at position %d, but %d is correct.\n", pos, engines_len); exit(1); } /* Search for non-existing names that would be inserted at random positions. */ if (xds_find_engine(engines, engines_len, "balthasar", &pos)) { printf("xds_find_engine() said 'balthasar' would be in the array, but that's wrong.\n"); exit(1); } if (pos != 1) { printf("xds_find_engine() would insert 'balthasar' at position %d, but 1 is correct.\n", pos); exit(1); } if (xds_find_engine(engines, engines_len, "bulli", &pos)) { printf("xds_find_engine() said 'bulli' would be in the array, but that's wrong.\n"); exit(1); } if (pos != 2) { printf("xds_find_engine() would insert 'bulli' at position %d, but 2 is correct.\n", pos); exit(1); } if (xds_find_engine(engines, engines_len, "hildegard", &pos)) { printf("xds_find_engine() said 'hildegard' would be in the array, but that's wrong.\n"); exit(1); } if (pos != 8) { printf("xds_find_engine() would insert 'hildegard' at position %d, but 8 is correct.\n", pos); exit(1); } if (xds_find_engine(engines, engines_len, "harald", &pos)) { printf("xds_find_engine() said 'harald' would be in the array, but that's wrong.\n"); exit(1); } if (pos != 7) { printf("xds_find_engine() would insert 'harald' at position %d, but 7 is correct.\n", pos); exit(1); } /* Everything went fine. */ return 0; } From ossp-cvs-owner@ossp.org Sun Jul 8 16:06:09 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f68E67M75682; Sun, 8 Jul 2001 16:06:07 +0200 (CEST) Date: Sun, 8 Jul 2001 16:06:07 +0200 (CEST) Message-Id: <200107081406.f68E67M75682@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds/regression-tests xds-register.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 08-Jul-2001 16:06:07 Branch: HEAD Handle: 2001070815060700 Added files: ossp-pkg/srpc/libxds/regression-tests xds-register.c Log: Test module for the xds_register() function. Summary: Revision Changes Path 1.1 +110 -0 ossp-pkg/srpc/libxds/regression-tests/xds-register.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/regression-tests/xds-register.c ============================================================ $ cvs update -p -r1.1 xds-register.c /* XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) This file is part of OSSP XDS, an extensible data serialization library which can be found at http://www.ossp.com/pkg/xds/. 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. */ #include #include #include "../internal.h" static int dummy_engine(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list args) { if (xds == NULL) { printf("XDS context isn't passed through to registered engine.\n"); exit(1); } if (engine_context != (void*)42) { printf("Engine context isn't passed through to registered engine.\n"); exit(1); } if (buffer == NULL) { printf("Buffer passed to engine is NULL.\n"); exit(1); } if (buffer_size == 0) { printf("Buffer size passed to engine is NULL.\n"); exit(1); } return 0; } int main() { xds_t* xds; /* Create contexts for encoding and decoding. */ xds = xds_init(XDS_ENCODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); return 1; } /* Register the dummy callback under multiple names. */ if (xds_register(xds, "foo", &dummy_engine, (void*)42) != XDS_OK) { printf("Failed to register engine for 'foo'.\n"); return 1; } if (xds_register(xds, "bar", &dummy_engine, (void*)42) != XDS_OK) { printf("Failed to register engine for 'bar'.\n"); return 1; } if (xds_register(xds, "zarah", &dummy_engine, (void*)42) != XDS_OK) { printf("Failed to register engine for 'zarah'.\n"); return 1; } if (xds_register(xds, "caesar", &dummy_engine, (void*)42) != XDS_OK) { printf("Failed to register engine for 'caesar'.\n"); return 1; } if (xds_register(xds, "claus", &dummy_engine, (void*)42) != XDS_OK) { printf("Failed to register engine for 'claus'.\n"); return 1; } if (xds_register(xds, "heinz", &dummy_engine, (void*)42) != XDS_OK) { printf("Failed to register engine for 'heinz'.\n"); return 1; } /* Clean up. */ xds_destroy(xds); /* Everything went fine. */ return 0; } From ossp-cvs-owner@ossp.org Sun Jul 8 16:07:37 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f68E7Zh75820; Sun, 8 Jul 2001 16:07:35 +0200 (CEST) Date: Sun, 8 Jul 2001 16:07:35 +0200 (CEST) Message-Id: <200107081407.f68E7Zh75820@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds Makefile Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 08-Jul-2001 16:07:35 Branch: HEAD Handle: 2001070815073500 Modified files: ossp-pkg/srpc/libxds Makefile Log: - Added _GNU_SOURCE define to CPPFLAGS so those stupid Linux boxes find routines not included in the ANSI-C standard. - Added find-engine.o module to build. Summary: Revision Changes Path 1.10 +2 -2 ossp-pkg/srpc/libxds/Makefile ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/Makefile ============================================================ $ cvs diff -u -r1.9 -r1.10 Makefile --- ossp-pkg/srpc/libxds/Makefile 2001/07/04 16:13:56 1.9 +++ ossp-pkg/srpc/libxds/Makefile 2001/07/08 14:07:35 1.10 @@ -8,13 +8,13 @@ WARNFLAGS = -Wall -ansi -pedantic OPTFLAGS = -O3 -pipe -CPPFLAGS = +CPPFLAGS = -D_GNU_SOURCE CFLAGS = CXXFLAGS = LDFLAGS = OBJS = decode.o destroy.o encode.o getbuffer.o init.o register.o \ - setbuffer.o unregister.o vdecode.o vencode.o + setbuffer.o unregister.o vdecode.o vencode.o find-engine.o .c.o: $(CC) $(CPPFLAGS) $(WARNFLAGS) $(OPTFLAGS) $(CFLAGS) -c $< From ossp-cvs-owner@ossp.org Sun Jul 8 16:08:18 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f68E8HO75900; Sun, 8 Jul 2001 16:08:17 +0200 (CEST) Date: Sun, 8 Jul 2001 16:08:17 +0200 (CEST) Message-Id: <200107081408.f68E8HO75900@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds destroy.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 08-Jul-2001 16:08:17 Branch: HEAD Handle: 2001070815081600 Modified files: ossp-pkg/srpc/libxds destroy.c Log: Removed unnecessary inclusion of the errno.h header. Summary: Revision Changes Path 1.3 +0 -1 ossp-pkg/srpc/libxds/destroy.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/destroy.c ============================================================ $ cvs diff -u -r1.2 -r1.3 destroy.c --- ossp-pkg/srpc/libxds/destroy.c 2001/07/04 16:21:26 1.2 +++ ossp-pkg/srpc/libxds/destroy.c 2001/07/08 14:08:16 1.3 @@ -26,7 +26,6 @@ */ #include -#include #include #include "internal.h" From ossp-cvs-owner@ossp.org Sun Jul 8 16:09:43 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f68E9gn76307; Sun, 8 Jul 2001 16:09:42 +0200 (CEST) Date: Sun, 8 Jul 2001 16:09:42 +0200 (CEST) Message-Id: <200107081409.f68E9gn76307@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds internal.h Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 08-Jul-2001 16:09:42 Branch: HEAD Handle: 2001070815094200 Modified files: ossp-pkg/srpc/libxds internal.h Log: - Added definition of engine_map_t. - Added prototype for xds_find_engine(). - Renamed buffer_size to buffer_capacity in xds_context. - Added engine_map_t stuff to xds_context. Summary: Revision Changes Path 1.2 +19 -4 ossp-pkg/srpc/libxds/internal.h ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/internal.h ============================================================ $ cvs diff -u -r1.1 -r1.2 internal.h --- ossp-pkg/srpc/libxds/internal.h 2001/07/04 16:05:06 1.1 +++ ossp-pkg/srpc/libxds/internal.h 2001/07/08 14:09:42 1.2 @@ -32,13 +32,28 @@ #include "xds.h" +typedef struct + { + char* name; + xds_engine_t engine; + void* context; + } +engine_map_t; + struct xds_context { - xds_mode_t mode; /* XDS_ENCODE or XDS_DECODE */ + xds_mode_t mode; - char* buffer; /* may be NULL if unallocated */ - size_t buffer_size; /* physical size of the buffer */ - size_t buffer_len; /* length of buffer's content */ + char* buffer; + size_t buffer_len; + size_t buffer_capacity; + int we_own_buffer; + + engine_map_t* engines; + size_t engines_len; + size_t engines_capacity; }; + +int xds_find_engine(const engine_map_t* engines, size_t last, const char* name, size_t* pos); #endif /* !defined(__INTERNAL_H__) */ From ossp-cvs-owner@ossp.org Sun Jul 8 16:10:34 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f68EAX576405; Sun, 8 Jul 2001 16:10:33 +0200 (CEST) Date: Sun, 8 Jul 2001 16:10:33 +0200 (CEST) Message-Id: <200107081410.f68EAX576405@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds find-engine.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 08-Jul-2001 16:10:33 Branch: HEAD Handle: 2001070815103200 Added files: ossp-pkg/srpc/libxds find-engine.c Log: The xds_find_engine() routine will binary search through the engine_map_t to find an engine or the spot where it should be inserted to keep the correct alphabetical ordering. Summary: Revision Changes Path 1.1 +69 -0 ossp-pkg/srpc/libxds/find-engine.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/find-engine.c ============================================================ $ cvs update -p -r1.1 find-engine.c /* XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) This file is part of OSSP XDS, an extensible data serialization library which can be found at http://www.ossp.com/pkg/xds/. 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. */ #include #include #include "internal.h" int xds_find_engine(const engine_map_t* engines, size_t last, const char* name, size_t* pos) { size_t first; /* Sanity checks. */ assert(engines != NULL); assert(name != NULL); assert(pos != NULL); if (engines == NULL || name == NULL || pos == NULL) return XDS_ERR_INVALID_ARG; /* Use binary search to find "name" in "engines". */ for (first = 0; (last - first) > 0; ) { size_t half = first + ((last - first) / 2); int rc = strcmp(engines[half].name, name); if (rc < 0) { first = half + 1; } else if(rc == 0) { /* found it */ *pos = half; return (1 == 1); } else { last = half; } assert(first <= last); } *pos = first; return (1 != 1); } From ossp-cvs-owner@ossp.org Sun Jul 8 16:19:01 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f68EJ0j77191; Sun, 8 Jul 2001 16:19:00 +0200 (CEST) Date: Sun, 8 Jul 2001 16:19:00 +0200 (CEST) Message-Id: <200107081419.f68EJ0j77191@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds/regression-tests xds-find-engine.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 08-Jul-2001 16:19:00 Branch: HEAD Handle: 2001070815190000 Modified files: ossp-pkg/srpc/libxds/regression-tests xds-find-engine.c Log: Added test whether xds_find_engine() can handle an empty array. Summary: Revision Changes Path 1.2 +13 -0 ossp-pkg/srpc/libxds/regression-tests/xds-find-engine.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/regression-tests/xds-find-engine.c ============================================================ $ cvs diff -u -r1.1 -r1.2 xds-find-engine.c --- ossp-pkg/srpc/libxds/regression-tests/xds-find-engine.c 2001/07/08 14:05:35 1.1 +++ ossp-pkg/srpc/libxds/regression-tests/xds-find-engine.c 2001/07/08 14:19:00 1.2 @@ -49,6 +49,19 @@ size_t pos; size_t i; + /* Does xds_find_engine handle an empty array? */ + + if (xds_find_engine(engines, 0, "whatever", &pos)) + { + printf("xds_find_engine() said 'whatever' would be in the array, but that's wrong.\n"); + exit(1); + } + if (pos != 0) + { + printf("xds_find_engine() would insert 'whatever' at position %d, but 0 is correct.\n", pos); + exit(1); + } + /* Search for every single entry in the array and check the results. */ From ossp-cvs-owner@ossp.org Sun Jul 8 16:21:10 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f68EL9D77661; Sun, 8 Jul 2001 16:21:09 +0200 (CEST) Date: Sun, 8 Jul 2001 16:21:09 +0200 (CEST) Message-Id: <200107081421.f68EL9D77661@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds destroy.c init.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 08-Jul-2001 16:21:09 Branch: HEAD Handle: 2001070815210800 Modified files: ossp-pkg/srpc/libxds destroy.c init.c Log: xds_init() and xds_destroy() will now initialize and destroy the engines array in the context, too. Summary: Revision Changes Path 1.4 +9 -4 ossp-pkg/srpc/libxds/destroy.c 1.3 +10 -0 ossp-pkg/srpc/libxds/init.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/destroy.c ============================================================ $ cvs diff -u -r1.3 -r1.4 destroy.c --- ossp-pkg/srpc/libxds/destroy.c 2001/07/08 14:08:16 1.3 +++ ossp-pkg/srpc/libxds/destroy.c 2001/07/08 14:21:08 1.4 @@ -31,9 +31,14 @@ void xds_destroy(xds_t* xds) { + /* Sanity checks. */ + assert(xds != NULL); - if (xds != NULL) - { - free(xds); - } + if (xds == NULL) + return; + + /* Free allocated memory. */ + + free(xds->engines); + free(xds); } Index: ossp-pkg/srpc/libxds/init.c ============================================================ $ cvs diff -u -r1.2 -r1.3 init.c --- ossp-pkg/srpc/libxds/init.c 2001/07/04 16:21:26 1.2 +++ ossp-pkg/srpc/libxds/init.c 2001/07/08 14:21:08 1.3 @@ -53,6 +53,16 @@ ctx->mode = mode; + /* Allocate engines array. */ + + ctx->engines = calloc(32, sizeof(engine_map_t)); + if (ctx->engines == NULL) + { + free(ctx); + return NULL; + } + ctx->engines_capacity = 32; + /* We are initialized. */ return ctx; From ossp-cvs-owner@ossp.org Sun Jul 8 17:16:31 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f68FGUC83815; Sun, 8 Jul 2001 17:16:30 +0200 (CEST) Date: Sun, 8 Jul 2001 17:16:30 +0200 (CEST) Message-Id: <200107081516.f68FGUC83815@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds/regression-tests .run-tests Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 08-Jul-2001 17:16:29 Branch: HEAD Handle: 2001070816162900 Modified files: ossp-pkg/srpc/libxds/regression-tests .run-tests Log: Cosmetic changes: Made the output more neat. Summary: Revision Changes Path 1.3 +5 -4 ossp-pkg/srpc/libxds/regression-tests/.run-tests ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/regression-tests/.run-tests ============================================================ $ cvs diff -u -r1.2 -r1.3 .run-tests --- ossp-pkg/srpc/libxds/regression-tests/.run-tests 2001/07/04 16:22:57 1.2 +++ ossp-pkg/srpc/libxds/regression-tests/.run-tests 2001/07/08 15:16:29 1.3 @@ -9,16 +9,17 @@ numTests=0 numFails=0 -echo Running test suite ... +echo "Running test suite:" for suite in $*; do - tmp="${suite%%.exe}: " + tmp="${suite%%.exe}" echo -n "$tmp" currpos=$(($RESCOLUMN-${#tmp})) - while [ $currpos -gt 0 ]; do - echo -n " " + while [ $currpos -gt 1 ]; do + echo -n "." currpos=$(($currpos-1)) done + echo -n " " numTests=$(($numTests+1)) eval ./$suite >${suite%%.exe}.log 2>&1 if [ $? -eq 0 ]; then From ossp-cvs-owner@ossp.org Sun Jul 8 17:18:52 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f68FIpl84014; Sun, 8 Jul 2001 17:18:51 +0200 (CEST) Date: Sun, 8 Jul 2001 17:18:51 +0200 (CEST) Message-Id: <200107081518.f68FIpl84014@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds/regression-tests xds-register.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 08-Jul-2001 17:18:51 Branch: HEAD Handle: 2001070816185000 Modified files: ossp-pkg/srpc/libxds/regression-tests xds-register.c Log: - Removed the sanity checking code from dummy_callback: It won't be called in this test suite. Hence, the context for the registered callbacks can be NULL. - Fixed old comments, which do not apply anymore. - Added test at the end that ensures the entries are in alphabetical order. Summary: Revision Changes Path 1.2 +35 -31 ossp-pkg/srpc/libxds/regression-tests/xds-register.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/regression-tests/xds-register.c ============================================================ $ cvs diff -u -r1.1 -r1.2 xds-register.c --- ossp-pkg/srpc/libxds/regression-tests/xds-register.c 2001/07/08 14:06:07 1.1 +++ ossp-pkg/srpc/libxds/regression-tests/xds-register.c 2001/07/08 15:18:50 1.2 @@ -26,78 +26,82 @@ */ #include +#include #include +#include #include "../internal.h" static int dummy_engine(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list args) { - if (xds == NULL) - { - printf("XDS context isn't passed through to registered engine.\n"); - exit(1); - } - if (engine_context != (void*)42) - { - printf("Engine context isn't passed through to registered engine.\n"); - exit(1); - } - if (buffer == NULL) - { - printf("Buffer passed to engine is NULL.\n"); - exit(1); - } - if (buffer_size == 0) - { - printf("Buffer size passed to engine is NULL.\n"); - exit(1); - } return 0; } int main() { xds_t* xds; + size_t i; - /* Create contexts for encoding and decoding. */ + /* Create context. */ xds = xds_init(XDS_ENCODE); if (xds == NULL) - { - printf("Failed to initialize XDS context.\n"); - return 1; - } + { + printf("Failed to initialize XDS context.\n"); + return 1; + } /* Register the dummy callback under multiple names. */ - if (xds_register(xds, "foo", &dummy_engine, (void*)42) != XDS_OK) + if (xds_register(xds, "foo", &dummy_engine, NULL) != XDS_OK) { printf("Failed to register engine for 'foo'.\n"); return 1; } - if (xds_register(xds, "bar", &dummy_engine, (void*)42) != XDS_OK) + if (xds_register(xds, "bar", &dummy_engine, NULL) != XDS_OK) { printf("Failed to register engine for 'bar'.\n"); return 1; } - if (xds_register(xds, "zarah", &dummy_engine, (void*)42) != XDS_OK) + if (xds_register(xds, "zarah", &dummy_engine, NULL) != XDS_OK) { printf("Failed to register engine for 'zarah'.\n"); return 1; } - if (xds_register(xds, "caesar", &dummy_engine, (void*)42) != XDS_OK) + if (xds_register(xds, "caesar", &dummy_engine, NULL) != XDS_OK) { printf("Failed to register engine for 'caesar'.\n"); return 1; } - if (xds_register(xds, "claus", &dummy_engine, (void*)42) != XDS_OK) + if (xds_register(xds, "claus", &dummy_engine, NULL) != XDS_OK) { printf("Failed to register engine for 'claus'.\n"); return 1; } - if (xds_register(xds, "heinz", &dummy_engine, (void*)42) != XDS_OK) + if (xds_register(xds, "heinz", &dummy_engine, NULL) != XDS_OK) { printf("Failed to register engine for 'heinz'.\n"); return 1; + } + + /* Register the callback again, overwriting an existing entry. */ + + if (xds_register(xds, "claus", &dummy_engine, NULL) != XDS_OK) + { + printf("Failed to re-register engine for 'claus'.\n"); + return 1; + } + + /* Ensure that everything is in alphabetical order. */ + + for (i = 1; i < xds->engines_len; ++i) + { + assert(xds->engines[i-1].name != NULL); + assert(xds->engines[i].name != NULL); + if (strcmp(xds->engines[i-1].name, xds->engines[i].name) >= 0) + { + printf("xds->engines is not in alphabetical order!\n"); + exit(1); + } } /* Clean up. */ From ossp-cvs-owner@ossp.org Sun Jul 8 17:20:36 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f68FKZa84470; Sun, 8 Jul 2001 17:20:35 +0200 (CEST) Date: Sun, 8 Jul 2001 17:20:35 +0200 (CEST) Message-Id: <200107081520.f68FKZa84470@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds Makefile internal.h set-capacity.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 08-Jul-2001 17:20:35 Branch: HEAD Handle: 2001070816203400 Added files: ossp-pkg/srpc/libxds set-capacity.c Modified files: ossp-pkg/srpc/libxds Makefile internal.h Log: Added generic xds_set_capacity() function that will handle the enlarging of dynamic buffers for the rest of the code. Summary: Revision Changes Path 1.11 +2 -1 ossp-pkg/srpc/libxds/Makefile 1.3 +1 -0 ossp-pkg/srpc/libxds/internal.h 1.1 +67 -0 ossp-pkg/srpc/libxds/set-capacity.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/Makefile ============================================================ $ cvs diff -u -r1.10 -r1.11 Makefile --- ossp-pkg/srpc/libxds/Makefile 2001/07/08 14:07:35 1.10 +++ ossp-pkg/srpc/libxds/Makefile 2001/07/08 15:20:34 1.11 @@ -14,7 +14,8 @@ LDFLAGS = OBJS = decode.o destroy.o encode.o getbuffer.o init.o register.o \ - setbuffer.o unregister.o vdecode.o vencode.o find-engine.o + setbuffer.o unregister.o vdecode.o vencode.o find-engine.o \ + set-capacity.o .c.o: $(CC) $(CPPFLAGS) $(WARNFLAGS) $(OPTFLAGS) $(CFLAGS) -c $< Index: ossp-pkg/srpc/libxds/internal.h ============================================================ $ cvs diff -u -r1.2 -r1.3 internal.h --- ossp-pkg/srpc/libxds/internal.h 2001/07/08 14:09:42 1.2 +++ ossp-pkg/srpc/libxds/internal.h 2001/07/08 15:20:34 1.3 @@ -55,5 +55,6 @@ }; int xds_find_engine(const engine_map_t* engines, size_t last, const char* name, size_t* pos); +int xds_set_capacity(void** array, size_t* array_capacity, size_t new_capacity, size_t elem_size, size_t initial_capacity); #endif /* !defined(__INTERNAL_H__) */ Index: ossp-pkg/srpc/libxds/set-capacity.c ============================================================ $ cvs update -p -r1.1 set-capacity.c /* XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) This file is part of OSSP XDS, an extensible data serialization library which can be found at http://www.ossp.com/pkg/xds/. 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. */ #include /* delete me */ #include #include #include "internal.h" int xds_set_capacity(void** array, size_t* array_capacity, size_t new_capacity, size_t elem_size, size_t initial_capacity) { void* buf; size_t size; /* Sanity checks. */ assert(array != NULL); assert(array_capacity != NULL); assert(elem_size != 0); assert(initial_capacity != 0); /* Do we need to re-allocate? */ if (*array_capacity > new_capacity) return XDS_OK; /* Find the correct capacity. */ for(size = (*array_capacity != 0) ? *array_capacity * 2 : initial_capacity; size <= new_capacity; size *= 2) ; /* Allocate the array and store the new values. */ printf("Reallocating array with capacity %d; old value was %d.\n", size, *array_capacity); buf = realloc(*array, size * elem_size); if (buf == NULL) return XDS_ERR_NO_MEM; *array = buf; *array_capacity = size; return XDS_OK; } From ossp-cvs-owner@ossp.org Sun Jul 8 17:22:02 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f68FM1384638; Sun, 8 Jul 2001 17:22:01 +0200 (CEST) Date: Sun, 8 Jul 2001 17:22:01 +0200 (CEST) Message-Id: <200107081522.f68FM1384638@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds destroy.c find-engine.c init.c regist... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 08-Jul-2001 17:22:01 Branch: HEAD Handle: 2001070816220000 Modified files: ossp-pkg/srpc/libxds destroy.c find-engine.c init.c register.c ossp-pkg/srpc/libxds/regression-tests Makefile Log: xds_find_engine() can now handle a NULL pointer for "engines" as long as "last" is set correctly to 0. This is necessary so that we don't have to allocate an array before we actually have any entries. Summary: Revision Changes Path 1.5 +4 -1 ossp-pkg/srpc/libxds/destroy.c 1.2 +1 -3 ossp-pkg/srpc/libxds/find-engine.c 1.4 +0 -10 ossp-pkg/srpc/libxds/init.c 1.2 +53 -1 ossp-pkg/srpc/libxds/register.c 1.5 +1 -1 ossp-pkg/srpc/libxds/regression-tests/Makefile ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/destroy.c ============================================================ $ cvs diff -u -r1.4 -r1.5 destroy.c --- ossp-pkg/srpc/libxds/destroy.c 2001/07/08 14:21:08 1.4 +++ ossp-pkg/srpc/libxds/destroy.c 2001/07/08 15:22:00 1.5 @@ -39,6 +39,9 @@ /* Free allocated memory. */ - free(xds->engines); + assert(xds->engines != NULL || xds->engines_capacity == 0); + if (xds->engines != NULL) + free(xds->engines); + free(xds); } Index: ossp-pkg/srpc/libxds/find-engine.c ============================================================ $ cvs diff -u -r1.1 -r1.2 find-engine.c --- ossp-pkg/srpc/libxds/find-engine.c 2001/07/08 14:10:32 1.1 +++ ossp-pkg/srpc/libxds/find-engine.c 2001/07/08 15:22:00 1.2 @@ -35,11 +35,9 @@ /* Sanity checks. */ - assert(engines != NULL); + assert(engines != NULL || last == 0); assert(name != NULL); assert(pos != NULL); - if (engines == NULL || name == NULL || pos == NULL) - return XDS_ERR_INVALID_ARG; /* Use binary search to find "name" in "engines". */ Index: ossp-pkg/srpc/libxds/init.c ============================================================ $ cvs diff -u -r1.3 -r1.4 init.c --- ossp-pkg/srpc/libxds/init.c 2001/07/08 14:21:08 1.3 +++ ossp-pkg/srpc/libxds/init.c 2001/07/08 15:22:00 1.4 @@ -53,16 +53,6 @@ ctx->mode = mode; - /* Allocate engines array. */ - - ctx->engines = calloc(32, sizeof(engine_map_t)); - if (ctx->engines == NULL) - { - free(ctx); - return NULL; - } - ctx->engines_capacity = 32; - /* We are initialized. */ return ctx; Index: ossp-pkg/srpc/libxds/register.c ============================================================ $ cvs diff -u -r1.1 -r1.2 register.c --- ossp-pkg/srpc/libxds/register.c 2001/07/04 15:58:51 1.1 +++ ossp-pkg/srpc/libxds/register.c 2001/07/08 15:22:00 1.2 @@ -25,9 +25,61 @@ SUCH DAMAGE. */ +#include /* delete me */ + +#include +#include +#include #include "internal.h" int xds_register(xds_t* xds, const char* name, xds_engine_t engine, void* engine_context) { - return XDS_ERR_INVALID_ARG; + size_t pos; + + printf("*** Inserting '%s' ...\n", name); + printf("Before the insertion:\n"); + for (pos = 0; pos < xds->engines_len; ++pos) + printf("\tengines[%d] = '%s'\n", pos, xds->engines[pos].name); + + /* Sanity checks. */ + + assert(xds != NULL); + assert(name != NULL); + assert(engine != NULL); + if (xds == NULL || name == NULL || engine == NULL) + return XDS_ERR_INVALID_ARG; + + /* Copy the name argument into our own memory. */ + + name = strdup(name); + if (name == NULL) + return XDS_ERR_NO_MEM; + + /* Search engines for the entry. */ + + if (xds_find_engine(xds->engines, xds->engines_len, name, &pos)) + { /* overwrite existing entry */ + free(xds->engines[pos].name); + } + else + { /* insert new entry */ + xds_set_capacity((void**)&xds->engines, &xds->engines_capacity, xds->engines_len + 1, sizeof(engine_map_t), 1); + memmove(&xds->engines[pos+1], &xds->engines[pos], (xds->engines_len - pos) * sizeof(engine_map_t)); + ++xds->engines_len; + } + + /* Insert entry. */ + + xds->engines[pos].name = (char*)name; + xds->engines[pos].engine = engine; + xds->engines[pos].context = engine_context; + + printf("After the insertion:\n"); + for (pos = 0; pos < xds->engines_len; ++pos) + printf("\tengines[%d] = '%s'\n", pos, xds->engines[pos].name); + printf("\n"); + + /* Everything is fine. */ + + return XDS_OK; } Index: ossp-pkg/srpc/libxds/regression-tests/Makefile ============================================================ $ cvs diff -u -r1.4 -r1.5 Makefile --- ossp-pkg/srpc/libxds/regression-tests/Makefile 2001/07/08 14:05:03 1.4 +++ ossp-pkg/srpc/libxds/regression-tests/Makefile 2001/07/08 15:22:00 1.5 @@ -8,7 +8,7 @@ CFLAGS = LDFLAGS = -L.. -TESTS = xds-core.exe xds-find-engine.exe xds-register.exe +TESTS = xds-core.exe xds-find-engine.exe xds-register.exe xds-callback-semantics.exe .SUFFIXES: .SUFFIXES: .c .exe From ossp-cvs-owner@ossp.org Sun Jul 8 17:26:24 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f68FQMw84989; Sun, 8 Jul 2001 17:26:22 +0200 (CEST) Date: Sun, 8 Jul 2001 17:26:22 +0200 (CEST) Message-Id: <200107081526.f68FQMw84989@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds register.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 08-Jul-2001 17:26:22 Branch: HEAD Handle: 2001070816262200 Modified files: ossp-pkg/srpc/libxds register.c Log: xds_register() now uses xds_set_capacity() to handle the dynamic buffer for storing the engines. Summary: Revision Changes Path 1.3 +5 -1 ossp-pkg/srpc/libxds/register.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/register.c ============================================================ $ cvs diff -u -r1.2 -r1.3 register.c --- ossp-pkg/srpc/libxds/register.c 2001/07/08 15:22:00 1.2 +++ ossp-pkg/srpc/libxds/register.c 2001/07/08 15:26:22 1.3 @@ -63,7 +63,11 @@ } else { /* insert new entry */ - xds_set_capacity((void**)&xds->engines, &xds->engines_capacity, xds->engines_len + 1, sizeof(engine_map_t), 1); + int rc = xds_set_capacity((void**)&xds->engines, &xds->engines_capacity, + xds->engines_len + 1, sizeof(engine_map_t), 32); + assert(rc == XDS_OK || rc == XDS_ERR_NO_MEM); + if (rc != XDS_OK) + return rc; memmove(&xds->engines[pos+1], &xds->engines[pos], (xds->engines_len - pos) * sizeof(engine_map_t)); ++xds->engines_len; } From ossp-cvs-owner@ossp.org Sun Jul 8 17:28:52 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f68FSpJ85208; Sun, 8 Jul 2001 17:28:51 +0200 (CEST) Date: Sun, 8 Jul 2001 17:28:51 +0200 (CEST) Message-Id: <200107081528.f68FSpJ85208@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds internal.h register.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 08-Jul-2001 17:28:51 Branch: HEAD Handle: 2001070816285100 Modified files: ossp-pkg/srpc/libxds internal.h register.c Log: Added define for the initial size of the engines array to internal.h and use it in xds_register(). Summary: Revision Changes Path 1.4 +2 -0 ossp-pkg/srpc/libxds/internal.h 1.4 +5 -2 ossp-pkg/srpc/libxds/register.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/internal.h ============================================================ $ cvs diff -u -r1.3 -r1.4 internal.h --- ossp-pkg/srpc/libxds/internal.h 2001/07/08 15:20:34 1.3 +++ ossp-pkg/srpc/libxds/internal.h 2001/07/08 15:28:51 1.4 @@ -32,6 +32,8 @@ #include "xds.h" +#define XDS_INITIAL_ENGINES_CAPACITY 32 + typedef struct { char* name; Index: ossp-pkg/srpc/libxds/register.c ============================================================ $ cvs diff -u -r1.3 -r1.4 register.c --- ossp-pkg/srpc/libxds/register.c 2001/07/08 15:26:22 1.3 +++ ossp-pkg/srpc/libxds/register.c 2001/07/08 15:28:51 1.4 @@ -63,8 +63,11 @@ } else { /* insert new entry */ - int rc = xds_set_capacity((void**)&xds->engines, &xds->engines_capacity, - xds->engines_len + 1, sizeof(engine_map_t), 32); + int rc = xds_set_capacity((void**)&xds->engines, + &xds->engines_capacity, + xds->engines_len + 1, + sizeof(engine_map_t), + XDS_INITIAL_ENGINES_CAPACITY); assert(rc == XDS_OK || rc == XDS_ERR_NO_MEM); if (rc != XDS_OK) return rc; From ossp-cvs-owner@ossp.org Sun Jul 8 17:36:31 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f68FaTu86228; Sun, 8 Jul 2001 17:36:29 +0200 (CEST) Date: Sun, 8 Jul 2001 17:36:29 +0200 (CEST) Message-Id: <200107081536.f68FaTu86228@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds Makefile test.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 08-Jul-2001 17:36:29 Branch: HEAD Handle: 19700101010000994602989 Modified files: ossp-pkg/srpc/libxds Makefile Removed files: ossp-pkg/srpc/libxds test.c Log: Removed test.c -- this won't be needed anymore now that we have regression testing. Summary: Revision Changes Path 1.12 +3 -5 ossp-pkg/srpc/libxds/Makefile NONE +0 -23 ossp-pkg/srpc/libxds/test.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/Makefile ============================================================ $ cvs diff -u -r1.11 -r1.12 Makefile --- ossp-pkg/srpc/libxds/Makefile 2001/07/08 15:20:34 1.11 +++ ossp-pkg/srpc/libxds/Makefile 2001/07/08 15:36:29 1.12 @@ -23,16 +23,13 @@ .cpp.o: $(CXX) $(CPPFLAGS) $(WARNFLAGS) $(OPTFLAGS) $(CXXFLAGS) -c $< -all: libxds.a xds.3 test +all: libxds.a xds.3 libxds.a: $(OBJS) @rm -f $@ $(AR) cr $@ $(OBJS) $(RANLIB) $@ -test: test.o libxds.a - $(CC) $(LDFLAGS) -o $@ test.o -L. -lxds - xds.3: xds.pod pod2man --section=3 --center="XDS Library Programmer API " xds.pod >xds.3 @@ -49,11 +46,12 @@ decode.o: internal.h xds.h destroy.o: internal.h xds.h encode.o: internal.h xds.h +find-engine.o: internal.h xds.h getbuffer.o: internal.h xds.h init.o: internal.h xds.h register.o: internal.h xds.h +set-capacity.o: internal.h xds.h setbuffer.o: internal.h xds.h -test.o: xds.h unregister.o: internal.h xds.h vdecode.o: internal.h xds.h vencode.o: internal.h xds.h From ossp-cvs-owner@ossp.org Sun Jul 8 17:37:15 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f68FbEt86313; Sun, 8 Jul 2001 17:37:14 +0200 (CEST) Date: Sun, 8 Jul 2001 17:37:14 +0200 (CEST) Message-Id: <200107081537.f68FbEt86313@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds register.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 08-Jul-2001 17:37:14 Branch: HEAD Handle: 2001070816371300 Modified files: ossp-pkg/srpc/libxds register.c Log: Removed debug output. Summary: Revision Changes Path 1.5 +0 -12 ossp-pkg/srpc/libxds/register.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/register.c ============================================================ $ cvs diff -u -r1.4 -r1.5 register.c --- ossp-pkg/srpc/libxds/register.c 2001/07/08 15:28:51 1.4 +++ ossp-pkg/srpc/libxds/register.c 2001/07/08 15:37:13 1.5 @@ -25,8 +25,6 @@ SUCH DAMAGE. */ -#include /* delete me */ - #include #include #include @@ -36,11 +34,6 @@ { size_t pos; - printf("*** Inserting '%s' ...\n", name); - printf("Before the insertion:\n"); - for (pos = 0; pos < xds->engines_len; ++pos) - printf("\tengines[%d] = '%s'\n", pos, xds->engines[pos].name); - /* Sanity checks. */ assert(xds != NULL); @@ -80,11 +73,6 @@ xds->engines[pos].name = (char*)name; xds->engines[pos].engine = engine; xds->engines[pos].context = engine_context; - - printf("After the insertion:\n"); - for (pos = 0; pos < xds->engines_len; ++pos) - printf("\tengines[%d] = '%s'\n", pos, xds->engines[pos].name); - printf("\n"); /* Everything is fine. */ From ossp-cvs-owner@ossp.org Sun Jul 8 17:57:28 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f68FvSl88479; Sun, 8 Jul 2001 17:57:28 +0200 (CEST) Date: Sun, 8 Jul 2001 17:57:28 +0200 (CEST) Message-Id: <200107081557.f68FvSl88479@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds/regression-tests .run-tests Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 08-Jul-2001 17:57:28 Branch: HEAD Handle: 2001070816572700 Modified files: ossp-pkg/srpc/libxds/regression-tests .run-tests Log: More cosmetic changes to the output. Summary: Revision Changes Path 1.4 +2 -2 ossp-pkg/srpc/libxds/regression-tests/.run-tests ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/regression-tests/.run-tests ============================================================ $ cvs diff -u -r1.3 -r1.4 .run-tests --- ossp-pkg/srpc/libxds/regression-tests/.run-tests 2001/07/08 15:16:29 1.3 +++ ossp-pkg/srpc/libxds/regression-tests/.run-tests 2001/07/08 15:57:27 1.4 @@ -31,10 +31,10 @@ done echo -echo "Summary: $numFails of $numTests tests failed ($(($numFails*100/$numTests))%)." - if [ $numFails -eq 0 ]; then + echo "Summary: All tests succeeded." exit 0 else + echo "Summary: $numFails of $numTests tests failed ($(($numFails*100/$numTests))%)." exit 1 fi From ossp-cvs-owner@ossp.org Sun Jul 8 17:58:16 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f68FwE688583; Sun, 8 Jul 2001 17:58:14 +0200 (CEST) Date: Sun, 8 Jul 2001 17:58:14 +0200 (CEST) Message-Id: <200107081558.f68FwE688583@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds/regression-tests xds-register.c ossp-... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 08-Jul-2001 17:58:14 Branch: HEAD Handle: 2001070816581301 Modified files: ossp-pkg/srpc/libxds unregister.c ossp-pkg/srpc/libxds/regression-tests xds-register.c Log: Implemented xds_unregister() function and added apropriate test cases. Summary: Revision Changes Path 1.3 +32 -0 ossp-pkg/srpc/libxds/regression-tests/xds-register.c 1.2 +37 -1 ossp-pkg/srpc/libxds/unregister.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/regression-tests/xds-register.c ============================================================ $ cvs diff -u -r1.2 -r1.3 xds-register.c --- ossp-pkg/srpc/libxds/regression-tests/xds-register.c 2001/07/08 15:18:50 1.2 +++ ossp-pkg/srpc/libxds/regression-tests/xds-register.c 2001/07/08 15:58:14 1.3 @@ -104,6 +104,38 @@ } } + /* Try to remove an unknown entry. */ + + if (xds_unregister(xds, "abacadabra") != XDS_ERR_UNKNOWN_ENGINE) + { + printf("xds_unregister() succeeded at removing 'abacadabra' even though it is not there.\n"); + exit(1); + } + + /* Remove an entry from the middle. */ + + if (xds_unregister(xds, "heinz") != XDS_OK) + { + printf("xds_unregister() failed to remove 'heinz'.\n"); + exit(1); + } + + /* Remove the last entry. */ + + if (xds_unregister(xds, "zarah") != XDS_OK) + { + printf("xds_unregister() failed to remove 'bar'.\n"); + exit(1); + } + + /* Remove the first entry. */ + + if (xds_unregister(xds, "bar") != XDS_OK) + { + printf("xds_unregister() failed to remove 'bar'.\n"); + exit(1); + } + /* Clean up. */ xds_destroy(xds); Index: ossp-pkg/srpc/libxds/unregister.c ============================================================ $ cvs diff -u -r1.1 -r1.2 unregister.c --- ossp-pkg/srpc/libxds/unregister.c 2001/07/04 15:58:51 1.1 +++ ossp-pkg/srpc/libxds/unregister.c 2001/07/08 15:58:13 1.2 @@ -25,9 +25,45 @@ SUCH DAMAGE. */ +#include +#include +#include #include "internal.h" int xds_unregister(xds_t* xds, const char* name) { - return XDS_ERR_UNKNOWN_ENGINE; + size_t pos; + + /* Sanity checks. */ + + assert(xds != NULL); + assert(name != NULL); + if (xds == NULL || name == NULL) + return XDS_ERR_INVALID_ARG; + + /* Find the entry we're supposed to delete. */ + + if (!xds_find_engine(xds->engines, xds->engines_len, name, &pos)) + return XDS_ERR_UNKNOWN_ENGINE; + + /* Free the memory allocated for this entry and move the entries + behind it back if necessary. */ + + assert(xds->engines[pos].name != NULL); + free(xds->engines[pos].name); + memmove(&xds->engines[pos], &xds->engines[pos+1], (xds->engines_len - (pos + 1)) * sizeof(engine_map_t)); + --xds->engines_len; + + /* Lower capacity if necessary. */ + + int rc = xds_set_capacity((void**)&xds->engines, + &xds->engines_capacity, + xds->engines_len, + sizeof(engine_map_t), + XDS_INITIAL_ENGINES_CAPACITY); + assert(rc == XDS_OK || rc == XDS_ERR_NO_MEM); + if (rc != XDS_OK) + return rc; + + return XDS_OK; } From ossp-cvs-owner@ossp.org Sun Jul 8 18:01:39 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f68G1b089423; Sun, 8 Jul 2001 18:01:37 +0200 (CEST) Date: Sun, 8 Jul 2001 18:01:37 +0200 (CEST) Message-Id: <200107081601.f68G1b089423@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds unregister.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 08-Jul-2001 18:01:37 Branch: HEAD Handle: 2001070817013700 Modified files: ossp-pkg/srpc/libxds unregister.c Log: Messed up declaration of "rc" when doing cut & paste. Fixed that. Summary: Revision Changes Path 1.3 +6 -5 ossp-pkg/srpc/libxds/unregister.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/unregister.c ============================================================ $ cvs diff -u -r1.2 -r1.3 unregister.c --- ossp-pkg/srpc/libxds/unregister.c 2001/07/08 15:58:13 1.2 +++ ossp-pkg/srpc/libxds/unregister.c 2001/07/08 16:01:37 1.3 @@ -33,6 +33,7 @@ int xds_unregister(xds_t* xds, const char* name) { size_t pos; + int rc; /* Sanity checks. */ @@ -56,11 +57,11 @@ /* Lower capacity if necessary. */ - int rc = xds_set_capacity((void**)&xds->engines, - &xds->engines_capacity, - xds->engines_len, - sizeof(engine_map_t), - XDS_INITIAL_ENGINES_CAPACITY); + rc = xds_set_capacity((void**)&xds->engines, + &xds->engines_capacity, + xds->engines_len, + sizeof(engine_map_t), + XDS_INITIAL_ENGINES_CAPACITY); assert(rc == XDS_OK || rc == XDS_ERR_NO_MEM); if (rc != XDS_OK) return rc; From ossp-cvs-owner@ossp.org Sun Jul 8 18:02:58 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f68G2uC89556; Sun, 8 Jul 2001 18:02:56 +0200 (CEST) Date: Sun, 8 Jul 2001 18:02:56 +0200 (CEST) Message-Id: <200107081602.f68G2uC89556@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds/regression-tests Makefile xds-encode.... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 08-Jul-2001 18:02:56 Branch: HEAD Handle: 2001070817025600 Added files: ossp-pkg/srpc/libxds/regression-tests xds-encode.c Modified files: ossp-pkg/srpc/libxds/regression-tests Makefile Log: Added preliminary version of the xds-encode test case. Summary: Revision Changes Path 1.6 +1 -1 ossp-pkg/srpc/libxds/regression-tests/Makefile 1.1 +134 -0 ossp-pkg/srpc/libxds/regression-tests/xds-encode.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/regression-tests/Makefile ============================================================ $ cvs diff -u -r1.5 -r1.6 Makefile --- ossp-pkg/srpc/libxds/regression-tests/Makefile 2001/07/08 15:22:00 1.5 +++ ossp-pkg/srpc/libxds/regression-tests/Makefile 2001/07/08 16:02:56 1.6 @@ -8,7 +8,7 @@ CFLAGS = LDFLAGS = -L.. -TESTS = xds-core.exe xds-find-engine.exe xds-register.exe xds-callback-semantics.exe +TESTS = xds-core.exe xds-find-engine.exe xds-register.exe xds-encode.exe .SUFFIXES: .SUFFIXES: .c .exe Index: ossp-pkg/srpc/libxds/regression-tests/xds-encode.c ============================================================ $ cvs update -p -r1.1 xds-encode.c /* XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) This file is part of OSSP XDS, an extensible data serialization library which can be found at http://www.ossp.com/pkg/xds/. 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. */ #include #include #include #include #include "../internal.h" static int dummy_engine(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list args) { if (xds == NULL) { printf("XDS context isn't passed through to registered engine.\n"); exit(1); } if (engine_context != (void*)42) { printf("Engine context isn't passed through to registered engine.\n"); exit(1); } if (buffer == NULL) { printf("Buffer passed to engine is NULL.\n"); exit(1); } if (buffer_size == 0) { printf("Buffer size passed to engine is NULL.\n"); exit(1); } return 0; } int main() { xds_t* xds; size_t i; /* Create contexts for encoding and decoding. */ xds = xds_init(XDS_ENCODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); return 1; } /* Register the dummy callback under multiple names. */ if (xds_register(xds, "foo", &dummy_engine, (void*)42) != XDS_OK) { printf("Failed to register engine for 'foo'.\n"); return 1; } if (xds_register(xds, "bar", &dummy_engine, (void*)42) != XDS_OK) { printf("Failed to register engine for 'bar'.\n"); return 1; } if (xds_register(xds, "zarah", &dummy_engine, (void*)42) != XDS_OK) { printf("Failed to register engine for 'zarah'.\n"); return 1; } if (xds_register(xds, "caesar", &dummy_engine, (void*)42) != XDS_OK) { printf("Failed to register engine for 'caesar'.\n"); return 1; } if (xds_register(xds, "claus", &dummy_engine, (void*)42) != XDS_OK) { printf("Failed to register engine for 'claus'.\n"); return 1; } if (xds_register(xds, "heinz", &dummy_engine, (void*)42) != XDS_OK) { printf("Failed to register engine for 'heinz'.\n"); return 1; } /* Register the callback again, overwriting an existing entry. */ if (xds_register(xds, "claus", &dummy_engine, (void*)42) != XDS_OK) { printf("Failed to re-register engine for 'claus'.\n"); return 1; } /* Ensure that everything is in alphabetical order. */ for (i = 1; i < xds->engines_len; ++i) { assert(xds->engines[i-1].name != NULL); assert(xds->engines[i].name != NULL); if (strcmp(xds->engines[i-1].name, xds->engines[i].name) >= 0) { printf("xds->engines is not in alphabetical order!\n"); exit(1); } } /* Clean up. */ xds_destroy(xds); /* Everything went fine. */ return 0; } From ossp-cvs-owner@ossp.org Mon Jul 9 19:16:32 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f69HGVU68458; Mon, 9 Jul 2001 19:16:31 +0200 (CEST) Date: Mon, 9 Jul 2001 19:16:31 +0200 (CEST) Message-Id: <200107091716.f69HGVU68458@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds/regression-tests Makefile xds-getbuff... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 09-Jul-2001 19:16:31 Branch: HEAD Handle: 2001070918163000 Added files: ossp-pkg/srpc/libxds/regression-tests xds-getbuffer.c Modified files: ossp-pkg/srpc/libxds/regression-tests Makefile Log: Added test suite for xds_getbuffer(). Summary: Revision Changes Path 1.7 +2 -1 ossp-pkg/srpc/libxds/regression-tests/Makefile 1.1 +146 -0 ossp-pkg/srpc/libxds/regression-tests/xds-getbuffer.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/regression-tests/Makefile ============================================================ $ cvs diff -u -r1.6 -r1.7 Makefile --- ossp-pkg/srpc/libxds/regression-tests/Makefile 2001/07/08 16:02:56 1.6 +++ ossp-pkg/srpc/libxds/regression-tests/Makefile 2001/07/09 17:16:30 1.7 @@ -8,7 +8,8 @@ CFLAGS = LDFLAGS = -L.. -TESTS = xds-core.exe xds-find-engine.exe xds-register.exe xds-encode.exe +TESTS = xds-core.exe xds-find-engine.exe xds-register.exe xds-encode.exe \ + xds-getbuffer.exe .SUFFIXES: .SUFFIXES: .c .exe Index: ossp-pkg/srpc/libxds/regression-tests/xds-getbuffer.c ============================================================ $ cvs update -p -r1.1 xds-getbuffer.c /* XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) This file is part of OSSP XDS, an extensible data serialization library which can be found at http://www.ossp.com/pkg/xds/. 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. */ #include #include #include #include #include "../internal.h" static int dummy_engine(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list args) { strncpy(buffer, "Hallo!", buffer_size); return 6; } int main() { xds_t* xds; char* old; size_t old_len; char* new; size_t new_len; /* Create XDS context. */ xds = xds_init(XDS_ENCODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); return 1; } /* Register the dummy callback under multiple names. */ if (xds_register(xds, "text", &dummy_engine, (void*)42) != XDS_OK) { printf("Failed to register my encoding engine.\n"); return 1; } /* Encode something, then flush the buffer by calling xds_getbuffer(), then encode something new and verify that the old buffer hasn't ben overwritten and that the new one contains the correct string. */ if (xds_encode(xds, "text text") != XDS_OK) { printf("xds_encode() failed!"); return 1; } if (xds_getbuffer(xds, XDS_GIFT, (void**)&old, &old_len) != XDS_OK) { printf("xds_getbuffer() failed for the first buffer!"); return 1; } if (xds_encode(xds, "text") != XDS_OK) { printf("xds_encode() failed!"); return 1; } if (xds_getbuffer(xds, XDS_GIFT, (void**)&new, &new_len) != XDS_OK) { printf("xds_getbuffer() failed for the second buffer!"); return 1; } if ((strcmp(old, "Hallo!Hallo!") != 0 || old_len != 12) && (strcmp(new, "Hallo!") != 0 || new_len != 6)) { printf("xds_encode() did not yield the expected result.\n"); return 1; } free(old); free(new); /* Encode somthing, then get the buffer via XDS_LOAN and verify the contents. Encode something new and compare the new content with what we expect. */ if (xds_encode(xds, "text text") != XDS_OK) { printf("xds_encode() failed!"); return 1; } if (xds_getbuffer(xds, XDS_LOAN, (void**)&old, &old_len) != XDS_OK) { printf("xds_getbuffer() failed for the first buffer!"); return 1; } if (strcmp(old, "Hallo!Hallo!") != 0 || old_len != 12) { printf("xds_encode() did not yield the expected result.\n"); return 1; } if (xds_encode(xds, "text") != XDS_OK) { printf("xds_encode() failed!"); return 1; } if (xds_getbuffer(xds, XDS_LOAN, (void**)&new, &new_len) != XDS_OK) { printf("xds_getbuffer() failed for the second buffer!"); return 1; } if (old != new) { printf("xds_encode() allocated a new buffer even though we used XDS_LOAN.\n"); return 1; } if (strcmp(new, "Hallo!") != 0 || new_len != 6) { printf("xds_encode() did not yield the expected result.\n"); return 1; } /* Clean up. */ xds_destroy(xds); /* Everything went fine. */ return 0; } From ossp-cvs-owner@ossp.org Mon Jul 9 19:17:04 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f69HH3j68524; Mon, 9 Jul 2001 19:17:03 +0200 (CEST) Date: Mon, 9 Jul 2001 19:17:03 +0200 (CEST) Message-Id: <200107091717.f69HH3j68524@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds/regression-tests xds-encode.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 09-Jul-2001 19:17:03 Branch: HEAD Handle: 2001070918170200 Modified files: ossp-pkg/srpc/libxds/regression-tests xds-encode.c Log: Implemented test suite for xds_encode(). Summary: Revision Changes Path 1.2 +19 -49 ossp-pkg/srpc/libxds/regression-tests/xds-encode.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/regression-tests/xds-encode.c ============================================================ $ cvs diff -u -r1.1 -r1.2 xds-encode.c --- ossp-pkg/srpc/libxds/regression-tests/xds-encode.c 2001/07/08 16:02:56 1.1 +++ ossp-pkg/srpc/libxds/regression-tests/xds-encode.c 2001/07/09 17:17:02 1.2 @@ -50,78 +50,48 @@ } if (buffer_size == 0) { - printf("Buffer size passed to engine is NULL.\n"); + printf("Buffer size passed to engine is zero!\n"); exit(1); } - return 0; + strncpy(buffer, "Hallo ", buffer_size); + return 6; } int main() { xds_t* xds; - size_t i; - /* Create contexts for encoding and decoding. */ + /* Create XDS context. */ xds = xds_init(XDS_ENCODE); if (xds == NULL) - { - printf("Failed to initialize XDS context.\n"); - return 1; - } - - /* Register the dummy callback under multiple names. */ - - if (xds_register(xds, "foo", &dummy_engine, (void*)42) != XDS_OK) - { - printf("Failed to register engine for 'foo'.\n"); - return 1; - } - if (xds_register(xds, "bar", &dummy_engine, (void*)42) != XDS_OK) { - printf("Failed to register engine for 'bar'.\n"); + printf("Failed to initialize XDS context.\n"); return 1; } - if (xds_register(xds, "zarah", &dummy_engine, (void*)42) != XDS_OK) - { - printf("Failed to register engine for 'zarah'.\n"); - return 1; - } - if (xds_register(xds, "caesar", &dummy_engine, (void*)42) != XDS_OK) - { - printf("Failed to register engine for 'caesar'.\n"); - return 1; - } - if (xds_register(xds, "claus", &dummy_engine, (void*)42) != XDS_OK) - { - printf("Failed to register engine for 'claus'.\n"); - return 1; - } - if (xds_register(xds, "heinz", &dummy_engine, (void*)42) != XDS_OK) + + /* Register the dummy callback under multiple names. */ + + if (xds_register(xds, "int", &dummy_engine, (void*)42) != XDS_OK || + xds_register(xds, "float", &dummy_engine, (void*)42) != XDS_OK || + xds_register(xds, "double", &dummy_engine, (void*)42) != XDS_OK || + xds_register(xds, "text", &dummy_engine, (void*)42) != XDS_OK) { - printf("Failed to register engine for 'heinz'.\n"); + printf("Failed to register my encoding engines.\n"); return 1; } - /* Register the callback again, overwriting an existing entry. */ + /* Let's go and encode something. */ - if (xds_register(xds, "claus", &dummy_engine, (void*)42) != XDS_OK) + if (xds_encode(xds, "int:text double double float") != XDS_OK) { - printf("Failed to re-register engine for 'claus'.\n"); + printf("xds_encode() failed!"); return 1; } - - /* Ensure that everything is in alphabetical order. */ - - for (i = 1; i < xds->engines_len; ++i) + if (strcmp(xds->buffer, "Hallo Hallo Hallo Hallo Hallo ") != 0) { - assert(xds->engines[i-1].name != NULL); - assert(xds->engines[i].name != NULL); - if (strcmp(xds->engines[i-1].name, xds->engines[i].name) >= 0) - { - printf("xds->engines is not in alphabetical order!\n"); - exit(1); - } + printf("xds_encode() did not yield the expected result.\n"); + return 1; } /* Clean up. */ From ossp-cvs-owner@ossp.org Mon Jul 9 19:17:35 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f69HHXY68592; Mon, 9 Jul 2001 19:17:33 +0200 (CEST) Date: Mon, 9 Jul 2001 19:17:33 +0200 (CEST) Message-Id: <200107091717.f69HHXY68592@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds/regression-tests xds-register.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 09-Jul-2001 19:17:33 Branch: HEAD Handle: 2001070918173300 Modified files: ossp-pkg/srpc/libxds/regression-tests xds-register.c Log: Improved the test suite. Summary: Revision Changes Path 1.4 +30 -32 ossp-pkg/srpc/libxds/regression-tests/xds-register.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/regression-tests/xds-register.c ============================================================ $ cvs diff -u -r1.3 -r1.4 xds-register.c --- ossp-pkg/srpc/libxds/regression-tests/xds-register.c 2001/07/08 15:58:14 1.3 +++ ossp-pkg/srpc/libxds/regression-tests/xds-register.c 2001/07/09 17:17:33 1.4 @@ -38,6 +38,16 @@ int main() { + const char* test_names[] = + { + "foo", + "bar", + "zarah", + "caesar", + "claus", + "heinz", + }; + size_t test_names_len = sizeof(test_names) / sizeof(char*); xds_t* xds; size_t i; @@ -50,37 +60,24 @@ return 1; } - /* Register the dummy callback under multiple names. */ + /* Register the dummy callback under an invalid name to see + whether the routine fails correctly. */ - if (xds_register(xds, "foo", &dummy_engine, NULL) != XDS_OK) - { - printf("Failed to register engine for 'foo'.\n"); - return 1; - } - if (xds_register(xds, "bar", &dummy_engine, NULL) != XDS_OK) - { - printf("Failed to register engine for 'bar'.\n"); - return 1; - } - if (xds_register(xds, "zarah", &dummy_engine, NULL) != XDS_OK) - { - printf("Failed to register engine for 'zarah'.\n"); - return 1; - } - if (xds_register(xds, "caesar", &dummy_engine, NULL) != XDS_OK) + if (xds_register(xds, "abcdefh1230#", &dummy_engine, NULL) != XDS_ERR_INVALID_ARG) { - printf("Failed to register engine for 'caesar'.\n"); + printf("xds_register() illegally accepted an invalid name for the engine.\n"); return 1; } - if (xds_register(xds, "claus", &dummy_engine, NULL) != XDS_OK) - { - printf("Failed to register engine for 'claus'.\n"); - return 1; - } - if (xds_register(xds, "heinz", &dummy_engine, NULL) != XDS_OK) + + /* Register the dummy callback under multiple names. */ + + for(i = 0; i < test_names_len; ++i) { - printf("Failed to register engine for 'heinz'.\n"); - return 1; + if (xds_register(xds, test_names[i], &dummy_engine, NULL) != XDS_OK) + { + printf("Failed to register engine for '%s'.\n", test_names[i]); + return 1; + } } /* Register the callback again, overwriting an existing entry. */ @@ -114,25 +111,26 @@ /* Remove an entry from the middle. */ - if (xds_unregister(xds, "heinz") != XDS_OK) + if (xds_unregister(xds, test_names[test_names_len/2]) != XDS_OK) { - printf("xds_unregister() failed to remove 'heinz'.\n"); + printf("xds_unregister() failed to remove '%s'.\n", test_names[test_names_len/2]); exit(1); } /* Remove the last entry. */ - if (xds_unregister(xds, "zarah") != XDS_OK) + assert(test_names_len > 0); + if (xds_unregister(xds, test_names[test_names_len-1]) != XDS_OK) { - printf("xds_unregister() failed to remove 'bar'.\n"); + printf("xds_unregister() failed to remove '%s'.\n", test_names[test_names_len-1]); exit(1); } /* Remove the first entry. */ - if (xds_unregister(xds, "bar") != XDS_OK) + if (xds_unregister(xds, test_names[0]) != XDS_OK) { - printf("xds_unregister() failed to remove 'bar'.\n"); + printf("xds_unregister() failed to remove '%s'.\n", test_names[0]); exit(1); } From ossp-cvs-owner@ossp.org Mon Jul 9 19:18:22 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f69HILc68672; Mon, 9 Jul 2001 19:18:21 +0200 (CEST) Date: Mon, 9 Jul 2001 19:18:21 +0200 (CEST) Message-Id: <200107091718.f69HILc68672@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds destroy.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 09-Jul-2001 19:18:21 Branch: HEAD Handle: 2001070918182000 Modified files: ossp-pkg/srpc/libxds destroy.c Log: xds_destroy() will now free() an allocated buffer in the xds_context structure. Summary: Revision Changes Path 1.6 +4 -0 ossp-pkg/srpc/libxds/destroy.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/destroy.c ============================================================ $ cvs diff -u -r1.5 -r1.6 destroy.c --- ossp-pkg/srpc/libxds/destroy.c 2001/07/08 15:22:00 1.5 +++ ossp-pkg/srpc/libxds/destroy.c 2001/07/09 17:18:20 1.6 @@ -39,6 +39,10 @@ /* Free allocated memory. */ + assert(xds->buffer != NULL || (xds->buffer_capacity == 0 && xds->buffer_len == 0)); + if (xds->buffer != NULL && xds->we_own_buffer) + free(xds->buffer); + assert(xds->engines != NULL || xds->engines_capacity == 0); if (xds->engines != NULL) free(xds->engines); From ossp-cvs-owner@ossp.org Mon Jul 9 19:19:28 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f69HJRH68770; Mon, 9 Jul 2001 19:19:27 +0200 (CEST) Date: Mon, 9 Jul 2001 19:19:27 +0200 (CEST) Message-Id: <200107091719.f69HJRH68770@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds xds.h Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 09-Jul-2001 19:19:27 Branch: HEAD Handle: 2001070918192600 Modified files: ossp-pkg/srpc/libxds xds.h Log: - Added XDS_ERR_INVALID_MODE define. - Renamed argument in the xds_getbuffer() prototype from buffer_size to buffer_len for consistency. Summary: Revision Changes Path 1.14 +4 -3 ossp-pkg/srpc/libxds/xds.h ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/xds.h ============================================================ $ cvs diff -u -r1.13 -r1.14 xds.h --- ossp-pkg/srpc/libxds/xds.h 2001/07/04 15:25:38 1.13 +++ ossp-pkg/srpc/libxds/xds.h 2001/07/09 17:19:26 1.14 @@ -40,7 +40,8 @@ XDS_ERR_OVERFLOW = -2, XDS_ERR_INVALID_ARG = -3, XDS_ERR_TYPE_MISMATCH = -4, - XDS_ERR_UNKNOWN_ENGINE = -5 + XDS_ERR_UNKNOWN_ENGINE = -5, + XDS_ERR_INVALID_MODE = -6 }; typedef enum { XDS_ENCODE, XDS_DECODE } xds_mode_t; typedef enum { XDS_LOAN, XDS_GIFT } xds_scope_t; @@ -60,8 +61,8 @@ int xds_register(xds_t* xds, const char* name, xds_engine_t engine, void* engine_context); int xds_unregister(xds_t* xds, const char* name); -int xds_setbuffer(xds_t* xds, xds_scope_t flag, void* buffer, size_t buffer_size); -int xds_getbuffer(xds_t* xds, xds_scope_t flag, void** buffer, size_t* buffer_size); +int xds_setbuffer(xds_t* xds, xds_scope_t flag, void* buffer, size_t buffer_len); +int xds_getbuffer(xds_t* xds, xds_scope_t flag, void** buffer, size_t* buffer_len); int xds_encode(xds_t* xds, const char* fmt, ...); int xds_decode(xds_t* xds, const char* fmt, ...); From ossp-cvs-owner@ossp.org Mon Jul 9 19:20:00 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f69HJx568844; Mon, 9 Jul 2001 19:19:59 +0200 (CEST) Date: Mon, 9 Jul 2001 19:19:59 +0200 (CEST) Message-Id: <200107091719.f69HJx568844@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds encode.c vencode.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 09-Jul-2001 19:19:59 Branch: HEAD Handle: 2001070918195800 Modified files: ossp-pkg/srpc/libxds encode.c vencode.c Log: Implemented xds_encode() and xds_vencode(). Summary: Revision Changes Path 1.2 +6 -1 ossp-pkg/srpc/libxds/encode.c 1.2 +132 -2 ossp-pkg/srpc/libxds/vencode.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/encode.c ============================================================ $ cvs diff -u -r1.1 -r1.2 encode.c --- ossp-pkg/srpc/libxds/encode.c 2001/07/04 15:58:51 1.1 +++ ossp-pkg/srpc/libxds/encode.c 2001/07/09 17:19:58 1.2 @@ -29,5 +29,10 @@ int xds_encode(xds_t* xds, const char* fmt, ...) { - return XDS_ERR_INVALID_ARG; + int rc; + va_list args; + va_start(args, fmt); + rc = xds_vencode(xds, fmt, args); + va_end(args); + return rc; } Index: ossp-pkg/srpc/libxds/vencode.c ============================================================ $ cvs diff -u -r1.1 -r1.2 vencode.c --- ossp-pkg/srpc/libxds/vencode.c 2001/07/04 15:58:51 1.1 +++ ossp-pkg/srpc/libxds/vencode.c 2001/07/09 17:19:58 1.2 @@ -25,9 +25,139 @@ SUCH DAMAGE. */ +#include /* delete me */ + +#include +#include +#include #include "internal.h" -int xds_vencode(xds_t* xds, const char* fmt, va_list args) +int xds_vencode(xds_t* xds, const char* fmt_arg, va_list args) { - return XDS_ERR_INVALID_ARG; + char* name; + char* p; + char* fmt; + int rc; + + /* Sanity checks. */ + + assert(xds != NULL); + assert(fmt_arg != NULL); + assert(xds->mode == XDS_ENCODE); + if (xds == NULL || fmt_arg == NULL) + return XDS_ERR_INVALID_ARG; + if (xds->mode != XDS_ENCODE) + return XDS_ERR_INVALID_MODE; + + /* Ensure we have a buffer allocated ready for use. */ + + if (xds->buffer == NULL) + { /* allocate a new buffer */ + int rc = xds_set_capacity((void**)&xds->buffer, + &xds->buffer_capacity, + XDS_INITIAL_BUFFER_CAPACITY, + sizeof(char), + XDS_INITIAL_BUFFER_CAPACITY); + assert(rc == XDS_OK || rc == XDS_ERR_NO_MEM); + if (rc != XDS_OK) + return rc; + printf("Enlarged buffer to %d byte.\n", xds->buffer_capacity); + xds->buffer_len = 0; + xds->we_own_buffer = (1==1); + } + + /* Ensure the buffer has free space. */ + + assert(xds->buffer_len <= xds->buffer_capacity); + if (xds->buffer_len == xds->buffer_capacity) + { + if (xds->we_own_buffer) + { + int rc = xds_set_capacity((void**)&xds->buffer, + &xds->buffer_capacity, + xds->buffer_len + 1, + sizeof(char), + XDS_INITIAL_BUFFER_CAPACITY); + assert(rc == XDS_OK || rc == XDS_ERR_NO_MEM); + if (rc != XDS_OK) + return rc; + printf("Enlarged buffer to %d byte.\n", xds->buffer_capacity); + } + else + return XDS_ERR_OVERFLOW; + } + + /* Iterate through the items in the format string and execute the + apropriate engines. */ + + fmt = p = strdup(fmt_arg); + if (fmt == NULL) + return XDS_ERR_NO_MEM; + for(name = p; *p != '\0'; name = p) + { + while(isalnum(*p) || *p == '-' || *p == '_') + ++p; + *p++ = '\0'; + + if (strlen(name) > 0) + { + size_t pos; + if (xds_find_engine(xds->engines, xds->engines_len, name, &pos)) + { + int restart_engine; + do + { + printf("Executing engine '%s' ...\n", name); + rc = (*xds->engines[pos].engine)(xds, + xds->engines[pos].context, + xds->buffer + xds->buffer_len, + xds->buffer_capacity - xds->buffer_len, + args); + if (rc < 0) + goto leave; + else if (rc >= xds->buffer_capacity - xds->buffer_len) + { /* enlarge buffer */ + int rc2; + + if (!xds->we_own_buffer) + { + rc = XDS_ERR_OVERFLOW; + goto leave; + } + + rc2 = xds_set_capacity((void**)&xds->buffer, + &xds->buffer_capacity, + xds->buffer_capacity + rc, + sizeof(char), + XDS_INITIAL_BUFFER_CAPACITY); + assert(rc2 == XDS_OK || rc2 == XDS_ERR_NO_MEM); + if (rc2 != XDS_OK) + { + rc = rc2; + goto leave; + } + restart_engine = (1==1); + printf("Enlarged buffer to %d byte.\n", xds->buffer_capacity); + } + else + { + restart_engine = (1!=1); + xds->buffer_len += rc; + } + } + while (restart_engine); + } + else + { + rc = XDS_ERR_UNKNOWN_ENGINE; + goto leave; + } + } + } + rc = XDS_OK; + + /* Clean up and leave. */ + leave: + free(fmt); + return rc; } From ossp-cvs-owner@ossp.org Mon Jul 9 19:20:57 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f69HKuP68960; Mon, 9 Jul 2001 19:20:56 +0200 (CEST) Date: Mon, 9 Jul 2001 19:20:56 +0200 (CEST) Message-Id: <200107091720.f69HKuP68960@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds setbuffer.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 09-Jul-2001 19:20:56 Branch: HEAD Handle: 2001070918205600 Modified files: ossp-pkg/srpc/libxds setbuffer.c Log: Renamed argument in the xds_getbuffer() prototype from buffer_size to buffer_len for consistency. Summary: Revision Changes Path 1.2 +1 -1 ossp-pkg/srpc/libxds/setbuffer.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/setbuffer.c ============================================================ $ cvs diff -u -r1.1 -r1.2 setbuffer.c --- ossp-pkg/srpc/libxds/setbuffer.c 2001/07/04 15:58:51 1.1 +++ ossp-pkg/srpc/libxds/setbuffer.c 2001/07/09 17:20:56 1.2 @@ -27,7 +27,7 @@ #include "internal.h" -int xds_setbuffer(xds_t* xds, xds_scope_t flag, void* buffer, size_t buffer_size) +int xds_setbuffer(xds_t* xds, xds_scope_t flag, void* buffer, size_t buffer_len) { return XDS_ERR_INVALID_ARG; } From ossp-cvs-owner@ossp.org Mon Jul 9 19:21:37 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f69HLbk69310; Mon, 9 Jul 2001 19:21:37 +0200 (CEST) Date: Mon, 9 Jul 2001 19:21:37 +0200 (CEST) Message-Id: <200107091721.f69HLbk69310@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds internal.h Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 09-Jul-2001 19:21:37 Branch: HEAD Handle: 2001070918213600 Modified files: ossp-pkg/srpc/libxds internal.h Log: Added XDS_INITIAL_BUFFER_CAPACITY define. Summary: Revision Changes Path 1.5 +2 -1 ossp-pkg/srpc/libxds/internal.h ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/internal.h ============================================================ $ cvs diff -u -r1.4 -r1.5 internal.h --- ossp-pkg/srpc/libxds/internal.h 2001/07/08 15:28:51 1.4 +++ ossp-pkg/srpc/libxds/internal.h 2001/07/09 17:21:36 1.5 @@ -32,7 +32,8 @@ #include "xds.h" -#define XDS_INITIAL_ENGINES_CAPACITY 32 +#define XDS_INITIAL_BUFFER_CAPACITY 512 +#define XDS_INITIAL_ENGINES_CAPACITY 32 typedef struct { From ossp-cvs-owner@ossp.org Mon Jul 9 19:22:05 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f69HM4s69380; Mon, 9 Jul 2001 19:22:04 +0200 (CEST) Date: Mon, 9 Jul 2001 19:22:04 +0200 (CEST) Message-Id: <200107091722.f69HM4s69380@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds getbuffer.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 09-Jul-2001 19:22:04 Branch: HEAD Handle: 2001070918220300 Modified files: ossp-pkg/srpc/libxds getbuffer.c Log: Implemented xds_getbuffer(). Summary: Revision Changes Path 1.2 +24 -2 ossp-pkg/srpc/libxds/getbuffer.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/getbuffer.c ============================================================ $ cvs diff -u -r1.1 -r1.2 getbuffer.c --- ossp-pkg/srpc/libxds/getbuffer.c 2001/07/04 15:58:51 1.1 +++ ossp-pkg/srpc/libxds/getbuffer.c 2001/07/09 17:22:03 1.2 @@ -25,9 +25,31 @@ SUCH DAMAGE. */ +#include "assert.h" #include "internal.h" -int xds_getbuffer(xds_t* xds, xds_scope_t flag, void** buffer, size_t* buffer_size) +int xds_getbuffer(xds_t* xds, xds_scope_t flag, void** buffer, size_t* buffer_len) { - return XDS_ERR_INVALID_ARG; + /* Sanity checks. */ + + assert(xds != NULL); + assert(flag == XDS_GIFT || flag == XDS_LOAN); + assert(buffer != NULL); + assert(buffer_len != NULL); + if (xds == NULL || buffer == NULL || buffer_len == NULL || (flag != XDS_GIFT && flag != XDS_LOAN)) + return XDS_ERR_INVALID_ARG; + + /* Return the buffer to the caller. */ + + *buffer = xds->buffer; + *buffer_len = xds->buffer_len; + if (flag == XDS_GIFT) + { + xds->buffer = NULL; + xds->buffer_capacity = xds->buffer_len = 0; + } + else + xds->buffer_len = 0; + + return XDS_OK; } From ossp-cvs-owner@ossp.org Mon Jul 9 19:22:35 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f69HMYX69445; Mon, 9 Jul 2001 19:22:34 +0200 (CEST) Date: Mon, 9 Jul 2001 19:22:34 +0200 (CEST) Message-Id: <200107091722.f69HMYX69445@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds set-capacity.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 09-Jul-2001 19:22:34 Branch: HEAD Handle: 2001070918223400 Modified files: ossp-pkg/srpc/libxds set-capacity.c Log: Removed debug output. Summary: Revision Changes Path 1.2 +0 -4 ossp-pkg/srpc/libxds/set-capacity.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/set-capacity.c ============================================================ $ cvs diff -u -r1.1 -r1.2 set-capacity.c --- ossp-pkg/srpc/libxds/set-capacity.c 2001/07/08 15:20:34 1.1 +++ ossp-pkg/srpc/libxds/set-capacity.c 2001/07/09 17:22:34 1.2 @@ -25,8 +25,6 @@ SUCH DAMAGE. */ -#include /* delete me */ - #include #include #include "internal.h" @@ -54,8 +52,6 @@ ; /* Allocate the array and store the new values. */ - - printf("Reallocating array with capacity %d; old value was %d.\n", size, *array_capacity); buf = realloc(*array, size * elem_size); if (buf == NULL) From ossp-cvs-owner@ossp.org Mon Jul 9 19:23:40 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f69HNdB69545; Mon, 9 Jul 2001 19:23:39 +0200 (CEST) Date: Mon, 9 Jul 2001 19:23:39 +0200 (CEST) Message-Id: <200107091723.f69HNdB69545@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds register.c unregister.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 09-Jul-2001 19:23:39 Branch: HEAD Handle: 2001070918233800 Modified files: ossp-pkg/srpc/libxds register.c unregister.c Log: Added test that return XDS_ERR_INVALID_ARG if the name argument contains illegal characters. Allowed are: "[a-zA-Z0-9_-]". Summary: Revision Changes Path 1.6 +6 -0 ossp-pkg/srpc/libxds/register.c 1.4 +6 -0 ossp-pkg/srpc/libxds/unregister.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/register.c ============================================================ $ cvs diff -u -r1.5 -r1.6 register.c --- ossp-pkg/srpc/libxds/register.c 2001/07/08 15:37:13 1.5 +++ ossp-pkg/srpc/libxds/register.c 2001/07/09 17:23:38 1.6 @@ -27,6 +27,7 @@ #include #include +#include #include #include "internal.h" @@ -41,6 +42,11 @@ assert(engine != NULL); if (xds == NULL || name == NULL || engine == NULL) return XDS_ERR_INVALID_ARG; + for(pos = 0; name[pos] != '\0'; ++pos) + { + if (!isalnum(name[pos]) && name[pos] != '-' && name[pos] != '_') + return XDS_ERR_INVALID_ARG; + } /* Copy the name argument into our own memory. */ Index: ossp-pkg/srpc/libxds/unregister.c ============================================================ $ cvs diff -u -r1.3 -r1.4 unregister.c --- ossp-pkg/srpc/libxds/unregister.c 2001/07/08 16:01:37 1.3 +++ ossp-pkg/srpc/libxds/unregister.c 2001/07/09 17:23:38 1.4 @@ -27,6 +27,7 @@ #include #include +#include #include #include "internal.h" @@ -41,6 +42,11 @@ assert(name != NULL); if (xds == NULL || name == NULL) return XDS_ERR_INVALID_ARG; + for(pos = 0; name[pos] != '\0'; ++pos) + { + if (!isalnum(name[pos]) && name[pos] != '-' && name[pos] != '_') + return XDS_ERR_INVALID_ARG; + } /* Find the entry we're supposed to delete. */ From ossp-cvs-owner@ossp.org Mon Jul 9 19:36:34 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f69HaYg71497; Mon, 9 Jul 2001 19:36:34 +0200 (CEST) Date: Mon, 9 Jul 2001 19:36:34 +0200 (CEST) Message-Id: <200107091736.f69HaYg71497@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds vencode.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 09-Jul-2001 19:36:33 Branch: HEAD Handle: 2001070918363300 Modified files: ossp-pkg/srpc/libxds vencode.c Log: Fixed a bug in xds_vencode() that would cause the routine not to recognize the end of the fmt string correctly. Summary: Revision Changes Path 1.3 +4 -1 ossp-pkg/srpc/libxds/vencode.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/vencode.c ============================================================ $ cvs diff -u -r1.2 -r1.3 vencode.c --- ossp-pkg/srpc/libxds/vencode.c 2001/07/09 17:19:58 1.2 +++ ossp-pkg/srpc/libxds/vencode.c 2001/07/09 17:36:33 1.3 @@ -97,7 +97,10 @@ { while(isalnum(*p) || *p == '-' || *p == '_') ++p; - *p++ = '\0'; + if (*p) + *p++ = '\0'; + else + *p = '\0'; if (strlen(name) > 0) { From ossp-cvs-owner@ossp.org Mon Jul 9 19:44:31 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f69HiUb72338; Mon, 9 Jul 2001 19:44:30 +0200 (CEST) Date: Mon, 9 Jul 2001 19:44:30 +0200 (CEST) Message-Id: <200107091744.f69HiUb72338@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds vencode.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 09-Jul-2001 19:44:30 Branch: HEAD Handle: 2001070918442900 Modified files: ossp-pkg/srpc/libxds vencode.c Log: Removed two instances where a local definition of "rc" shadowed an earlier one in the routine. Summary: Revision Changes Path 1.4 +10 -10 ossp-pkg/srpc/libxds/vencode.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/vencode.c ============================================================ $ cvs diff -u -r1.3 -r1.4 vencode.c --- ossp-pkg/srpc/libxds/vencode.c 2001/07/09 17:36:33 1.3 +++ ossp-pkg/srpc/libxds/vencode.c 2001/07/09 17:44:29 1.4 @@ -53,11 +53,11 @@ if (xds->buffer == NULL) { /* allocate a new buffer */ - int rc = xds_set_capacity((void**)&xds->buffer, - &xds->buffer_capacity, - XDS_INITIAL_BUFFER_CAPACITY, - sizeof(char), - XDS_INITIAL_BUFFER_CAPACITY); + rc = xds_set_capacity((void**)&xds->buffer, + &xds->buffer_capacity, + XDS_INITIAL_BUFFER_CAPACITY, + sizeof(char), + XDS_INITIAL_BUFFER_CAPACITY); assert(rc == XDS_OK || rc == XDS_ERR_NO_MEM); if (rc != XDS_OK) return rc; @@ -73,11 +73,11 @@ { if (xds->we_own_buffer) { - int rc = xds_set_capacity((void**)&xds->buffer, - &xds->buffer_capacity, - xds->buffer_len + 1, - sizeof(char), - XDS_INITIAL_BUFFER_CAPACITY); + rc = xds_set_capacity((void**)&xds->buffer, + &xds->buffer_capacity, + xds->buffer_len + 1, + sizeof(char), + XDS_INITIAL_BUFFER_CAPACITY); assert(rc == XDS_OK || rc == XDS_ERR_NO_MEM); if (rc != XDS_OK) return rc; From ossp-cvs-owner@ossp.org Mon Jul 9 19:44:49 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f69Himq72402; Mon, 9 Jul 2001 19:44:48 +0200 (CEST) Date: Mon, 9 Jul 2001 19:44:48 +0200 (CEST) Message-Id: <200107091744.f69Himq72402@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds Makefile ossp-pkg/srpc/libxds/regress... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 09-Jul-2001 19:44:48 Branch: HEAD Handle: 2001070918444700 Modified files: ossp-pkg/srpc/libxds Makefile ossp-pkg/srpc/libxds/regression-tests Makefile Log: Added more aggressive warning flags. Summary: Revision Changes Path 1.13 +1 -1 ossp-pkg/srpc/libxds/Makefile 1.8 +1 -1 ossp-pkg/srpc/libxds/regression-tests/Makefile ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/Makefile ============================================================ $ cvs diff -u -r1.12 -r1.13 Makefile --- ossp-pkg/srpc/libxds/Makefile 2001/07/08 15:36:29 1.12 +++ ossp-pkg/srpc/libxds/Makefile 2001/07/09 17:44:47 1.13 @@ -5,7 +5,7 @@ AR = ar RANLIB = ranlib -WARNFLAGS = -Wall -ansi -pedantic +WARNFLAGS = -Wall -ansi -pedantic -Wshadow -Wpointer-arith -Wcast-align -Winline -Wmissing-prototypes -Wmissing-declarations -Wnested-externs OPTFLAGS = -O3 -pipe CPPFLAGS = -D_GNU_SOURCE Index: ossp-pkg/srpc/libxds/regression-tests/Makefile ============================================================ $ cvs diff -u -r1.7 -r1.8 Makefile --- ossp-pkg/srpc/libxds/regression-tests/Makefile 2001/07/09 17:16:30 1.7 +++ ossp-pkg/srpc/libxds/regression-tests/Makefile 2001/07/09 17:44:47 1.8 @@ -2,7 +2,7 @@ CC = gcc -WARNFLAGS = -Wall -ansi -pedantic -Werror +WARNFLAGS = -Wall -ansi -pedantic -Wshadow -Wpointer-arith -Wcast-align -Winline -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Werror OPTFLAGS = -O3 -pipe CPPFLAGS = CFLAGS = From ossp-cvs-owner@ossp.org Mon Jul 9 19:50:59 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f69How773002; Mon, 9 Jul 2001 19:50:58 +0200 (CEST) Date: Mon, 9 Jul 2001 19:50:58 +0200 (CEST) Message-Id: <200107091750.f69How773002@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds/regression-tests .run-tests Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 09-Jul-2001 19:50:58 Branch: HEAD Handle: 2001070918505800 Modified files: ossp-pkg/srpc/libxds/regression-tests .run-tests Log: Enhanced portability. Summary: Revision Changes Path 1.5 +5 -5 ossp-pkg/srpc/libxds/regression-tests/.run-tests ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/regression-tests/.run-tests ============================================================ $ cvs diff -u -r1.4 -r1.5 .run-tests --- ossp-pkg/srpc/libxds/regression-tests/.run-tests 2001/07/08 15:57:27 1.4 +++ ossp-pkg/srpc/libxds/regression-tests/.run-tests 2001/07/09 17:50:58 1.5 @@ -14,24 +14,24 @@ for suite in $*; do tmp="${suite%%.exe}" echo -n "$tmp" - currpos=$(($RESCOLUMN-${#tmp})) + currpos=`expr $RESCOLUMN - ${#tmp}` while [ $currpos -gt 1 ]; do echo -n "." - currpos=$(($currpos-1)) + currpos=`expr $currpos - 1` done echo -n " " - numTests=$(($numTests+1)) + numTests=`expr $numTests + 1` eval ./$suite >${suite%%.exe}.log 2>&1 if [ $? -eq 0 ]; then echo OK else - numFails=$(($numFails+1)) + numFails=`expr $numFails + 1` echo FAILED fi done echo -if [ $numFails -eq 0 ]; then +if [ $numFails -eq 15 ]; then echo "Summary: All tests succeeded." exit 0 else From ossp-cvs-owner@ossp.org Mon Jul 9 19:55:55 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f69HtsX73664; Mon, 9 Jul 2001 19:55:54 +0200 (CEST) Date: Mon, 9 Jul 2001 19:55:54 +0200 (CEST) Message-Id: <200107091755.f69HtsX73664@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds/regression-tests .run-tests Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 09-Jul-2001 19:55:54 Branch: HEAD Handle: 2001070918555400 Modified files: ossp-pkg/srpc/libxds/regression-tests .run-tests Log: Enhanced portability even more. :-) Summary: Revision Changes Path 1.6 +1 -1 ossp-pkg/srpc/libxds/regression-tests/.run-tests ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/regression-tests/.run-tests ============================================================ $ cvs diff -u -r1.5 -r1.6 .run-tests --- ossp-pkg/srpc/libxds/regression-tests/.run-tests 2001/07/09 17:50:58 1.5 +++ ossp-pkg/srpc/libxds/regression-tests/.run-tests 2001/07/09 17:55:54 1.6 @@ -14,7 +14,7 @@ for suite in $*; do tmp="${suite%%.exe}" echo -n "$tmp" - currpos=`expr $RESCOLUMN - ${#tmp}` + currpos=`expr $RESCOLUMN - \( length $tmp \)` while [ $currpos -gt 1 ]; do echo -n "." currpos=`expr $currpos - 1` From ossp-cvs-owner@ossp.org Mon Jul 9 20:19:32 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f69IJVI76325; Mon, 9 Jul 2001 20:19:31 +0200 (CEST) Date: Mon, 9 Jul 2001 20:19:31 +0200 (CEST) Message-Id: <200107091819.f69IJVI76325@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds/regression-tests .run-tests Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 09-Jul-2001 20:19:31 Branch: HEAD Handle: 2001070919193100 Modified files: ossp-pkg/srpc/libxds/regression-tests .run-tests Log: Enhanced portability even more. Unfortunately, there're still some problems on Solaris, most notably the fact that the stupid bourne shell there doesn't know "echo -n". Summary: Revision Changes Path 1.7 +2 -3 ossp-pkg/srpc/libxds/regression-tests/.run-tests ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/regression-tests/.run-tests ============================================================ $ cvs diff -u -r1.6 -r1.7 .run-tests --- ossp-pkg/srpc/libxds/regression-tests/.run-tests 2001/07/09 17:55:54 1.6 +++ ossp-pkg/srpc/libxds/regression-tests/.run-tests 2001/07/09 18:19:31 1.7 @@ -12,7 +12,7 @@ echo "Running test suite:" for suite in $*; do - tmp="${suite%%.exe}" + tmp=`expr "${suite}" : '\(.*\)\.exe$'` echo -n "$tmp" currpos=`expr $RESCOLUMN - \( length $tmp \)` while [ $currpos -gt 1 ]; do @@ -21,8 +21,7 @@ done echo -n " " numTests=`expr $numTests + 1` - eval ./$suite >${suite%%.exe}.log 2>&1 - if [ $? -eq 0 ]; then + if eval ./$suite >${tmp}.log 2>&1; then echo OK else numFails=`expr $numFails + 1` From ossp-cvs-owner@ossp.org Mon Jul 9 20:22:39 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f69IMbT77111; Mon, 9 Jul 2001 20:22:37 +0200 (CEST) Date: Mon, 9 Jul 2001 20:22:37 +0200 (CEST) Message-Id: <200107091822.f69IMbT77111@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds/regression-tests .run-tests Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 09-Jul-2001 20:22:37 Branch: HEAD Handle: 2001070919223700 Modified files: ossp-pkg/srpc/libxds/regression-tests .run-tests Log: Reverted the change of eval being called directly from "if" because that doesn't work on FreeBSD. Yuck. Summary: Revision Changes Path 1.8 +8 -7 ossp-pkg/srpc/libxds/regression-tests/.run-tests ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/regression-tests/.run-tests ============================================================ $ cvs diff -u -r1.7 -r1.8 .run-tests --- ossp-pkg/srpc/libxds/regression-tests/.run-tests 2001/07/09 18:19:31 1.7 +++ ossp-pkg/srpc/libxds/regression-tests/.run-tests 2001/07/09 18:22:37 1.8 @@ -16,21 +16,22 @@ echo -n "$tmp" currpos=`expr $RESCOLUMN - \( length $tmp \)` while [ $currpos -gt 1 ]; do - echo -n "." - currpos=`expr $currpos - 1` + echo -n "." + currpos=`expr $currpos - 1` done echo -n " " numTests=`expr $numTests + 1` - if eval ./$suite >${tmp}.log 2>&1; then - echo OK + eval ./$suite >${suite%%.exe}.log 2>&1 + if [ $? -eq 0 ]; then + echo OK else - numFails=`expr $numFails + 1` - echo FAILED + numFails=`expr $numFails + 1` + echo FAILED fi done echo -if [ $numFails -eq 15 ]; then +if [ $numFails -eq 0 ]; then echo "Summary: All tests succeeded." exit 0 else From ossp-cvs-owner@ossp.org Mon Jul 9 20:27:27 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f69IRQw77715; Mon, 9 Jul 2001 20:27:26 +0200 (CEST) Date: Mon, 9 Jul 2001 20:27:26 +0200 (CEST) Message-Id: <200107091827.f69IRQw77715@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds/regression-tests .run-tests Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 09-Jul-2001 20:27:26 Branch: HEAD Handle: 2001070919272600 Modified files: ossp-pkg/srpc/libxds/regression-tests .run-tests Log: Reverted the use of "expr length" also because FreeBSD cannot do it. Summary: Revision Changes Path 1.9 +2 -2 ossp-pkg/srpc/libxds/regression-tests/.run-tests ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/regression-tests/.run-tests ============================================================ $ cvs diff -u -r1.8 -r1.9 .run-tests --- ossp-pkg/srpc/libxds/regression-tests/.run-tests 2001/07/09 18:22:37 1.8 +++ ossp-pkg/srpc/libxds/regression-tests/.run-tests 2001/07/09 18:27:26 1.9 @@ -14,14 +14,14 @@ for suite in $*; do tmp=`expr "${suite}" : '\(.*\)\.exe$'` echo -n "$tmp" - currpos=`expr $RESCOLUMN - \( length $tmp \)` + currpos=`expr $RESCOLUMN - ${#tmp}` while [ $currpos -gt 1 ]; do echo -n "." currpos=`expr $currpos - 1` done echo -n " " numTests=`expr $numTests + 1` - eval ./$suite >${suite%%.exe}.log 2>&1 + eval ./$suite >${tmp}.log 2>&1 if [ $? -eq 0 ]; then echo OK else From ossp-cvs-owner@ossp.org Mon Jul 9 21:00:46 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f69J0iw81726; Mon, 9 Jul 2001 21:00:44 +0200 (CEST) Date: Mon, 9 Jul 2001 21:00:44 +0200 (CEST) Message-Id: <200107091900.f69J0iw81726@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds decode.c vdecode.c xds.h Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 09-Jul-2001 21:00:44 Branch: HEAD Handle: 2001070920004400 Modified files: ossp-pkg/srpc/libxds decode.c vdecode.c xds.h Log: Implemented xds_decode(). Summary: Revision Changes Path 1.2 +6 -1 ossp-pkg/srpc/libxds/decode.c 1.2 +67 -2 ossp-pkg/srpc/libxds/vdecode.c 1.15 +2 -1 ossp-pkg/srpc/libxds/xds.h ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/decode.c ============================================================ $ cvs diff -u -r1.1 -r1.2 decode.c --- ossp-pkg/srpc/libxds/decode.c 2001/07/04 15:58:51 1.1 +++ ossp-pkg/srpc/libxds/decode.c 2001/07/09 19:00:44 1.2 @@ -29,5 +29,10 @@ int xds_decode(xds_t* xds, const char* fmt, ...) { - return XDS_ERR_INVALID_ARG; + int rc; + va_list args; + va_start(args, fmt); + rc = xds_vdecode(xds, fmt, args); + va_end(args); + return rc; } Index: ossp-pkg/srpc/libxds/vdecode.c ============================================================ $ cvs diff -u -r1.1 -r1.2 vdecode.c --- ossp-pkg/srpc/libxds/vdecode.c 2001/07/04 15:58:51 1.1 +++ ossp-pkg/srpc/libxds/vdecode.c 2001/07/09 19:00:44 1.2 @@ -25,9 +25,74 @@ SUCH DAMAGE. */ +#include +#include +#include #include "internal.h" -int xds_vdecode(xds_t* xds, const char* fmt, va_list args) +int xds_vdecode(xds_t* xds, const char* fmt_arg, va_list args) { - return XDS_ERR_INVALID_ARG; + char* name; + char* p; + char* fmt; + int rc; + + /* Sanity checks. */ + + assert(xds != NULL); + assert(fmt_arg != NULL); + assert(xds->mode == XDS_DECODE); + if (xds == NULL || fmt_arg == NULL) + return XDS_ERR_INVALID_ARG; + if (xds->mode != XDS_DECODE) + return XDS_ERR_INVALID_MODE; + + /* Ensure we have a buffer to decode. */ + + if (xds->buffer == NULL || xds->buffer_capacity == 0) + return XDS_ERR_UNDERFLOW; + + /* Iterate through the items in the format string and execute the + apropriate engines. */ + + fmt = p = strdup(fmt_arg); + if (fmt == NULL) + return XDS_ERR_NO_MEM; + for(name = p; *p != '\0'; name = p) + { + while(isalnum(*p) || *p == '-' || *p == '_') + ++p; + if (*p) + *p++ = '\0'; + else + *p = '\0'; + + if (strlen(name) > 0) + { + size_t pos; + if (xds_find_engine(xds->engines, xds->engines_len, name, &pos)) + { + rc = (*xds->engines[pos].engine)(xds, + xds->engines[pos].context, + xds->buffer + xds->buffer_len, + xds->buffer_capacity - xds->buffer_len, + args); + if (rc < 0) + goto leave; + else + xds->buffer_len += rc; + } + else + { + rc = XDS_ERR_UNKNOWN_ENGINE; + goto leave; + } + } + } + rc = XDS_OK; + + /* Clean up and leave. */ + leave: + free(fmt); + return rc; } Index: ossp-pkg/srpc/libxds/xds.h ============================================================ $ cvs diff -u -r1.14 -r1.15 xds.h --- ossp-pkg/srpc/libxds/xds.h 2001/07/09 17:19:26 1.14 +++ ossp-pkg/srpc/libxds/xds.h 2001/07/09 19:00:44 1.15 @@ -41,7 +41,8 @@ XDS_ERR_INVALID_ARG = -3, XDS_ERR_TYPE_MISMATCH = -4, XDS_ERR_UNKNOWN_ENGINE = -5, - XDS_ERR_INVALID_MODE = -6 + XDS_ERR_INVALID_MODE = -6, + XDS_ERR_UNDERFLOW = -7 }; typedef enum { XDS_ENCODE, XDS_DECODE } xds_mode_t; typedef enum { XDS_LOAN, XDS_GIFT } xds_scope_t; From ossp-cvs-owner@ossp.org Mon Jul 9 21:09:44 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f69J9gg82601; Mon, 9 Jul 2001 21:09:42 +0200 (CEST) Date: Mon, 9 Jul 2001 21:09:42 +0200 (CEST) Message-Id: <200107091909.f69J9gg82601@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds/regression-tests Makefile xds-decode.... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 09-Jul-2001 21:09:42 Branch: HEAD Handle: 2001070920094200 Added files: ossp-pkg/srpc/libxds/regression-tests xds-decode.c Modified files: ossp-pkg/srpc/libxds/regression-tests Makefile Log: Added test suite for xds_decode(). Summary: Revision Changes Path 1.9 +1 -1 ossp-pkg/srpc/libxds/regression-tests/Makefile 1.1 +106 -0 ossp-pkg/srpc/libxds/regression-tests/xds-decode.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/regression-tests/Makefile ============================================================ $ cvs diff -u -r1.8 -r1.9 Makefile --- ossp-pkg/srpc/libxds/regression-tests/Makefile 2001/07/09 17:44:47 1.8 +++ ossp-pkg/srpc/libxds/regression-tests/Makefile 2001/07/09 19:09:42 1.9 @@ -9,7 +9,7 @@ LDFLAGS = -L.. TESTS = xds-core.exe xds-find-engine.exe xds-register.exe xds-encode.exe \ - xds-getbuffer.exe + xds-getbuffer.exe xds-decode.exe .SUFFIXES: .SUFFIXES: .c .exe Index: ossp-pkg/srpc/libxds/regression-tests/xds-decode.c ============================================================ $ cvs update -p -r1.1 xds-decode.c /* XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) This file is part of OSSP XDS, an extensible data serialization library which can be found at http://www.ossp.com/pkg/xds/. 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. */ #include #include #include "../internal.h" static int dummy_engine(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list args) { if (xds == NULL) { printf("XDS context isn't passed through to registered engine.\n"); exit(1); } if (engine_context != (void*)42) { printf("Engine context isn't passed through to registered engine.\n"); exit(1); } if (buffer == NULL) { printf("Buffer passed to engine is NULL.\n"); exit(1); } if (buffer_size == 0) { printf("Buffer size passed to engine is zero!\n"); exit(1); } if (strncmp(buffer, "Hallo!", 6) != 0) { printf("The contents of the decode buffer are not what we expected.\n"); exit(1); } return 6; } int main() { xds_t* xds; char buffer[] = "Hallo!Hallo!Hallo!"; /* Create XDS context. */ xds = xds_init(XDS_DECODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); return 1; } /* Register the dummy callback under multiple names. */ if (xds_register(xds, "text", &dummy_engine, (void*)42) != XDS_OK) { printf("Failed to register my decoding engines.\n"); return 1; } /* Decode the buffer and have the callback report when something is wrong. */ if (xds_setbuffer(xds, XDS_LOAN, buffer, strlen(buffer)) != XDS_OK) { printf("xds_decode() failed!"); return 1; } if (xds_decode(xds, "text::text text") != XDS_OK) { printf("xds_decode() failed!"); return 1; } /* Clean up. */ xds_destroy(xds); /* Everything went fine. */ return 0; } From ossp-cvs-owner@ossp.org Mon Jul 9 21:10:08 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f69JA7B82681; Mon, 9 Jul 2001 21:10:07 +0200 (CEST) Date: Mon, 9 Jul 2001 21:10:07 +0200 (CEST) Message-Id: <200107091910.f69JA7B82681@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds/regression-tests xds-encode.c xds-get... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 09-Jul-2001 21:10:07 Branch: HEAD Handle: 2001070920100600 Modified files: ossp-pkg/srpc/libxds/regression-tests xds-encode.c xds-getbuffer.c xds-register.c Log: Removed unnecessary include statements. Summary: Revision Changes Path 1.3 +0 -2 ossp-pkg/srpc/libxds/regression-tests/xds-encode.c 1.2 +0 -2 ossp-pkg/srpc/libxds/regression-tests/xds-getbuffer.c 1.5 +0 -1 ossp-pkg/srpc/libxds/regression-tests/xds-register.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/regression-tests/xds-encode.c ============================================================ $ cvs diff -u -r1.2 -r1.3 xds-encode.c --- ossp-pkg/srpc/libxds/regression-tests/xds-encode.c 2001/07/09 17:17:02 1.2 +++ ossp-pkg/srpc/libxds/regression-tests/xds-encode.c 2001/07/09 19:10:06 1.3 @@ -27,8 +27,6 @@ #include #include -#include -#include #include "../internal.h" static int dummy_engine(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list args) Index: ossp-pkg/srpc/libxds/regression-tests/xds-getbuffer.c ============================================================ $ cvs diff -u -r1.1 -r1.2 xds-getbuffer.c --- ossp-pkg/srpc/libxds/regression-tests/xds-getbuffer.c 2001/07/09 17:16:30 1.1 +++ ossp-pkg/srpc/libxds/regression-tests/xds-getbuffer.c 2001/07/09 19:10:06 1.2 @@ -27,8 +27,6 @@ #include #include -#include -#include #include "../internal.h" static int dummy_engine(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list args) Index: ossp-pkg/srpc/libxds/regression-tests/xds-register.c ============================================================ $ cvs diff -u -r1.4 -r1.5 xds-register.c --- ossp-pkg/srpc/libxds/regression-tests/xds-register.c 2001/07/09 17:17:33 1.4 +++ ossp-pkg/srpc/libxds/regression-tests/xds-register.c 2001/07/09 19:10:06 1.5 @@ -27,7 +27,6 @@ #include #include -#include #include #include "../internal.h" From ossp-cvs-owner@ossp.org Mon Jul 9 21:19:39 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f69JJcc84149; Mon, 9 Jul 2001 21:19:38 +0200 (CEST) Date: Mon, 9 Jul 2001 21:19:38 +0200 (CEST) Message-Id: <200107091919.f69JJcc84149@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds setbuffer.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 09-Jul-2001 21:19:38 Branch: HEAD Handle: 2001070920193700 Modified files: ossp-pkg/srpc/libxds setbuffer.c Log: Implemented xds_setbuffer(). Summary: Revision Changes Path 1.3 +34 -2 ossp-pkg/srpc/libxds/setbuffer.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/setbuffer.c ============================================================ $ cvs diff -u -r1.2 -r1.3 setbuffer.c --- ossp-pkg/srpc/libxds/setbuffer.c 2001/07/09 17:20:56 1.2 +++ ossp-pkg/srpc/libxds/setbuffer.c 2001/07/09 19:19:37 1.3 @@ -25,9 +25,41 @@ SUCH DAMAGE. */ +#include "assert.h" #include "internal.h" -int xds_setbuffer(xds_t* xds, xds_scope_t flag, void* buffer, size_t buffer_len) +int xds_setbuffer(xds_t* xds, xds_scope_t flag, void* buffer, size_t buffer_len) { - return XDS_ERR_INVALID_ARG; + /* Sanity checks. */ + + assert(xds != NULL); + assert(flag == XDS_GIFT || flag == XDS_LOAN); + assert((buffer != NULL && buffer_len != 0) || flag == XDS_GIFT); + if (xds == NULL || (flag != XDS_GIFT && flag != XDS_LOAN) || + ((buffer == NULL || buffer_len == 0) && flag == XDS_LOAN)) + return XDS_ERR_INVALID_ARG; + + /* Free the old buffer if there is one. */ + + if (xds->buffer != NULL) + free(xds->buffer); + xds->buffer_len = 0; + + if (flag == XDS_GIFT) + { + xds->buffer = buffer; + if (buffer == NULL) + xds->buffer_capacity = 0; + else + xds->buffer_capacity = buffer_len; + xds->we_own_buffer = (1==1); + } + else + { + xds->buffer = buffer; + xds->buffer_capacity = buffer_len; + xds->we_own_buffer = (1!=1); + } + + return XDS_OK; } From ossp-cvs-owner@ossp.org Mon Jul 9 21:21:00 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f69JKx784283; Mon, 9 Jul 2001 21:20:59 +0200 (CEST) Date: Mon, 9 Jul 2001 21:20:59 +0200 (CEST) Message-Id: <200107091920.f69JKx784283@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds setbuffer.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 09-Jul-2001 21:20:59 Branch: HEAD Handle: 2001070920205800 Modified files: ossp-pkg/srpc/libxds setbuffer.c Log: Swapped order of if statement to be more efficient. Summary: Revision Changes Path 1.4 +1 -1 ossp-pkg/srpc/libxds/setbuffer.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/setbuffer.c ============================================================ $ cvs diff -u -r1.3 -r1.4 setbuffer.c --- ossp-pkg/srpc/libxds/setbuffer.c 2001/07/09 19:19:37 1.3 +++ ossp-pkg/srpc/libxds/setbuffer.c 2001/07/09 19:20:58 1.4 @@ -36,7 +36,7 @@ assert(flag == XDS_GIFT || flag == XDS_LOAN); assert((buffer != NULL && buffer_len != 0) || flag == XDS_GIFT); if (xds == NULL || (flag != XDS_GIFT && flag != XDS_LOAN) || - ((buffer == NULL || buffer_len == 0) && flag == XDS_LOAN)) + (flag == XDS_LOAN && (buffer == NULL || buffer_len == 0))) return XDS_ERR_INVALID_ARG; /* Free the old buffer if there is one. */ From ossp-cvs-owner@ossp.org Sun Jul 15 13:48:29 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f6FBmRR14847; Sun, 15 Jul 2001 13:48:27 +0200 (CEST) Date: Sun, 15 Jul 2001 13:48:27 +0200 (CEST) Message-Id: <200107151148.f6FBmRR14847@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc TODO Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 15-Jul-2001 13:48:27 Branch: HEAD Handle: 2001071512482600 Modified files: ossp-pkg/srpc TODO Log: Revamp the XDS/AMP TODO file by updating the forthcoming milestones and corresponding dates. Peti: Please look carefully over it and feel free to add/remove entries and/or adjust milestone times if you thing we cannot fulfill this. Summary: Revision Changes Path 1.5 +52 -23 ossp-pkg/srpc/TODO ____________________________________________________________________________ Index: ossp-pkg/srpc/TODO ============================================================ $ cvs diff -u -r1.4 -r1.5 TODO --- ossp-pkg/srpc/TODO 2001/06/21 05:16:05 1.4 +++ ossp-pkg/srpc/TODO 2001/07/15 11:48:26 1.5 @@ -3,34 +3,63 @@ ======================== o M1 (peti) [11-Jun-2001] - - evaluation (-> ideas) - (checklist) - - prototype - (C++) + - evaluation checklist for XDS and AMP + done: 50% [-> EVAL] + - prototype C++ + done: 0% o M2 (peti+rse) [25-Jun-2001] - design/architecture paper (authentication+encryption framework) (< 10KB Text + 1x Figure) + done: 30% [-> architecture.fig] -o M3 (peti+rse) [9-Jul-2001] +o M3 (peti+rse) [2-Jul-2001] - design libxds API - - design libamp API - - preliminary design libsrpc API + done: 100% [-> libxds/xds.h + libxds/xds.pod] -o M4 (peti) - - implementation of libxds - - implementation of libamp - -o M5 (peti+rse) - - design libsrpc API and protocol - -o M6 (peti) - - implementation libsrpc - - implementation xxxd - -o M7 (peti) - - documentation - -o M8 (rse) - - OSSP integration +o M4 (peti) [3 weeks until 23-Jul-2001] + - implementation of libxds library framework + done: 100% [-> libxds/*.c] + - implementation of libxds SunRPC/XDR and XML-RPC backends + for basic data types: + o integer: + - short + - unsigned short + - int + - unsigned int + - long + - unsigned long + o floating point: + - float + - double + o pointer: + - void * + - void(*)() + o string + - char * (end is NUL) + - unsigned char * (end is NUL) + o octet-stream + - void * (end is after given length) + Function prototype is xds_engine_t. + Function name scheme is: + {xdr,xml}_{en,de}code_{[u]short,[u]int,[u]long, + float,double,voidptr,funcptr, + [u]string,octets} + - regression tests for libxds (make check) + +o M5 (peti+rse) [1 week until 30-Jul-2001] + - [peti] documentation for libxds (xds.pod) + - [rse] OSSP adjustments for libxds + +o M6 (peti+rse) [1 week until 06-Aug-2001] + - design API for libamp + +o M7 (peti) [3 week until 27-Aug-2001] + - implementation of libamp library framework + - implementation of libamp backends SHM, TCP and UDP + - regression tests for libamp + +o M8 (peti+rse) [1 week until 03-Sep-2001] + - [peti] documentation for libamp + - [rse] OSSP adjustments for libamp From ossp-cvs-owner@ossp.org Mon Jul 16 19:50:10 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f6GHo9u38823; Mon, 16 Jul 2001 19:50:09 +0200 (CEST) Date: Mon, 16 Jul 2001 19:50:09 +0200 (CEST) Message-Id: <200107161750.f6GHo9u38823@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds/regression-tests xds-decode.c xds-enc... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 16-Jul-2001 19:50:08 Branch: HEAD Handle: 2001071618500701 Modified files: ossp-pkg/srpc/libxds vdecode.c vencode.c xds.h ossp-pkg/srpc/libxds/regression-tests xds-decode.c xds-encode.c xds-getbuffer.c xds-register.c Log: Passing va_list parameters by value is fine, unless the called routine modifies the parameter list and you expect the change to propagate back to the mother routine. What is what we want. Hence, I changed the prototype of the engine callback to expect a pointer to va_list. Summary: Revision Changes Path 1.2 +1 -1 ossp-pkg/srpc/libxds/regression-tests/xds-decode.c 1.4 +1 -1 ossp-pkg/srpc/libxds/regression-tests/xds-encode.c 1.3 +1 -1 ossp-pkg/srpc/libxds/regression-tests/xds-getbuffer.c 1.6 +1 -1 ossp-pkg/srpc/libxds/regression-tests/xds-register.c 1.3 +1 -1 ossp-pkg/srpc/libxds/vdecode.c 1.5 +1 -1 ossp-pkg/srpc/libxds/vencode.c 1.16 +1 -1 ossp-pkg/srpc/libxds/xds.h ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/regression-tests/xds-decode.c ============================================================ $ cvs diff -u -r1.1 -r1.2 xds-decode.c --- ossp-pkg/srpc/libxds/regression-tests/xds-decode.c 2001/07/09 19:09:42 1.1 +++ ossp-pkg/srpc/libxds/regression-tests/xds-decode.c 2001/07/16 17:50:08 1.2 @@ -29,7 +29,7 @@ #include #include "../internal.h" -static int dummy_engine(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list args) +static int dummy_engine(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) { if (xds == NULL) { Index: ossp-pkg/srpc/libxds/regression-tests/xds-encode.c ============================================================ $ cvs diff -u -r1.3 -r1.4 xds-encode.c --- ossp-pkg/srpc/libxds/regression-tests/xds-encode.c 2001/07/09 19:10:06 1.3 +++ ossp-pkg/srpc/libxds/regression-tests/xds-encode.c 2001/07/16 17:50:08 1.4 @@ -29,7 +29,7 @@ #include #include "../internal.h" -static int dummy_engine(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list args) +static int dummy_engine(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) { if (xds == NULL) { Index: ossp-pkg/srpc/libxds/regression-tests/xds-getbuffer.c ============================================================ $ cvs diff -u -r1.2 -r1.3 xds-getbuffer.c --- ossp-pkg/srpc/libxds/regression-tests/xds-getbuffer.c 2001/07/09 19:10:06 1.2 +++ ossp-pkg/srpc/libxds/regression-tests/xds-getbuffer.c 2001/07/16 17:50:08 1.3 @@ -29,7 +29,7 @@ #include #include "../internal.h" -static int dummy_engine(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list args) +static int dummy_engine(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) { strncpy(buffer, "Hallo!", buffer_size); return 6; Index: ossp-pkg/srpc/libxds/regression-tests/xds-register.c ============================================================ $ cvs diff -u -r1.5 -r1.6 xds-register.c --- ossp-pkg/srpc/libxds/regression-tests/xds-register.c 2001/07/09 19:10:06 1.5 +++ ossp-pkg/srpc/libxds/regression-tests/xds-register.c 2001/07/16 17:50:08 1.6 @@ -30,7 +30,7 @@ #include #include "../internal.h" -static int dummy_engine(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list args) +static int dummy_engine(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) { return 0; } Index: ossp-pkg/srpc/libxds/vdecode.c ============================================================ $ cvs diff -u -r1.2 -r1.3 vdecode.c --- ossp-pkg/srpc/libxds/vdecode.c 2001/07/09 19:00:44 1.2 +++ ossp-pkg/srpc/libxds/vdecode.c 2001/07/16 17:50:07 1.3 @@ -76,7 +76,7 @@ xds->engines[pos].context, xds->buffer + xds->buffer_len, xds->buffer_capacity - xds->buffer_len, - args); + &args); if (rc < 0) goto leave; else Index: ossp-pkg/srpc/libxds/vencode.c ============================================================ $ cvs diff -u -r1.4 -r1.5 vencode.c --- ossp-pkg/srpc/libxds/vencode.c 2001/07/09 17:44:29 1.4 +++ ossp-pkg/srpc/libxds/vencode.c 2001/07/16 17:50:07 1.5 @@ -115,7 +115,7 @@ xds->engines[pos].context, xds->buffer + xds->buffer_len, xds->buffer_capacity - xds->buffer_len, - args); + &args); if (rc < 0) goto leave; else if (rc >= xds->buffer_capacity - xds->buffer_len) Index: ossp-pkg/srpc/libxds/xds.h ============================================================ $ cvs diff -u -r1.15 -r1.16 xds.h --- ossp-pkg/srpc/libxds/xds.h 2001/07/09 19:00:44 1.15 +++ ossp-pkg/srpc/libxds/xds.h 2001/07/16 17:50:07 1.16 @@ -54,7 +54,7 @@ void* engine_context, void* buffer, size_t buffer_size, - va_list args); + va_list* args); xds_t* xds_init(xds_mode_t); void xds_destroy(xds_t* xds); From ossp-cvs-owner@ossp.org Mon Jul 16 20:27:00 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f6GIQxC44028; Mon, 16 Jul 2001 20:26:59 +0200 (CEST) Date: Mon, 16 Jul 2001 20:26:59 +0200 (CEST) Message-Id: <200107161826.f6GIQxC44028@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds set-capacity.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 16-Jul-2001 20:26:59 Branch: HEAD Handle: 2001071619265800 Modified files: ossp-pkg/srpc/libxds set-capacity.c Log: It's not necessary to enlarge size until it is larger than new_capacity; equalling new_capacity is fine. Summary: Revision Changes Path 1.3 +1 -1 ossp-pkg/srpc/libxds/set-capacity.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/set-capacity.c ============================================================ $ cvs diff -u -r1.2 -r1.3 set-capacity.c --- ossp-pkg/srpc/libxds/set-capacity.c 2001/07/09 17:22:34 1.2 +++ ossp-pkg/srpc/libxds/set-capacity.c 2001/07/16 18:26:58 1.3 @@ -48,7 +48,7 @@ /* Find the correct capacity. */ - for(size = (*array_capacity != 0) ? *array_capacity * 2 : initial_capacity; size <= new_capacity; size *= 2) + for(size = (*array_capacity != 0) ? *array_capacity * 2 : initial_capacity; size < new_capacity; size *= 2) ; /* Allocate the array and store the new values. */ From ossp-cvs-owner@ossp.org Mon Jul 16 20:28:34 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f6GISXN44182; Mon, 16 Jul 2001 20:28:33 +0200 (CEST) Date: Mon, 16 Jul 2001 20:28:33 +0200 (CEST) Message-Id: <200107161828.f6GISXN44182@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds vencode.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 16-Jul-2001 20:28:33 Branch: HEAD Handle: 2001071619283200 Modified files: ossp-pkg/srpc/libxds vencode.c Log: Improved clarity of debug message. Summary: Revision Changes Path 1.6 +1 -1 ossp-pkg/srpc/libxds/vencode.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/vencode.c ============================================================ $ cvs diff -u -r1.5 -r1.6 vencode.c --- ossp-pkg/srpc/libxds/vencode.c 2001/07/16 17:50:07 1.5 +++ ossp-pkg/srpc/libxds/vencode.c 2001/07/16 18:28:32 1.6 @@ -61,7 +61,7 @@ assert(rc == XDS_OK || rc == XDS_ERR_NO_MEM); if (rc != XDS_OK) return rc; - printf("Enlarged buffer to %d byte.\n", xds->buffer_capacity); + printf("Setting up buffer with capacity %d byte.\n", xds->buffer_capacity); xds->buffer_len = 0; xds->we_own_buffer = (1==1); } From ossp-cvs-owner@ossp.org Mon Jul 16 20:31:37 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f6GIVaL44643; Mon, 16 Jul 2001 20:31:36 +0200 (CEST) Date: Mon, 16 Jul 2001 20:31:36 +0200 (CEST) Message-Id: <200107161831.f6GIVaL44643@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds vencode.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 16-Jul-2001 20:31:36 Branch: HEAD Handle: 2001071619313600 Modified files: ossp-pkg/srpc/libxds vencode.c Log: We need to make a difference between the callback using up all buffer capacity, in which case we need to enlarge the buffer but don't need to restart the callback, and the callback truncating its output, because the buffer was too small, in which case we need to enlarge the buffer _and_ restart the callback. Summary: Revision Changes Path 1.7 +5 -1 ossp-pkg/srpc/libxds/vencode.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/vencode.c ============================================================ $ cvs diff -u -r1.6 -r1.7 vencode.c --- ossp-pkg/srpc/libxds/vencode.c 2001/07/16 18:28:32 1.6 +++ ossp-pkg/srpc/libxds/vencode.c 2001/07/16 18:31:36 1.7 @@ -122,6 +122,11 @@ { /* enlarge buffer */ int rc2; + if (rc > xds->buffer_capacity - xds->buffer_len) + restart_engine = (1==1); + else + restart_engine = (1!=1); + if (!xds->we_own_buffer) { rc = XDS_ERR_OVERFLOW; @@ -139,7 +144,6 @@ rc = rc2; goto leave; } - restart_engine = (1==1); printf("Enlarged buffer to %d byte.\n", xds->buffer_capacity); } else From ossp-cvs-owner@ossp.org Mon Jul 16 20:38:54 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f6GIcr045470; Mon, 16 Jul 2001 20:38:53 +0200 (CEST) Date: Mon, 16 Jul 2001 20:38:53 +0200 (CEST) Message-Id: <200107161838.f6GIcr045470@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds/regression-tests Makefile xds-setbuff... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 16-Jul-2001 20:38:53 Branch: HEAD Handle: 2001071619385300 Added files: ossp-pkg/srpc/libxds/regression-tests xds-setbuffer.c Modified files: ossp-pkg/srpc/libxds/regression-tests Makefile Log: Added test suite for xds_setbuffer(). Summary: Revision Changes Path 1.10 +2 -2 ossp-pkg/srpc/libxds/regression-tests/Makefile 1.1 +128 -0 ossp-pkg/srpc/libxds/regression-tests/xds-setbuffer.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/regression-tests/Makefile ============================================================ $ cvs diff -u -r1.9 -r1.10 Makefile --- ossp-pkg/srpc/libxds/regression-tests/Makefile 2001/07/09 19:09:42 1.9 +++ ossp-pkg/srpc/libxds/regression-tests/Makefile 2001/07/16 18:38:53 1.10 @@ -4,12 +4,12 @@ WARNFLAGS = -Wall -ansi -pedantic -Wshadow -Wpointer-arith -Wcast-align -Winline -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Werror OPTFLAGS = -O3 -pipe -CPPFLAGS = +CPPFLAGS = -D_GNU_SOURCE CFLAGS = LDFLAGS = -L.. TESTS = xds-core.exe xds-find-engine.exe xds-register.exe xds-encode.exe \ - xds-getbuffer.exe xds-decode.exe + xds-getbuffer.exe xds-decode.exe xds-setbuffer.exe .SUFFIXES: .SUFFIXES: .c .exe Index: ossp-pkg/srpc/libxds/regression-tests/xds-setbuffer.c ============================================================ $ cvs update -p -r1.1 xds-setbuffer.c /* XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) This file is part of OSSP XDS, an extensible data serialization library which can be found at http://www.ossp.com/pkg/xds/. 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. */ #include #include #include #include "../internal.h" static int dummy_engine(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) { assert(xds != NULL); assert(buffer != NULL); assert(buffer_size != 0); if (buffer_size >= 64) memset(buffer, 'a', 64); return 64; } int main() { xds_t* xds; char* buffer; size_t buffer_size; /* Create XDS context. */ xds = xds_init(XDS_ENCODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); return 1; } /* Register the callback. */ if (xds_register(xds, "dummy", &dummy_engine, NULL) != XDS_OK) { printf("Failed to register my encoding engine.\n"); return 1; } /* Give the library a buffer of 64 byte, call the engine once, get the buffer back and see whether it has been enlarged or not. */ buffer = malloc(64); if (buffer == NULL) { printf("Failed to allocate my memory.\n"); return 1; } buffer_size = 64; if (xds_setbuffer(xds, XDS_GIFT, buffer, buffer_size) != XDS_OK) { printf("xds_setbuffer() failed!\n"); return 1; } if (xds_encode(xds, "dummy") != XDS_OK) { printf("xds_encode() failed!\n"); return 1; } if (xds_getbuffer(xds, XDS_GIFT, (void**)&buffer, &buffer_size) != XDS_OK) { printf("xds_getbuffer() failed!\n"); return 1; } if (buffer_size == 64) { printf("xds_encode() did not enlarge the buffer after processing the callback\n"); printf("even though all capacity was used up!\n"); return 1; } /* Loan the library a buffer we own, call the engine once to exceed the buffer's capacity and check, whether the library returns the correct error code. */ buffer = malloc(32); if (buffer == NULL) { printf("Failed to allocate my memory.\n"); return 1; } buffer_size = 32; if (xds_setbuffer(xds, XDS_LOAN, buffer, buffer_size) != XDS_OK) { printf("xds_setbuffer() failed!\n"); return 1; } if (xds_encode(xds, "dummy") != XDS_ERR_OVERFLOW) { printf("xds_encode() was supposed to fail with XDS_ERR_OVERFLOW!\n"); return 1; } free(buffer); /* Clean up. */ xds_destroy(xds); /* Everything went fine. */ return 0; } From ossp-cvs-owner@ossp.org Wed Jul 18 13:29:48 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f6IBTlP61059; Wed, 18 Jul 2001 13:29:47 +0200 (CEST) Date: Wed, 18 Jul 2001 13:29:47 +0200 (CEST) Message-Id: <200107181129.f6IBTlP61059@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds/regression-tests Makefile xdr-int32.c... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 18-Jul-2001 13:29:47 Branch: HEAD Handle: 2001071812294600 Added files: ossp-pkg/srpc/libxds/regression-tests xdr-int32.c xdr-uint32.c Modified files: ossp-pkg/srpc/libxds/regression-tests Makefile Log: Added test suites for the encoding of int32 and uint32 values in XDR. Summary: Revision Changes Path 1.11 +2 -1 ossp-pkg/srpc/libxds/regression-tests/Makefile 1.1 +108 -0 ossp-pkg/srpc/libxds/regression-tests/xdr-int32.c 1.1 +107 -0 ossp-pkg/srpc/libxds/regression-tests/xdr-uint32.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/regression-tests/Makefile ============================================================ $ cvs diff -u -r1.10 -r1.11 Makefile --- ossp-pkg/srpc/libxds/regression-tests/Makefile 2001/07/16 18:38:53 1.10 +++ ossp-pkg/srpc/libxds/regression-tests/Makefile 2001/07/18 11:29:46 1.11 @@ -9,7 +9,8 @@ LDFLAGS = -L.. TESTS = xds-core.exe xds-find-engine.exe xds-register.exe xds-encode.exe \ - xds-getbuffer.exe xds-decode.exe xds-setbuffer.exe + xds-getbuffer.exe xds-decode.exe xds-setbuffer.exe \ + xdr-uint32.exe xdr-int32.exe .SUFFIXES: .SUFFIXES: .c .exe Index: ossp-pkg/srpc/libxds/regression-tests/xdr-int32.c ============================================================ $ cvs update -p -r1.1 xdr-int32.c /* XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) This file is part of OSSP XDS, an extensible data serialization library which can be found at http://www.ossp.com/pkg/xds/. 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. */ #include #include #include #include #include "../internal.h" int main() { XDR xdrs; char xdr_buf[1024]; size_t xdr_buf_size; xds_t* xds; char* xds_buf; size_t xds_buf_size; int32_t values[] = { 0x00000000, 0x12345678, -0x12345678, 0xabcdef01, -0xabcdef01, 0x7fffffff }; size_t i; /* Encode the values array using the RPC-XDR implementation. */ xdrmem_create(&xdrs, xdr_buf, sizeof(xdr_buf), XDR_ENCODE); for (i = 0; i < sizeof(values)/sizeof(int32_t); ++i) xdr_int32_t(&xdrs, &values[i]); xdr_buf_size = xdr_getpos(&xdrs); xdr_destroy(&xdrs); /* Encode the values array using the XDS implementation. */ xds = xds_init(XDS_ENCODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); return 1; } if (xds_register(xds, "int", &xdr_encode_int32, NULL) != XDS_OK) { printf("Failed to register my encoding engines.\n"); return 1; } for (i = 0; i < sizeof(values)/sizeof(int32_t); ++i) { if (xds_encode(xds, "int", values[i]) != XDS_OK) { printf("xds_encode(values[%d]) failed!", i); return 1; } } if (xds_getbuffer(xds, XDS_GIFT, (void**)&xds_buf, &xds_buf_size) != XDS_OK) { printf("getbuffer() failed.\n"); return 1; } xds_destroy(xds); /* Both buffers must be equal now. */ if (xdr_buf_size != xds_buf_size) { printf("The buffer sizes don't match: %d != %d.\n", xdr_buf_size, xds_buf_size); return 1; } if (memcmp(xds_buf, xdr_buf, xds_buf_size) != 0) { printf("The buffers' contents is not identical!\n"); return 1; } /* Everything went fine. */ return 0; } Index: ossp-pkg/srpc/libxds/regression-tests/xdr-uint32.c ============================================================ $ cvs update -p -r1.1 xdr-uint32.c /* XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) This file is part of OSSP XDS, an extensible data serialization library which can be found at http://www.ossp.com/pkg/xds/. 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. */ #include #include #include #include #include "../internal.h" int main() { XDR xdrs; char xdr_buf[1024]; size_t xdr_buf_size; xds_t* xds; char* xds_buf; size_t xds_buf_size; u_int32_t values[] = { 0x00000000, 0x12345678, 0xabcdef01, 0xc500b3ef, 0xffffffff }; size_t i; /* Encode the values array using the RPC-XDR implementation. */ xdrmem_create(&xdrs, xdr_buf, sizeof(xdr_buf), XDR_ENCODE); for (i = 0; i < sizeof(values)/sizeof(u_int32_t); ++i) xdr_uint32_t(&xdrs, &values[i]); xdr_buf_size = xdr_getpos(&xdrs); xdr_destroy(&xdrs); /* Encode the values array using the XDS implementation. */ xds = xds_init(XDS_ENCODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); return 1; } if (xds_register(xds, "uint", &xdr_encode_uint32, NULL) != XDS_OK) { printf("Failed to register my encoding engines.\n"); return 1; } for (i = 0; i < sizeof(values)/sizeof(uint32_t); ++i) { if (xds_encode(xds, "uint", values[i]) != XDS_OK) { printf("xds_encode(values[%d]) failed!", i); return 1; } } if (xds_getbuffer(xds, XDS_GIFT, (void**)&xds_buf, &xds_buf_size) != XDS_OK) { printf("getbuffer() failed.\n"); return 1; } xds_destroy(xds); /* Both buffers must be equal now. */ if (xdr_buf_size != xds_buf_size) { printf("The buffer sizes don't match: %d != %d.\n", xdr_buf_size, xds_buf_size); return 1; } if (memcmp(xds_buf, xdr_buf, xds_buf_size) != 0) { printf("The buffers' contents is not identical!\n"); return 1; } /* Everything went fine. */ return 0; } From ossp-cvs-owner@ossp.org Wed Jul 18 13:30:20 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f6IBUKh61357; Wed, 18 Jul 2001 13:30:20 +0200 (CEST) Date: Wed, 18 Jul 2001 13:30:20 +0200 (CEST) Message-Id: <200107181130.f6IBUKh61357@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds Makefile xdr-encode-int.c xds.h Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 18-Jul-2001 13:30:20 Branch: HEAD Handle: 2001071812301900 Added files: ossp-pkg/srpc/libxds xdr-encode-int.c Modified files: ossp-pkg/srpc/libxds Makefile xds.h Log: Added XDR encoding engines for int32 and uint32. Summary: Revision Changes Path 1.14 +1 -1 ossp-pkg/srpc/libxds/Makefile 1.1 +91 -0 ossp-pkg/srpc/libxds/xdr-encode-int.c 1.17 +3 -0 ossp-pkg/srpc/libxds/xds.h ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/Makefile ============================================================ $ cvs diff -u -r1.13 -r1.14 Makefile --- ossp-pkg/srpc/libxds/Makefile 2001/07/09 17:44:47 1.13 +++ ossp-pkg/srpc/libxds/Makefile 2001/07/18 11:30:19 1.14 @@ -15,7 +15,7 @@ OBJS = decode.o destroy.o encode.o getbuffer.o init.o register.o \ setbuffer.o unregister.o vdecode.o vencode.o find-engine.o \ - set-capacity.o + set-capacity.o xdr-encode-int.o .c.o: $(CC) $(CPPFLAGS) $(WARNFLAGS) $(OPTFLAGS) $(CFLAGS) -c $< Index: ossp-pkg/srpc/libxds/xdr-encode-int.c ============================================================ $ cvs update -p -r1.1 xdr-encode-int.c /* XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) This file is part of OSSP XDS, an extensible data serialization library which can be found at http://www.ossp.com/pkg/xds/. 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. */ #include #include "internal.h" int xdr_encode_int32(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) { /* Consistency checks. */ assert(xds != NULL); assert(buffer != NULL); assert(buffer_size != 0); assert(args != NULL); if (xds == NULL || buffer == NULL || buffer_size == 0 || args == NULL) return XDS_ERR_INVALID_ARG; /* Get value and format it into the buffer. */ if (buffer_size >= 4) { u_int32_t tmp; int32_t value = va_arg(*args, u_int32_t); if (value < 0) { value = 0 - value; tmp = 0 - (u_int32_t)value; } else tmp = (u_int32_t)value; ((u_int8_t*)buffer)[0] = (tmp >> 24) & 0x000000ff; ((u_int8_t*)buffer)[1] = (tmp >> 16) & 0x000000ff; ((u_int8_t*)buffer)[2] = (tmp >> 8) & 0x000000ff; ((u_int8_t*)buffer)[3] = (tmp >> 0) & 0x000000ff; } /* Done. */ return 4; } int xdr_encode_uint32(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) { /* Consistency checks. */ assert(xds != NULL); assert(buffer != NULL); assert(buffer_size != 0); assert(args != NULL); if (xds == NULL || buffer == NULL || buffer_size == 0 || args == NULL) return XDS_ERR_INVALID_ARG; /* Get value and format it into the buffer. */ if (buffer_size >= 4) { u_int32_t value = va_arg(*args, u_int32_t); ((u_int8_t*)buffer)[0] = (value >> 24) & 0x000000ff; ((u_int8_t*)buffer)[1] = (value >> 16) & 0x000000ff; ((u_int8_t*)buffer)[2] = (value >> 8) & 0x000000ff; ((u_int8_t*)buffer)[3] = (value >> 0) & 0x000000ff; } /* Done. */ return 4; } Index: ossp-pkg/srpc/libxds/xds.h ============================================================ $ cvs diff -u -r1.16 -r1.17 xds.h --- ossp-pkg/srpc/libxds/xds.h 2001/07/16 17:50:07 1.16 +++ ossp-pkg/srpc/libxds/xds.h 2001/07/18 11:30:19 1.17 @@ -70,4 +70,7 @@ int xds_vencode(xds_t* xds, const char* fmt, va_list args); int xds_vdecode(xds_t* xds, const char* fmt, va_list args); +int xdr_encode_uint32(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); +int xdr_encode_int32(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); + #endif /* !defined(__LIBXDS_H__) */ From ossp-cvs-owner@ossp.org Wed Jul 18 18:59:30 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f6IGxTi04059; Wed, 18 Jul 2001 18:59:29 +0200 (CEST) Date: Wed, 18 Jul 2001 18:59:29 +0200 (CEST) Message-Id: <200107181659.f6IGxTi04059@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds/regression-tests Makefile xdr-int64.c... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 18-Jul-2001 18:59:29 Branch: HEAD Handle: 2001071817592701 Added files: ossp-pkg/srpc/libxds/regression-tests xdr-int64.c xdr-uint64.c Modified files: ossp-pkg/srpc/libxds xdr-encode-int.c xds.h ossp-pkg/srpc/libxds/regression-tests Makefile Log: Implemented encoding routines for 64 bit integers and added the apropriate test suites. Summary: Revision Changes Path 1.12 +4 -2 ossp-pkg/srpc/libxds/regression-tests/Makefile 1.1 +108 -0 ossp-pkg/srpc/libxds/regression-tests/xdr-int64.c 1.1 +107 -0 ossp-pkg/srpc/libxds/regression-tests/xdr-uint64.c 1.2 +70 -0 ossp-pkg/srpc/libxds/xdr-encode-int.c 1.18 +2 -0 ossp-pkg/srpc/libxds/xds.h ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/regression-tests/Makefile ============================================================ $ cvs diff -u -r1.11 -r1.12 Makefile --- ossp-pkg/srpc/libxds/regression-tests/Makefile 2001/07/18 11:29:46 1.11 +++ ossp-pkg/srpc/libxds/regression-tests/Makefile 2001/07/18 16:59:28 1.12 @@ -2,7 +2,9 @@ CC = gcc -WARNFLAGS = -Wall -ansi -pedantic -Wshadow -Wpointer-arith -Wcast-align -Winline -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Werror +WARNFLAGS = -Wall -ansi -pedantic -Wshadow -Wpointer-arith -Wcast-align -Winline \ + -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wno-long-long \ + -Werror OPTFLAGS = -O3 -pipe CPPFLAGS = -D_GNU_SOURCE CFLAGS = @@ -10,7 +12,7 @@ TESTS = xds-core.exe xds-find-engine.exe xds-register.exe xds-encode.exe \ xds-getbuffer.exe xds-decode.exe xds-setbuffer.exe \ - xdr-uint32.exe xdr-int32.exe + xdr-uint32.exe xdr-int32.exe xdr-uint64.exe xdr-int64.exe .SUFFIXES: .SUFFIXES: .c .exe Index: ossp-pkg/srpc/libxds/regression-tests/xdr-int64.c ============================================================ $ cvs update -p -r1.1 xdr-int64.c /* XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) This file is part of OSSP XDS, an extensible data serialization library which can be found at http://www.ossp.com/pkg/xds/. 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. */ #include #include #include #include #include "../internal.h" int main() { XDR xdrs; char xdr_buf[1024]; size_t xdr_buf_size; xds_t* xds; char* xds_buf; size_t xds_buf_size; int64_t values[] = { 0x0000000000000000LL, 0x123456789abcdef0LL, -0x123456789abcdef0LL, 0xabcdef01cc45bb9aLL, -0xabcdef01cc45bb9aLL, 0x7fffffffffffffffLL }; size_t i; /* Encode the values array using the RPC-XDR implementation. */ xdrmem_create(&xdrs, xdr_buf, sizeof(xdr_buf), XDR_ENCODE); for (i = 0; i < sizeof(values)/sizeof(int64_t); ++i) xdr_int64_t(&xdrs, &values[i]); xdr_buf_size = xdr_getpos(&xdrs); xdr_destroy(&xdrs); /* Encode the values array using the XDS implementation. */ xds = xds_init(XDS_ENCODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); return 1; } if (xds_register(xds, "int", &xdr_encode_int64, NULL) != XDS_OK) { printf("Failed to register my encoding engines.\n"); return 1; } for (i = 0; i < sizeof(values)/sizeof(int64_t); ++i) { if (xds_encode(xds, "int", values[i]) != XDS_OK) { printf("xds_encode(values[%d]) failed!", i); return 1; } } if (xds_getbuffer(xds, XDS_GIFT, (void**)&xds_buf, &xds_buf_size) != XDS_OK) { printf("getbuffer() failed.\n"); return 1; } xds_destroy(xds); /* Both buffers must be equal now. */ if (xdr_buf_size != xds_buf_size) { printf("The buffer sizes don't match: %d != %d.\n", xdr_buf_size, xds_buf_size); return 1; } if (memcmp(xds_buf, xdr_buf, xds_buf_size) != 0) { printf("The buffers' contents is not identical!\n"); return 1; } /* Everything went fine. */ return 0; } Index: ossp-pkg/srpc/libxds/regression-tests/xdr-uint64.c ============================================================ $ cvs update -p -r1.1 xdr-uint64.c /* XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) This file is part of OSSP XDS, an extensible data serialization library which can be found at http://www.ossp.com/pkg/xds/. 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. */ #include #include #include #include #include "../internal.h" int main() { XDR xdrs; char xdr_buf[1024]; size_t xdr_buf_size; xds_t* xds; char* xds_buf; size_t xds_buf_size; u_int64_t values[] = { 0x0000000000000000ULL, 0x123456789abcdef0ULL, 0xabcdef01cc45bb9aULL, 0xc500b3efdd34ca9eULL, 0xffffffffffffffffULL }; size_t i; /* Encode the values array using the RPC-XDR implementation. */ xdrmem_create(&xdrs, xdr_buf, sizeof(xdr_buf), XDR_ENCODE); for (i = 0; i < sizeof(values)/sizeof(u_int64_t); ++i) xdr_uint64_t(&xdrs, &values[i]); xdr_buf_size = xdr_getpos(&xdrs); xdr_destroy(&xdrs); /* Encode the values array using the XDS implementation. */ xds = xds_init(XDS_ENCODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); return 1; } if (xds_register(xds, "uint", &xdr_encode_uint64, NULL) != XDS_OK) { printf("Failed to register my encoding engines.\n"); return 1; } for (i = 0; i < sizeof(values)/sizeof(uint64_t); ++i) { if (xds_encode(xds, "uint", values[i]) != XDS_OK) { printf("xds_encode(values[%d]) failed!", i); return 1; } } if (xds_getbuffer(xds, XDS_GIFT, (void**)&xds_buf, &xds_buf_size) != XDS_OK) { printf("getbuffer() failed.\n"); return 1; } xds_destroy(xds); /* Both buffers must be equal now. */ if (xdr_buf_size != xds_buf_size) { printf("The buffer sizes don't match: %d != %d.\n", xdr_buf_size, xds_buf_size); return 1; } if (memcmp(xds_buf, xdr_buf, xds_buf_size) != 0) { printf("The buffers' contents is not identical!\n"); return 1; } /* Everything went fine. */ return 0; } Index: ossp-pkg/srpc/libxds/xdr-encode-int.c ============================================================ $ cvs diff -u -r1.1 -r1.2 xdr-encode-int.c --- ossp-pkg/srpc/libxds/xdr-encode-int.c 2001/07/18 11:30:19 1.1 +++ ossp-pkg/srpc/libxds/xdr-encode-int.c 2001/07/18 16:59:27 1.2 @@ -89,3 +89,73 @@ return 4; } + +int xdr_encode_int64(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) + { + /* Consistency checks. */ + + assert(xds != NULL); + assert(buffer != NULL); + assert(buffer_size != 0); + assert(args != NULL); + if (xds == NULL || buffer == NULL || buffer_size == 0 || args == NULL) + return XDS_ERR_INVALID_ARG; + + /* Get value and format it into the buffer. */ + + if (buffer_size >= 8) + { + u_int64_t tmp; + int64_t value = va_arg(*args, u_int64_t); + if (value < 0) + { + value = 0 - value; + tmp = 0 - (u_int64_t)value; + } + else + tmp = (u_int64_t)value; + ((u_int8_t*)buffer)[0] = (tmp >> 56) & 0x000000ff; + ((u_int8_t*)buffer)[1] = (tmp >> 48) & 0x000000ff; + ((u_int8_t*)buffer)[2] = (tmp >> 40) & 0x000000ff; + ((u_int8_t*)buffer)[3] = (tmp >> 32) & 0x000000ff; + ((u_int8_t*)buffer)[4] = (tmp >> 24) & 0x000000ff; + ((u_int8_t*)buffer)[5] = (tmp >> 16) & 0x000000ff; + ((u_int8_t*)buffer)[6] = (tmp >> 8) & 0x000000ff; + ((u_int8_t*)buffer)[7] = (tmp >> 0) & 0x000000ff; + } + + /* Done. */ + + return 8; + } + +int xdr_encode_uint64(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) + { + /* Consistency checks. */ + + assert(xds != NULL); + assert(buffer != NULL); + assert(buffer_size != 0); + assert(args != NULL); + if (xds == NULL || buffer == NULL || buffer_size == 0 || args == NULL) + return XDS_ERR_INVALID_ARG; + + /* Get value and format it into the buffer. */ + + if (buffer_size >= 8) + { + u_int64_t value = va_arg(*args, u_int64_t); + ((u_int8_t*)buffer)[0] = (value >> 56) & 0x000000ff; + ((u_int8_t*)buffer)[1] = (value >> 48) & 0x000000ff; + ((u_int8_t*)buffer)[2] = (value >> 40) & 0x000000ff; + ((u_int8_t*)buffer)[3] = (value >> 32) & 0x000000ff; + ((u_int8_t*)buffer)[4] = (value >> 24) & 0x000000ff; + ((u_int8_t*)buffer)[5] = (value >> 16) & 0x000000ff; + ((u_int8_t*)buffer)[6] = (value >> 8) & 0x000000ff; + ((u_int8_t*)buffer)[7] = (value >> 0) & 0x000000ff; + } + + /* Done. */ + + return 8; + } Index: ossp-pkg/srpc/libxds/xds.h ============================================================ $ cvs diff -u -r1.17 -r1.18 xds.h --- ossp-pkg/srpc/libxds/xds.h 2001/07/18 11:30:19 1.17 +++ ossp-pkg/srpc/libxds/xds.h 2001/07/18 16:59:27 1.18 @@ -72,5 +72,7 @@ int xdr_encode_uint32(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); int xdr_encode_int32(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); +int xdr_encode_uint64(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); +int xdr_encode_int64(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); #endif /* !defined(__LIBXDS_H__) */ From ossp-cvs-owner@ossp.org Wed Jul 18 19:37:51 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f6IHboC09095; Wed, 18 Jul 2001 19:37:50 +0200 (CEST) Date: Wed, 18 Jul 2001 19:37:50 +0200 (CEST) Message-Id: <200107181737.f6IHboC09095@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds/regression-tests xds-decode.c xds-enc... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 18-Jul-2001 19:37:50 Branch: HEAD Handle: 2001071818374900 Modified files: ossp-pkg/srpc/libxds/regression-tests xds-decode.c xds-encode.c xds-setbuffer.c Log: Since args is a pointer now, let the engine check that it does not get passed NULL here. Summary: Revision Changes Path 1.3 +5 -0 ossp-pkg/srpc/libxds/regression-tests/xds-decode.c 1.5 +5 -0 ossp-pkg/srpc/libxds/regression-tests/xds-encode.c 1.2 +1 -0 ossp-pkg/srpc/libxds/regression-tests/xds-setbuffer.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/regression-tests/xds-decode.c ============================================================ $ cvs diff -u -r1.2 -r1.3 xds-decode.c --- ossp-pkg/srpc/libxds/regression-tests/xds-decode.c 2001/07/16 17:50:08 1.2 +++ ossp-pkg/srpc/libxds/regression-tests/xds-decode.c 2001/07/18 17:37:49 1.3 @@ -51,6 +51,11 @@ printf("Buffer size passed to engine is zero!\n"); exit(1); } + if (args == NULL) + { + printf("args pointer passed to engine is NULL!\n"); + exit(1); + } if (strncmp(buffer, "Hallo!", 6) != 0) { printf("The contents of the decode buffer are not what we expected.\n"); Index: ossp-pkg/srpc/libxds/regression-tests/xds-encode.c ============================================================ $ cvs diff -u -r1.4 -r1.5 xds-encode.c --- ossp-pkg/srpc/libxds/regression-tests/xds-encode.c 2001/07/16 17:50:08 1.4 +++ ossp-pkg/srpc/libxds/regression-tests/xds-encode.c 2001/07/18 17:37:49 1.5 @@ -51,6 +51,11 @@ printf("Buffer size passed to engine is zero!\n"); exit(1); } + if (args == NULL) + { + printf("args pointer passed to engine is NULL!\n"); + exit(1); + } strncpy(buffer, "Hallo ", buffer_size); return 6; } Index: ossp-pkg/srpc/libxds/regression-tests/xds-setbuffer.c ============================================================ $ cvs diff -u -r1.1 -r1.2 xds-setbuffer.c --- ossp-pkg/srpc/libxds/regression-tests/xds-setbuffer.c 2001/07/16 18:38:53 1.1 +++ ossp-pkg/srpc/libxds/regression-tests/xds-setbuffer.c 2001/07/18 17:37:49 1.2 @@ -35,6 +35,7 @@ assert(xds != NULL); assert(buffer != NULL); assert(buffer_size != 0); + assert(args != NULL); if (buffer_size >= 64) memset(buffer, 'a', 64); return 64; From ossp-cvs-owner@ossp.org Wed Jul 18 19:38:39 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f6IHccT09207; Wed, 18 Jul 2001 19:38:38 +0200 (CEST) Date: Wed, 18 Jul 2001 19:38:38 +0200 (CEST) Message-Id: <200107181738.f6IHccT09207@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds/regression-tests Makefile xds-engine-... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 18-Jul-2001 19:38:38 Branch: HEAD Handle: 2001071818383700 Added files: ossp-pkg/srpc/libxds/regression-tests xds-engine-restart.c Modified files: ossp-pkg/srpc/libxds vencode.c ossp-pkg/srpc/libxds/regression-tests Makefile Log: When an engine is restarted after buffer enlargement, the original value of the ap_list must be restored. Fixed that bug and added a test suite that verifies this behavior. Summary: Revision Changes Path 1.13 +1 -1 ossp-pkg/srpc/libxds/regression-tests/Makefile 1.1 +111 -0 ossp-pkg/srpc/libxds/regression-tests/xds-engine-restart.c 1.8 +5 -0 ossp-pkg/srpc/libxds/vencode.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/regression-tests/Makefile ============================================================ $ cvs diff -u -r1.12 -r1.13 Makefile --- ossp-pkg/srpc/libxds/regression-tests/Makefile 2001/07/18 16:59:28 1.12 +++ ossp-pkg/srpc/libxds/regression-tests/Makefile 2001/07/18 17:38:37 1.13 @@ -11,7 +11,7 @@ LDFLAGS = -L.. TESTS = xds-core.exe xds-find-engine.exe xds-register.exe xds-encode.exe \ - xds-getbuffer.exe xds-decode.exe xds-setbuffer.exe \ + xds-getbuffer.exe xds-decode.exe xds-setbuffer.exe xds-engine-restart.exe \ xdr-uint32.exe xdr-int32.exe xdr-uint64.exe xdr-int64.exe .SUFFIXES: Index: ossp-pkg/srpc/libxds/regression-tests/xds-engine-restart.c ============================================================ $ cvs update -p -r1.1 xds-engine-restart.c /* XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) This file is part of OSSP XDS, an extensible data serialization library which can be found at http://www.ossp.com/pkg/xds/. 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. */ #include #include #include "../internal.h" static int dummy_engine(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) { if (xds == NULL) { printf("XDS context isn't passed through to registered engine.\n"); exit(1); } if (engine_context != (void*)42) { printf("Engine context isn't passed through to registered engine.\n"); exit(1); } if (buffer == NULL) { printf("Buffer passed to engine is NULL.\n"); exit(1); } if (buffer_size == 0) { printf("Buffer size passed to engine is zero!\n"); exit(1); } if (args == NULL) { printf("args pointer passed to engine is NULL!\n"); exit(1); } if (va_arg(*args, int) != 42) { printf("The varadic argument is not what the engine expected!\n"); exit(1); } return 64; } int main() { xds_t* xds; char* buffer; size_t buffer_size; /* Create an XDS context and set a buffer that's too small for the first encode() call. Then call encode() with two parameters: the one the engine is expecting and a different one after that. The engine will complain if it sees the second value -- what would mean that the args parameter was not resetted to the original value before the engine is restarted after buffer enlargement. */ xds = xds_init(XDS_ENCODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); return 1; } if (xds_register(xds, "int", &dummy_engine, (void*)42) != XDS_OK) { printf("Failed to register my encoding engines.\n"); return 1; } buffer = malloc(32); if (buffer == NULL) { printf("malloc() failed!\n"); return 1; } buffer_size = 32; if (xds_setbuffer(xds, XDS_GIFT, buffer, buffer_size) != XDS_OK) { printf("xds_setbuffer() failed!\n"); return 1; } if (xds_encode(xds, "int", 42, 13) != XDS_OK) { printf("xds_encode() failed!"); return 1; } xds_destroy(xds); return 0; } Index: ossp-pkg/srpc/libxds/vencode.c ============================================================ $ cvs diff -u -r1.7 -r1.8 vencode.c --- ossp-pkg/srpc/libxds/vencode.c 2001/07/16 18:31:36 1.7 +++ ossp-pkg/srpc/libxds/vencode.c 2001/07/18 17:38:37 1.8 @@ -34,6 +34,7 @@ int xds_vencode(xds_t* xds, const char* fmt_arg, va_list args) { + va_list args_backup; char* name; char* p; char* fmt; @@ -111,6 +112,7 @@ do { printf("Executing engine '%s' ...\n", name); + args_backup = args; rc = (*xds->engines[pos].engine)(xds, xds->engines[pos].context, xds->buffer + xds->buffer_len, @@ -123,7 +125,10 @@ int rc2; if (rc > xds->buffer_capacity - xds->buffer_len) + { restart_engine = (1==1); + args = args_backup; + } else restart_engine = (1!=1); From ossp-cvs-owner@ossp.org Wed Jul 18 19:49:53 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f6IHnqD10528; Wed, 18 Jul 2001 19:49:52 +0200 (CEST) Date: Wed, 18 Jul 2001 19:49:52 +0200 (CEST) Message-Id: <200107181749.f6IHnqD10528@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds find-engine.c internal.h setbuffer.c ... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 18-Jul-2001 19:49:52 Branch: HEAD Handle: 2001071818495100 Modified files: ossp-pkg/srpc/libxds find-engine.c internal.h setbuffer.c vencode.c Log: Added XDS_TRUE and XDS_FALSE defines and started using them in the sources. Summary: Revision Changes Path 1.3 +2 -2 ossp-pkg/srpc/libxds/find-engine.c 1.6 +3 -0 ossp-pkg/srpc/libxds/internal.h 1.5 +2 -2 ossp-pkg/srpc/libxds/setbuffer.c 1.9 +4 -4 ossp-pkg/srpc/libxds/vencode.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/find-engine.c ============================================================ $ cvs diff -u -r1.2 -r1.3 find-engine.c --- ossp-pkg/srpc/libxds/find-engine.c 2001/07/08 15:22:00 1.2 +++ ossp-pkg/srpc/libxds/find-engine.c 2001/07/18 17:49:51 1.3 @@ -53,7 +53,7 @@ else if(rc == 0) { /* found it */ *pos = half; - return (1 == 1); + return XDS_TRUE; } else { @@ -63,5 +63,5 @@ } *pos = first; - return (1 != 1); + return XDS_FALSE; } Index: ossp-pkg/srpc/libxds/internal.h ============================================================ $ cvs diff -u -r1.5 -r1.6 internal.h --- ossp-pkg/srpc/libxds/internal.h 2001/07/09 17:21:36 1.5 +++ ossp-pkg/srpc/libxds/internal.h 2001/07/18 17:49:51 1.6 @@ -32,6 +32,9 @@ #include "xds.h" +#define XDS_TRUE (1==1) +#define XDS_FALSE (1!=1) + #define XDS_INITIAL_BUFFER_CAPACITY 512 #define XDS_INITIAL_ENGINES_CAPACITY 32 Index: ossp-pkg/srpc/libxds/setbuffer.c ============================================================ $ cvs diff -u -r1.4 -r1.5 setbuffer.c --- ossp-pkg/srpc/libxds/setbuffer.c 2001/07/09 19:20:58 1.4 +++ ossp-pkg/srpc/libxds/setbuffer.c 2001/07/18 17:49:51 1.5 @@ -52,13 +52,13 @@ xds->buffer_capacity = 0; else xds->buffer_capacity = buffer_len; - xds->we_own_buffer = (1==1); + xds->we_own_buffer = XDS_TRUE; } else { xds->buffer = buffer; xds->buffer_capacity = buffer_len; - xds->we_own_buffer = (1!=1); + xds->we_own_buffer = XDS_FALSE; } return XDS_OK; Index: ossp-pkg/srpc/libxds/vencode.c ============================================================ $ cvs diff -u -r1.8 -r1.9 vencode.c --- ossp-pkg/srpc/libxds/vencode.c 2001/07/18 17:38:37 1.8 +++ ossp-pkg/srpc/libxds/vencode.c 2001/07/18 17:49:51 1.9 @@ -64,7 +64,7 @@ return rc; printf("Setting up buffer with capacity %d byte.\n", xds->buffer_capacity); xds->buffer_len = 0; - xds->we_own_buffer = (1==1); + xds->we_own_buffer = XDS_FALSE; } /* Ensure the buffer has free space. */ @@ -126,11 +126,11 @@ if (rc > xds->buffer_capacity - xds->buffer_len) { - restart_engine = (1==1); + restart_engine = XDS_TRUE; args = args_backup; } else - restart_engine = (1!=1); + restart_engine = XDS_FALSE; if (!xds->we_own_buffer) { @@ -153,7 +153,7 @@ } else { - restart_engine = (1!=1); + restart_engine = XDS_FALSE; xds->buffer_len += rc; } } From ossp-cvs-owner@ossp.org Wed Jul 18 20:26:35 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f6IIQYT14874; Wed, 18 Jul 2001 20:26:34 +0200 (CEST) Date: Wed, 18 Jul 2001 20:26:34 +0200 (CEST) Message-Id: <200107181826.f6IIQYT14874@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds Makefile ossp-pkg/srpc/libxds/regress... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 18-Jul-2001 20:26:34 Branch: HEAD Handle: 2001071819263201 Added files: ossp-pkg/srpc/libxds xdr-decode-int.c Modified files: ossp-pkg/srpc/libxds Makefile xds.h ossp-pkg/srpc/libxds/regression-tests xdr-int32.c xdr-int64.c xdr-uint32.c xdr-uint64.c Log: Implemented decoding engines for the integer data types and extended the existing test suites to verify them. Summary: Revision Changes Path 1.15 +3 -2 ossp-pkg/srpc/libxds/Makefile 1.2 +36 -0 ossp-pkg/srpc/libxds/regression-tests/xdr-int32.c 1.2 +36 -0 ossp-pkg/srpc/libxds/regression-tests/xdr-int64.c 1.2 +36 -0 ossp-pkg/srpc/libxds/regression-tests/xdr-uint32.c 1.2 +36 -0 ossp-pkg/srpc/libxds/regression-tests/xdr-uint64.c 1.1 +183 -0 ossp-pkg/srpc/libxds/xdr-decode-int.c 1.19 +5 -0 ossp-pkg/srpc/libxds/xds.h ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/Makefile ============================================================ $ cvs diff -u -r1.14 -r1.15 Makefile --- ossp-pkg/srpc/libxds/Makefile 2001/07/18 11:30:19 1.14 +++ ossp-pkg/srpc/libxds/Makefile 2001/07/18 18:26:32 1.15 @@ -5,7 +5,8 @@ AR = ar RANLIB = ranlib -WARNFLAGS = -Wall -ansi -pedantic -Wshadow -Wpointer-arith -Wcast-align -Winline -Wmissing-prototypes -Wmissing-declarations -Wnested-externs +WARNFLAGS = -Wall -ansi -pedantic -Wshadow -Wpointer-arith -Wcast-align -Winline -Wmissing-prototypes \ + -Wmissing-declarations -Wnested-externs OPTFLAGS = -O3 -pipe CPPFLAGS = -D_GNU_SOURCE @@ -15,7 +16,7 @@ OBJS = decode.o destroy.o encode.o getbuffer.o init.o register.o \ setbuffer.o unregister.o vdecode.o vencode.o find-engine.o \ - set-capacity.o xdr-encode-int.o + set-capacity.o xdr-encode-int.o xdr-decode-int.o .c.o: $(CC) $(CPPFLAGS) $(WARNFLAGS) $(OPTFLAGS) $(CFLAGS) -c $< Index: ossp-pkg/srpc/libxds/regression-tests/xdr-int32.c ============================================================ $ cvs diff -u -r1.1 -r1.2 xdr-int32.c --- ossp-pkg/srpc/libxds/regression-tests/xdr-int32.c 2001/07/18 11:29:46 1.1 +++ ossp-pkg/srpc/libxds/regression-tests/xdr-int32.c 2001/07/18 18:26:33 1.2 @@ -102,6 +102,42 @@ return 1; } + /* Now we decode the values again using the XDS implementation and + compare them to our original values. Obviously, they should not + differ. */ + + xds = xds_init(XDS_DECODE); + if (xds == NULL) + { + printf("Failed to initialize XDS context.\n"); + return 1; + } + if (xds_register(xds, "int", &xdr_decode_int32, NULL) != XDS_OK) + { + printf("Failed to register my decoding engines.\n"); + return 1; + } + if (xds_setbuffer(xds, XDS_GIFT, xds_buf, xds_buf_size) != XDS_OK) + { + printf("setbuffer() failed.\n"); + return 1; + } + for (i = 0; i < sizeof(values)/sizeof(int32_t); ++i) + { + int32_t tmp; + if (xds_decode(xds, "int", &tmp) != XDS_OK) + { + printf("xds_encode() failed for the %d value!", i); + return 1; + } + if (values[i] != tmp) + { + printf("The %dth value has not been decoded correctly!", i); + return 1; + } + } + xds_destroy(xds); + /* Everything went fine. */ return 0; Index: ossp-pkg/srpc/libxds/regression-tests/xdr-int64.c ============================================================ $ cvs diff -u -r1.1 -r1.2 xdr-int64.c --- ossp-pkg/srpc/libxds/regression-tests/xdr-int64.c 2001/07/18 16:59:28 1.1 +++ ossp-pkg/srpc/libxds/regression-tests/xdr-int64.c 2001/07/18 18:26:33 1.2 @@ -102,6 +102,42 @@ return 1; } + /* Now we decode the values again using the XDS implementation and + compare them to our original values. Obviously, they should not + differ. */ + + xds = xds_init(XDS_DECODE); + if (xds == NULL) + { + printf("Failed to initialize XDS context.\n"); + return 1; + } + if (xds_register(xds, "int", &xdr_decode_int64, NULL) != XDS_OK) + { + printf("Failed to register my decoding engines.\n"); + return 1; + } + if (xds_setbuffer(xds, XDS_GIFT, xds_buf, xds_buf_size) != XDS_OK) + { + printf("setbuffer() failed.\n"); + return 1; + } + for (i = 0; i < sizeof(values)/sizeof(int64_t); ++i) + { + int64_t tmp; + if (xds_decode(xds, "int", &tmp) != XDS_OK) + { + printf("xds_encode() failed for the %d value!", i); + return 1; + } + if (values[i] != tmp) + { + printf("The %dth value has not been decoded correctly!", i); + return 1; + } + } + xds_destroy(xds); + /* Everything went fine. */ return 0; Index: ossp-pkg/srpc/libxds/regression-tests/xdr-uint32.c ============================================================ $ cvs diff -u -r1.1 -r1.2 xdr-uint32.c --- ossp-pkg/srpc/libxds/regression-tests/xdr-uint32.c 2001/07/18 11:29:46 1.1 +++ ossp-pkg/srpc/libxds/regression-tests/xdr-uint32.c 2001/07/18 18:26:33 1.2 @@ -101,6 +101,42 @@ return 1; } + /* Now we decode the values again using the XDS implementation and + compare them to our original values. Obviously, they should not + differ. */ + + xds = xds_init(XDS_DECODE); + if (xds == NULL) + { + printf("Failed to initialize XDS context.\n"); + return 1; + } + if (xds_register(xds, "uint", &xdr_decode_uint32, NULL) != XDS_OK) + { + printf("Failed to register my decoding engines.\n"); + return 1; + } + if (xds_setbuffer(xds, XDS_GIFT, xds_buf, xds_buf_size) != XDS_OK) + { + printf("setbuffer() failed.\n"); + return 1; + } + for (i = 0; i < sizeof(values)/sizeof(u_int32_t); ++i) + { + u_int32_t tmp; + if (xds_decode(xds, "uint", &tmp) != XDS_OK) + { + printf("xds_encode() failed for the %d value!", i); + return 1; + } + if (values[i] != tmp) + { + printf("The %dth value has not been decoded correctly!", i); + return 1; + } + } + xds_destroy(xds); + /* Everything went fine. */ return 0; Index: ossp-pkg/srpc/libxds/regression-tests/xdr-uint64.c ============================================================ $ cvs diff -u -r1.1 -r1.2 xdr-uint64.c --- ossp-pkg/srpc/libxds/regression-tests/xdr-uint64.c 2001/07/18 16:59:28 1.1 +++ ossp-pkg/srpc/libxds/regression-tests/xdr-uint64.c 2001/07/18 18:26:33 1.2 @@ -101,6 +101,42 @@ return 1; } + /* Now we decode the values again using the XDS implementation and + compare them to our original values. Obviously, they should not + differ. */ + + xds = xds_init(XDS_DECODE); + if (xds == NULL) + { + printf("Failed to initialize XDS context.\n"); + return 1; + } + if (xds_register(xds, "uint", &xdr_decode_uint64, NULL) != XDS_OK) + { + printf("Failed to register my decoding engines.\n"); + return 1; + } + if (xds_setbuffer(xds, XDS_GIFT, xds_buf, xds_buf_size) != XDS_OK) + { + printf("setbuffer() failed.\n"); + return 1; + } + for (i = 0; i < sizeof(values)/sizeof(u_int64_t); ++i) + { + u_int64_t tmp; + if (xds_decode(xds, "uint", &tmp) != XDS_OK) + { + printf("xds_encode() failed for the %d value!", i); + return 1; + } + if (values[i] != tmp) + { + printf("The %dth value has not been decoded correctly!", i); + return 1; + } + } + xds_destroy(xds); + /* Everything went fine. */ return 0; Index: ossp-pkg/srpc/libxds/xdr-decode-int.c ============================================================ $ cvs update -p -r1.1 xdr-decode-int.c /* XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) This file is part of OSSP XDS, an extensible data serialization library which can be found at http://www.ossp.com/pkg/xds/. 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. */ #include #include "internal.h" int xdr_decode_int32(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) { int32_t* value; u_int32_t tmp; /* Consistency checks. */ assert(xds != NULL); assert(buffer != NULL); assert(args != NULL); if (xds == NULL || buffer == NULL || buffer_size == 0 || args == NULL) return XDS_ERR_INVALID_ARG; if (buffer_size < 4) return XDS_ERR_UNDERFLOW; /* Get value and format it into the buffer. */ value = va_arg(*args, int32_t*); assert(value != NULL); if (((u_int8_t*)buffer)[0] & 0x80) { /* negative number */ tmp = ((u_int8_t*)buffer)[0]; tmp = tmp << 8; tmp += ((u_int8_t*)buffer)[1]; tmp = tmp << 8; tmp += ((u_int8_t*)buffer)[2]; tmp = tmp << 8; tmp += ((u_int8_t*)buffer)[3]; tmp = 0 - tmp; *value = 0 - (int32_t)tmp; } else { /* positive number */ *value = ((u_int8_t*)buffer)[0]; *value = *value << 8; *value += ((u_int8_t*)buffer)[1]; *value = *value << 8; *value += ((u_int8_t*)buffer)[2]; *value = *value << 8; *value += ((u_int8_t*)buffer)[3]; } /* Done. */ return 4; } int xdr_decode_uint32(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) { u_int32_t* value; /* Consistency checks. */ assert(xds != NULL); assert(buffer != NULL); assert(args != NULL); if (xds == NULL || buffer == NULL || buffer_size == 0 || args == NULL) return XDS_ERR_INVALID_ARG; if (buffer_size < 4) return XDS_ERR_UNDERFLOW; /* Get value and format it into the buffer. */ value = va_arg(*args, u_int32_t*); assert(value != NULL); *value = ((u_int8_t*)buffer)[0]; *value = *value << 8; *value += ((u_int8_t*)buffer)[1]; *value = *value << 8; *value += ((u_int8_t*)buffer)[2]; *value = *value << 8; *value += ((u_int8_t*)buffer)[3]; /* Done. */ return 4; } int xdr_decode_int64(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) { int64_t* value; u_int64_t tmp; /* Consistency checks. */ assert(xds != NULL); assert(buffer != NULL); assert(args != NULL); if (xds == NULL || buffer == NULL || buffer_size == 0 || args == NULL) return XDS_ERR_INVALID_ARG; if (buffer_size < 8) return XDS_ERR_UNDERFLOW; /* Get value and format it into the buffer. */ value = va_arg(*args, int64_t*); assert(value != NULL); if (((u_int8_t*)buffer)[0] & 0x80) { /* negative number */ tmp = ((u_int8_t*)buffer)[0]; tmp = tmp << 8; tmp += ((u_int8_t*)buffer)[1]; tmp = tmp << 8; tmp += ((u_int8_t*)buffer)[2]; tmp = tmp << 8; tmp += ((u_int8_t*)buffer)[3]; tmp = tmp << 8; tmp += ((u_int8_t*)buffer)[4]; tmp = tmp << 8; tmp += ((u_int8_t*)buffer)[5]; tmp = tmp << 8; tmp += ((u_int8_t*)buffer)[6]; tmp = tmp << 8; tmp += ((u_int8_t*)buffer)[7]; tmp = 0 - tmp; *value = 0 - (int64_t)tmp; } else { /* positive number */ *value = ((u_int8_t*)buffer)[0]; *value = *value << 8; *value += ((u_int8_t*)buffer)[1]; *value = *value << 8; *value += ((u_int8_t*)buffer)[2]; *value = *value << 8; *value += ((u_int8_t*)buffer)[3]; *value = *value << 8; *value += ((u_int8_t*)buffer)[4]; *value = *value << 8; *value += ((u_int8_t*)buffer)[5]; *value = *value << 8; *value += ((u_int8_t*)buffer)[6]; *value = *value << 8; *value += ((u_int8_t*)buffer)[7]; } /* Done. */ return 8; } int xdr_decode_uint64(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) { u_int64_t* value; /* Consistency checks. */ assert(xds != NULL); assert(buffer != NULL); assert(args != NULL); if (xds == NULL || buffer == NULL || buffer_size == 0 || args == NULL) return XDS_ERR_INVALID_ARG; if (buffer_size < 8) return XDS_ERR_UNDERFLOW; /* Get value and format it into the buffer. */ value = va_arg(*args, u_int64_t*); assert(value != NULL); *value = ((u_int8_t*)buffer)[0]; *value = *value << 8; *value += ((u_int8_t*)buffer)[1]; *value = *value << 8; *value += ((u_int8_t*)buffer)[2]; *value = *value << 8; *value += ((u_int8_t*)buffer)[3]; *value = *value << 8; *value += ((u_int8_t*)buffer)[4]; *value = *value << 8; *value += ((u_int8_t*)buffer)[5]; *value = *value << 8; *value += ((u_int8_t*)buffer)[6]; *value = *value << 8; *value += ((u_int8_t*)buffer)[7]; /* Done. */ return 8; } Index: ossp-pkg/srpc/libxds/xds.h ============================================================ $ cvs diff -u -r1.18 -r1.19 xds.h --- ossp-pkg/srpc/libxds/xds.h 2001/07/18 16:59:27 1.18 +++ ossp-pkg/srpc/libxds/xds.h 2001/07/18 18:26:32 1.19 @@ -75,4 +75,9 @@ int xdr_encode_uint64(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); int xdr_encode_int64(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); +int xdr_decode_uint32(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); +int xdr_decode_int32(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); +int xdr_decode_uint64(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); +int xdr_decode_int64(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); + #endif /* !defined(__LIBXDS_H__) */ From ossp-cvs-owner@ossp.org Wed Jul 18 20:58:48 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f6IIwlh18883; Wed, 18 Jul 2001 20:58:47 +0200 (CEST) Date: Wed, 18 Jul 2001 20:58:47 +0200 (CEST) Message-Id: <200107181858.f6IIwlh18883@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds/regression-tests xdr-int32.c xdr-int6... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 18-Jul-2001 20:58:47 Branch: HEAD Handle: 2001071819584600 Modified files: ossp-pkg/srpc/libxds/regression-tests xdr-int32.c xdr-int64.c xdr-uint32.c xdr-uint64.c Log: Added missing linefeed at the end of printf() output. Summary: Revision Changes Path 1.3 +3 -3 ossp-pkg/srpc/libxds/regression-tests/xdr-int32.c 1.3 +3 -3 ossp-pkg/srpc/libxds/regression-tests/xdr-int64.c 1.3 +3 -3 ossp-pkg/srpc/libxds/regression-tests/xdr-uint32.c 1.3 +3 -3 ossp-pkg/srpc/libxds/regression-tests/xdr-uint64.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/regression-tests/xdr-int32.c ============================================================ $ cvs diff -u -r1.2 -r1.3 xdr-int32.c --- ossp-pkg/srpc/libxds/regression-tests/xdr-int32.c 2001/07/18 18:26:33 1.2 +++ ossp-pkg/srpc/libxds/regression-tests/xdr-int32.c 2001/07/18 18:58:46 1.3 @@ -78,7 +78,7 @@ { if (xds_encode(xds, "int", values[i]) != XDS_OK) { - printf("xds_encode(values[%d]) failed!", i); + printf("xds_encode(values[%d]) failed!\n", i); return 1; } } @@ -127,12 +127,12 @@ int32_t tmp; if (xds_decode(xds, "int", &tmp) != XDS_OK) { - printf("xds_encode() failed for the %d value!", i); + printf("xds_encode() failed for the %d value!\n", i); return 1; } if (values[i] != tmp) { - printf("The %dth value has not been decoded correctly!", i); + printf("The %dth value has not been decoded correctly!\n", i); return 1; } } Index: ossp-pkg/srpc/libxds/regression-tests/xdr-int64.c ============================================================ $ cvs diff -u -r1.2 -r1.3 xdr-int64.c --- ossp-pkg/srpc/libxds/regression-tests/xdr-int64.c 2001/07/18 18:26:33 1.2 +++ ossp-pkg/srpc/libxds/regression-tests/xdr-int64.c 2001/07/18 18:58:46 1.3 @@ -78,7 +78,7 @@ { if (xds_encode(xds, "int", values[i]) != XDS_OK) { - printf("xds_encode(values[%d]) failed!", i); + printf("xds_encode(values[%d]) failed!\n", i); return 1; } } @@ -127,12 +127,12 @@ int64_t tmp; if (xds_decode(xds, "int", &tmp) != XDS_OK) { - printf("xds_encode() failed for the %d value!", i); + printf("xds_encode() failed for the %d value!\n", i); return 1; } if (values[i] != tmp) { - printf("The %dth value has not been decoded correctly!", i); + printf("The %dth value has not been decoded correctly!\n", i); return 1; } } Index: ossp-pkg/srpc/libxds/regression-tests/xdr-uint32.c ============================================================ $ cvs diff -u -r1.2 -r1.3 xdr-uint32.c --- ossp-pkg/srpc/libxds/regression-tests/xdr-uint32.c 2001/07/18 18:26:33 1.2 +++ ossp-pkg/srpc/libxds/regression-tests/xdr-uint32.c 2001/07/18 18:58:46 1.3 @@ -77,7 +77,7 @@ { if (xds_encode(xds, "uint", values[i]) != XDS_OK) { - printf("xds_encode(values[%d]) failed!", i); + printf("xds_encode(values[%d]) failed!\n", i); return 1; } } @@ -126,12 +126,12 @@ u_int32_t tmp; if (xds_decode(xds, "uint", &tmp) != XDS_OK) { - printf("xds_encode() failed for the %d value!", i); + printf("xds_encode() failed for the %d value!\n", i); return 1; } if (values[i] != tmp) { - printf("The %dth value has not been decoded correctly!", i); + printf("The %dth value has not been decoded correctly!\n", i); return 1; } } Index: ossp-pkg/srpc/libxds/regression-tests/xdr-uint64.c ============================================================ $ cvs diff -u -r1.2 -r1.3 xdr-uint64.c --- ossp-pkg/srpc/libxds/regression-tests/xdr-uint64.c 2001/07/18 18:26:33 1.2 +++ ossp-pkg/srpc/libxds/regression-tests/xdr-uint64.c 2001/07/18 18:58:46 1.3 @@ -77,7 +77,7 @@ { if (xds_encode(xds, "uint", values[i]) != XDS_OK) { - printf("xds_encode(values[%d]) failed!", i); + printf("xds_encode(values[%d]) failed!\n", i); return 1; } } @@ -126,12 +126,12 @@ u_int64_t tmp; if (xds_decode(xds, "uint", &tmp) != XDS_OK) { - printf("xds_encode() failed for the %d value!", i); + printf("xds_encode() failed for the %d value!\n", i); return 1; } if (values[i] != tmp) { - printf("The %dth value has not been decoded correctly!", i); + printf("The %dth value has not been decoded correctly!\n", i); return 1; } } From ossp-cvs-owner@ossp.org Wed Jul 18 21:00:42 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f6IJ0eL19398; Wed, 18 Jul 2001 21:00:40 +0200 (CEST) Date: Wed, 18 Jul 2001 21:00:40 +0200 (CEST) Message-Id: <200107181900.f6IJ0eL19398@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds/regression-tests xds-getbuffer.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 18-Jul-2001 21:00:40 Branch: HEAD Handle: 2001071820004000 Modified files: ossp-pkg/srpc/libxds/regression-tests xds-getbuffer.c Log: Added missing linefeed at the end of printf() output. Summary: Revision Changes Path 1.4 +8 -8 ossp-pkg/srpc/libxds/regression-tests/xds-getbuffer.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/regression-tests/xds-getbuffer.c ============================================================ $ cvs diff -u -r1.3 -r1.4 xds-getbuffer.c --- ossp-pkg/srpc/libxds/regression-tests/xds-getbuffer.c 2001/07/16 17:50:08 1.3 +++ ossp-pkg/srpc/libxds/regression-tests/xds-getbuffer.c 2001/07/18 19:00:40 1.4 @@ -67,22 +67,22 @@ if (xds_encode(xds, "text text") != XDS_OK) { - printf("xds_encode() failed!"); + printf("xds_encode() failed!\n"); return 1; } if (xds_getbuffer(xds, XDS_GIFT, (void**)&old, &old_len) != XDS_OK) { - printf("xds_getbuffer() failed for the first buffer!"); + printf("xds_getbuffer() failed for the first buffer!\n"); return 1; } if (xds_encode(xds, "text") != XDS_OK) { - printf("xds_encode() failed!"); + printf("xds_encode() failed!\n"); return 1; } if (xds_getbuffer(xds, XDS_GIFT, (void**)&new, &new_len) != XDS_OK) { - printf("xds_getbuffer() failed for the second buffer!"); + printf("xds_getbuffer() failed for the second buffer!\n"); return 1; } if ((strcmp(old, "Hallo!Hallo!") != 0 || old_len != 12) && @@ -100,12 +100,12 @@ if (xds_encode(xds, "text text") != XDS_OK) { - printf("xds_encode() failed!"); + printf("xds_encode() failed!\n"); return 1; } if (xds_getbuffer(xds, XDS_LOAN, (void**)&old, &old_len) != XDS_OK) { - printf("xds_getbuffer() failed for the first buffer!"); + printf("xds_getbuffer() failed for the first buffer!\n"); return 1; } if (strcmp(old, "Hallo!Hallo!") != 0 || old_len != 12) @@ -115,12 +115,12 @@ } if (xds_encode(xds, "text") != XDS_OK) { - printf("xds_encode() failed!"); + printf("xds_encode() failed!\n"); return 1; } if (xds_getbuffer(xds, XDS_LOAN, (void**)&new, &new_len) != XDS_OK) { - printf("xds_getbuffer() failed for the second buffer!"); + printf("xds_getbuffer() failed for the second buffer!\n"); return 1; } if (old != new) From ossp-cvs-owner@ossp.org Wed Jul 18 21:03:19 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f6IJ3If19598; Wed, 18 Jul 2001 21:03:18 +0200 (CEST) Date: Wed, 18 Jul 2001 21:03:18 +0200 (CEST) Message-Id: <200107181903.f6IJ3If19598@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds/regression-tests Makefile xds-mystruc... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 18-Jul-2001 21:03:18 Branch: HEAD Handle: 2001071820031700 Added files: ossp-pkg/srpc/libxds/regression-tests xds-mystruct.c Modified files: ossp-pkg/srpc/libxds/regression-tests Makefile Log: Added test suite that will verify that it is okay to call xds_encode() in an encoding engine and xds_decode() in a decoding engine. Summary: Revision Changes Path 1.14 +2 -1 ossp-pkg/srpc/libxds/regression-tests/Makefile 1.1 +165 -0 ossp-pkg/srpc/libxds/regression-tests/xds-mystruct.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/regression-tests/Makefile ============================================================ $ cvs diff -u -r1.13 -r1.14 Makefile --- ossp-pkg/srpc/libxds/regression-tests/Makefile 2001/07/18 17:38:37 1.13 +++ ossp-pkg/srpc/libxds/regression-tests/Makefile 2001/07/18 19:03:17 1.14 @@ -12,7 +12,8 @@ TESTS = xds-core.exe xds-find-engine.exe xds-register.exe xds-encode.exe \ xds-getbuffer.exe xds-decode.exe xds-setbuffer.exe xds-engine-restart.exe \ - xdr-uint32.exe xdr-int32.exe xdr-uint64.exe xdr-int64.exe + xdr-uint32.exe xdr-int32.exe xdr-uint64.exe xdr-int64.exe \ + xds-mystruct.exe .SUFFIXES: .SUFFIXES: .c .exe Index: ossp-pkg/srpc/libxds/regression-tests/xds-mystruct.c ============================================================ $ cvs update -p -r1.1 xds-mystruct.c /* XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) This file is part of OSSP XDS, an extensible data serialization library which can be found at http://www.ossp.com/pkg/xds/. 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. */ #include #include #include #include "../internal.h" struct mystruct { int32_t small; int64_t big; u_int32_t positive; }; static int encode_mystruct_engine(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) { int rc; struct mystruct* ms; assert(xds != NULL); assert(buffer != NULL); assert(buffer_size != 0); assert(args != NULL); if (buffer_size >= sizeof(struct mystruct)) { ms = va_arg(*args, struct mystruct*); rc = xds_encode(xds, "int32 int64 uint32", ms->small, ms->big, ms->positive); if (rc != XDS_OK) return rc; } else return sizeof(struct mystruct); return 0; } static int decode_mystruct_engine(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) { int rc; struct mystruct* ms; assert(xds != NULL); assert(buffer != NULL); assert(buffer_size != 0); assert(args != NULL); if (buffer_size >= sizeof(struct mystruct)) { ms = va_arg(*args, struct mystruct*); rc = xds_decode(xds, "int32 int64 uint32", &(ms->small), &(ms->big), &(ms->positive)); if (rc != XDS_OK) return rc; } else return XDS_ERR_UNDERFLOW; return 0; } int main() { xds_t* xds; char* buffer; size_t buffer_size; struct mystruct ms, new_ms; ms.small = -0x1234567; ms.big = -0x1234567890abcdeLL; ms.positive = 42; /* Encode our copy of mystruct using our encoding callback. Then get a the buffer and destroy the context again. */ xds = xds_init(XDS_ENCODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); return 1; } if (xds_register(xds, "mystruct", &encode_mystruct_engine, NULL) != XDS_OK || xds_register(xds, "int32", &xdr_encode_int32, NULL) != XDS_OK || xds_register(xds, "int64", &xdr_encode_int64, NULL) != XDS_OK || xds_register(xds, "uint32", &xdr_encode_uint32, NULL) != XDS_OK) { printf("Failed to register my encoding engines.\n"); return 1; } if (xds_encode(xds, "mystruct", &ms) != XDS_OK) { printf("xds_encode() failed!\n"); return 1; } if (xds_getbuffer(xds, XDS_GIFT, (void**)&buffer, &buffer_size) != XDS_OK) { printf("xds_setbuffer() failed!\n"); return 1; } xds_destroy(xds); /* Now create a decoding context and decode the whole thing again. */ xds = xds_init(XDS_DECODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); return 1; } if (xds_register(xds, "mystruct", &decode_mystruct_engine, NULL) != XDS_OK || xds_register(xds, "int32", &xdr_decode_int32, NULL) != XDS_OK || xds_register(xds, "int64", &xdr_decode_int64, NULL) != XDS_OK || xds_register(xds, "uint32", &xdr_decode_uint32, NULL) != XDS_OK) { printf("Failed to register my decoding engines.\n"); return 1; } if (xds_setbuffer(xds, XDS_GIFT, buffer, buffer_size) != XDS_OK) { printf("xds_setbuffer() failed!\n"); return 1; } if (xds_decode(xds, "mystruct", &new_ms) != XDS_OK) { printf("xds_decode() failed!\n"); return 1; } xds_destroy(xds); /* Both structures must be identical. */ if (memcmp(&ms, &new_ms, sizeof(struct mystruct)) != 0) { printf("Decoded data does not match the original!\n"); return 1; } /* Everything went fine. */ return 0; } From ossp-cvs-owner@ossp.org Thu Jul 19 08:55:33 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f6J6tVN10590; Thu, 19 Jul 2001 08:55:31 +0200 (CEST) Date: Thu, 19 Jul 2001 08:55:31 +0200 (CEST) Message-Id: <200107190655.f6J6tVN10590@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds xdr-decode-int.c xdr-encode-int.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 19-Jul-2001 08:55:31 Branch: HEAD Handle: 2001071907553000 Modified files: ossp-pkg/srpc/libxds xdr-decode-int.c xdr-encode-int.c Log: Including sys/types.h for u_int32_t and others. Summary: Revision Changes Path 1.2 +1 -0 ossp-pkg/srpc/libxds/xdr-decode-int.c 1.3 +1 -0 ossp-pkg/srpc/libxds/xdr-encode-int.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/xdr-decode-int.c ============================================================ $ cvs diff -u -r1.1 -r1.2 xdr-decode-int.c --- ossp-pkg/srpc/libxds/xdr-decode-int.c 2001/07/18 18:26:32 1.1 +++ ossp-pkg/srpc/libxds/xdr-decode-int.c 2001/07/19 06:55:30 1.2 @@ -26,6 +26,7 @@ */ #include +#include #include "internal.h" int xdr_decode_int32(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) Index: ossp-pkg/srpc/libxds/xdr-encode-int.c ============================================================ $ cvs diff -u -r1.2 -r1.3 xdr-encode-int.c --- ossp-pkg/srpc/libxds/xdr-encode-int.c 2001/07/18 16:59:27 1.2 +++ ossp-pkg/srpc/libxds/xdr-encode-int.c 2001/07/19 06:55:30 1.3 @@ -26,6 +26,7 @@ */ #include +#include #include "internal.h" int xdr_encode_int32(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) From ossp-cvs-owner@ossp.org Thu Jul 19 11:38:44 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f6J9cg332162; Thu, 19 Jul 2001 11:38:42 +0200 (CEST) Date: Thu, 19 Jul 2001 11:38:42 +0200 (CEST) Message-Id: <200107190938.f6J9cg332162@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds/regression-tests xds-mystruct.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 19-Jul-2001 11:38:42 Branch: HEAD Handle: 2001071910384200 Modified files: ossp-pkg/srpc/libxds/regression-tests xds-mystruct.c Log: Include sys/types.h for int32_t and others. Summary: Revision Changes Path 1.2 +1 -0 ossp-pkg/srpc/libxds/regression-tests/xds-mystruct.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/regression-tests/xds-mystruct.c ============================================================ $ cvs diff -u -r1.1 -r1.2 xds-mystruct.c --- ossp-pkg/srpc/libxds/regression-tests/xds-mystruct.c 2001/07/18 19:03:17 1.1 +++ ossp-pkg/srpc/libxds/regression-tests/xds-mystruct.c 2001/07/19 09:38:42 1.2 @@ -28,6 +28,7 @@ #include #include #include +#include #include "../internal.h" struct mystruct From ossp-cvs-owner@ossp.org Thu Jul 19 11:47:05 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f6J9l4j33609; Thu, 19 Jul 2001 11:47:04 +0200 (CEST) Date: Thu, 19 Jul 2001 11:47:04 +0200 (CEST) Message-Id: <200107190947.f6J9l4j33609@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds/regression-tests xdr-uint32.c xdr-uin... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 19-Jul-2001 11:47:04 Branch: HEAD Handle: 2001071910470300 Modified files: ossp-pkg/srpc/libxds/regression-tests xdr-uint32.c xdr-uint64.c Log: Added stub for XDR routine that's called differently on FreeBSD. Summary: Revision Changes Path 1.4 +7 -0 ossp-pkg/srpc/libxds/regression-tests/xdr-uint32.c 1.4 +7 -0 ossp-pkg/srpc/libxds/regression-tests/xdr-uint64.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/regression-tests/xdr-uint32.c ============================================================ $ cvs diff -u -r1.3 -r1.4 xdr-uint32.c --- ossp-pkg/srpc/libxds/regression-tests/xdr-uint32.c 2001/07/18 18:58:46 1.3 +++ ossp-pkg/srpc/libxds/regression-tests/xdr-uint32.c 2001/07/19 09:47:03 1.4 @@ -31,6 +31,13 @@ #include #include "../internal.h" +#ifdef __FreeBSD__ +static int xdr_uint32_t(XDR *xdrs, uint32_t *val) + { + return xdr_u_int32_t(xdrs, val); + } +#endif + int main() { XDR xdrs; Index: ossp-pkg/srpc/libxds/regression-tests/xdr-uint64.c ============================================================ $ cvs diff -u -r1.3 -r1.4 xdr-uint64.c --- ossp-pkg/srpc/libxds/regression-tests/xdr-uint64.c 2001/07/18 18:58:46 1.3 +++ ossp-pkg/srpc/libxds/regression-tests/xdr-uint64.c 2001/07/19 09:47:03 1.4 @@ -31,6 +31,13 @@ #include #include "../internal.h" +#ifdef __FreeBSD__ +static int xdr_uint64_t(XDR *xdrs, uint64_t *val) + { + return xdr_u_int64_t(xdrs, val); + } +#endif + int main() { XDR xdrs; From ossp-cvs-owner@ossp.org Thu Jul 19 13:07:16 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f6JB7FA43425; Thu, 19 Jul 2001 13:07:15 +0200 (CEST) Date: Thu, 19 Jul 2001 13:07:15 +0200 (CEST) Message-Id: <200107191107.f6JB7FA43425@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc TODO Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 19-Jul-2001 13:07:15 Branch: HEAD Handle: 2001071912071500 Modified files: ossp-pkg/srpc TODO Log: Added tags to be used in XML encoding. Summary: Revision Changes Path 1.6 +6 -4 ossp-pkg/srpc/TODO ____________________________________________________________________________ Index: ossp-pkg/srpc/TODO ============================================================ $ cvs diff -u -r1.5 -r1.6 TODO --- ossp-pkg/srpc/TODO 2001/07/15 11:48:26 1.5 +++ ossp-pkg/srpc/TODO 2001/07/19 11:07:15 1.6 @@ -27,8 +27,8 @@ - unsigned short - int - unsigned int - - long - - unsigned long + - long + - unsigned long o floating point: - float - double @@ -38,7 +38,7 @@ o string - char * (end is NUL) - unsigned char * (end is NUL) - o octet-stream + o octet-stream - void * (end is after given length) Function prototype is xds_engine_t. Function name scheme is: @@ -47,6 +47,9 @@ [u]string,octets} - regression tests for libxds (make check) + - XML: 1234 + uint32, int64, uint64, + o M5 (peti+rse) [1 week until 30-Jul-2001] - [peti] documentation for libxds (xds.pod) - [rse] OSSP adjustments for libxds @@ -62,4 +65,3 @@ o M8 (peti+rse) [1 week until 03-Sep-2001] - [peti] documentation for libamp - [rse] OSSP adjustments for libamp - From ossp-cvs-owner@ossp.org Thu Jul 19 14:28:17 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f6JCSGL52770; Thu, 19 Jul 2001 14:28:16 +0200 (CEST) Date: Thu, 19 Jul 2001 14:28:16 +0200 (CEST) Message-Id: <200107191228.f6JCSGL52770@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds Makefile xdr-decode-int.c xdr-decode-... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 19-Jul-2001 14:28:16 Branch: HEAD Handle: 19700101010000995542095 Added files: ossp-pkg/srpc/libxds xdr-decode-int32.c xdr-decode-int64.c xdr-decode-uint32.c xdr-decode-uint64.c xdr-encode-int32.c xdr-encode-int64.c xdr-encode-uint32.c xdr-encode-uint64.c Modified files: ossp-pkg/srpc/libxds Makefile Removed files: ossp-pkg/srpc/libxds xdr-decode-int.c xdr-encode-int.c Log: Split the various encoding and decoding routines into separate files so that the linker may pull them in separately. Summary: Revision Changes Path 1.16 +3 -2 ossp-pkg/srpc/libxds/Makefile NONE +0 -184 ossp-pkg/srpc/libxds/xdr-decode-int.c 1.1 +72 -0 ossp-pkg/srpc/libxds/xdr-decode-int32.c 1.1 +80 -0 ossp-pkg/srpc/libxds/xdr-decode-int64.c 1.1 +59 -0 ossp-pkg/srpc/libxds/xdr-decode-uint32.c 1.1 +63 -0 ossp-pkg/srpc/libxds/xdr-decode-uint64.c NONE +0 -162 ossp-pkg/srpc/libxds/xdr-encode-int.c 1.1 +65 -0 ossp-pkg/srpc/libxds/xdr-encode-int32.c 1.1 +69 -0 ossp-pkg/srpc/libxds/xdr-encode-int64.c 1.1 +57 -0 ossp-pkg/srpc/libxds/xdr-encode-uint32.c 1.1 +61 -0 ossp-pkg/srpc/libxds/xdr-encode-uint64.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/Makefile ============================================================ $ cvs diff -u -r1.15 -r1.16 Makefile --- ossp-pkg/srpc/libxds/Makefile 2001/07/18 18:26:32 1.15 +++ ossp-pkg/srpc/libxds/Makefile 2001/07/19 12:28:15 1.16 @@ -16,8 +16,9 @@ OBJS = decode.o destroy.o encode.o getbuffer.o init.o register.o \ setbuffer.o unregister.o vdecode.o vencode.o find-engine.o \ - set-capacity.o xdr-encode-int.o xdr-decode-int.o - + set-capacity.o xdr-encode-int32.o xdr-encode-int64.o \ + xdr-encode-uint32.o xdr-encode-uint64.o xdr-decode-int32.o \ + xdr-decode-int64.o xdr-decode-uint32.o xdr-decode-uint64.o .c.o: $(CC) $(CPPFLAGS) $(WARNFLAGS) $(OPTFLAGS) $(CFLAGS) -c $< Index: ossp-pkg/srpc/libxds/xdr-decode-int32.c ============================================================ $ cvs update -p -r1.1 xdr-decode-int32.c /* XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) This file is part of OSSP XDS, an extensible data serialization library which can be found at http://www.ossp.com/pkg/xds/. 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. */ #include #include #include "internal.h" int xdr_decode_int32(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) { int32_t* value; u_int32_t tmp; /* Consistency checks. */ assert(xds != NULL); assert(buffer != NULL); assert(args != NULL); if (xds == NULL || buffer == NULL || buffer_size == 0 || args == NULL) return XDS_ERR_INVALID_ARG; if (buffer_size < 4) return XDS_ERR_UNDERFLOW; /* Get value and format it into the buffer. */ value = va_arg(*args, int32_t*); assert(value != NULL); if (((u_int8_t*)buffer)[0] & 0x80) { /* negative number */ tmp = ((u_int8_t*)buffer)[0]; tmp = tmp << 8; tmp += ((u_int8_t*)buffer)[1]; tmp = tmp << 8; tmp += ((u_int8_t*)buffer)[2]; tmp = tmp << 8; tmp += ((u_int8_t*)buffer)[3]; tmp = 0 - tmp; *value = 0 - (int32_t)tmp; } else { /* positive number */ *value = ((u_int8_t*)buffer)[0]; *value = *value << 8; *value += ((u_int8_t*)buffer)[1]; *value = *value << 8; *value += ((u_int8_t*)buffer)[2]; *value = *value << 8; *value += ((u_int8_t*)buffer)[3]; } /* Done. */ return 4; } Index: ossp-pkg/srpc/libxds/xdr-decode-int64.c ============================================================ $ cvs update -p -r1.1 xdr-decode-int64.c /* XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) This file is part of OSSP XDS, an extensible data serialization library which can be found at http://www.ossp.com/pkg/xds/. 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. */ #include #include #include "internal.h" int xdr_decode_int64(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) { int64_t* value; u_int64_t tmp; /* Consistency checks. */ assert(xds != NULL); assert(buffer != NULL); assert(args != NULL); if (xds == NULL || buffer == NULL || buffer_size == 0 || args == NULL) return XDS_ERR_INVALID_ARG; if (buffer_size < 8) return XDS_ERR_UNDERFLOW; /* Get value and format it into the buffer. */ value = va_arg(*args, int64_t*); assert(value != NULL); if (((u_int8_t*)buffer)[0] & 0x80) { /* negative number */ tmp = ((u_int8_t*)buffer)[0]; tmp = tmp << 8; tmp += ((u_int8_t*)buffer)[1]; tmp = tmp << 8; tmp += ((u_int8_t*)buffer)[2]; tmp = tmp << 8; tmp += ((u_int8_t*)buffer)[3]; tmp = tmp << 8; tmp += ((u_int8_t*)buffer)[4]; tmp = tmp << 8; tmp += ((u_int8_t*)buffer)[5]; tmp = tmp << 8; tmp += ((u_int8_t*)buffer)[6]; tmp = tmp << 8; tmp += ((u_int8_t*)buffer)[7]; tmp = 0 - tmp; *value = 0 - (int64_t)tmp; } else { /* positive number */ *value = ((u_int8_t*)buffer)[0]; *value = *value << 8; *value += ((u_int8_t*)buffer)[1]; *value = *value << 8; *value += ((u_int8_t*)buffer)[2]; *value = *value << 8; *value += ((u_int8_t*)buffer)[3]; *value = *value << 8; *value += ((u_int8_t*)buffer)[4]; *value = *value << 8; *value += ((u_int8_t*)buffer)[5]; *value = *value << 8; *value += ((u_int8_t*)buffer)[6]; *value = *value << 8; *value += ((u_int8_t*)buffer)[7]; } /* Done. */ return 8; } Index: ossp-pkg/srpc/libxds/xdr-decode-uint32.c ============================================================ $ cvs update -p -r1.1 xdr-decode-uint32.c /* XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) This file is part of OSSP XDS, an extensible data serialization library which can be found at http://www.ossp.com/pkg/xds/. 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. */ #include #include #include "internal.h" int xdr_decode_uint32(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) { u_int32_t* value; /* Consistency checks. */ assert(xds != NULL); assert(buffer != NULL); assert(args != NULL); if (xds == NULL || buffer == NULL || buffer_size == 0 || args == NULL) return XDS_ERR_INVALID_ARG; if (buffer_size < 4) return XDS_ERR_UNDERFLOW; /* Get value and format it into the buffer. */ value = va_arg(*args, u_int32_t*); assert(value != NULL); *value = ((u_int8_t*)buffer)[0]; *value = *value << 8; *value += ((u_int8_t*)buffer)[1]; *value = *value << 8; *value += ((u_int8_t*)buffer)[2]; *value = *value << 8; *value += ((u_int8_t*)buffer)[3]; /* Done. */ return 4; } Index: ossp-pkg/srpc/libxds/xdr-decode-uint64.c ============================================================ $ cvs update -p -r1.1 xdr-decode-uint64.c /* XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) This file is part of OSSP XDS, an extensible data serialization library which can be found at http://www.ossp.com/pkg/xds/. 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. */ #include #include #include "internal.h" int xdr_decode_uint64(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) { u_int64_t* value; /* Consistency checks. */ assert(xds != NULL); assert(buffer != NULL); assert(args != NULL); if (xds == NULL || buffer == NULL || buffer_size == 0 || args == NULL) return XDS_ERR_INVALID_ARG; if (buffer_size < 8) return XDS_ERR_UNDERFLOW; /* Get value and format it into the buffer. */ value = va_arg(*args, u_int64_t*); assert(value != NULL); *value = ((u_int8_t*)buffer)[0]; *value = *value << 8; *value += ((u_int8_t*)buffer)[1]; *value = *value << 8; *value += ((u_int8_t*)buffer)[2]; *value = *value << 8; *value += ((u_int8_t*)buffer)[3]; *value = *value << 8; *value += ((u_int8_t*)buffer)[4]; *value = *value << 8; *value += ((u_int8_t*)buffer)[5]; *value = *value << 8; *value += ((u_int8_t*)buffer)[6]; *value = *value << 8; *value += ((u_int8_t*)buffer)[7]; /* Done. */ return 8; } Index: ossp-pkg/srpc/libxds/xdr-encode-int32.c ============================================================ $ cvs update -p -r1.1 xdr-encode-int32.c /* XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) This file is part of OSSP XDS, an extensible data serialization library which can be found at http://www.ossp.com/pkg/xds/. 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. */ #include #include #include "internal.h" int xdr_encode_int32(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) { /* Consistency checks. */ assert(xds != NULL); assert(buffer != NULL); assert(buffer_size != 0); assert(args != NULL); if (xds == NULL || buffer == NULL || buffer_size == 0 || args == NULL) return XDS_ERR_INVALID_ARG; /* Get value and format it into the buffer. */ if (buffer_size >= 4) { u_int32_t tmp; int32_t value = va_arg(*args, u_int32_t); if (value < 0) { value = 0 - value; tmp = 0 - (u_int32_t)value; } else tmp = (u_int32_t)value; ((u_int8_t*)buffer)[0] = (tmp >> 24) & 0x000000ff; ((u_int8_t*)buffer)[1] = (tmp >> 16) & 0x000000ff; ((u_int8_t*)buffer)[2] = (tmp >> 8) & 0x000000ff; ((u_int8_t*)buffer)[3] = (tmp >> 0) & 0x000000ff; } /* Done. */ return 4; } Index: ossp-pkg/srpc/libxds/xdr-encode-int64.c ============================================================ $ cvs update -p -r1.1 xdr-encode-int64.c /* XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) This file is part of OSSP XDS, an extensible data serialization library which can be found at http://www.ossp.com/pkg/xds/. 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. */ #include #include #include "internal.h" int xdr_encode_int64(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) { /* Consistency checks. */ assert(xds != NULL); assert(buffer != NULL); assert(buffer_size != 0); assert(args != NULL); if (xds == NULL || buffer == NULL || buffer_size == 0 || args == NULL) return XDS_ERR_INVALID_ARG; /* Get value and format it into the buffer. */ if (buffer_size >= 8) { u_int64_t tmp; int64_t value = va_arg(*args, u_int64_t); if (value < 0) { value = 0 - value; tmp = 0 - (u_int64_t)value; } else tmp = (u_int64_t)value; ((u_int8_t*)buffer)[0] = (tmp >> 56) & 0x000000ff; ((u_int8_t*)buffer)[1] = (tmp >> 48) & 0x000000ff; ((u_int8_t*)buffer)[2] = (tmp >> 40) & 0x000000ff; ((u_int8_t*)buffer)[3] = (tmp >> 32) & 0x000000ff; ((u_int8_t*)buffer)[4] = (tmp >> 24) & 0x000000ff; ((u_int8_t*)buffer)[5] = (tmp >> 16) & 0x000000ff; ((u_int8_t*)buffer)[6] = (tmp >> 8) & 0x000000ff; ((u_int8_t*)buffer)[7] = (tmp >> 0) & 0x000000ff; } /* Done. */ return 8; } Index: ossp-pkg/srpc/libxds/xdr-encode-uint32.c ============================================================ $ cvs update -p -r1.1 xdr-encode-uint32.c /* XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) This file is part of OSSP XDS, an extensible data serialization library which can be found at http://www.ossp.com/pkg/xds/. 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. */ #include #include #include "internal.h" int xdr_encode_uint32(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) { /* Consistency checks. */ assert(xds != NULL); assert(buffer != NULL); assert(buffer_size != 0); assert(args != NULL); if (xds == NULL || buffer == NULL || buffer_size == 0 || args == NULL) return XDS_ERR_INVALID_ARG; /* Get value and format it into the buffer. */ if (buffer_size >= 4) { u_int32_t value = va_arg(*args, u_int32_t); ((u_int8_t*)buffer)[0] = (value >> 24) & 0x000000ff; ((u_int8_t*)buffer)[1] = (value >> 16) & 0x000000ff; ((u_int8_t*)buffer)[2] = (value >> 8) & 0x000000ff; ((u_int8_t*)buffer)[3] = (value >> 0) & 0x000000ff; } /* Done. */ return 4; } Index: ossp-pkg/srpc/libxds/xdr-encode-uint64.c ============================================================ $ cvs update -p -r1.1 xdr-encode-uint64.c /* XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) This file is part of OSSP XDS, an extensible data serialization library which can be found at http://www.ossp.com/pkg/xds/. 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. */ #include #include #include "internal.h" int xdr_encode_uint64(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) { /* Consistency checks. */ assert(xds != NULL); assert(buffer != NULL); assert(buffer_size != 0); assert(args != NULL); if (xds == NULL || buffer == NULL || buffer_size == 0 || args == NULL) return XDS_ERR_INVALID_ARG; /* Get value and format it into the buffer. */ if (buffer_size >= 8) { u_int64_t value = va_arg(*args, u_int64_t); ((u_int8_t*)buffer)[0] = (value >> 56) & 0x000000ff; ((u_int8_t*)buffer)[1] = (value >> 48) & 0x000000ff; ((u_int8_t*)buffer)[2] = (value >> 40) & 0x000000ff; ((u_int8_t*)buffer)[3] = (value >> 32) & 0x000000ff; ((u_int8_t*)buffer)[4] = (value >> 24) & 0x000000ff; ((u_int8_t*)buffer)[5] = (value >> 16) & 0x000000ff; ((u_int8_t*)buffer)[6] = (value >> 8) & 0x000000ff; ((u_int8_t*)buffer)[7] = (value >> 0) & 0x000000ff; } /* Done. */ return 8; } From ossp-cvs-owner@ossp.org Thu Jul 19 14:28:58 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f6JCSv852843; Thu, 19 Jul 2001 14:28:57 +0200 (CEST) Date: Thu, 19 Jul 2001 14:28:57 +0200 (CEST) Message-Id: <200107191228.f6JCSv852843@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds Makefile Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 19-Jul-2001 14:28:57 Branch: HEAD Handle: 2001071913285700 Modified files: ossp-pkg/srpc/libxds Makefile Log: Updated dependencies. Summary: Revision Changes Path 1.17 +8 -0 ossp-pkg/srpc/libxds/Makefile ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/Makefile ============================================================ $ cvs diff -u -r1.16 -r1.17 Makefile --- ossp-pkg/srpc/libxds/Makefile 2001/07/19 12:28:15 1.16 +++ ossp-pkg/srpc/libxds/Makefile 2001/07/19 12:28:57 1.17 @@ -57,3 +57,11 @@ unregister.o: internal.h xds.h vdecode.o: internal.h xds.h vencode.o: internal.h xds.h +xdr-decode-int32.o: internal.h xds.h +xdr-decode-int64.o: internal.h xds.h +xdr-decode-uint32.o: internal.h xds.h +xdr-decode-uint64.o: internal.h xds.h +xdr-encode-int32.o: internal.h xds.h +xdr-encode-int64.o: internal.h xds.h +xdr-encode-uint32.o: internal.h xds.h +xdr-encode-uint64.o: internal.h xds.h From ossp-cvs-owner@ossp.org Thu Jul 19 16:58:29 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f6JEwTf70937; Thu, 19 Jul 2001 16:58:29 +0200 (CEST) Date: Thu, 19 Jul 2001 16:58:29 +0200 (CEST) Message-Id: <200107191458.f6JEwTf70937@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds Makefile ossp-pkg/srpc/libxds/regress... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 19-Jul-2001 16:58:28 Branch: HEAD Handle: 2001071915582701 Added files: ossp-pkg/srpc/libxds xdr-decode-octedstream.c xdr-encode-octedstream.c ossp-pkg/srpc/libxds/regression-tests xdr-octedstream.c Modified files: ossp-pkg/srpc/libxds Makefile xds.h ossp-pkg/srpc/libxds/regression-tests Makefile Log: Implemented encoding and decoding of variable length octed streams. Summary: Revision Changes Path 1.18 +2 -1 ossp-pkg/srpc/libxds/Makefile 1.15 +2 -2 ossp-pkg/srpc/libxds/regression-tests/Makefile 1.1 +110 -0 ossp-pkg/srpc/libxds/regression-tests/xdr-octedstream.c 1.1 +89 -0 ossp-pkg/srpc/libxds/xdr-decode-octedstream.c 1.1 +71 -0 ossp-pkg/srpc/libxds/xdr-encode-octedstream.c 1.20 +3 -0 ossp-pkg/srpc/libxds/xds.h ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/Makefile ============================================================ $ cvs diff -u -r1.17 -r1.18 Makefile --- ossp-pkg/srpc/libxds/Makefile 2001/07/19 12:28:57 1.17 +++ ossp-pkg/srpc/libxds/Makefile 2001/07/19 14:58:27 1.18 @@ -18,7 +18,8 @@ setbuffer.o unregister.o vdecode.o vencode.o find-engine.o \ set-capacity.o xdr-encode-int32.o xdr-encode-int64.o \ xdr-encode-uint32.o xdr-encode-uint64.o xdr-decode-int32.o \ - xdr-decode-int64.o xdr-decode-uint32.o xdr-decode-uint64.o + xdr-decode-int64.o xdr-decode-uint32.o xdr-decode-uint64.o \ + xdr-encode-octedstream.o xdr-decode-octedstream.o .c.o: $(CC) $(CPPFLAGS) $(WARNFLAGS) $(OPTFLAGS) $(CFLAGS) -c $< Index: ossp-pkg/srpc/libxds/regression-tests/Makefile ============================================================ $ cvs diff -u -r1.14 -r1.15 Makefile --- ossp-pkg/srpc/libxds/regression-tests/Makefile 2001/07/18 19:03:17 1.14 +++ ossp-pkg/srpc/libxds/regression-tests/Makefile 2001/07/19 14:58:28 1.15 @@ -12,8 +12,8 @@ TESTS = xds-core.exe xds-find-engine.exe xds-register.exe xds-encode.exe \ xds-getbuffer.exe xds-decode.exe xds-setbuffer.exe xds-engine-restart.exe \ - xdr-uint32.exe xdr-int32.exe xdr-uint64.exe xdr-int64.exe \ - xds-mystruct.exe + xdr-uint32.exe xdr-int32.exe xdr-uint64.exe xdr-int64.exe \ + xdr-octedstream.exe xds-mystruct.exe .SUFFIXES: .SUFFIXES: .c .exe Index: ossp-pkg/srpc/libxds/regression-tests/xdr-octedstream.c ============================================================ $ cvs update -p -r1.1 xdr-octedstream.c /* XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) This file is part of OSSP XDS, an extensible data serialization library which can be found at http://www.ossp.com/pkg/xds/. 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. */ #include #include #include "../internal.h" int main() { xds_t* xds; char* buffer; size_t buffer_size; char msg[] = "Hello World"; char* new_msg; size_t new_msg_size; /* Encode the string as octed stream. Then erase the buffer and decode the string back, verifying that it hasn't changed. */ xds = xds_init(XDS_ENCODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); return 1; } if (xds_register(xds, "os", &xdr_encode_octedstream, NULL) != XDS_OK) { printf("Failed to register my encoding engines.\n"); return 1; } if (xds_encode(xds, "os", msg, strlen(msg)) != XDS_OK) { printf("xds_encode() failed.\n"); return 1; } if (xds_getbuffer(xds, XDS_GIFT, (void**)&buffer, &buffer_size) != XDS_OK) { printf("xds_getbuffer() failed.\n"); return 1; } xds_destroy(xds); if (buffer_size % 4 != 0) { printf("The encoded octed stream's buffer size is not a multiple of 4.\n"); return 1; } xds = xds_init(XDS_DECODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); return 1; } if (xds_register(xds, "os", &xdr_decode_octedstream, NULL) != XDS_OK) { printf("Failed to register my decoding engines.\n"); return 1; } if (xds_setbuffer(xds, XDS_GIFT, buffer, buffer_size) != XDS_OK) { printf("xds_setbuffer() failed.\n"); return 1; } if (xds_decode(xds, "os", &new_msg, &new_msg_size) != XDS_OK) { printf("xds_decode() failed.\n"); return 1; } if (new_msg_size != strlen(msg)) { printf("The size of the decoded message is wrong.\n"); return 1; } if (strncmp(msg, new_msg, new_msg_size) != 0) { printf("The decoded octed stream is not correct.\n"); return 1; } xds_destroy(xds); free(new_msg); /* Everything went fine. */ return 0; } Index: ossp-pkg/srpc/libxds/xdr-decode-octedstream.c ============================================================ $ cvs update -p -r1.1 xdr-decode-octedstream.c /* XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) This file is part of OSSP XDS, an extensible data serialization library which can be found at http://www.ossp.com/pkg/xds/. 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. */ #include #include #include #include "internal.h" int xdr_decode_octedstream(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) { void** p; size_t* p_len; size_t padding; /* Consistency checks. */ assert(xds != NULL); assert(buffer != NULL); assert(buffer_size != 0); assert(args != NULL); if (xds == NULL || buffer == NULL || buffer_size == 0 || args == NULL) return XDS_ERR_INVALID_ARG; /* Get pointers from the stack. */ p = va_arg(*args, void**); p_len = va_arg(*args, size_t*); assert(p != NULL); assert(p_len != NULL); /* Read the size of the message. */ if (buffer_size >= 4) { *p_len = ((u_int8_t*)buffer)[0]; *p_len = *p_len << 8; *p_len += ((u_int8_t*)buffer)[1]; *p_len = *p_len << 8; *p_len += ((u_int8_t*)buffer)[2]; *p_len = *p_len << 8; *p_len += ((u_int8_t*)buffer)[3]; } else return XDS_ERR_UNDERFLOW; /* Calculate padding. */ padding = (4 - (*p_len & 0x03)) & 0x03; /* Do we have enough data?. */ if (buffer_size < 4 + *p_len + padding) return XDS_ERR_UNDERFLOW; /* Allocate buffer for the data. */ *p = malloc(*p_len); if (*p == NULL) return XDS_ERR_NO_MEM; /* Copy data into the buffer. */ memmove(*p, (u_int8_t*)buffer+4, *p_len); /* Done. */ return 4 + *p_len + padding; } Index: ossp-pkg/srpc/libxds/xdr-encode-octedstream.c ============================================================ $ cvs update -p -r1.1 xdr-encode-octedstream.c /* XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) This file is part of OSSP XDS, an extensible data serialization library which can be found at http://www.ossp.com/pkg/xds/. 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. */ #include #include #include #include "internal.h" int xdr_encode_octedstream(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) { u_int8_t* p; size_t p_len; size_t padding; /* Consistency checks. */ assert(xds != NULL); assert(buffer != NULL); assert(buffer_size != 0); assert(args != NULL); if (xds == NULL || buffer == NULL || buffer_size == 0 || args == NULL) return XDS_ERR_INVALID_ARG; /* Get value from stack and calculate the correct amount of padding. */ p = (u_int8_t*)va_arg(*args, void*); p_len = va_arg(*args, size_t); padding = (4 - (p_len & 0x03)) & 0x03; assert((p_len + padding) % 4 == 0); /* Format the values into the buffer. */ if (buffer_size >= 4 + p_len + padding) { ((u_int8_t*)buffer)[0] = (p_len >> 24) & 0x000000ff; ((u_int8_t*)buffer)[1] = (p_len >> 16) & 0x000000ff; ((u_int8_t*)buffer)[2] = (p_len >> 8) & 0x000000ff; ((u_int8_t*)buffer)[3] = (p_len >> 0) & 0x000000ff; memmove((u_int8_t*)buffer+4, p, p_len); memset(buffer+4+p_len, 0, padding); } /* Done. */ return 4 + p_len + padding; } Index: ossp-pkg/srpc/libxds/xds.h ============================================================ $ cvs diff -u -r1.19 -r1.20 xds.h --- ossp-pkg/srpc/libxds/xds.h 2001/07/18 18:26:32 1.19 +++ ossp-pkg/srpc/libxds/xds.h 2001/07/19 14:58:27 1.20 @@ -80,4 +80,7 @@ int xdr_decode_uint64(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); int xdr_decode_int64(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); +int xdr_encode_octedstream(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); +int xdr_decode_octedstream(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); + #endif /* !defined(__LIBXDS_H__) */ From ossp-cvs-owner@ossp.org Thu Jul 19 17:02:49 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f6JF2l071624; Thu, 19 Jul 2001 17:02:47 +0200 (CEST) Date: Thu, 19 Jul 2001 17:02:47 +0200 (CEST) Message-Id: <200107191502.f6JF2l071624@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds xdr-encode-octedstream.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 19-Jul-2001 17:02:47 Branch: HEAD Handle: 2001071916024700 Modified files: ossp-pkg/srpc/libxds xdr-encode-octedstream.c Log: Added assertion that the to-be-encoded buffer must not be NULL. Summary: Revision Changes Path 1.2 +1 -0 ossp-pkg/srpc/libxds/xdr-encode-octedstream.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/xdr-encode-octedstream.c ============================================================ $ cvs diff -u -r1.1 -r1.2 xdr-encode-octedstream.c --- ossp-pkg/srpc/libxds/xdr-encode-octedstream.c 2001/07/19 14:58:27 1.1 +++ ossp-pkg/srpc/libxds/xdr-encode-octedstream.c 2001/07/19 15:02:47 1.2 @@ -49,6 +49,7 @@ padding. */ p = (u_int8_t*)va_arg(*args, void*); + assert(p != NULL); p_len = va_arg(*args, size_t); padding = (4 - (p_len & 0x03)) & 0x03; assert((p_len + padding) % 4 == 0); From ossp-cvs-owner@ossp.org Thu Jul 19 17:13:41 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f6JFDeN72742; Thu, 19 Jul 2001 17:13:40 +0200 (CEST) Date: Thu, 19 Jul 2001 17:13:40 +0200 (CEST) Message-Id: <200107191513.f6JFDeN72742@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds Makefile ossp-pkg/srpc/libxds/regress... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 19-Jul-2001 17:13:40 Branch: HEAD Handle: 2001071916133901 Added files: ossp-pkg/srpc/libxds xdr-decode-string.c xdr-encode-string.c ossp-pkg/srpc/libxds/regression-tests xdr-string.c Modified files: ossp-pkg/srpc/libxds Makefile xds.h ossp-pkg/srpc/libxds/regression-tests Makefile Log: Implemented XDR encoding and decoding of strings. Summary: Revision Changes Path 1.19 +2 -1 ossp-pkg/srpc/libxds/Makefile 1.16 +1 -1 ossp-pkg/srpc/libxds/regression-tests/Makefile 1.1 +110 -0 ossp-pkg/srpc/libxds/regression-tests/xdr-string.c 1.1 +90 -0 ossp-pkg/srpc/libxds/xdr-decode-string.c 1.1 +72 -0 ossp-pkg/srpc/libxds/xdr-encode-string.c 1.21 +3 -0 ossp-pkg/srpc/libxds/xds.h ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/Makefile ============================================================ $ cvs diff -u -r1.18 -r1.19 Makefile --- ossp-pkg/srpc/libxds/Makefile 2001/07/19 14:58:27 1.18 +++ ossp-pkg/srpc/libxds/Makefile 2001/07/19 15:13:39 1.19 @@ -19,7 +19,8 @@ set-capacity.o xdr-encode-int32.o xdr-encode-int64.o \ xdr-encode-uint32.o xdr-encode-uint64.o xdr-decode-int32.o \ xdr-decode-int64.o xdr-decode-uint32.o xdr-decode-uint64.o \ - xdr-encode-octedstream.o xdr-decode-octedstream.o + xdr-encode-octedstream.o xdr-decode-octedstream.o \ + xdr-encode-string.o xdr-decode-string.o .c.o: $(CC) $(CPPFLAGS) $(WARNFLAGS) $(OPTFLAGS) $(CFLAGS) -c $< Index: ossp-pkg/srpc/libxds/regression-tests/Makefile ============================================================ $ cvs diff -u -r1.15 -r1.16 Makefile --- ossp-pkg/srpc/libxds/regression-tests/Makefile 2001/07/19 14:58:28 1.15 +++ ossp-pkg/srpc/libxds/regression-tests/Makefile 2001/07/19 15:13:40 1.16 @@ -13,7 +13,7 @@ TESTS = xds-core.exe xds-find-engine.exe xds-register.exe xds-encode.exe \ xds-getbuffer.exe xds-decode.exe xds-setbuffer.exe xds-engine-restart.exe \ xdr-uint32.exe xdr-int32.exe xdr-uint64.exe xdr-int64.exe \ - xdr-octedstream.exe xds-mystruct.exe + xdr-octedstream.exe xdr-string.exe xds-mystruct.exe .SUFFIXES: .SUFFIXES: .c .exe Index: ossp-pkg/srpc/libxds/regression-tests/xdr-string.c ============================================================ $ cvs update -p -r1.1 xdr-string.c /* XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) This file is part of OSSP XDS, an extensible data serialization library which can be found at http://www.ossp.com/pkg/xds/. 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. */ #include #include #include "../internal.h" int main() { xds_t* xds; char* buffer; size_t buffer_size; char msg[] = "Hello World"; char* new_msg; size_t new_msg_size; /* Encode the string as octed stream. Then erase the buffer and decode the string back, verifying that it hasn't changed. */ xds = xds_init(XDS_ENCODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); return 1; } if (xds_register(xds, "os", &xdr_encode_string, NULL) != XDS_OK) { printf("Failed to register my encoding engines.\n"); return 1; } if (xds_encode(xds, "os", msg) != XDS_OK) { printf("xds_encode() failed.\n"); return 1; } if (xds_getbuffer(xds, XDS_GIFT, (void**)&buffer, &buffer_size) != XDS_OK) { printf("xds_getbuffer() failed.\n"); return 1; } xds_destroy(xds); if (buffer_size % 4 != 0) { printf("The encoded octed stream's buffer size is not a multiple of 4.\n"); return 1; } xds = xds_init(XDS_DECODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); return 1; } if (xds_register(xds, "os", &xdr_decode_string, NULL) != XDS_OK) { printf("Failed to register my decoding engines.\n"); return 1; } if (xds_setbuffer(xds, XDS_GIFT, buffer, buffer_size) != XDS_OK) { printf("xds_setbuffer() failed.\n"); return 1; } if (xds_decode(xds, "os", &new_msg, &new_msg_size) != XDS_OK) { printf("xds_decode() failed.\n"); return 1; } if (new_msg_size != strlen(msg)) { printf("The size of the decoded message is wrong: %d.\n", new_msg_size); return 1; } if (strncmp(msg, new_msg, new_msg_size) != 0) { printf("The decoded octed stream is not correct.\n"); return 1; } xds_destroy(xds); free(new_msg); /* Everything went fine. */ return 0; } Index: ossp-pkg/srpc/libxds/xdr-decode-string.c ============================================================ $ cvs update -p -r1.1 xdr-decode-string.c /* XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) This file is part of OSSP XDS, an extensible data serialization library which can be found at http://www.ossp.com/pkg/xds/. 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. */ #include #include #include #include "internal.h" int xdr_decode_string(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) { void** p; size_t* p_len; size_t padding; /* Consistency checks. */ assert(xds != NULL); assert(buffer != NULL); assert(buffer_size != 0); assert(args != NULL); if (xds == NULL || buffer == NULL || buffer_size == 0 || args == NULL) return XDS_ERR_INVALID_ARG; /* Get pointers from the stack. */ p = va_arg(*args, void**); p_len = va_arg(*args, size_t*); assert(p != NULL); assert(p_len != NULL); /* Read the size of the message. */ if (buffer_size >= 4) { *p_len = ((u_int8_t*)buffer)[0]; *p_len = *p_len << 8; *p_len += ((u_int8_t*)buffer)[1]; *p_len = *p_len << 8; *p_len += ((u_int8_t*)buffer)[2]; *p_len = *p_len << 8; *p_len += ((u_int8_t*)buffer)[3]; } else return XDS_ERR_UNDERFLOW; /* Calculate padding. */ padding = (4 - (*p_len & 0x03)) & 0x03; /* Do we have enough data?. */ if (buffer_size < 4 + *p_len + padding) return XDS_ERR_UNDERFLOW; /* Allocate buffer for the data. */ *p = malloc(*p_len + 1); if (*p == NULL) return XDS_ERR_NO_MEM; /* Copy data into the buffer. */ memmove(*p, (u_int8_t*)buffer+4, *p_len); ((u_int8_t*)buffer)[4+*p_len] = '\0'; /* Done. */ return 4 + *p_len + padding; } Index: ossp-pkg/srpc/libxds/xdr-encode-string.c ============================================================ $ cvs update -p -r1.1 xdr-encode-string.c /* XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) This file is part of OSSP XDS, an extensible data serialization library which can be found at http://www.ossp.com/pkg/xds/. 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. */ #include #include #include #include "internal.h" int xdr_encode_string(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) { u_int8_t* p; size_t p_len; size_t padding; /* Consistency checks. */ assert(xds != NULL); assert(buffer != NULL); assert(buffer_size != 0); assert(args != NULL); if (xds == NULL || buffer == NULL || buffer_size == 0 || args == NULL) return XDS_ERR_INVALID_ARG; /* Get value from stack and calculate the correct amount of padding. */ p = (u_int8_t*)va_arg(*args, void*); assert(p != NULL); p_len = strlen(p); padding = (4 - (p_len & 0x03)) & 0x03; assert((p_len + padding) % 4 == 0); /* Format the values into the buffer. */ if (buffer_size >= 4 + p_len + padding) { ((u_int8_t*)buffer)[0] = (p_len >> 24) & 0x000000ff; ((u_int8_t*)buffer)[1] = (p_len >> 16) & 0x000000ff; ((u_int8_t*)buffer)[2] = (p_len >> 8) & 0x000000ff; ((u_int8_t*)buffer)[3] = (p_len >> 0) & 0x000000ff; memmove((u_int8_t*)buffer+4, p, p_len); memset(buffer+4+p_len, 0, padding); } /* Done. */ return 4 + p_len + padding; } Index: ossp-pkg/srpc/libxds/xds.h ============================================================ $ cvs diff -u -r1.20 -r1.21 xds.h --- ossp-pkg/srpc/libxds/xds.h 2001/07/19 14:58:27 1.20 +++ ossp-pkg/srpc/libxds/xds.h 2001/07/19 15:13:39 1.21 @@ -83,4 +83,7 @@ int xdr_encode_octedstream(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); int xdr_decode_octedstream(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); +int xdr_encode_string(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); +int xdr_decode_string(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); + #endif /* !defined(__LIBXDS_H__) */ From ossp-cvs-owner@ossp.org Thu Jul 19 17:18:52 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f6JFIpU73632; Thu, 19 Jul 2001 17:18:51 +0200 (CEST) Date: Thu, 19 Jul 2001 17:18:51 +0200 (CEST) Message-Id: <200107191518.f6JFIpU73632@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds/regression-tests Makefile xdr-octedst... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 19-Jul-2001 17:18:51 Branch: HEAD Handle: 2001071916185000 Added files: ossp-pkg/srpc/libxds/regression-tests xdr-octedstream-empty.c Modified files: ossp-pkg/srpc/libxds/regression-tests Makefile Log: Added test suite that verifies the correct handling of encoding/decoding octed streams with length 0. Summary: Revision Changes Path 1.17 +2 -1 ossp-pkg/srpc/libxds/regression-tests/Makefile 1.1 +110 -0 ossp-pkg/srpc/libxds/regression-tests/xdr-octedstream-empty.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/regression-tests/Makefile ============================================================ $ cvs diff -u -r1.16 -r1.17 Makefile --- ossp-pkg/srpc/libxds/regression-tests/Makefile 2001/07/19 15:13:40 1.16 +++ ossp-pkg/srpc/libxds/regression-tests/Makefile 2001/07/19 15:18:50 1.17 @@ -13,7 +13,8 @@ TESTS = xds-core.exe xds-find-engine.exe xds-register.exe xds-encode.exe \ xds-getbuffer.exe xds-decode.exe xds-setbuffer.exe xds-engine-restart.exe \ xdr-uint32.exe xdr-int32.exe xdr-uint64.exe xdr-int64.exe \ - xdr-octedstream.exe xdr-string.exe xds-mystruct.exe + xdr-octedstream.exe xdr-octedstream-empty.exe xdr-string.exe \ + xds-mystruct.exe .SUFFIXES: .SUFFIXES: .c .exe Index: ossp-pkg/srpc/libxds/regression-tests/xdr-octedstream-empty.c ============================================================ $ cvs update -p -r1.1 xdr-octedstream-empty.c /* XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) This file is part of OSSP XDS, an extensible data serialization library which can be found at http://www.ossp.com/pkg/xds/. 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. */ #include #include #include "../internal.h" int main() { xds_t* xds; char* buffer; size_t buffer_size; char msg[] = ""; char* new_msg; size_t new_msg_size; /* Encode the string as octed stream. Then erase the buffer and decode the string back, verifying that it hasn't changed. */ xds = xds_init(XDS_ENCODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); return 1; } if (xds_register(xds, "os", &xdr_encode_octedstream, NULL) != XDS_OK) { printf("Failed to register my encoding engines.\n"); return 1; } if (xds_encode(xds, "os", msg, 0) != XDS_OK) { printf("xds_encode() failed.\n"); return 1; } if (xds_getbuffer(xds, XDS_GIFT, (void**)&buffer, &buffer_size) != XDS_OK) { printf("xds_getbuffer() failed.\n"); return 1; } xds_destroy(xds); if (buffer_size % 4 != 0) { printf("The encoded octed stream's buffer size is not a multiple of 4.\n"); return 1; } xds = xds_init(XDS_DECODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); return 1; } if (xds_register(xds, "os", &xdr_decode_octedstream, NULL) != XDS_OK) { printf("Failed to register my decoding engines.\n"); return 1; } if (xds_setbuffer(xds, XDS_GIFT, buffer, buffer_size) != XDS_OK) { printf("xds_setbuffer() failed.\n"); return 1; } if (xds_decode(xds, "os", &new_msg, &new_msg_size) != XDS_OK) { printf("xds_decode() failed.\n"); return 1; } if (new_msg_size != 0) { printf("The size of the decoded message is wrong.\n"); return 1; } if (strncmp(msg, new_msg, new_msg_size) != 0) { printf("The decoded octed stream is not correct.\n"); return 1; } xds_destroy(xds); free(new_msg); /* Everything went fine. */ return 0; } From ossp-cvs-owner@ossp.org Thu Jul 19 17:20:49 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f6JFKmu73820; Thu, 19 Jul 2001 17:20:48 +0200 (CEST) Date: Thu, 19 Jul 2001 17:20:48 +0200 (CEST) Message-Id: <200107191520.f6JFKmu73820@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds/regression-tests Makefile xdr-string-... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 19-Jul-2001 17:20:48 Branch: HEAD Handle: 2001071916204700 Added files: ossp-pkg/srpc/libxds/regression-tests xdr-string-empty.c Modified files: ossp-pkg/srpc/libxds/regression-tests Makefile Log: Added test suite for handling of empty strings. Summary: Revision Changes Path 1.18 +1 -1 ossp-pkg/srpc/libxds/regression-tests/Makefile 1.1 +110 -0 ossp-pkg/srpc/libxds/regression-tests/xdr-string-empty.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/regression-tests/Makefile ============================================================ $ cvs diff -u -r1.17 -r1.18 Makefile --- ossp-pkg/srpc/libxds/regression-tests/Makefile 2001/07/19 15:18:50 1.17 +++ ossp-pkg/srpc/libxds/regression-tests/Makefile 2001/07/19 15:20:47 1.18 @@ -14,7 +14,7 @@ xds-getbuffer.exe xds-decode.exe xds-setbuffer.exe xds-engine-restart.exe \ xdr-uint32.exe xdr-int32.exe xdr-uint64.exe xdr-int64.exe \ xdr-octedstream.exe xdr-octedstream-empty.exe xdr-string.exe \ - xds-mystruct.exe + xdr-string-empty.exe xds-mystruct.exe .SUFFIXES: .SUFFIXES: .c .exe Index: ossp-pkg/srpc/libxds/regression-tests/xdr-string-empty.c ============================================================ $ cvs update -p -r1.1 xdr-string-empty.c /* XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) This file is part of OSSP XDS, an extensible data serialization library which can be found at http://www.ossp.com/pkg/xds/. 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. */ #include #include #include "../internal.h" int main() { xds_t* xds; char* buffer; size_t buffer_size; char msg[] = ""; char* new_msg; size_t new_msg_size; /* Encode the string as octed stream. Then erase the buffer and decode the string back, verifying that it hasn't changed. */ xds = xds_init(XDS_ENCODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); return 1; } if (xds_register(xds, "os", &xdr_encode_string, NULL) != XDS_OK) { printf("Failed to register my encoding engines.\n"); return 1; } if (xds_encode(xds, "os", msg, 0) != XDS_OK) { printf("xds_encode() failed.\n"); return 1; } if (xds_getbuffer(xds, XDS_GIFT, (void**)&buffer, &buffer_size) != XDS_OK) { printf("xds_getbuffer() failed.\n"); return 1; } xds_destroy(xds); if (buffer_size % 4 != 0) { printf("The encoded octed stream's buffer size is not a multiple of 4.\n"); return 1; } xds = xds_init(XDS_DECODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); return 1; } if (xds_register(xds, "os", &xdr_decode_string, NULL) != XDS_OK) { printf("Failed to register my decoding engines.\n"); return 1; } if (xds_setbuffer(xds, XDS_GIFT, buffer, buffer_size) != XDS_OK) { printf("xds_setbuffer() failed.\n"); return 1; } if (xds_decode(xds, "os", &new_msg, &new_msg_size) != XDS_OK) { printf("xds_decode() failed.\n"); return 1; } if (new_msg_size != 0) { printf("The size of the decoded message is wrong.\n"); return 1; } if (strncmp(msg, new_msg, new_msg_size) != 0) { printf("The decoded octed stream is not correct.\n"); return 1; } xds_destroy(xds); free(new_msg); /* Everything went fine. */ return 0; } From ossp-cvs-owner@ossp.org Thu Jul 19 17:21:37 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f6JFLZ373909; Thu, 19 Jul 2001 17:21:35 +0200 (CEST) Date: Thu, 19 Jul 2001 17:21:35 +0200 (CEST) Message-Id: <200107191521.f6JFLZ373909@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds vencode.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 19-Jul-2001 17:21:35 Branch: HEAD Handle: 2001071916213500 Modified files: ossp-pkg/srpc/libxds vencode.c Log: Removed debug output. Summary: Revision Changes Path 1.10 +0 -6 ossp-pkg/srpc/libxds/vencode.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/vencode.c ============================================================ $ cvs diff -u -r1.9 -r1.10 vencode.c --- ossp-pkg/srpc/libxds/vencode.c 2001/07/18 17:49:51 1.9 +++ ossp-pkg/srpc/libxds/vencode.c 2001/07/19 15:21:35 1.10 @@ -25,8 +25,6 @@ SUCH DAMAGE. */ -#include /* delete me */ - #include #include #include @@ -62,7 +60,6 @@ assert(rc == XDS_OK || rc == XDS_ERR_NO_MEM); if (rc != XDS_OK) return rc; - printf("Setting up buffer with capacity %d byte.\n", xds->buffer_capacity); xds->buffer_len = 0; xds->we_own_buffer = XDS_FALSE; } @@ -82,7 +79,6 @@ assert(rc == XDS_OK || rc == XDS_ERR_NO_MEM); if (rc != XDS_OK) return rc; - printf("Enlarged buffer to %d byte.\n", xds->buffer_capacity); } else return XDS_ERR_OVERFLOW; @@ -111,7 +107,6 @@ int restart_engine; do { - printf("Executing engine '%s' ...\n", name); args_backup = args; rc = (*xds->engines[pos].engine)(xds, xds->engines[pos].context, @@ -149,7 +144,6 @@ rc = rc2; goto leave; } - printf("Enlarged buffer to %d byte.\n", xds->buffer_capacity); } else { From ossp-cvs-owner@ossp.org Fri Jul 20 11:22:28 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f6K9MRa11207; Fri, 20 Jul 2001 11:22:27 +0200 (CEST) Date: Fri, 20 Jul 2001 11:22:27 +0200 (CEST) Message-Id: <200107200922.f6K9MRa11207@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds Makefile ossp-pkg/srpc/libxds/regress... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 20-Jul-2001 11:22:27 Branch: HEAD Handle: 19700101010000995617346 Added files: ossp-pkg/srpc/libxds xdr-decode-octetstream.c xdr-encode-octetstream.c ossp-pkg/srpc/libxds/regression-tests xdr-octetstream-empty.c xdr-octetstream.c Modified files: ossp-pkg/srpc/libxds Makefile xds.h ossp-pkg/srpc/libxds/regression-tests Makefile xdr-string-empty.c xdr-string.c Removed files: ossp-pkg/srpc/libxds xdr-decode-octedstream.c xdr-encode-octedstream.c ossp-pkg/srpc/libxds/regression-tests xdr-octedstream-empty.c xdr-octedstream.c Log: People who know how to spell clearly have an advantage. Summary: Revision Changes Path 1.20 +1 -1 ossp-pkg/srpc/libxds/Makefile 1.19 +1 -1 ossp-pkg/srpc/libxds/regression-tests/Makefile NONE +0 -110 ossp-pkg/srpc/libxds/regression-tests/xdr-octedstream-empty.c NONE +0 -110 ossp-pkg/srpc/libxds/regression-tests/xdr-octedstream.c 1.1 +110 -0 ossp-pkg/srpc/libxds/regression-tests/xdr-octetstream-empty.c 1.1 +110 -0 ossp-pkg/srpc/libxds/regression-tests/xdr-octetstream.c 1.2 +3 -3 ossp-pkg/srpc/libxds/regression-tests/xdr-string-empty.c 1.2 +3 -3 ossp-pkg/srpc/libxds/regression-tests/xdr-string.c NONE +0 -89 ossp-pkg/srpc/libxds/xdr-decode-octedstream.c 1.1 +89 -0 ossp-pkg/srpc/libxds/xdr-decode-octetstream.c NONE +0 -72 ossp-pkg/srpc/libxds/xdr-encode-octedstream.c 1.1 +72 -0 ossp-pkg/srpc/libxds/xdr-encode-octetstream.c 1.22 +2 -2 ossp-pkg/srpc/libxds/xds.h ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/Makefile ============================================================ $ cvs diff -u -r1.19 -r1.20 Makefile --- ossp-pkg/srpc/libxds/Makefile 2001/07/19 15:13:39 1.19 +++ ossp-pkg/srpc/libxds/Makefile 2001/07/20 09:22:25 1.20 @@ -19,7 +19,7 @@ set-capacity.o xdr-encode-int32.o xdr-encode-int64.o \ xdr-encode-uint32.o xdr-encode-uint64.o xdr-decode-int32.o \ xdr-decode-int64.o xdr-decode-uint32.o xdr-decode-uint64.o \ - xdr-encode-octedstream.o xdr-decode-octedstream.o \ + xdr-encode-octetstream.o xdr-decode-octetstream.o \ xdr-encode-string.o xdr-decode-string.o .c.o: $(CC) $(CPPFLAGS) $(WARNFLAGS) $(OPTFLAGS) $(CFLAGS) -c $< Index: ossp-pkg/srpc/libxds/regression-tests/Makefile ============================================================ $ cvs diff -u -r1.18 -r1.19 Makefile --- ossp-pkg/srpc/libxds/regression-tests/Makefile 2001/07/19 15:20:47 1.18 +++ ossp-pkg/srpc/libxds/regression-tests/Makefile 2001/07/20 09:22:26 1.19 @@ -13,7 +13,7 @@ TESTS = xds-core.exe xds-find-engine.exe xds-register.exe xds-encode.exe \ xds-getbuffer.exe xds-decode.exe xds-setbuffer.exe xds-engine-restart.exe \ xdr-uint32.exe xdr-int32.exe xdr-uint64.exe xdr-int64.exe \ - xdr-octedstream.exe xdr-octedstream-empty.exe xdr-string.exe \ + xdr-octetstream.exe xdr-octetstream-empty.exe xdr-string.exe \ xdr-string-empty.exe xds-mystruct.exe .SUFFIXES: Index: ossp-pkg/srpc/libxds/regression-tests/xdr-octetstream-empty.c ============================================================ $ cvs update -p -r1.1 xdr-octetstream-empty.c /* XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) This file is part of OSSP XDS, an extensible data serialization library which can be found at http://www.ossp.com/pkg/xds/. 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. */ #include #include #include "../internal.h" int main() { xds_t* xds; char* buffer; size_t buffer_size; char msg[] = ""; char* new_msg; size_t new_msg_size; /* Encode the string as octet stream. Then erase the buffer and decode the string back, verifying that it hasn't changed. */ xds = xds_init(XDS_ENCODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); return 1; } if (xds_register(xds, "os", &xdr_encode_octetstream, NULL) != XDS_OK) { printf("Failed to register my encoding engines.\n"); return 1; } if (xds_encode(xds, "os", msg, 0) != XDS_OK) { printf("xds_encode() failed.\n"); return 1; } if (xds_getbuffer(xds, XDS_GIFT, (void**)&buffer, &buffer_size) != XDS_OK) { printf("xds_getbuffer() failed.\n"); return 1; } xds_destroy(xds); if (buffer_size % 4 != 0) { printf("The encoded octet stream's buffer size is not a multiple of 4.\n"); return 1; } xds = xds_init(XDS_DECODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); return 1; } if (xds_register(xds, "os", &xdr_decode_octetstream, NULL) != XDS_OK) { printf("Failed to register my decoding engines.\n"); return 1; } if (xds_setbuffer(xds, XDS_GIFT, buffer, buffer_size) != XDS_OK) { printf("xds_setbuffer() failed.\n"); return 1; } if (xds_decode(xds, "os", &new_msg, &new_msg_size) != XDS_OK) { printf("xds_decode() failed.\n"); return 1; } if (new_msg_size != 0) { printf("The size of the decoded message is wrong.\n"); return 1; } if (strncmp(msg, new_msg, new_msg_size) != 0) { printf("The decoded octet stream is not correct.\n"); return 1; } xds_destroy(xds); free(new_msg); /* Everything went fine. */ return 0; } Index: ossp-pkg/srpc/libxds/regression-tests/xdr-octetstream.c ============================================================ $ cvs update -p -r1.1 xdr-octetstream.c /* XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) This file is part of OSSP XDS, an extensible data serialization library which can be found at http://www.ossp.com/pkg/xds/. 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. */ #include #include #include "../internal.h" int main() { xds_t* xds; char* buffer; size_t buffer_size; char msg[] = "Hello World"; char* new_msg; size_t new_msg_size; /* Encode the string as octet stream. Then erase the buffer and decode the string back, verifying that it hasn't changed. */ xds = xds_init(XDS_ENCODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); return 1; } if (xds_register(xds, "os", &xdr_encode_octetstream, NULL) != XDS_OK) { printf("Failed to register my encoding engines.\n"); return 1; } if (xds_encode(xds, "os", msg, strlen(msg)) != XDS_OK) { printf("xds_encode() failed.\n"); return 1; } if (xds_getbuffer(xds, XDS_GIFT, (void**)&buffer, &buffer_size) != XDS_OK) { printf("xds_getbuffer() failed.\n"); return 1; } xds_destroy(xds); if (buffer_size % 4 != 0) { printf("The encoded octet stream's buffer size is not a multiple of 4.\n"); return 1; } xds = xds_init(XDS_DECODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); return 1; } if (xds_register(xds, "os", &xdr_decode_octetstream, NULL) != XDS_OK) { printf("Failed to register my decoding engines.\n"); return 1; } if (xds_setbuffer(xds, XDS_GIFT, buffer, buffer_size) != XDS_OK) { printf("xds_setbuffer() failed.\n"); return 1; } if (xds_decode(xds, "os", &new_msg, &new_msg_size) != XDS_OK) { printf("xds_decode() failed.\n"); return 1; } if (new_msg_size != strlen(msg)) { printf("The size of the decoded message is wrong.\n"); return 1; } if (strncmp(msg, new_msg, new_msg_size) != 0) { printf("The decoded octet stream is not correct.\n"); return 1; } xds_destroy(xds); free(new_msg); /* Everything went fine. */ return 0; } Index: ossp-pkg/srpc/libxds/regression-tests/xdr-string-empty.c ============================================================ $ cvs diff -u -r1.1 -r1.2 xdr-string-empty.c --- ossp-pkg/srpc/libxds/regression-tests/xdr-string-empty.c 2001/07/19 15:20:47 1.1 +++ ossp-pkg/srpc/libxds/regression-tests/xdr-string-empty.c 2001/07/20 09:22:26 1.2 @@ -39,7 +39,7 @@ char* new_msg; size_t new_msg_size; - /* Encode the string as octed stream. Then erase the buffer and + /* Encode the string as octet stream. Then erase the buffer and decode the string back, verifying that it hasn't changed. */ xds = xds_init(XDS_ENCODE); @@ -66,7 +66,7 @@ xds_destroy(xds); if (buffer_size % 4 != 0) { - printf("The encoded octed stream's buffer size is not a multiple of 4.\n"); + printf("The encoded strings' buffer size is not a multiple of 4.\n"); return 1; } @@ -98,7 +98,7 @@ } if (strncmp(msg, new_msg, new_msg_size) != 0) { - printf("The decoded octed stream is not correct.\n"); + printf("The decoded string is not correct.\n"); return 1; } xds_destroy(xds); Index: ossp-pkg/srpc/libxds/regression-tests/xdr-string.c ============================================================ $ cvs diff -u -r1.1 -r1.2 xdr-string.c --- ossp-pkg/srpc/libxds/regression-tests/xdr-string.c 2001/07/19 15:13:40 1.1 +++ ossp-pkg/srpc/libxds/regression-tests/xdr-string.c 2001/07/20 09:22:26 1.2 @@ -39,7 +39,7 @@ char* new_msg; size_t new_msg_size; - /* Encode the string as octed stream. Then erase the buffer and + /* Encode the string as octet stream. Then erase the buffer and decode the string back, verifying that it hasn't changed. */ xds = xds_init(XDS_ENCODE); @@ -66,7 +66,7 @@ xds_destroy(xds); if (buffer_size % 4 != 0) { - printf("The encoded octed stream's buffer size is not a multiple of 4.\n"); + printf("The encoded strings' buffer size is not a multiple of 4.\n"); return 1; } @@ -98,7 +98,7 @@ } if (strncmp(msg, new_msg, new_msg_size) != 0) { - printf("The decoded octed stream is not correct.\n"); + printf("The decoded string is not correct.\n"); return 1; } xds_destroy(xds); Index: ossp-pkg/srpc/libxds/xdr-decode-octetstream.c ============================================================ $ cvs update -p -r1.1 xdr-decode-octetstream.c /* XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) This file is part of OSSP XDS, an extensible data serialization library which can be found at http://www.ossp.com/pkg/xds/. 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. */ #include #include #include #include "internal.h" int xdr_decode_octetstream(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) { void** p; size_t* p_len; size_t padding; /* Consistency checks. */ assert(xds != NULL); assert(buffer != NULL); assert(buffer_size != 0); assert(args != NULL); if (xds == NULL || buffer == NULL || buffer_size == 0 || args == NULL) return XDS_ERR_INVALID_ARG; /* Get pointers from the stack. */ p = va_arg(*args, void**); p_len = va_arg(*args, size_t*); assert(p != NULL); assert(p_len != NULL); /* Read the size of the message. */ if (buffer_size >= 4) { *p_len = ((u_int8_t*)buffer)[0]; *p_len = *p_len << 8; *p_len += ((u_int8_t*)buffer)[1]; *p_len = *p_len << 8; *p_len += ((u_int8_t*)buffer)[2]; *p_len = *p_len << 8; *p_len += ((u_int8_t*)buffer)[3]; } else return XDS_ERR_UNDERFLOW; /* Calculate padding. */ padding = (4 - (*p_len & 0x03)) & 0x03; /* Do we have enough data?. */ if (buffer_size < 4 + *p_len + padding) return XDS_ERR_UNDERFLOW; /* Allocate buffer for the data. */ *p = malloc(*p_len); if (*p == NULL) return XDS_ERR_NO_MEM; /* Copy data into the buffer. */ memmove(*p, (u_int8_t*)buffer+4, *p_len); /* Done. */ return 4 + *p_len + padding; } Index: ossp-pkg/srpc/libxds/xdr-encode-octetstream.c ============================================================ $ cvs update -p -r1.1 xdr-encode-octetstream.c /* XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) This file is part of OSSP XDS, an extensible data serialization library which can be found at http://www.ossp.com/pkg/xds/. 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. */ #include #include #include #include "internal.h" int xdr_encode_octetstream(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) { u_int8_t* p; size_t p_len; size_t padding; /* Consistency checks. */ assert(xds != NULL); assert(buffer != NULL); assert(buffer_size != 0); assert(args != NULL); if (xds == NULL || buffer == NULL || buffer_size == 0 || args == NULL) return XDS_ERR_INVALID_ARG; /* Get value from stack and calculate the correct amount of padding. */ p = (u_int8_t*)va_arg(*args, void*); assert(p != NULL); p_len = va_arg(*args, size_t); padding = (4 - (p_len & 0x03)) & 0x03; assert((p_len + padding) % 4 == 0); /* Format the values into the buffer. */ if (buffer_size >= 4 + p_len + padding) { ((u_int8_t*)buffer)[0] = (p_len >> 24) & 0x000000ff; ((u_int8_t*)buffer)[1] = (p_len >> 16) & 0x000000ff; ((u_int8_t*)buffer)[2] = (p_len >> 8) & 0x000000ff; ((u_int8_t*)buffer)[3] = (p_len >> 0) & 0x000000ff; memmove((u_int8_t*)buffer+4, p, p_len); memset(buffer+4+p_len, 0, padding); } /* Done. */ return 4 + p_len + padding; } Index: ossp-pkg/srpc/libxds/xds.h ============================================================ $ cvs diff -u -r1.21 -r1.22 xds.h --- ossp-pkg/srpc/libxds/xds.h 2001/07/19 15:13:39 1.21 +++ ossp-pkg/srpc/libxds/xds.h 2001/07/20 09:22:25 1.22 @@ -80,8 +80,8 @@ int xdr_decode_uint64(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); int xdr_decode_int64(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); -int xdr_encode_octedstream(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); -int xdr_decode_octedstream(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); +int xdr_encode_octetstream(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); +int xdr_decode_octetstream(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); int xdr_encode_string(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); int xdr_decode_string(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); From ossp-cvs-owner@ossp.org Fri Jul 20 11:53:40 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f6K9rdm15145; Fri, 20 Jul 2001 11:53:39 +0200 (CEST) Date: Fri, 20 Jul 2001 11:53:39 +0200 (CEST) Message-Id: <200107200953.f6K9rdm15145@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds Makefile Makefile.in configure.in oss... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 20-Jul-2001 11:53:38 Branch: HEAD Handle: 19700101010000995619218 Added files: ossp-pkg/srpc/libxds Makefile.in configure.in ossp-pkg/srpc/libxds/regression-tests Makefile.in Removed files: ossp-pkg/srpc/libxds Makefile ossp-pkg/srpc/libxds/regression-tests Makefile Log: Added skeleton autoconf support. Summary: Revision Changes Path NONE +0 -69 ossp-pkg/srpc/libxds/Makefile 1.1 +74 -0 ossp-pkg/srpc/libxds/Makefile.in 1.1 +0 -0 ossp-pkg/srpc/libxds/configure.in NONE +0 -40 ossp-pkg/srpc/libxds/regression-tests/Makefile 1.1 +44 -0 ossp-pkg/srpc/libxds/regression-tests/Makefile.in ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/Makefile.in ============================================================ $ cvs update -p -r1.1 Makefile.in # Build libxds and support/test programs. CC = @CC@ AR = ar RANLIB = @RANLIB@ CPPFLAGS = @CPPFLAGS@ @DEFS@ CFLAGS = @CFLAGS@ LDFLAGS = @LDFLAGS@ OBJS = decode.o destroy.o encode.o getbuffer.o init.o register.o \ setbuffer.o unregister.o vdecode.o vencode.o find-engine.o \ set-capacity.o xdr-encode-int32.o xdr-encode-int64.o \ xdr-encode-uint32.o xdr-encode-uint64.o xdr-decode-int32.o \ xdr-decode-int64.o xdr-decode-uint32.o xdr-decode-uint64.o \ xdr-encode-octetstream.o xdr-decode-octetstream.o \ xdr-encode-string.o xdr-decode-string.o .c.o: $(CC) $(CPPFLAGS) $(WARNFLAGS) $(OPTFLAGS) $(CFLAGS) -c $< .cpp.o: $(CXX) $(CPPFLAGS) $(WARNFLAGS) $(OPTFLAGS) $(CXXFLAGS) -c $< all: libxds.a xds.3 libxds.a: $(OBJS) @rm -f $@ $(AR) cr $@ $(OBJS) $(RANLIB) $@ xds.3: xds.pod pod2man --section=3 --center="XDS Library Programmer API " xds.pod >xds.3 clean:: @(cd regression-tests && $(MAKE) $@) rm -f $(OBJS) rm -f libxds.a test.o test xds.3 distclean:: clean @(cd regression-tests && $(MAKE) $@) rm -f config.log config.status Makefile realclean:: distclean rm -f configure check: libxds.a (cd regression-tests && $(MAKE) check) # Dependencies decode.o: internal.h xds.h destroy.o: internal.h xds.h encode.o: internal.h xds.h find-engine.o: internal.h xds.h getbuffer.o: internal.h xds.h init.o: internal.h xds.h register.o: internal.h xds.h set-capacity.o: internal.h xds.h setbuffer.o: internal.h xds.h unregister.o: internal.h xds.h vdecode.o: internal.h xds.h vencode.o: internal.h xds.h xdr-decode-int32.o: internal.h xds.h xdr-decode-int64.o: internal.h xds.h xdr-decode-octetstream.o: internal.h xds.h xdr-decode-string.o: internal.h xds.h xdr-decode-uint32.o: internal.h xds.h xdr-decode-uint64.o: internal.h xds.h xdr-encode-int32.o: internal.h xds.h xdr-encode-int64.o: internal.h xds.h xdr-encode-octetstream.o: internal.h xds.h xdr-encode-string.o: internal.h xds.h xdr-encode-uint32.o: internal.h xds.h xdr-encode-uint64.o: internal.h xds.h Index: ossp-pkg/srpc/libxds/configure.in ============================================================ $ cvs update -p -r1.1 configure.in dnl configure.in -- Process this file with autoconf to produce a configure script. AC_INIT(libxds, [$Revision: 1.1 $]) dnl Get rid of the lousy -g and -O defaults in CFLAGS. dnl CFLAGS=${CFLAGS:-} dnl Checks for paths and programs. dnl AC_PROG_CC AC_PROG_RANLIB dnl Set special flags for gcc. dnl if test "$GCC" = yes; then CFLAGS="$CFLAGS -Wall -ansi -pedantic -Wshadow -Wpointer-arith -Wcast-align -Winline -Wmissing-prototypes -Wmissing-declarations -Wnested-externs" fi dnl Write results. dnl AC_OUTPUT(Makefile regression-tests/Makefile) Index: ossp-pkg/srpc/libxds/regression-tests/Makefile.in ============================================================ $ cvs update -p -r1.1 Makefile.in # Build and run the regression tests. CC = @CC@ AR = ar RANLIB = @RANLIB@ CPPFLAGS = @CPPFLAGS@ @DEFS@ CFLAGS = @CFLAGS@ LDFLAGS = @LDFLAGS@ -L.. TESTS = xds-core.exe xds-find-engine.exe xds-register.exe xds-encode.exe \ xds-getbuffer.exe xds-decode.exe xds-setbuffer.exe xds-engine-restart.exe \ xdr-uint32.exe xdr-int32.exe xdr-uint64.exe xdr-int64.exe \ xdr-octetstream.exe xdr-octetstream-empty.exe xdr-string.exe \ xdr-string-empty.exe xds-mystruct.exe .SUFFIXES: .SUFFIXES: .c .exe .c.exe: $(CC) $(CPPFLAGS) $(WARNFLAGS) $(OPTFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $< -lxds .cpp.exe: $(CXX) $(CPPFLAGS) $(WARNFLAGS) $(OPTFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ $< -lxds all: $(TESTS) check: all @./.run-tests $(TESTS) ../libxds.a: (cd .. && $(MAKE) libxds.a) clean:: rm -f $(TESTS) *.log distclean:: clean rm -f Makefile realclean:: distclean # Dependencies $(TESTS): ../libxds.a From ossp-cvs-owner@ossp.org Fri Jul 20 11:54:36 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f6K9sZB15257; Fri, 20 Jul 2001 11:54:35 +0200 (CEST) Date: Fri, 20 Jul 2001 11:54:35 +0200 (CEST) Message-Id: <200107200954.f6K9sZB15257@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds Makefile.in ossp-pkg/srpc/libxds/regr... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 20-Jul-2001 11:54:35 Branch: HEAD Handle: 2001072010543401 Modified files: ossp-pkg/srpc/libxds Makefile.in ossp-pkg/srpc/libxds/regression-tests Makefile.in Log: Made comments in makefiles more accurate. Summary: Revision Changes Path 1.2 +1 -1 ossp-pkg/srpc/libxds/Makefile.in 1.2 +1 -1 ossp-pkg/srpc/libxds/regression-tests/Makefile.in ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/Makefile.in ============================================================ $ cvs diff -u -r1.1 -r1.2 Makefile.in --- ossp-pkg/srpc/libxds/Makefile.in 2001/07/20 09:53:37 1.1 +++ ossp-pkg/srpc/libxds/Makefile.in 2001/07/20 09:54:34 1.2 @@ -1,4 +1,4 @@ -# Build libxds and support/test programs. +# Build libxds. CC = @CC@ AR = ar Index: ossp-pkg/srpc/libxds/regression-tests/Makefile.in ============================================================ $ cvs diff -u -r1.1 -r1.2 Makefile.in --- ossp-pkg/srpc/libxds/regression-tests/Makefile.in 2001/07/20 09:53:38 1.1 +++ ossp-pkg/srpc/libxds/regression-tests/Makefile.in 2001/07/20 09:54:35 1.2 @@ -1,4 +1,4 @@ -# Build and run the regression tests. +# Build and run the regression tests for libxds. CC = @CC@ AR = ar From ossp-cvs-owner@ossp.org Fri Jul 20 11:55:31 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f6K9tUU15357; Fri, 20 Jul 2001 11:55:30 +0200 (CEST) Date: Fri, 20 Jul 2001 11:55:30 +0200 (CEST) Message-Id: <200107200955.f6K9tUU15357@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds Makefile.in Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 20-Jul-2001 11:55:30 Branch: HEAD Handle: 2001072010552900 Modified files: ossp-pkg/srpc/libxds Makefile.in Log: Solved the dependency thing. Summary: Revision Changes Path 1.3 +1 -24 ossp-pkg/srpc/libxds/Makefile.in ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/Makefile.in ============================================================ $ cvs diff -u -r1.2 -r1.3 Makefile.in --- ossp-pkg/srpc/libxds/Makefile.in 2001/07/20 09:54:34 1.2 +++ ossp-pkg/srpc/libxds/Makefile.in 2001/07/20 09:55:29 1.3 @@ -48,27 +48,4 @@ # Dependencies -decode.o: internal.h xds.h -destroy.o: internal.h xds.h -encode.o: internal.h xds.h -find-engine.o: internal.h xds.h -getbuffer.o: internal.h xds.h -init.o: internal.h xds.h -register.o: internal.h xds.h -set-capacity.o: internal.h xds.h -setbuffer.o: internal.h xds.h -unregister.o: internal.h xds.h -vdecode.o: internal.h xds.h -vencode.o: internal.h xds.h -xdr-decode-int32.o: internal.h xds.h -xdr-decode-int64.o: internal.h xds.h -xdr-decode-octetstream.o: internal.h xds.h -xdr-decode-string.o: internal.h xds.h -xdr-decode-uint32.o: internal.h xds.h -xdr-decode-uint64.o: internal.h xds.h -xdr-encode-int32.o: internal.h xds.h -xdr-encode-int64.o: internal.h xds.h -xdr-encode-octetstream.o: internal.h xds.h -xdr-encode-string.o: internal.h xds.h -xdr-encode-uint32.o: internal.h xds.h -xdr-encode-uint64.o: internal.h xds.h +$(OBJS): internal.h xds.h From ossp-cvs-owner@ossp.org Fri Jul 20 12:07:13 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f6KA7C817480; Fri, 20 Jul 2001 12:07:12 +0200 (CEST) Date: Fri, 20 Jul 2001 12:07:12 +0200 (CEST) Message-Id: <200107201007.f6KA7C817480@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds xdr-encode-octetstream.c xdr-encode-s... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 20-Jul-2001 12:07:12 Branch: HEAD Handle: 2001072011071100 Modified files: ossp-pkg/srpc/libxds xdr-encode-octetstream.c xdr-encode-string.c Log: Added casts to get rid of warnings. Summary: Revision Changes Path 1.2 +1 -1 ossp-pkg/srpc/libxds/xdr-encode-octetstream.c 1.2 +2 -2 ossp-pkg/srpc/libxds/xdr-encode-string.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/xdr-encode-octetstream.c ============================================================ $ cvs diff -u -r1.1 -r1.2 xdr-encode-octetstream.c --- ossp-pkg/srpc/libxds/xdr-encode-octetstream.c 2001/07/20 09:22:25 1.1 +++ ossp-pkg/srpc/libxds/xdr-encode-octetstream.c 2001/07/20 10:07:11 1.2 @@ -63,7 +63,7 @@ ((u_int8_t*)buffer)[2] = (p_len >> 8) & 0x000000ff; ((u_int8_t*)buffer)[3] = (p_len >> 0) & 0x000000ff; memmove((u_int8_t*)buffer+4, p, p_len); - memset(buffer+4+p_len, 0, padding); + memset((u_int8_t*)buffer+4+p_len, 0, padding); } /* Done. */ Index: ossp-pkg/srpc/libxds/xdr-encode-string.c ============================================================ $ cvs diff -u -r1.1 -r1.2 xdr-encode-string.c --- ossp-pkg/srpc/libxds/xdr-encode-string.c 2001/07/19 15:13:39 1.1 +++ ossp-pkg/srpc/libxds/xdr-encode-string.c 2001/07/20 10:07:11 1.2 @@ -50,7 +50,7 @@ p = (u_int8_t*)va_arg(*args, void*); assert(p != NULL); - p_len = strlen(p); + p_len = strlen((char*)p); padding = (4 - (p_len & 0x03)) & 0x03; assert((p_len + padding) % 4 == 0); @@ -63,7 +63,7 @@ ((u_int8_t*)buffer)[2] = (p_len >> 8) & 0x000000ff; ((u_int8_t*)buffer)[3] = (p_len >> 0) & 0x000000ff; memmove((u_int8_t*)buffer+4, p, p_len); - memset(buffer+4+p_len, 0, padding); + memset((u_int8_t*)buffer+4+p_len, 0, padding); } /* Done. */ From ossp-cvs-owner@ossp.org Fri Jul 20 12:08:28 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f6KA8RF17616; Fri, 20 Jul 2001 12:08:27 +0200 (CEST) Date: Fri, 20 Jul 2001 12:08:27 +0200 (CEST) Message-Id: <200107201008.f6KA8RF17616@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds .cvsignore ossp-pkg/srpc/libxds/regre... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 20-Jul-2001 12:08:27 Branch: HEAD Handle: 2001072011082600 Modified files: ossp-pkg/srpc/libxds .cvsignore ossp-pkg/srpc/libxds/regression-tests .cvsignore Log: Ignore dependent files created by autoconf. Summary: Revision Changes Path 1.3 +1 -1 ossp-pkg/srpc/libxds/.cvsignore 1.2 +1 -0 ossp-pkg/srpc/libxds/regression-tests/.cvsignore ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/.cvsignore ============================================================ $ cvs diff -u -r1.2 -r1.3 .cvsignore --- ossp-pkg/srpc/libxds/.cvsignore 2001/07/03 09:38:25 1.2 +++ ossp-pkg/srpc/libxds/.cvsignore 2001/07/20 10:08:26 1.3 @@ -1,2 +1,2 @@ xds.3 -test +Makefile configure Index: ossp-pkg/srpc/libxds/regression-tests/.cvsignore ============================================================ $ cvs diff -u -r1.1 -r1.2 .cvsignore --- ossp-pkg/srpc/libxds/regression-tests/.cvsignore 2001/07/04 15:09:55 1.1 +++ ossp-pkg/srpc/libxds/regression-tests/.cvsignore 2001/07/20 10:08:26 1.2 @@ -1 +1,2 @@ *.log +Makefile From ossp-cvs-owner@ossp.org Fri Jul 20 12:09:08 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f6KA97U17717; Fri, 20 Jul 2001 12:09:07 +0200 (CEST) Date: Fri, 20 Jul 2001 12:09:07 +0200 (CEST) Message-Id: <200107201009.f6KA97U17717@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds Makefile.in ossp-pkg/srpc/libxds/regr... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 20-Jul-2001 12:09:07 Branch: HEAD Handle: 2001072011090600 Modified files: ossp-pkg/srpc/libxds Makefile.in ossp-pkg/srpc/libxds/regression-tests Makefile.in Log: Hard-code the define of _GNU_SOURCE for the moment. Summary: Revision Changes Path 1.4 +1 -1 ossp-pkg/srpc/libxds/Makefile.in 1.3 +2 -2 ossp-pkg/srpc/libxds/regression-tests/Makefile.in ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/Makefile.in ============================================================ $ cvs diff -u -r1.3 -r1.4 Makefile.in --- ossp-pkg/srpc/libxds/Makefile.in 2001/07/20 09:55:29 1.3 +++ ossp-pkg/srpc/libxds/Makefile.in 2001/07/20 10:09:06 1.4 @@ -4,7 +4,7 @@ AR = ar RANLIB = @RANLIB@ -CPPFLAGS = @CPPFLAGS@ @DEFS@ +CPPFLAGS = @CPPFLAGS@ @DEFS@ -D_GNU_SOURCE CFLAGS = @CFLAGS@ LDFLAGS = @LDFLAGS@ Index: ossp-pkg/srpc/libxds/regression-tests/Makefile.in ============================================================ $ cvs diff -u -r1.2 -r1.3 Makefile.in --- ossp-pkg/srpc/libxds/regression-tests/Makefile.in 2001/07/20 09:54:35 1.2 +++ ossp-pkg/srpc/libxds/regression-tests/Makefile.in 2001/07/20 10:09:06 1.3 @@ -4,7 +4,7 @@ AR = ar RANLIB = @RANLIB@ -CPPFLAGS = @CPPFLAGS@ @DEFS@ +CPPFLAGS = @CPPFLAGS@ @DEFS@ -D_GNU_SOURCE CFLAGS = @CFLAGS@ LDFLAGS = @LDFLAGS@ -L.. @@ -41,4 +41,4 @@ # Dependencies -$(TESTS): ../libxds.a +$(TESTS): ../libxds.a ../internal.h ../xds.h From ossp-cvs-owner@ossp.org Fri Jul 20 12:09:28 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f6KA9Rm17770; Fri, 20 Jul 2001 12:09:27 +0200 (CEST) Date: Fri, 20 Jul 2001 12:09:27 +0200 (CEST) Message-Id: <200107201009.f6KA9Rm17770@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds configure.in Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 20-Jul-2001 12:09:27 Branch: HEAD Handle: 2001072011092700 Modified files: ossp-pkg/srpc/libxds configure.in Log: Added the -Wno-long-long flag. Summary: Revision Changes Path 1.2 +2 -2 ossp-pkg/srpc/libxds/configure.in ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/configure.in ============================================================ $ cvs diff -u -r1.1 -r1.2 configure.in --- ossp-pkg/srpc/libxds/configure.in 2001/07/20 09:53:37 1.1 +++ ossp-pkg/srpc/libxds/configure.in 2001/07/20 10:09:27 1.2 @@ -1,6 +1,6 @@ dnl configure.in -- Process this file with autoconf to produce a configure script. -AC_INIT(libxds, [$Revision: 1.1 $]) +AC_INIT(libxds, [$Revision: 1.2 $]) dnl Get rid of the lousy -g and -O defaults in CFLAGS. dnl @@ -14,7 +14,7 @@ dnl Set special flags for gcc. dnl if test "$GCC" = yes; then - CFLAGS="$CFLAGS -Wall -ansi -pedantic -Wshadow -Wpointer-arith -Wcast-align -Winline -Wmissing-prototypes -Wmissing-declarations -Wnested-externs" + CFLAGS="$CFLAGS -Wall -ansi -pedantic -Wshadow -Wpointer-arith -Wcast-align -Winline -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wno-long-long" fi dnl Write results. From ossp-cvs-owner@ossp.org Fri Jul 20 12:42:36 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f6KAgZR21432; Fri, 20 Jul 2001 12:42:35 +0200 (CEST) Date: Fri, 20 Jul 2001 12:42:35 +0200 (CEST) Message-Id: <200107201042.f6KAgZR21432@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds .cvsignore configure.ac configure.in ... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 20-Jul-2001 12:42:35 Branch: HEAD Handle: 19700101010000995622154 Added files: ossp-pkg/srpc/libxds configure.ac xds.h.in Modified files: ossp-pkg/srpc/libxds .cvsignore Removed files: ossp-pkg/srpc/libxds configure.in xds.h Log: - Renamed configure.in to configure.ac for autoconf 2.50 and later. - Added tests that will find the exact data types and typedef our versions to them. Summary: Revision Changes Path 1.4 +1 -1 ossp-pkg/srpc/libxds/.cvsignore 1.1 +0 -0 ossp-pkg/srpc/libxds/configure.ac NONE +0 -22 ossp-pkg/srpc/libxds/configure.in NONE +0 -89 ossp-pkg/srpc/libxds/xds.h 1.1 +97 -0 ossp-pkg/srpc/libxds/xds.h.in ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/.cvsignore ============================================================ $ cvs diff -u -r1.3 -r1.4 .cvsignore --- ossp-pkg/srpc/libxds/.cvsignore 2001/07/20 10:08:26 1.3 +++ ossp-pkg/srpc/libxds/.cvsignore 2001/07/20 10:42:34 1.4 @@ -1,2 +1,2 @@ xds.3 -Makefile configure +xds.h Makefile configure Index: ossp-pkg/srpc/libxds/configure.ac ============================================================ $ cvs update -p -r1.1 configure.ac dnl configure.in -- Process this file with autoconf to produce a configure script. AC_INIT(libxds, [$Revision: 1.1 $]) dnl Get rid of the lousy -g and -O defaults in CFLAGS. dnl CFLAGS=${CFLAGS:-} dnl Checks for paths and programs. dnl AC_PROG_CC AC_PROG_RANLIB dnl Set special flags for gcc. dnl if test "$GCC" = yes; then CFLAGS="$CFLAGS -Wall -ansi -pedantic -Wshadow -Wpointer-arith -Wcast-align -Winline -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wno-long-long" fi dnl Check for exact data types. dnl AC_CHECK_TYPE(u_int8_t, [xds_uint8_t=u_int8_t], [AC_CHECK_TYPE(uint8_t, [xds_uint8_t=uint8_t], [AC_MSG_ERROR([no unsigned 8 bit data type found])] )] ) AC_SUBST([xds_uint8_t]) AC_CHECK_TYPE(u_int16_t, [xds_uint16_t=u_int16_t], [AC_CHECK_TYPE(uint16_t, [xds_uint16_t=uint16_t], [AC_MSG_ERROR([no unsigned 16 bit data type found])] )] ) AC_SUBST([xds_uint16_t]) AC_CHECK_TYPE(u_int32_t, [xds_uint32_t=u_int32_t], [AC_CHECK_TYPE(uint32_t, [xds_uint32_t=uint32_t], [AC_MSG_ERROR([no unsigned 32 bit data type found])] )] ) AC_SUBST([xds_uint32_t]) AC_CHECK_TYPE(int8_t, [xds_int8_t=int8_t], [AC_CHECK_TYPE(int8_t, [xds_int8_t=int8_t], [AC_MSG_ERROR([no signed 8 bit data type found])] )] ) AC_SUBST([xds_int8_t]) AC_CHECK_TYPE(int16_t, [xds_int16_t=int16_t], [AC_CHECK_TYPE(int16_t, [xds_int16_t=int16_t], [AC_MSG_ERROR([no signed 16 bit data type found])] )] ) AC_SUBST([xds_int16_t]) AC_CHECK_TYPE(int32_t, [xds_int32_t=int32_t], [AC_CHECK_TYPE(int32_t, [xds_int32_t=int32_t], [AC_MSG_ERROR([no signed 32 bit data type found])] )] ) AC_SUBST([xds_int32_t]) dnl Write results. dnl AC_OUTPUT(xds.h Makefile regression-tests/Makefile) Index: ossp-pkg/srpc/libxds/xds.h.in ============================================================ $ cvs update -p -r1.1 xds.h.in /* XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) This file is part of OSSP XDS, an extensible data serialization library which can be found at http://www.ossp.com/pkg/xds/. 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. xds.h: C API */ #ifndef __LIBXDS_H__ #define __LIBXDS_H__ #include #include #include typedef @xds_uint8_t@ xds_uint8_t; typedef @xds_uint16_t@ xds_uint16_t; typedef @xds_uint32_t@ xds_uint32_t; typedef @xds_int8_t@ xds_int8_t; typedef @xds_int16_t@ xds_int16_t; typedef @xds_int32_t@ xds_int32_t; enum { XDS_OK = 0, XDS_ERR_NO_MEM = -1, XDS_ERR_OVERFLOW = -2, XDS_ERR_INVALID_ARG = -3, XDS_ERR_TYPE_MISMATCH = -4, XDS_ERR_UNKNOWN_ENGINE = -5, XDS_ERR_INVALID_MODE = -6, XDS_ERR_UNDERFLOW = -7 }; typedef enum { XDS_ENCODE, XDS_DECODE } xds_mode_t; typedef enum { XDS_LOAN, XDS_GIFT } xds_scope_t; struct xds_context; typedef struct xds_context xds_t; typedef int (*xds_engine_t)(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); xds_t* xds_init(xds_mode_t); void xds_destroy(xds_t* xds); int xds_register(xds_t* xds, const char* name, xds_engine_t engine, void* engine_context); int xds_unregister(xds_t* xds, const char* name); int xds_setbuffer(xds_t* xds, xds_scope_t flag, void* buffer, size_t buffer_len); int xds_getbuffer(xds_t* xds, xds_scope_t flag, void** buffer, size_t* buffer_len); int xds_encode(xds_t* xds, const char* fmt, ...); int xds_decode(xds_t* xds, const char* fmt, ...); int xds_vencode(xds_t* xds, const char* fmt, va_list args); int xds_vdecode(xds_t* xds, const char* fmt, va_list args); int xdr_encode_uint32(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); int xdr_encode_int32(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); int xdr_encode_uint64(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); int xdr_encode_int64(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); int xdr_decode_uint32(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); int xdr_decode_int32(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); int xdr_decode_uint64(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); int xdr_decode_int64(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); int xdr_encode_octetstream(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); int xdr_decode_octetstream(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); int xdr_encode_string(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); int xdr_decode_string(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); #endif /* !defined(__LIBXDS_H__) */ From ossp-cvs-owner@ossp.org Fri Jul 20 12:56:04 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f6KAu3S23066; Fri, 20 Jul 2001 12:56:03 +0200 (CEST) Date: Fri, 20 Jul 2001 12:56:03 +0200 (CEST) Message-Id: <200107201056.f6KAu3S23066@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds configure.ac ossp-pkg/srpc/libxds/reg... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 20-Jul-2001 12:56:03 Branch: HEAD Handle: 2001072011560101 Modified files: ossp-pkg/srpc/libxds configure.ac xdr-decode-int32.c xdr-decode-int64.c xdr-decode-octetstream.c xdr-decode-string.c xdr-decode-uint32.c xdr-decode-uint64.c xdr-encode-int32.c xdr-encode-int64.c xdr-encode-octetstream.c xdr-encode-string.c xdr-encode-uint32.c xdr-encode-uint64.c xds.h.in ossp-pkg/srpc/libxds/regression-tests xdr-int32.c xdr-int64.c xdr-uint32.c xdr-uint64.c xds-mystruct.c Log: Use xds_(u)int(8|16|32|64) instead of the system defines. Summary: Revision Changes Path 1.2 +13 -1 ossp-pkg/srpc/libxds/configure.ac 1.4 +5 -5 ossp-pkg/srpc/libxds/regression-tests/xdr-int32.c 1.4 +5 -5 ossp-pkg/srpc/libxds/regression-tests/xdr-int64.c 1.5 +4 -4 ossp-pkg/srpc/libxds/regression-tests/xdr-uint32.c 1.5 +4 -4 ossp-pkg/srpc/libxds/regression-tests/xdr-uint64.c 1.3 +3 -3 ossp-pkg/srpc/libxds/regression-tests/xds-mystruct.c 1.2 +12 -12 ossp-pkg/srpc/libxds/xdr-decode-int32.c 1.2 +21 -21 ossp-pkg/srpc/libxds/xdr-decode-int64.c 1.2 +5 -5 ossp-pkg/srpc/libxds/xdr-decode-octetstream.c 1.2 +6 -6 ossp-pkg/srpc/libxds/xdr-decode-string.c 1.2 +6 -6 ossp-pkg/srpc/libxds/xdr-decode-uint32.c 1.2 +10 -10 ossp-pkg/srpc/libxds/xdr-decode-uint64.c 1.2 +8 -8 ossp-pkg/srpc/libxds/xdr-encode-int32.c 1.2 +12 -12 ossp-pkg/srpc/libxds/xdr-encode-int64.c 1.3 +10 -10 ossp-pkg/srpc/libxds/xdr-encode-octetstream.c 1.3 +8 -8 ossp-pkg/srpc/libxds/xdr-encode-string.c 1.2 +5 -5 ossp-pkg/srpc/libxds/xdr-encode-uint32.c 1.2 +9 -9 ossp-pkg/srpc/libxds/xdr-encode-uint64.c 1.2 +2 -0 ossp-pkg/srpc/libxds/xds.h.in ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/configure.ac ============================================================ $ cvs diff -u -r1.1 -r1.2 configure.ac --- ossp-pkg/srpc/libxds/configure.ac 2001/07/20 10:42:34 1.1 +++ ossp-pkg/srpc/libxds/configure.ac 2001/07/20 10:56:01 1.2 @@ -1,6 +1,6 @@ dnl configure.in -- Process this file with autoconf to produce a configure script. -AC_INIT(libxds, [$Revision: 1.1 $]) +AC_INIT(libxds, [$Revision: 1.2 $]) dnl Get rid of the lousy -g and -O defaults in CFLAGS. dnl @@ -37,6 +37,12 @@ )] ) AC_SUBST([xds_uint32_t]) +AC_CHECK_TYPE(u_int64_t, [xds_uint64_t=u_int64_t], + [AC_CHECK_TYPE(uint64_t, [xds_uint64_t=uint64_t], + [AC_MSG_ERROR([no unsigned 64 bit data type found])] + )] + ) +AC_SUBST([xds_uint64_t]) AC_CHECK_TYPE(int8_t, [xds_int8_t=int8_t], [AC_CHECK_TYPE(int8_t, [xds_int8_t=int8_t], [AC_MSG_ERROR([no signed 8 bit data type found])] @@ -55,6 +61,12 @@ )] ) AC_SUBST([xds_int32_t]) +AC_CHECK_TYPE(int64_t, [xds_int64_t=int64_t], + [AC_CHECK_TYPE(int64_t, [xds_int64_t=int64_t], + [AC_MSG_ERROR([no signed 64 bit data type found])] + )] + ) +AC_SUBST([xds_int64_t]) dnl Write results. dnl Index: ossp-pkg/srpc/libxds/regression-tests/xdr-int32.c ============================================================ $ cvs diff -u -r1.3 -r1.4 xdr-int32.c --- ossp-pkg/srpc/libxds/regression-tests/xdr-int32.c 2001/07/18 18:58:46 1.3 +++ ossp-pkg/srpc/libxds/regression-tests/xdr-int32.c 2001/07/20 10:56:02 1.4 @@ -41,7 +41,7 @@ char* xds_buf; size_t xds_buf_size; - int32_t values[] = + xds_int32_t values[] = { 0x00000000, 0x12345678, @@ -56,7 +56,7 @@ /* Encode the values array using the RPC-XDR implementation. */ xdrmem_create(&xdrs, xdr_buf, sizeof(xdr_buf), XDR_ENCODE); - for (i = 0; i < sizeof(values)/sizeof(int32_t); ++i) + for (i = 0; i < sizeof(values)/sizeof(xds_int32_t); ++i) xdr_int32_t(&xdrs, &values[i]); xdr_buf_size = xdr_getpos(&xdrs); xdr_destroy(&xdrs); @@ -74,7 +74,7 @@ printf("Failed to register my encoding engines.\n"); return 1; } - for (i = 0; i < sizeof(values)/sizeof(int32_t); ++i) + for (i = 0; i < sizeof(values)/sizeof(xds_int32_t); ++i) { if (xds_encode(xds, "int", values[i]) != XDS_OK) { @@ -122,9 +122,9 @@ printf("setbuffer() failed.\n"); return 1; } - for (i = 0; i < sizeof(values)/sizeof(int32_t); ++i) + for (i = 0; i < sizeof(values)/sizeof(xds_int32_t); ++i) { - int32_t tmp; + xds_int32_t tmp; if (xds_decode(xds, "int", &tmp) != XDS_OK) { printf("xds_encode() failed for the %d value!\n", i); Index: ossp-pkg/srpc/libxds/regression-tests/xdr-int64.c ============================================================ $ cvs diff -u -r1.3 -r1.4 xdr-int64.c --- ossp-pkg/srpc/libxds/regression-tests/xdr-int64.c 2001/07/18 18:58:46 1.3 +++ ossp-pkg/srpc/libxds/regression-tests/xdr-int64.c 2001/07/20 10:56:02 1.4 @@ -41,7 +41,7 @@ char* xds_buf; size_t xds_buf_size; - int64_t values[] = + xds_int64_t values[] = { 0x0000000000000000LL, 0x123456789abcdef0LL, @@ -56,7 +56,7 @@ /* Encode the values array using the RPC-XDR implementation. */ xdrmem_create(&xdrs, xdr_buf, sizeof(xdr_buf), XDR_ENCODE); - for (i = 0; i < sizeof(values)/sizeof(int64_t); ++i) + for (i = 0; i < sizeof(values)/sizeof(xds_int64_t); ++i) xdr_int64_t(&xdrs, &values[i]); xdr_buf_size = xdr_getpos(&xdrs); xdr_destroy(&xdrs); @@ -74,7 +74,7 @@ printf("Failed to register my encoding engines.\n"); return 1; } - for (i = 0; i < sizeof(values)/sizeof(int64_t); ++i) + for (i = 0; i < sizeof(values)/sizeof(xds_int64_t); ++i) { if (xds_encode(xds, "int", values[i]) != XDS_OK) { @@ -122,9 +122,9 @@ printf("setbuffer() failed.\n"); return 1; } - for (i = 0; i < sizeof(values)/sizeof(int64_t); ++i) + for (i = 0; i < sizeof(values)/sizeof(xds_int64_t); ++i) { - int64_t tmp; + xds_int64_t tmp; if (xds_decode(xds, "int", &tmp) != XDS_OK) { printf("xds_encode() failed for the %d value!\n", i); Index: ossp-pkg/srpc/libxds/regression-tests/xdr-uint32.c ============================================================ $ cvs diff -u -r1.4 -r1.5 xdr-uint32.c --- ossp-pkg/srpc/libxds/regression-tests/xdr-uint32.c 2001/07/19 09:47:03 1.4 +++ ossp-pkg/srpc/libxds/regression-tests/xdr-uint32.c 2001/07/20 10:56:02 1.5 @@ -48,7 +48,7 @@ char* xds_buf; size_t xds_buf_size; - u_int32_t values[] = + xds_uint32_t values[] = { 0x00000000, 0x12345678, @@ -62,7 +62,7 @@ /* Encode the values array using the RPC-XDR implementation. */ xdrmem_create(&xdrs, xdr_buf, sizeof(xdr_buf), XDR_ENCODE); - for (i = 0; i < sizeof(values)/sizeof(u_int32_t); ++i) + for (i = 0; i < sizeof(values)/sizeof(xds_uint32_t); ++i) xdr_uint32_t(&xdrs, &values[i]); xdr_buf_size = xdr_getpos(&xdrs); xdr_destroy(&xdrs); @@ -128,9 +128,9 @@ printf("setbuffer() failed.\n"); return 1; } - for (i = 0; i < sizeof(values)/sizeof(u_int32_t); ++i) + for (i = 0; i < sizeof(values)/sizeof(xds_uint32_t); ++i) { - u_int32_t tmp; + xds_uint32_t tmp; if (xds_decode(xds, "uint", &tmp) != XDS_OK) { printf("xds_encode() failed for the %d value!\n", i); Index: ossp-pkg/srpc/libxds/regression-tests/xdr-uint64.c ============================================================ $ cvs diff -u -r1.4 -r1.5 xdr-uint64.c --- ossp-pkg/srpc/libxds/regression-tests/xdr-uint64.c 2001/07/19 09:47:03 1.4 +++ ossp-pkg/srpc/libxds/regression-tests/xdr-uint64.c 2001/07/20 10:56:02 1.5 @@ -48,7 +48,7 @@ char* xds_buf; size_t xds_buf_size; - u_int64_t values[] = + xds_uint64_t values[] = { 0x0000000000000000ULL, 0x123456789abcdef0ULL, @@ -62,7 +62,7 @@ /* Encode the values array using the RPC-XDR implementation. */ xdrmem_create(&xdrs, xdr_buf, sizeof(xdr_buf), XDR_ENCODE); - for (i = 0; i < sizeof(values)/sizeof(u_int64_t); ++i) + for (i = 0; i < sizeof(values)/sizeof(xds_uint64_t); ++i) xdr_uint64_t(&xdrs, &values[i]); xdr_buf_size = xdr_getpos(&xdrs); xdr_destroy(&xdrs); @@ -128,9 +128,9 @@ printf("setbuffer() failed.\n"); return 1; } - for (i = 0; i < sizeof(values)/sizeof(u_int64_t); ++i) + for (i = 0; i < sizeof(values)/sizeof(xds_uint64_t); ++i) { - u_int64_t tmp; + xds_uint64_t tmp; if (xds_decode(xds, "uint", &tmp) != XDS_OK) { printf("xds_encode() failed for the %d value!\n", i); Index: ossp-pkg/srpc/libxds/regression-tests/xds-mystruct.c ============================================================ $ cvs diff -u -r1.2 -r1.3 xds-mystruct.c --- ossp-pkg/srpc/libxds/regression-tests/xds-mystruct.c 2001/07/19 09:38:42 1.2 +++ ossp-pkg/srpc/libxds/regression-tests/xds-mystruct.c 2001/07/20 10:56:02 1.3 @@ -33,9 +33,9 @@ struct mystruct { - int32_t small; - int64_t big; - u_int32_t positive; + xds_int32_t small; + xds_int64_t big; + xds_uint32_t positive; }; static int encode_mystruct_engine(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) Index: ossp-pkg/srpc/libxds/xdr-decode-int32.c ============================================================ $ cvs diff -u -r1.1 -r1.2 xdr-decode-int32.c --- ossp-pkg/srpc/libxds/xdr-decode-int32.c 2001/07/19 12:28:15 1.1 +++ ossp-pkg/srpc/libxds/xdr-decode-int32.c 2001/07/20 10:56:01 1.2 @@ -31,8 +31,8 @@ int xdr_decode_int32(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) { - int32_t* value; - u_int32_t tmp; + xds_int32_t* value; + xds_uint32_t tmp; /* Consistency checks. */ @@ -46,24 +46,24 @@ /* Get value and format it into the buffer. */ - value = va_arg(*args, int32_t*); + value = va_arg(*args, xds_int32_t*); assert(value != NULL); - if (((u_int8_t*)buffer)[0] & 0x80) + if (((xds_uint8_t*)buffer)[0] & 0x80) { /* negative number */ - tmp = ((u_int8_t*)buffer)[0]; tmp = tmp << 8; - tmp += ((u_int8_t*)buffer)[1]; tmp = tmp << 8; - tmp += ((u_int8_t*)buffer)[2]; tmp = tmp << 8; - tmp += ((u_int8_t*)buffer)[3]; + tmp = ((xds_uint8_t*)buffer)[0]; tmp = tmp << 8; + tmp += ((xds_uint8_t*)buffer)[1]; tmp = tmp << 8; + tmp += ((xds_uint8_t*)buffer)[2]; tmp = tmp << 8; + tmp += ((xds_uint8_t*)buffer)[3]; tmp = 0 - tmp; *value = 0 - (int32_t)tmp; } else { /* positive number */ - *value = ((u_int8_t*)buffer)[0]; *value = *value << 8; - *value += ((u_int8_t*)buffer)[1]; *value = *value << 8; - *value += ((u_int8_t*)buffer)[2]; *value = *value << 8; - *value += ((u_int8_t*)buffer)[3]; + *value = ((xds_uint8_t*)buffer)[0]; *value = *value << 8; + *value += ((xds_uint8_t*)buffer)[1]; *value = *value << 8; + *value += ((xds_uint8_t*)buffer)[2]; *value = *value << 8; + *value += ((xds_uint8_t*)buffer)[3]; } /* Done. */ Index: ossp-pkg/srpc/libxds/xdr-decode-int64.c ============================================================ $ cvs diff -u -r1.1 -r1.2 xdr-decode-int64.c --- ossp-pkg/srpc/libxds/xdr-decode-int64.c 2001/07/19 12:28:15 1.1 +++ ossp-pkg/srpc/libxds/xdr-decode-int64.c 2001/07/20 10:56:01 1.2 @@ -31,8 +31,8 @@ int xdr_decode_int64(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) { - int64_t* value; - u_int64_t tmp; + xds_int64_t* value; + xds_uint64_t tmp; /* Consistency checks. */ @@ -46,32 +46,32 @@ /* Get value and format it into the buffer. */ - value = va_arg(*args, int64_t*); + value = va_arg(*args, xds_int64_t*); assert(value != NULL); - if (((u_int8_t*)buffer)[0] & 0x80) + if (((xds_uint8_t*)buffer)[0] & 0x80) { /* negative number */ - tmp = ((u_int8_t*)buffer)[0]; tmp = tmp << 8; - tmp += ((u_int8_t*)buffer)[1]; tmp = tmp << 8; - tmp += ((u_int8_t*)buffer)[2]; tmp = tmp << 8; - tmp += ((u_int8_t*)buffer)[3]; tmp = tmp << 8; - tmp += ((u_int8_t*)buffer)[4]; tmp = tmp << 8; - tmp += ((u_int8_t*)buffer)[5]; tmp = tmp << 8; - tmp += ((u_int8_t*)buffer)[6]; tmp = tmp << 8; - tmp += ((u_int8_t*)buffer)[7]; + tmp = ((xds_uint8_t*)buffer)[0]; tmp = tmp << 8; + tmp += ((xds_uint8_t*)buffer)[1]; tmp = tmp << 8; + tmp += ((xds_uint8_t*)buffer)[2]; tmp = tmp << 8; + tmp += ((xds_uint8_t*)buffer)[3]; tmp = tmp << 8; + tmp += ((xds_uint8_t*)buffer)[4]; tmp = tmp << 8; + tmp += ((xds_uint8_t*)buffer)[5]; tmp = tmp << 8; + tmp += ((xds_uint8_t*)buffer)[6]; tmp = tmp << 8; + tmp += ((xds_uint8_t*)buffer)[7]; tmp = 0 - tmp; - *value = 0 - (int64_t)tmp; + *value = 0 - (xds_int64_t)tmp; } else { /* positive number */ - *value = ((u_int8_t*)buffer)[0]; *value = *value << 8; - *value += ((u_int8_t*)buffer)[1]; *value = *value << 8; - *value += ((u_int8_t*)buffer)[2]; *value = *value << 8; - *value += ((u_int8_t*)buffer)[3]; *value = *value << 8; - *value += ((u_int8_t*)buffer)[4]; *value = *value << 8; - *value += ((u_int8_t*)buffer)[5]; *value = *value << 8; - *value += ((u_int8_t*)buffer)[6]; *value = *value << 8; - *value += ((u_int8_t*)buffer)[7]; + *value = ((xds_uint8_t*)buffer)[0]; *value = *value << 8; + *value += ((xds_uint8_t*)buffer)[1]; *value = *value << 8; + *value += ((xds_uint8_t*)buffer)[2]; *value = *value << 8; + *value += ((xds_uint8_t*)buffer)[3]; *value = *value << 8; + *value += ((xds_uint8_t*)buffer)[4]; *value = *value << 8; + *value += ((xds_uint8_t*)buffer)[5]; *value = *value << 8; + *value += ((xds_uint8_t*)buffer)[6]; *value = *value << 8; + *value += ((xds_uint8_t*)buffer)[7]; } /* Done. */ Index: ossp-pkg/srpc/libxds/xdr-decode-octetstream.c ============================================================ $ cvs diff -u -r1.1 -r1.2 xdr-decode-octetstream.c --- ossp-pkg/srpc/libxds/xdr-decode-octetstream.c 2001/07/20 09:22:25 1.1 +++ ossp-pkg/srpc/libxds/xdr-decode-octetstream.c 2001/07/20 10:56:01 1.2 @@ -56,10 +56,10 @@ if (buffer_size >= 4) { - *p_len = ((u_int8_t*)buffer)[0]; *p_len = *p_len << 8; - *p_len += ((u_int8_t*)buffer)[1]; *p_len = *p_len << 8; - *p_len += ((u_int8_t*)buffer)[2]; *p_len = *p_len << 8; - *p_len += ((u_int8_t*)buffer)[3]; + *p_len = ((xds_uint8_t*)buffer)[0]; *p_len = *p_len << 8; + *p_len += ((xds_uint8_t*)buffer)[1]; *p_len = *p_len << 8; + *p_len += ((xds_uint8_t*)buffer)[2]; *p_len = *p_len << 8; + *p_len += ((xds_uint8_t*)buffer)[3]; } else return XDS_ERR_UNDERFLOW; @@ -81,7 +81,7 @@ /* Copy data into the buffer. */ - memmove(*p, (u_int8_t*)buffer+4, *p_len); + memmove(*p, (xds_uint8_t*)buffer+4, *p_len); /* Done. */ Index: ossp-pkg/srpc/libxds/xdr-decode-string.c ============================================================ $ cvs diff -u -r1.1 -r1.2 xdr-decode-string.c --- ossp-pkg/srpc/libxds/xdr-decode-string.c 2001/07/19 15:13:39 1.1 +++ ossp-pkg/srpc/libxds/xdr-decode-string.c 2001/07/20 10:56:01 1.2 @@ -56,10 +56,10 @@ if (buffer_size >= 4) { - *p_len = ((u_int8_t*)buffer)[0]; *p_len = *p_len << 8; - *p_len += ((u_int8_t*)buffer)[1]; *p_len = *p_len << 8; - *p_len += ((u_int8_t*)buffer)[2]; *p_len = *p_len << 8; - *p_len += ((u_int8_t*)buffer)[3]; + *p_len = ((xds_uint8_t*)buffer)[0]; *p_len = *p_len << 8; + *p_len += ((xds_uint8_t*)buffer)[1]; *p_len = *p_len << 8; + *p_len += ((xds_uint8_t*)buffer)[2]; *p_len = *p_len << 8; + *p_len += ((xds_uint8_t*)buffer)[3]; } else return XDS_ERR_UNDERFLOW; @@ -81,8 +81,8 @@ /* Copy data into the buffer. */ - memmove(*p, (u_int8_t*)buffer+4, *p_len); - ((u_int8_t*)buffer)[4+*p_len] = '\0'; + memmove(*p, (xds_uint8_t*)buffer+4, *p_len); + ((xds_uint8_t*)buffer)[4+*p_len] = '\0'; /* Done. */ Index: ossp-pkg/srpc/libxds/xdr-decode-uint32.c ============================================================ $ cvs diff -u -r1.1 -r1.2 xdr-decode-uint32.c --- ossp-pkg/srpc/libxds/xdr-decode-uint32.c 2001/07/19 12:28:15 1.1 +++ ossp-pkg/srpc/libxds/xdr-decode-uint32.c 2001/07/20 10:56:01 1.2 @@ -31,7 +31,7 @@ int xdr_decode_uint32(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) { - u_int32_t* value; + xds_uint32_t* value; /* Consistency checks. */ @@ -45,13 +45,13 @@ /* Get value and format it into the buffer. */ - value = va_arg(*args, u_int32_t*); + value = va_arg(*args, xds_uint32_t*); assert(value != NULL); - *value = ((u_int8_t*)buffer)[0]; *value = *value << 8; - *value += ((u_int8_t*)buffer)[1]; *value = *value << 8; - *value += ((u_int8_t*)buffer)[2]; *value = *value << 8; - *value += ((u_int8_t*)buffer)[3]; + *value = ((xds_uint8_t*)buffer)[0]; *value = *value << 8; + *value += ((xds_uint8_t*)buffer)[1]; *value = *value << 8; + *value += ((xds_uint8_t*)buffer)[2]; *value = *value << 8; + *value += ((xds_uint8_t*)buffer)[3]; /* Done. */ Index: ossp-pkg/srpc/libxds/xdr-decode-uint64.c ============================================================ $ cvs diff -u -r1.1 -r1.2 xdr-decode-uint64.c --- ossp-pkg/srpc/libxds/xdr-decode-uint64.c 2001/07/19 12:28:15 1.1 +++ ossp-pkg/srpc/libxds/xdr-decode-uint64.c 2001/07/20 10:56:01 1.2 @@ -31,7 +31,7 @@ int xdr_decode_uint64(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) { - u_int64_t* value; + xds_uint64_t* value; /* Consistency checks. */ @@ -45,17 +45,17 @@ /* Get value and format it into the buffer. */ - value = va_arg(*args, u_int64_t*); + value = va_arg(*args, xds_uint64_t*); assert(value != NULL); - *value = ((u_int8_t*)buffer)[0]; *value = *value << 8; - *value += ((u_int8_t*)buffer)[1]; *value = *value << 8; - *value += ((u_int8_t*)buffer)[2]; *value = *value << 8; - *value += ((u_int8_t*)buffer)[3]; *value = *value << 8; - *value += ((u_int8_t*)buffer)[4]; *value = *value << 8; - *value += ((u_int8_t*)buffer)[5]; *value = *value << 8; - *value += ((u_int8_t*)buffer)[6]; *value = *value << 8; - *value += ((u_int8_t*)buffer)[7]; + *value = ((xds_uint8_t*)buffer)[0]; *value = *value << 8; + *value += ((xds_uint8_t*)buffer)[1]; *value = *value << 8; + *value += ((xds_uint8_t*)buffer)[2]; *value = *value << 8; + *value += ((xds_uint8_t*)buffer)[3]; *value = *value << 8; + *value += ((xds_uint8_t*)buffer)[4]; *value = *value << 8; + *value += ((xds_uint8_t*)buffer)[5]; *value = *value << 8; + *value += ((xds_uint8_t*)buffer)[6]; *value = *value << 8; + *value += ((xds_uint8_t*)buffer)[7]; /* Done. */ Index: ossp-pkg/srpc/libxds/xdr-encode-int32.c ============================================================ $ cvs diff -u -r1.1 -r1.2 xdr-encode-int32.c --- ossp-pkg/srpc/libxds/xdr-encode-int32.c 2001/07/19 12:28:15 1.1 +++ ossp-pkg/srpc/libxds/xdr-encode-int32.c 2001/07/20 10:56:01 1.2 @@ -44,19 +44,19 @@ if (buffer_size >= 4) { - u_int32_t tmp; - int32_t value = va_arg(*args, u_int32_t); + xds_uint32_t tmp; + xds_int32_t value = va_arg(*args, xds_uint32_t); if (value < 0) { value = 0 - value; - tmp = 0 - (u_int32_t)value; + tmp = 0 - (xds_uint32_t)value; } else - tmp = (u_int32_t)value; - ((u_int8_t*)buffer)[0] = (tmp >> 24) & 0x000000ff; - ((u_int8_t*)buffer)[1] = (tmp >> 16) & 0x000000ff; - ((u_int8_t*)buffer)[2] = (tmp >> 8) & 0x000000ff; - ((u_int8_t*)buffer)[3] = (tmp >> 0) & 0x000000ff; + tmp = (xds_uint32_t)value; + ((xds_uint8_t*)buffer)[0] = (tmp >> 24) & 0x000000ff; + ((xds_uint8_t*)buffer)[1] = (tmp >> 16) & 0x000000ff; + ((xds_uint8_t*)buffer)[2] = (tmp >> 8) & 0x000000ff; + ((xds_uint8_t*)buffer)[3] = (tmp >> 0) & 0x000000ff; } /* Done. */ Index: ossp-pkg/srpc/libxds/xdr-encode-int64.c ============================================================ $ cvs diff -u -r1.1 -r1.2 xdr-encode-int64.c --- ossp-pkg/srpc/libxds/xdr-encode-int64.c 2001/07/19 12:28:15 1.1 +++ ossp-pkg/srpc/libxds/xdr-encode-int64.c 2001/07/20 10:56:01 1.2 @@ -44,23 +44,23 @@ if (buffer_size >= 8) { - u_int64_t tmp; - int64_t value = va_arg(*args, u_int64_t); + xds_uint64_t tmp; + xds_int64_t value = va_arg(*args, xds_uint64_t); if (value < 0) { value = 0 - value; - tmp = 0 - (u_int64_t)value; + tmp = 0 - (xds_uint64_t)value; } else - tmp = (u_int64_t)value; - ((u_int8_t*)buffer)[0] = (tmp >> 56) & 0x000000ff; - ((u_int8_t*)buffer)[1] = (tmp >> 48) & 0x000000ff; - ((u_int8_t*)buffer)[2] = (tmp >> 40) & 0x000000ff; - ((u_int8_t*)buffer)[3] = (tmp >> 32) & 0x000000ff; - ((u_int8_t*)buffer)[4] = (tmp >> 24) & 0x000000ff; - ((u_int8_t*)buffer)[5] = (tmp >> 16) & 0x000000ff; - ((u_int8_t*)buffer)[6] = (tmp >> 8) & 0x000000ff; - ((u_int8_t*)buffer)[7] = (tmp >> 0) & 0x000000ff; + tmp = (xds_uint64_t)value; + ((xds_uint8_t*)buffer)[0] = (tmp >> 56) & 0x000000ff; + ((xds_uint8_t*)buffer)[1] = (tmp >> 48) & 0x000000ff; + ((xds_uint8_t*)buffer)[2] = (tmp >> 40) & 0x000000ff; + ((xds_uint8_t*)buffer)[3] = (tmp >> 32) & 0x000000ff; + ((xds_uint8_t*)buffer)[4] = (tmp >> 24) & 0x000000ff; + ((xds_uint8_t*)buffer)[5] = (tmp >> 16) & 0x000000ff; + ((xds_uint8_t*)buffer)[6] = (tmp >> 8) & 0x000000ff; + ((xds_uint8_t*)buffer)[7] = (tmp >> 0) & 0x000000ff; } /* Done. */ Index: ossp-pkg/srpc/libxds/xdr-encode-octetstream.c ============================================================ $ cvs diff -u -r1.2 -r1.3 xdr-encode-octetstream.c --- ossp-pkg/srpc/libxds/xdr-encode-octetstream.c 2001/07/20 10:07:11 1.2 +++ ossp-pkg/srpc/libxds/xdr-encode-octetstream.c 2001/07/20 10:56:01 1.3 @@ -32,9 +32,9 @@ int xdr_encode_octetstream(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) { - u_int8_t* p; - size_t p_len; - size_t padding; + xds_uint8_t* p; + size_t p_len; + size_t padding; /* Consistency checks. */ @@ -48,7 +48,7 @@ /* Get value from stack and calculate the correct amount of padding. */ - p = (u_int8_t*)va_arg(*args, void*); + p = (xds_uint8_t*)va_arg(*args, void*); assert(p != NULL); p_len = va_arg(*args, size_t); padding = (4 - (p_len & 0x03)) & 0x03; @@ -58,12 +58,12 @@ if (buffer_size >= 4 + p_len + padding) { - ((u_int8_t*)buffer)[0] = (p_len >> 24) & 0x000000ff; - ((u_int8_t*)buffer)[1] = (p_len >> 16) & 0x000000ff; - ((u_int8_t*)buffer)[2] = (p_len >> 8) & 0x000000ff; - ((u_int8_t*)buffer)[3] = (p_len >> 0) & 0x000000ff; - memmove((u_int8_t*)buffer+4, p, p_len); - memset((u_int8_t*)buffer+4+p_len, 0, padding); + ((xds_uint8_t*)buffer)[0] = (p_len >> 24) & 0x000000ff; + ((xds_uint8_t*)buffer)[1] = (p_len >> 16) & 0x000000ff; + ((xds_uint8_t*)buffer)[2] = (p_len >> 8) & 0x000000ff; + ((xds_uint8_t*)buffer)[3] = (p_len >> 0) & 0x000000ff; + memmove((xds_uint8_t*)buffer+4, p, p_len); + memset((xds_uint8_t*)buffer+4+p_len, 0, padding); } /* Done. */ Index: ossp-pkg/srpc/libxds/xdr-encode-string.c ============================================================ $ cvs diff -u -r1.2 -r1.3 xdr-encode-string.c --- ossp-pkg/srpc/libxds/xdr-encode-string.c 2001/07/20 10:07:11 1.2 +++ ossp-pkg/srpc/libxds/xdr-encode-string.c 2001/07/20 10:56:01 1.3 @@ -32,7 +32,7 @@ int xdr_encode_string(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) { - u_int8_t* p; + xds_uint8_t* p; size_t p_len; size_t padding; @@ -48,7 +48,7 @@ /* Get value from stack and calculate the correct amount of padding. */ - p = (u_int8_t*)va_arg(*args, void*); + p = (xds_uint8_t*)va_arg(*args, void*); assert(p != NULL); p_len = strlen((char*)p); padding = (4 - (p_len & 0x03)) & 0x03; @@ -58,12 +58,12 @@ if (buffer_size >= 4 + p_len + padding) { - ((u_int8_t*)buffer)[0] = (p_len >> 24) & 0x000000ff; - ((u_int8_t*)buffer)[1] = (p_len >> 16) & 0x000000ff; - ((u_int8_t*)buffer)[2] = (p_len >> 8) & 0x000000ff; - ((u_int8_t*)buffer)[3] = (p_len >> 0) & 0x000000ff; - memmove((u_int8_t*)buffer+4, p, p_len); - memset((u_int8_t*)buffer+4+p_len, 0, padding); + ((xds_uint8_t*)buffer)[0] = (p_len >> 24) & 0x000000ff; + ((xds_uint8_t*)buffer)[1] = (p_len >> 16) & 0x000000ff; + ((xds_uint8_t*)buffer)[2] = (p_len >> 8) & 0x000000ff; + ((xds_uint8_t*)buffer)[3] = (p_len >> 0) & 0x000000ff; + memmove((xds_uint8_t*)buffer+4, p, p_len); + memset((xds_uint8_t*)buffer+4+p_len, 0, padding); } /* Done. */ Index: ossp-pkg/srpc/libxds/xdr-encode-uint32.c ============================================================ $ cvs diff -u -r1.1 -r1.2 xdr-encode-uint32.c --- ossp-pkg/srpc/libxds/xdr-encode-uint32.c 2001/07/19 12:28:15 1.1 +++ ossp-pkg/srpc/libxds/xdr-encode-uint32.c 2001/07/20 10:56:01 1.2 @@ -44,11 +44,11 @@ if (buffer_size >= 4) { - u_int32_t value = va_arg(*args, u_int32_t); - ((u_int8_t*)buffer)[0] = (value >> 24) & 0x000000ff; - ((u_int8_t*)buffer)[1] = (value >> 16) & 0x000000ff; - ((u_int8_t*)buffer)[2] = (value >> 8) & 0x000000ff; - ((u_int8_t*)buffer)[3] = (value >> 0) & 0x000000ff; + xds_uint32_t value = va_arg(*args, xds_uint32_t); + ((xds_uint8_t*)buffer)[0] = (value >> 24) & 0x000000ff; + ((xds_uint8_t*)buffer)[1] = (value >> 16) & 0x000000ff; + ((xds_uint8_t*)buffer)[2] = (value >> 8) & 0x000000ff; + ((xds_uint8_t*)buffer)[3] = (value >> 0) & 0x000000ff; } /* Done. */ Index: ossp-pkg/srpc/libxds/xdr-encode-uint64.c ============================================================ $ cvs diff -u -r1.1 -r1.2 xdr-encode-uint64.c --- ossp-pkg/srpc/libxds/xdr-encode-uint64.c 2001/07/19 12:28:15 1.1 +++ ossp-pkg/srpc/libxds/xdr-encode-uint64.c 2001/07/20 10:56:01 1.2 @@ -44,15 +44,15 @@ if (buffer_size >= 8) { - u_int64_t value = va_arg(*args, u_int64_t); - ((u_int8_t*)buffer)[0] = (value >> 56) & 0x000000ff; - ((u_int8_t*)buffer)[1] = (value >> 48) & 0x000000ff; - ((u_int8_t*)buffer)[2] = (value >> 40) & 0x000000ff; - ((u_int8_t*)buffer)[3] = (value >> 32) & 0x000000ff; - ((u_int8_t*)buffer)[4] = (value >> 24) & 0x000000ff; - ((u_int8_t*)buffer)[5] = (value >> 16) & 0x000000ff; - ((u_int8_t*)buffer)[6] = (value >> 8) & 0x000000ff; - ((u_int8_t*)buffer)[7] = (value >> 0) & 0x000000ff; + xds_uint64_t value = va_arg(*args, xds_uint64_t); + ((xds_uint8_t*)buffer)[0] = (value >> 56) & 0x000000ff; + ((xds_uint8_t*)buffer)[1] = (value >> 48) & 0x000000ff; + ((xds_uint8_t*)buffer)[2] = (value >> 40) & 0x000000ff; + ((xds_uint8_t*)buffer)[3] = (value >> 32) & 0x000000ff; + ((xds_uint8_t*)buffer)[4] = (value >> 24) & 0x000000ff; + ((xds_uint8_t*)buffer)[5] = (value >> 16) & 0x000000ff; + ((xds_uint8_t*)buffer)[6] = (value >> 8) & 0x000000ff; + ((xds_uint8_t*)buffer)[7] = (value >> 0) & 0x000000ff; } /* Done. */ Index: ossp-pkg/srpc/libxds/xds.h.in ============================================================ $ cvs diff -u -r1.1 -r1.2 xds.h.in --- ossp-pkg/srpc/libxds/xds.h.in 2001/07/20 10:42:34 1.1 +++ ossp-pkg/srpc/libxds/xds.h.in 2001/07/20 10:56:01 1.2 @@ -37,9 +37,11 @@ typedef @xds_uint8_t@ xds_uint8_t; typedef @xds_uint16_t@ xds_uint16_t; typedef @xds_uint32_t@ xds_uint32_t; +typedef @xds_uint64_t@ xds_uint64_t; typedef @xds_int8_t@ xds_int8_t; typedef @xds_int16_t@ xds_int16_t; typedef @xds_int32_t@ xds_int32_t; +typedef @xds_int64_t@ xds_int64_t; enum { From ossp-cvs-owner@ossp.org Fri Jul 20 13:05:56 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f6KB5tt24458; Fri, 20 Jul 2001 13:05:55 +0200 (CEST) Date: Fri, 20 Jul 2001 13:05:55 +0200 (CEST) Message-Id: <200107201105.f6KB5tt24458@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds configure.ac ossp-pkg/srpc/libxds/reg... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 20-Jul-2001 13:05:55 Branch: HEAD Handle: 2001072012055401 Modified files: ossp-pkg/srpc/libxds configure.ac ossp-pkg/srpc/libxds/regression-tests Makefile.in Log: Check whether libnsl has to be linked for the xdr_xxx() routines. Summary: Revision Changes Path 1.3 +6 -1 ossp-pkg/srpc/libxds/configure.ac 1.4 +1 -1 ossp-pkg/srpc/libxds/regression-tests/Makefile.in ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/configure.ac ============================================================ $ cvs diff -u -r1.2 -r1.3 configure.ac --- ossp-pkg/srpc/libxds/configure.ac 2001/07/20 10:56:01 1.2 +++ ossp-pkg/srpc/libxds/configure.ac 2001/07/20 11:05:54 1.3 @@ -1,6 +1,6 @@ dnl configure.in -- Process this file with autoconf to produce a configure script. -AC_INIT(libxds, [$Revision: 1.2 $]) +AC_INIT(libxds, [$Revision: 1.3 $]) dnl Get rid of the lousy -g and -O defaults in CFLAGS. dnl @@ -67,6 +67,11 @@ )] ) AC_SUBST([xds_int64_t]) + +dnl Find the library containing the xdr_xxx() functions. +dnl +AC_CHECK_LIB(nsl, xdrmem_create, [xdr_lib=-lnsl]) +AC_SUBST([xdr_lib]) dnl Write results. dnl Index: ossp-pkg/srpc/libxds/regression-tests/Makefile.in ============================================================ $ cvs diff -u -r1.3 -r1.4 Makefile.in --- ossp-pkg/srpc/libxds/regression-tests/Makefile.in 2001/07/20 10:09:06 1.3 +++ ossp-pkg/srpc/libxds/regression-tests/Makefile.in 2001/07/20 11:05:55 1.4 @@ -6,7 +6,7 @@ CPPFLAGS = @CPPFLAGS@ @DEFS@ -D_GNU_SOURCE CFLAGS = @CFLAGS@ -LDFLAGS = @LDFLAGS@ -L.. +LDFLAGS = @LDFLAGS@ @xdr_lib@ -L.. TESTS = xds-core.exe xds-find-engine.exe xds-register.exe xds-encode.exe \ xds-getbuffer.exe xds-decode.exe xds-setbuffer.exe xds-engine-restart.exe \ From ossp-cvs-owner@ossp.org Fri Jul 20 13:15:41 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f6KBFeE25679; Fri, 20 Jul 2001 13:15:40 +0200 (CEST) Date: Fri, 20 Jul 2001 13:15:40 +0200 (CEST) Message-Id: <200107201115.f6KBFeE25679@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds xdr-decode-string.c xdr-encode-string... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 20-Jul-2001 13:15:39 Branch: HEAD Handle: 2001072012153900 Modified files: ossp-pkg/srpc/libxds xdr-decode-string.c xdr-encode-string.c Log: Relaxed type checking a bit: strings are char*, not void*. Summary: Revision Changes Path 1.3 +3 -3 ossp-pkg/srpc/libxds/xdr-decode-string.c 1.4 +5 -5 ossp-pkg/srpc/libxds/xdr-encode-string.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/xdr-decode-string.c ============================================================ $ cvs diff -u -r1.2 -r1.3 xdr-decode-string.c --- ossp-pkg/srpc/libxds/xdr-decode-string.c 2001/07/20 10:56:01 1.2 +++ ossp-pkg/srpc/libxds/xdr-decode-string.c 2001/07/20 11:15:39 1.3 @@ -32,7 +32,7 @@ int xdr_decode_string(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) { - void** p; + char** p; size_t* p_len; size_t padding; @@ -47,7 +47,7 @@ /* Get pointers from the stack. */ - p = va_arg(*args, void**); + p = va_arg(*args, char**); p_len = va_arg(*args, size_t*); assert(p != NULL); assert(p_len != NULL); @@ -75,7 +75,7 @@ /* Allocate buffer for the data. */ - *p = malloc(*p_len + 1); + *p = (char*)malloc(*p_len + 1); if (*p == NULL) return XDS_ERR_NO_MEM; Index: ossp-pkg/srpc/libxds/xdr-encode-string.c ============================================================ $ cvs diff -u -r1.3 -r1.4 xdr-encode-string.c --- ossp-pkg/srpc/libxds/xdr-encode-string.c 2001/07/20 10:56:01 1.3 +++ ossp-pkg/srpc/libxds/xdr-encode-string.c 2001/07/20 11:15:39 1.4 @@ -32,9 +32,9 @@ int xdr_encode_string(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) { - xds_uint8_t* p; - size_t p_len; - size_t padding; + char* p; + size_t p_len; + size_t padding; /* Consistency checks. */ @@ -48,9 +48,9 @@ /* Get value from stack and calculate the correct amount of padding. */ - p = (xds_uint8_t*)va_arg(*args, void*); + p = va_arg(*args, char*); assert(p != NULL); - p_len = strlen((char*)p); + p_len = strlen(p); padding = (4 - (p_len & 0x03)) & 0x03; assert((p_len + padding) % 4 == 0); From ossp-cvs-owner@ossp.org Fri Jul 20 13:22:20 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f6KBMIw26491; Fri, 20 Jul 2001 13:22:18 +0200 (CEST) Date: Fri, 20 Jul 2001 13:22:18 +0200 (CEST) Message-Id: <200107201122.f6KBMIw26491@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds configure.ac ossp-pkg/srpc/libxds/reg... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 20-Jul-2001 13:22:18 Branch: HEAD Handle: 19700101010000995624538 Added files: ossp-pkg/srpc/libxds/regression-tests .run-tests.in Modified files: ossp-pkg/srpc/libxds configure.ac ossp-pkg/srpc/libxds/regression-tests Makefile.in Removed files: ossp-pkg/srpc/libxds/regression-tests .run-tests Log: Insert path of "bash" into the run-tests script. Summary: Revision Changes Path 1.4 +3 -2 ossp-pkg/srpc/libxds/configure.ac NONE +0 -40 ossp-pkg/srpc/libxds/regression-tests/.run-tests 1.1 +40 -0 ossp-pkg/srpc/libxds/regression-tests/.run-tests.in 1.5 +1 -1 ossp-pkg/srpc/libxds/regression-tests/Makefile.in ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/configure.ac ============================================================ $ cvs diff -u -r1.3 -r1.4 configure.ac --- ossp-pkg/srpc/libxds/configure.ac 2001/07/20 11:05:54 1.3 +++ ossp-pkg/srpc/libxds/configure.ac 2001/07/20 11:22:17 1.4 @@ -1,6 +1,6 @@ dnl configure.in -- Process this file with autoconf to produce a configure script. -AC_INIT(libxds, [$Revision: 1.3 $]) +AC_INIT(libxds, [$Revision: 1.4 $]) dnl Get rid of the lousy -g and -O defaults in CFLAGS. dnl @@ -10,6 +10,7 @@ dnl AC_PROG_CC AC_PROG_RANLIB +AC_PATH_PROG(bash, bash) dnl Set special flags for gcc. dnl @@ -75,4 +76,4 @@ dnl Write results. dnl -AC_OUTPUT(xds.h Makefile regression-tests/Makefile) +AC_OUTPUT(xds.h regression-tests/.run-tests Makefile regression-tests/Makefile) Index: ossp-pkg/srpc/libxds/regression-tests/.run-tests.in ============================================================ $ cvs update -p -r1.1 .run-tests.in #! @bash@ if [ $# -lt 1 ]; then echo "Usage: $0 test1.exe [...]" exit 1; fi RESCOLUMN=30 numTests=0 numFails=0 echo "Running test suite:" for suite in $*; do tmp=`expr "${suite}" : '\(.*\)\.exe$'` echo -n "$tmp" currpos=`expr $RESCOLUMN - ${#tmp}` while [ $currpos -gt 1 ]; do echo -n "." currpos=`expr $currpos - 1` done echo -n " " numTests=`expr $numTests + 1` eval ./$suite >${tmp}.log 2>&1 if [ $? -eq 0 ]; then echo OK else numFails=`expr $numFails + 1` echo FAILED fi done echo if [ $numFails -eq 0 ]; then echo "Summary: All tests succeeded." exit 0 else echo "Summary: $numFails of $numTests tests failed ($(($numFails*100/$numTests))%)." exit 1 fi Index: ossp-pkg/srpc/libxds/regression-tests/Makefile.in ============================================================ $ cvs diff -u -r1.4 -r1.5 Makefile.in --- ossp-pkg/srpc/libxds/regression-tests/Makefile.in 2001/07/20 11:05:55 1.4 +++ ossp-pkg/srpc/libxds/regression-tests/Makefile.in 2001/07/20 11:22:18 1.5 @@ -34,7 +34,7 @@ rm -f $(TESTS) *.log distclean:: clean - rm -f Makefile + rm -f Makefile .run-tests realclean:: distclean From ossp-cvs-owner@ossp.org Fri Jul 20 13:27:27 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f6KBRQg27152; Fri, 20 Jul 2001 13:27:26 +0200 (CEST) Date: Fri, 20 Jul 2001 13:27:26 +0200 (CEST) Message-Id: <200107201127.f6KBRQg27152@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds configure.ac Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 20-Jul-2001 13:27:26 Branch: HEAD Handle: 2001072012272500 Modified files: ossp-pkg/srpc/libxds configure.ac Log: Make sure ./run-tests has an x-flag. Summary: Revision Changes Path 1.5 +4 -2 ossp-pkg/srpc/libxds/configure.ac ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/configure.ac ============================================================ $ cvs diff -u -r1.4 -r1.5 configure.ac --- ossp-pkg/srpc/libxds/configure.ac 2001/07/20 11:22:17 1.4 +++ ossp-pkg/srpc/libxds/configure.ac 2001/07/20 11:27:25 1.5 @@ -1,6 +1,6 @@ dnl configure.in -- Process this file with autoconf to produce a configure script. -AC_INIT(libxds, [$Revision: 1.4 $]) +AC_INIT(libxds, [$Revision: 1.5 $]) dnl Get rid of the lousy -g and -O defaults in CFLAGS. dnl @@ -76,4 +76,6 @@ dnl Write results. dnl -AC_OUTPUT(xds.h regression-tests/.run-tests Makefile regression-tests/Makefile) +AC_CONFIG_FILES(xds.h regression-tests/.run-tests Makefile regression-tests/Makefile) +AC_CONFIG_COMMANDS([default], [chmod +x regression-tests/.run-tests]) +AC_OUTPUT From ossp-cvs-owner@ossp.org Fri Jul 20 13:28:13 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f6KBSCb27232; Fri, 20 Jul 2001 13:28:12 +0200 (CEST) Date: Fri, 20 Jul 2001 13:28:12 +0200 (CEST) Message-Id: <200107201128.f6KBSCb27232@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds/regression-tests .cvsignore Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 20-Jul-2001 13:28:12 Branch: HEAD Handle: 2001072012281100 Modified files: ossp-pkg/srpc/libxds/regression-tests .cvsignore Log: Ignore dependent file .run-tests. Summary: Revision Changes Path 1.3 +1 -1 ossp-pkg/srpc/libxds/regression-tests/.cvsignore ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/regression-tests/.cvsignore ============================================================ $ cvs diff -u -r1.2 -r1.3 .cvsignore --- ossp-pkg/srpc/libxds/regression-tests/.cvsignore 2001/07/20 10:08:26 1.2 +++ ossp-pkg/srpc/libxds/regression-tests/.cvsignore 2001/07/20 11:28:11 1.3 @@ -1,2 +1,2 @@ *.log -Makefile +Makefile .run-tests From ossp-cvs-owner@ossp.org Fri Jul 20 13:32:53 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f6KBWqb27806; Fri, 20 Jul 2001 13:32:52 +0200 (CEST) Date: Fri, 20 Jul 2001 13:32:52 +0200 (CEST) Message-Id: <200107201132.f6KBWqb27806@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds configure.ac Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 20-Jul-2001 13:32:52 Branch: HEAD Handle: 2001072012325200 Modified files: ossp-pkg/srpc/libxds configure.ac Log: Use /bin/sh if no bash could be found. Summary: Revision Changes Path 1.6 +2 -2 ossp-pkg/srpc/libxds/configure.ac ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/configure.ac ============================================================ $ cvs diff -u -r1.5 -r1.6 configure.ac --- ossp-pkg/srpc/libxds/configure.ac 2001/07/20 11:27:25 1.5 +++ ossp-pkg/srpc/libxds/configure.ac 2001/07/20 11:32:52 1.6 @@ -1,6 +1,6 @@ dnl configure.in -- Process this file with autoconf to produce a configure script. -AC_INIT(libxds, [$Revision: 1.5 $]) +AC_INIT(libxds, [$Revision: 1.6 $]) dnl Get rid of the lousy -g and -O defaults in CFLAGS. dnl @@ -10,7 +10,7 @@ dnl AC_PROG_CC AC_PROG_RANLIB -AC_PATH_PROG(bash, bash) +AC_PATH_PROG(bash, bash, /bin/sh) dnl Set special flags for gcc. dnl From ossp-cvs-owner@ossp.org Sun Jul 22 19:18:50 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f6MHIma44875; Sun, 22 Jul 2001 19:18:48 +0200 (CEST) Date: Sun, 22 Jul 2001 19:18:48 +0200 (CEST) Message-Id: <200107221718.f6MHIma44875@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds/regression-tests .run-tests.in Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 22-Jul-2001 19:18:48 Branch: HEAD Handle: 2001072218184800 Modified files: ossp-pkg/srpc/libxds/regression-tests .run-tests.in Log: Increased performance and portability thanks to patches from RSE. Summary: Revision Changes Path 1.2 +16 -14 ossp-pkg/srpc/libxds/regression-tests/.run-tests.in ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/regression-tests/.run-tests.in ============================================================ $ cvs diff -u -r1.1 -r1.2 .run-tests.in --- ossp-pkg/srpc/libxds/regression-tests/.run-tests.in 2001/07/20 11:22:18 1.1 +++ ossp-pkg/srpc/libxds/regression-tests/.run-tests.in 2001/07/22 17:18:48 1.2 @@ -1,8 +1,8 @@ -#! @bash@ +#!/bin/sh if [ $# -lt 1 ]; then echo "Usage: $0 test1.exe [...]" - exit 1; + exit 1 fi RESCOLUMN=30 @@ -11,22 +11,22 @@ echo "Running test suite:" -for suite in $*; do - tmp=`expr "${suite}" : '\(.*\)\.exe$'` - echo -n "$tmp" - currpos=`expr $RESCOLUMN - ${#tmp}` - while [ $currpos -gt 1 ]; do - echo -n "." - currpos=`expr $currpos - 1` - done - echo -n " " +pad='' +n=$RESCOLUMN +while [ $n -gt 0 ]; do + pad="$pad." + n=`expr $n - 1` +done +for suite in "$@"; do + name=`expr "${suite}" : '\(.*\)\.exe$'` + echo "$name$pad" | awk '{ printf("%s ", substr($0, 0, n)); }' n=$RESCOLUMN numTests=`expr $numTests + 1` eval ./$suite >${tmp}.log 2>&1 if [ $? -eq 0 ]; then - echo OK + echo "OK" else numFails=`expr $numFails + 1` - echo FAILED + echo "FAILED" fi done @@ -35,6 +35,8 @@ echo "Summary: All tests succeeded." exit 0 else - echo "Summary: $numFails of $numTests tests failed ($(($numFails*100/$numTests))%)." + percent=`expr $numFails \* 100` + percent=`expr $percent / $numTests` + echo "Summary: $numFails of $numTests tests failed ($percent%)." exit 1 fi From ossp-cvs-owner@ossp.org Sun Jul 22 19:24:33 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f6MHOW545627; Sun, 22 Jul 2001 19:24:32 +0200 (CEST) Date: Sun, 22 Jul 2001 19:24:32 +0200 (CEST) Message-Id: <200107221724.f6MHOW545627@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds configure.ac ossp-pkg/srpc/libxds/reg... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 22-Jul-2001 19:24:32 Branch: HEAD Handle: 19700101010000995819071 Added files: ossp-pkg/srpc/libxds/regression-tests .run-tests Modified files: ossp-pkg/srpc/libxds configure.ac ossp-pkg/srpc/libxds/regression-tests .cvsignore Removed files: ossp-pkg/srpc/libxds/regression-tests .run-tests.in Log: The new run-tests script works fine without bash, so we don't need to have the script under autoconf control anymore. Summary: Revision Changes Path 1.7 +2 -4 ossp-pkg/srpc/libxds/configure.ac 1.4 +1 -1 ossp-pkg/srpc/libxds/regression-tests/.cvsignore 1.11 +42 -0 ossp-pkg/srpc/libxds/regression-tests/.run-tests NONE +0 -42 ossp-pkg/srpc/libxds/regression-tests/.run-tests.in ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/configure.ac ============================================================ $ cvs diff -u -r1.6 -r1.7 configure.ac --- ossp-pkg/srpc/libxds/configure.ac 2001/07/20 11:32:52 1.6 +++ ossp-pkg/srpc/libxds/configure.ac 2001/07/22 17:24:31 1.7 @@ -1,6 +1,6 @@ dnl configure.in -- Process this file with autoconf to produce a configure script. -AC_INIT(libxds, [$Revision: 1.6 $]) +AC_INIT(libxds, [$Revision: 1.7 $]) dnl Get rid of the lousy -g and -O defaults in CFLAGS. dnl @@ -10,7 +10,6 @@ dnl AC_PROG_CC AC_PROG_RANLIB -AC_PATH_PROG(bash, bash, /bin/sh) dnl Set special flags for gcc. dnl @@ -76,6 +75,5 @@ dnl Write results. dnl -AC_CONFIG_FILES(xds.h regression-tests/.run-tests Makefile regression-tests/Makefile) -AC_CONFIG_COMMANDS([default], [chmod +x regression-tests/.run-tests]) +AC_CONFIG_FILES(xds.h Makefile regression-tests/Makefile) AC_OUTPUT Index: ossp-pkg/srpc/libxds/regression-tests/.cvsignore ============================================================ $ cvs diff -u -r1.3 -r1.4 .cvsignore --- ossp-pkg/srpc/libxds/regression-tests/.cvsignore 2001/07/20 11:28:11 1.3 +++ ossp-pkg/srpc/libxds/regression-tests/.cvsignore 2001/07/22 17:24:31 1.4 @@ -1,2 +1,2 @@ *.log -Makefile .run-tests +Makefile Index: ossp-pkg/srpc/libxds/regression-tests/.run-tests ============================================================ $ cvs update -p -r1.11 .run-tests #!/bin/sh if [ $# -lt 1 ]; then echo "Usage: $0 test1.exe [...]" exit 1 fi RESCOLUMN=30 numTests=0 numFails=0 echo "Running test suite:" pad='' n=$RESCOLUMN while [ $n -gt 0 ]; do pad="$pad." n=`expr $n - 1` done for suite in "$@"; do name=`expr "${suite}" : '\(.*\)\.exe$'` echo "$name$pad" | awk '{ printf("%s ", substr($0, 0, n)); }' n=$RESCOLUMN numTests=`expr $numTests + 1` eval ./$suite >${tmp}.log 2>&1 if [ $? -eq 0 ]; then echo "OK" else numFails=`expr $numFails + 1` echo "FAILED" fi done echo if [ $numFails -eq 0 ]; then echo "Summary: All tests succeeded." exit 0 else percent=`expr $numFails \* 100` percent=`expr $percent / $numTests` echo "Summary: $numFails of $numTests tests failed ($percent%)." exit 1 fi From ossp-cvs-owner@ossp.org Mon Jul 23 15:03:31 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f6ND3UK00403; Mon, 23 Jul 2001 15:03:30 +0200 (CEST) Date: Mon, 23 Jul 2001 15:03:30 +0200 (CEST) Message-Id: <200107231303.f6ND3UK00403@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds/regression-tests .run-tests Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 23-Jul-2001 15:03:30 Branch: HEAD Handle: 2001072314032900 Modified files: ossp-pkg/srpc/libxds/regression-tests .run-tests Log: Fixed minor bug: The name of the "suite.log" file wasn't created correctly, thus all output ended up in ".log". Summary: Revision Changes Path 1.12 +1 -1 ossp-pkg/srpc/libxds/regression-tests/.run-tests ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/regression-tests/.run-tests ============================================================ $ cvs diff -u -r1.11 -r1.12 .run-tests --- ossp-pkg/srpc/libxds/regression-tests/.run-tests 2001/07/22 17:24:31 1.11 +++ ossp-pkg/srpc/libxds/regression-tests/.run-tests 2001/07/23 13:03:29 1.12 @@ -21,7 +21,7 @@ name=`expr "${suite}" : '\(.*\)\.exe$'` echo "$name$pad" | awk '{ printf("%s ", substr($0, 0, n)); }' n=$RESCOLUMN numTests=`expr $numTests + 1` - eval ./$suite >${tmp}.log 2>&1 + eval ./$suite >${name}.log 2>&1 if [ $? -eq 0 ]; then echo "OK" else From ossp-cvs-owner@ossp.org Mon Jul 23 15:04:08 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f6ND46d00492; Mon, 23 Jul 2001 15:04:06 +0200 (CEST) Date: Mon, 23 Jul 2001 15:04:06 +0200 (CEST) Message-Id: <200107231304.f6ND46d00492@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds Makefile.in xdr-decode-double.c xdr-e... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 23-Jul-2001 15:04:06 Branch: HEAD Handle: 2001072314040600 Added files: ossp-pkg/srpc/libxds xdr-decode-double.c xdr-encode-double.c Modified files: ossp-pkg/srpc/libxds Makefile.in Log: Added skeleton code for encoding and decoding of double types. Summary: Revision Changes Path 1.5 +3 -1 ossp-pkg/srpc/libxds/Makefile.in 1.1 +33 -0 ossp-pkg/srpc/libxds/xdr-decode-double.c 1.1 +33 -0 ossp-pkg/srpc/libxds/xdr-encode-double.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/Makefile.in ============================================================ $ cvs diff -u -r1.4 -r1.5 Makefile.in --- ossp-pkg/srpc/libxds/Makefile.in 2001/07/20 10:09:06 1.4 +++ ossp-pkg/srpc/libxds/Makefile.in 2001/07/23 13:04:06 1.5 @@ -14,7 +14,9 @@ xdr-encode-uint32.o xdr-encode-uint64.o xdr-decode-int32.o \ xdr-decode-int64.o xdr-decode-uint32.o xdr-decode-uint64.o \ xdr-encode-octetstream.o xdr-decode-octetstream.o \ - xdr-encode-string.o xdr-decode-string.o + xdr-encode-string.o xdr-decode-string.o xdr-encode-double.o \ + xdr-decode-double.o + .c.o: $(CC) $(CPPFLAGS) $(WARNFLAGS) $(OPTFLAGS) $(CFLAGS) -c $< Index: ossp-pkg/srpc/libxds/xdr-decode-double.c ============================================================ $ cvs update -p -r1.1 xdr-decode-double.c /* XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) This file is part of OSSP XDS, an extensible data serialization library which can be found at http://www.ossp.com/pkg/xds/. 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. */ #include "internal.h" int xdr_decode_double(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) { return -1; } Index: ossp-pkg/srpc/libxds/xdr-encode-double.c ============================================================ $ cvs update -p -r1.1 xdr-encode-double.c /* XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) This file is part of OSSP XDS, an extensible data serialization library which can be found at http://www.ossp.com/pkg/xds/. 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. */ #include "internal.h" int xdr_decode_double(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) { return -1; } From ossp-cvs-owner@ossp.org Mon Jul 23 15:05:25 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f6ND5Oi00612; Mon, 23 Jul 2001 15:05:24 +0200 (CEST) Date: Mon, 23 Jul 2001 15:05:24 +0200 (CEST) Message-Id: <200107231305.f6ND5Oi00612@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds/regression-tests Makefile.in Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 23-Jul-2001 15:05:24 Branch: HEAD Handle: 2001072314052400 Modified files: ossp-pkg/srpc/libxds/regression-tests Makefile.in Log: Don't erase .run-tests script at distclean anymore. Summary: Revision Changes Path 1.6 +1 -1 ossp-pkg/srpc/libxds/regression-tests/Makefile.in ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/regression-tests/Makefile.in ============================================================ $ cvs diff -u -r1.5 -r1.6 Makefile.in --- ossp-pkg/srpc/libxds/regression-tests/Makefile.in 2001/07/20 11:22:18 1.5 +++ ossp-pkg/srpc/libxds/regression-tests/Makefile.in 2001/07/23 13:05:24 1.6 @@ -34,7 +34,7 @@ rm -f $(TESTS) *.log distclean:: clean - rm -f Makefile .run-tests + rm -f Makefile realclean:: distclean From ossp-cvs-owner@ossp.org Mon Jul 23 17:28:55 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f6NFSsC19330; Mon, 23 Jul 2001 17:28:54 +0200 (CEST) Date: Mon, 23 Jul 2001 17:28:54 +0200 (CEST) Message-Id: <200107231528.f6NFSsC19330@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds Makefile.in xml-encode-int32.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 23-Jul-2001 17:28:54 Branch: HEAD Handle: 2001072316285300 Added files: ossp-pkg/srpc/libxds xml-encode-int32.c Modified files: ossp-pkg/srpc/libxds Makefile.in Log: Added skeleton for the int32 XML encoding engine. Summary: Revision Changes Path 1.6 +1 -1 ossp-pkg/srpc/libxds/Makefile.in 1.1 +34 -0 ossp-pkg/srpc/libxds/xml-encode-int32.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/Makefile.in ============================================================ $ cvs diff -u -r1.5 -r1.6 Makefile.in --- ossp-pkg/srpc/libxds/Makefile.in 2001/07/23 13:04:06 1.5 +++ ossp-pkg/srpc/libxds/Makefile.in 2001/07/23 15:28:53 1.6 @@ -15,7 +15,7 @@ xdr-decode-int64.o xdr-decode-uint32.o xdr-decode-uint64.o \ xdr-encode-octetstream.o xdr-decode-octetstream.o \ xdr-encode-string.o xdr-decode-string.o xdr-encode-double.o \ - xdr-decode-double.o + xdr-decode-double.o xml-encode-int32.o .c.o: $(CC) $(CPPFLAGS) $(WARNFLAGS) $(OPTFLAGS) $(CFLAGS) -c $< Index: ossp-pkg/srpc/libxds/xml-encode-int32.c ============================================================ $ cvs update -p -r1.1 xml-encode-int32.c /* XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) This file is part of OSSP XDS, an extensible data serialization library which can be found at http://www.ossp.com/pkg/xds/. 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. */ #include #include "internal.h" int xml_encode_int32(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) { return -1; } From ossp-cvs-owner@ossp.org Mon Jul 23 17:33:25 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f6NFXOs20152; Mon, 23 Jul 2001 17:33:24 +0200 (CEST) Date: Mon, 23 Jul 2001 17:33:24 +0200 (CEST) Message-Id: <200107231533.f6NFXOs20152@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds xds.h.in Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 23-Jul-2001 17:33:24 Branch: HEAD Handle: 2001072316332300 Modified files: ossp-pkg/srpc/libxds xds.h.in Log: Added prototypes for xdr_encode_double(), xdr_decode_double(), xml_encode_int32(), and xml_decode_int32(). Summary: Revision Changes Path 1.3 +7 -0 ossp-pkg/srpc/libxds/xds.h.in ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/xds.h.in ============================================================ $ cvs diff -u -r1.2 -r1.3 xds.h.in --- ossp-pkg/srpc/libxds/xds.h.in 2001/07/20 10:56:01 1.2 +++ ossp-pkg/srpc/libxds/xds.h.in 2001/07/23 15:33:23 1.3 @@ -96,4 +96,11 @@ int xdr_encode_string(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); int xdr_decode_string(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); +int xdr_encode_double(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); +int xdr_decode_double(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); + + +int xml_encode_int32(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); +int xml_decode_int32(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); + #endif /* !defined(__LIBXDS_H__) */ From ossp-cvs-owner@ossp.org Mon Jul 23 17:33:45 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f6NFXha20292; Mon, 23 Jul 2001 17:33:43 +0200 (CEST) Date: Mon, 23 Jul 2001 17:33:43 +0200 (CEST) Message-Id: <200107231533.f6NFXha20292@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds Makefile.in ossp-pkg/srpc/libxds/regr... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 23-Jul-2001 17:33:43 Branch: HEAD Handle: 2001072316334201 Modified files: ossp-pkg/srpc/libxds Makefile.in xdr-decode-int32.c xdr-decode-int64.c xdr-decode-octetstream.c xdr-decode-string.c xdr-decode-uint32.c xdr-decode-uint64.c xdr-encode-int32.c xdr-encode-int64.c xdr-encode-octetstream.c xdr-encode-string.c xdr-encode-uint32.c xdr-encode-uint64.c ossp-pkg/srpc/libxds/regression-tests xds-mystruct.c Log: Removed redundant include of sys/types.h. Summary: Revision Changes Path 1.7 +1 -1 ossp-pkg/srpc/libxds/Makefile.in 1.4 +0 -1 ossp-pkg/srpc/libxds/regression-tests/xds-mystruct.c 1.3 +0 -1 ossp-pkg/srpc/libxds/xdr-decode-int32.c 1.3 +0 -1 ossp-pkg/srpc/libxds/xdr-decode-int64.c 1.3 +0 -1 ossp-pkg/srpc/libxds/xdr-decode-octetstream.c 1.4 +0 -1 ossp-pkg/srpc/libxds/xdr-decode-string.c 1.3 +0 -1 ossp-pkg/srpc/libxds/xdr-decode-uint32.c 1.3 +0 -1 ossp-pkg/srpc/libxds/xdr-decode-uint64.c 1.3 +0 -1 ossp-pkg/srpc/libxds/xdr-encode-int32.c 1.3 +0 -1 ossp-pkg/srpc/libxds/xdr-encode-int64.c 1.4 +0 -1 ossp-pkg/srpc/libxds/xdr-encode-octetstream.c 1.5 +0 -1 ossp-pkg/srpc/libxds/xdr-encode-string.c 1.3 +0 -1 ossp-pkg/srpc/libxds/xdr-encode-uint32.c 1.3 +0 -1 ossp-pkg/srpc/libxds/xdr-encode-uint64.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/Makefile.in ============================================================ $ cvs diff -u -r1.6 -r1.7 Makefile.in --- ossp-pkg/srpc/libxds/Makefile.in 2001/07/23 15:28:53 1.6 +++ ossp-pkg/srpc/libxds/Makefile.in 2001/07/23 15:33:42 1.7 @@ -15,7 +15,7 @@ xdr-decode-int64.o xdr-decode-uint32.o xdr-decode-uint64.o \ xdr-encode-octetstream.o xdr-decode-octetstream.o \ xdr-encode-string.o xdr-decode-string.o xdr-encode-double.o \ - xdr-decode-double.o xml-encode-int32.o + xdr-decode-double.o xml-encode-int32.o xml-decode-int32.o .c.o: $(CC) $(CPPFLAGS) $(WARNFLAGS) $(OPTFLAGS) $(CFLAGS) -c $< Index: ossp-pkg/srpc/libxds/regression-tests/xds-mystruct.c ============================================================ $ cvs diff -u -r1.3 -r1.4 xds-mystruct.c --- ossp-pkg/srpc/libxds/regression-tests/xds-mystruct.c 2001/07/20 10:56:02 1.3 +++ ossp-pkg/srpc/libxds/regression-tests/xds-mystruct.c 2001/07/23 15:33:43 1.4 @@ -28,7 +28,6 @@ #include #include #include -#include #include "../internal.h" struct mystruct Index: ossp-pkg/srpc/libxds/xdr-decode-int32.c ============================================================ $ cvs diff -u -r1.2 -r1.3 xdr-decode-int32.c --- ossp-pkg/srpc/libxds/xdr-decode-int32.c 2001/07/20 10:56:01 1.2 +++ ossp-pkg/srpc/libxds/xdr-decode-int32.c 2001/07/23 15:33:42 1.3 @@ -26,7 +26,6 @@ */ #include -#include #include "internal.h" int xdr_decode_int32(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) Index: ossp-pkg/srpc/libxds/xdr-decode-int64.c ============================================================ $ cvs diff -u -r1.2 -r1.3 xdr-decode-int64.c --- ossp-pkg/srpc/libxds/xdr-decode-int64.c 2001/07/20 10:56:01 1.2 +++ ossp-pkg/srpc/libxds/xdr-decode-int64.c 2001/07/23 15:33:42 1.3 @@ -26,7 +26,6 @@ */ #include -#include #include "internal.h" int xdr_decode_int64(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) Index: ossp-pkg/srpc/libxds/xdr-decode-octetstream.c ============================================================ $ cvs diff -u -r1.2 -r1.3 xdr-decode-octetstream.c --- ossp-pkg/srpc/libxds/xdr-decode-octetstream.c 2001/07/20 10:56:01 1.2 +++ ossp-pkg/srpc/libxds/xdr-decode-octetstream.c 2001/07/23 15:33:42 1.3 @@ -27,7 +27,6 @@ #include #include -#include #include "internal.h" int xdr_decode_octetstream(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) Index: ossp-pkg/srpc/libxds/xdr-decode-string.c ============================================================ $ cvs diff -u -r1.3 -r1.4 xdr-decode-string.c --- ossp-pkg/srpc/libxds/xdr-decode-string.c 2001/07/20 11:15:39 1.3 +++ ossp-pkg/srpc/libxds/xdr-decode-string.c 2001/07/23 15:33:42 1.4 @@ -27,7 +27,6 @@ #include #include -#include #include "internal.h" int xdr_decode_string(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) Index: ossp-pkg/srpc/libxds/xdr-decode-uint32.c ============================================================ $ cvs diff -u -r1.2 -r1.3 xdr-decode-uint32.c --- ossp-pkg/srpc/libxds/xdr-decode-uint32.c 2001/07/20 10:56:01 1.2 +++ ossp-pkg/srpc/libxds/xdr-decode-uint32.c 2001/07/23 15:33:42 1.3 @@ -26,7 +26,6 @@ */ #include -#include #include "internal.h" int xdr_decode_uint32(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) Index: ossp-pkg/srpc/libxds/xdr-decode-uint64.c ============================================================ $ cvs diff -u -r1.2 -r1.3 xdr-decode-uint64.c --- ossp-pkg/srpc/libxds/xdr-decode-uint64.c 2001/07/20 10:56:01 1.2 +++ ossp-pkg/srpc/libxds/xdr-decode-uint64.c 2001/07/23 15:33:42 1.3 @@ -26,7 +26,6 @@ */ #include -#include #include "internal.h" int xdr_decode_uint64(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) Index: ossp-pkg/srpc/libxds/xdr-encode-int32.c ============================================================ $ cvs diff -u -r1.2 -r1.3 xdr-encode-int32.c --- ossp-pkg/srpc/libxds/xdr-encode-int32.c 2001/07/20 10:56:01 1.2 +++ ossp-pkg/srpc/libxds/xdr-encode-int32.c 2001/07/23 15:33:42 1.3 @@ -26,7 +26,6 @@ */ #include -#include #include "internal.h" int xdr_encode_int32(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) Index: ossp-pkg/srpc/libxds/xdr-encode-int64.c ============================================================ $ cvs diff -u -r1.2 -r1.3 xdr-encode-int64.c --- ossp-pkg/srpc/libxds/xdr-encode-int64.c 2001/07/20 10:56:01 1.2 +++ ossp-pkg/srpc/libxds/xdr-encode-int64.c 2001/07/23 15:33:42 1.3 @@ -26,7 +26,6 @@ */ #include -#include #include "internal.h" int xdr_encode_int64(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) Index: ossp-pkg/srpc/libxds/xdr-encode-octetstream.c ============================================================ $ cvs diff -u -r1.3 -r1.4 xdr-encode-octetstream.c --- ossp-pkg/srpc/libxds/xdr-encode-octetstream.c 2001/07/20 10:56:01 1.3 +++ ossp-pkg/srpc/libxds/xdr-encode-octetstream.c 2001/07/23 15:33:42 1.4 @@ -27,7 +27,6 @@ #include #include -#include #include "internal.h" int xdr_encode_octetstream(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) Index: ossp-pkg/srpc/libxds/xdr-encode-string.c ============================================================ $ cvs diff -u -r1.4 -r1.5 xdr-encode-string.c --- ossp-pkg/srpc/libxds/xdr-encode-string.c 2001/07/20 11:15:39 1.4 +++ ossp-pkg/srpc/libxds/xdr-encode-string.c 2001/07/23 15:33:42 1.5 @@ -27,7 +27,6 @@ #include #include -#include #include "internal.h" int xdr_encode_string(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) Index: ossp-pkg/srpc/libxds/xdr-encode-uint32.c ============================================================ $ cvs diff -u -r1.2 -r1.3 xdr-encode-uint32.c --- ossp-pkg/srpc/libxds/xdr-encode-uint32.c 2001/07/20 10:56:01 1.2 +++ ossp-pkg/srpc/libxds/xdr-encode-uint32.c 2001/07/23 15:33:42 1.3 @@ -26,7 +26,6 @@ */ #include -#include #include "internal.h" int xdr_encode_uint32(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) Index: ossp-pkg/srpc/libxds/xdr-encode-uint64.c ============================================================ $ cvs diff -u -r1.2 -r1.3 xdr-encode-uint64.c --- ossp-pkg/srpc/libxds/xdr-encode-uint64.c 2001/07/20 10:56:01 1.2 +++ ossp-pkg/srpc/libxds/xdr-encode-uint64.c 2001/07/23 15:33:42 1.3 @@ -26,7 +26,6 @@ */ #include -#include #include "internal.h" int xdr_encode_uint64(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) From ossp-cvs-owner@ossp.org Mon Jul 23 17:57:50 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f6NFvmj22892; Mon, 23 Jul 2001 17:57:48 +0200 (CEST) Date: Mon, 23 Jul 2001 17:57:48 +0200 (CEST) Message-Id: <200107231557.f6NFvmj22892@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds/regression-tests Makefile.in xml-int3... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 23-Jul-2001 17:57:48 Branch: HEAD Handle: 2001072316574701 Added files: ossp-pkg/srpc/libxds xml-decode-int32.c ossp-pkg/srpc/libxds/regression-tests xml-int32.c Modified files: ossp-pkg/srpc/libxds xml-encode-int32.c ossp-pkg/srpc/libxds/regression-tests Makefile.in Log: Implemented encoding and decoding of int32 values in XML. Summary: Revision Changes Path 1.7 +1 -1 ossp-pkg/srpc/libxds/regression-tests/Makefile.in 1.1 +116 -0 ossp-pkg/srpc/libxds/regression-tests/xml-int32.c 1.1 +55 -0 ossp-pkg/srpc/libxds/xml-decode-int32.c 1.2 +22 -1 ossp-pkg/srpc/libxds/xml-encode-int32.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/regression-tests/Makefile.in ============================================================ $ cvs diff -u -r1.6 -r1.7 Makefile.in --- ossp-pkg/srpc/libxds/regression-tests/Makefile.in 2001/07/23 13:05:24 1.6 +++ ossp-pkg/srpc/libxds/regression-tests/Makefile.in 2001/07/23 15:57:48 1.7 @@ -12,7 +12,7 @@ xds-getbuffer.exe xds-decode.exe xds-setbuffer.exe xds-engine-restart.exe \ xdr-uint32.exe xdr-int32.exe xdr-uint64.exe xdr-int64.exe \ xdr-octetstream.exe xdr-octetstream-empty.exe xdr-string.exe \ - xdr-string-empty.exe xds-mystruct.exe + xdr-string-empty.exe xds-mystruct.exe xml-int32.exe .SUFFIXES: .SUFFIXES: .c .exe Index: ossp-pkg/srpc/libxds/regression-tests/xml-int32.c ============================================================ $ cvs update -p -r1.1 xml-int32.c /* XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) This file is part of OSSP XDS, an extensible data serialization library which can be found at http://www.ossp.com/pkg/xds/. 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. */ #include #include #include #include #include "../internal.h" int main() { xds_t* xds; char* buffer; size_t buffer_size; xds_int32_t values[] = { 0x00000000, 0x12345678, -0x12345678, 0xabcdef01, -0xabcdef01, 0x7fffffff }; size_t i; /* Encode the values array, then decode it back and compare the numbers. */ xds = xds_init(XDS_ENCODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); return 1; } if (xds_register(xds, "int", &xml_encode_int32, NULL) != XDS_OK) { printf("Failed to register my encoding engines.\n"); return 1; } for (i = 0; i < sizeof(values)/sizeof(xds_int32_t); ++i) { if (xds_encode(xds, "int", values[i]) != XDS_OK) { printf("xds_encode(values[%d]) failed!\n", i); return 1; } } if (xds_getbuffer(xds, XDS_GIFT, (void**)&buffer, &buffer_size) != XDS_OK) { printf("getbuffer() failed.\n"); return 1; } xds_destroy(xds); xds = xds_init(XDS_DECODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); return 1; } if (xds_register(xds, "int", &xml_decode_int32, NULL) != XDS_OK) { printf("Failed to register my decoding engines.\n"); return 1; } if (xds_setbuffer(xds, XDS_GIFT, buffer, buffer_size) != XDS_OK) { printf("setbuffer() failed.\n"); return 1; } for (i = 0; i < sizeof(values)/sizeof(xds_int32_t); ++i) { xds_int32_t val; if (xds_decode(xds, "int", &val) != XDS_OK) { printf("xds_decode(values[%d]) failed!\n", i); return 1; } if (val != values[i]) { printf("Decoded value (%d) does not match the original value (%d)!\n", val, values[i]); return 1; } } xds_destroy(xds); /* Everything went fine. */ return 0; } Index: ossp-pkg/srpc/libxds/xml-decode-int32.c ============================================================ $ cvs update -p -r1.1 xml-decode-int32.c /* XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) This file is part of OSSP XDS, an extensible data serialization library which can be found at http://www.ossp.com/pkg/xds/. 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. */ #include #include #include "internal.h" int xml_decode_int32(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) { int rc; xds_int32_t* value; int len; /* Consistency checks. */ assert(xds != NULL); assert(buffer != NULL); assert(buffer_size != 0); assert(args != NULL); if (xds == NULL || buffer == NULL || buffer_size == 0 || args == NULL) return XDS_ERR_INVALID_ARG; /* Format value into buffer. */ value = va_arg(*args, xds_int32_t*); rc = sscanf(buffer, "%d%n", value, &len); if (rc <= 0) return XDS_ERR_UNDERFLOW; return len; } Index: ossp-pkg/srpc/libxds/xml-encode-int32.c ============================================================ $ cvs diff -u -r1.1 -r1.2 xml-encode-int32.c --- ossp-pkg/srpc/libxds/xml-encode-int32.c 2001/07/23 15:28:53 1.1 +++ ossp-pkg/srpc/libxds/xml-encode-int32.c 2001/07/23 15:57:47 1.2 @@ -25,10 +25,31 @@ SUCH DAMAGE. */ +#include #include #include "internal.h" int xml_encode_int32(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) { - return -1; + int rc; + xds_int32_t value; + + /* Consistency checks. */ + + assert(xds != NULL); + assert(buffer != NULL); + assert(buffer_size != 0); + assert(args != NULL); + if (xds == NULL || buffer == NULL || buffer_size == 0 || args == NULL) + return XDS_ERR_INVALID_ARG; + + /* Format value into buffer. */ + + value = va_arg(*args, xds_int32_t); + rc = snprintf(buffer, buffer_size, "%d", value); + if (rc < 0) + return buffer_size*2; + assert(rc >= 15); + + return rc; } From ossp-cvs-owner@ossp.org Mon Jul 23 18:17:46 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f6NGHjR25754; Mon, 23 Jul 2001 18:17:45 +0200 (CEST) Date: Mon, 23 Jul 2001 18:17:45 +0200 (CEST) Message-Id: <200107231617.f6NGHjR25754@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds Makefile.in ossp-pkg/srpc/libxds/regr... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 23-Jul-2001 18:17:45 Branch: HEAD Handle: 2001072317174301 Added files: ossp-pkg/srpc/libxds xml-decode-int64.c xml-decode-uint32.c xml-decode-uint64.c xml-encode-int64.c xml-encode-uint32.c xml-encode-uint64.c ossp-pkg/srpc/libxds/regression-tests xml-int64.c xml-uint32.c xml-uint64.c Modified files: ossp-pkg/srpc/libxds Makefile.in xds.h.in ossp-pkg/srpc/libxds/regression-tests Makefile.in Log: Added XML implementations for uint32, int64, and uint64. Summary: Revision Changes Path 1.8 +3 -1 ossp-pkg/srpc/libxds/Makefile.in 1.8 +2 -1 ossp-pkg/srpc/libxds/regression-tests/Makefile.in 1.1 +116 -0 ossp-pkg/srpc/libxds/regression-tests/xml-int64.c 1.1 +115 -0 ossp-pkg/srpc/libxds/regression-tests/xml-uint32.c 1.1 +115 -0 ossp-pkg/srpc/libxds/regression-tests/xml-uint64.c 1.4 +9 -0 ossp-pkg/srpc/libxds/xds.h.in 1.1 +55 -0 ossp-pkg/srpc/libxds/xml-decode-int64.c 1.1 +55 -0 ossp-pkg/srpc/libxds/xml-decode-uint32.c 1.1 +55 -0 ossp-pkg/srpc/libxds/xml-decode-uint64.c 1.1 +55 -0 ossp-pkg/srpc/libxds/xml-encode-int64.c 1.1 +55 -0 ossp-pkg/srpc/libxds/xml-encode-uint32.c 1.1 +55 -0 ossp-pkg/srpc/libxds/xml-encode-uint64.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/Makefile.in ============================================================ $ cvs diff -u -r1.7 -r1.8 Makefile.in --- ossp-pkg/srpc/libxds/Makefile.in 2001/07/23 15:33:42 1.7 +++ ossp-pkg/srpc/libxds/Makefile.in 2001/07/23 16:17:43 1.8 @@ -15,7 +15,9 @@ xdr-decode-int64.o xdr-decode-uint32.o xdr-decode-uint64.o \ xdr-encode-octetstream.o xdr-decode-octetstream.o \ xdr-encode-string.o xdr-decode-string.o xdr-encode-double.o \ - xdr-decode-double.o xml-encode-int32.o xml-decode-int32.o + xdr-decode-double.o xml-encode-int32.o xml-decode-int32.o \ + xml-decode-int64.o xml-decode-uint32.o xml-decode-uint64.o \ + xml-encode-int64.o xml-encode-uint32.o xml-encode-uint64.o .c.o: $(CC) $(CPPFLAGS) $(WARNFLAGS) $(OPTFLAGS) $(CFLAGS) -c $< Index: ossp-pkg/srpc/libxds/regression-tests/Makefile.in ============================================================ $ cvs diff -u -r1.7 -r1.8 Makefile.in --- ossp-pkg/srpc/libxds/regression-tests/Makefile.in 2001/07/23 15:57:48 1.7 +++ ossp-pkg/srpc/libxds/regression-tests/Makefile.in 2001/07/23 16:17:44 1.8 @@ -12,7 +12,8 @@ xds-getbuffer.exe xds-decode.exe xds-setbuffer.exe xds-engine-restart.exe \ xdr-uint32.exe xdr-int32.exe xdr-uint64.exe xdr-int64.exe \ xdr-octetstream.exe xdr-octetstream-empty.exe xdr-string.exe \ - xdr-string-empty.exe xds-mystruct.exe xml-int32.exe + xdr-string-empty.exe xds-mystruct.exe xml-uint32.exe xml-int32.exe \ + xml-uint64.exe xml-int64.exe .SUFFIXES: .SUFFIXES: .c .exe Index: ossp-pkg/srpc/libxds/regression-tests/xml-int64.c ============================================================ $ cvs update -p -r1.1 xml-int64.c /* XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) This file is part of OSSP XDS, an extensible data serialization library which can be found at http://www.ossp.com/pkg/xds/. 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. */ #include #include #include #include #include "../internal.h" int main() { xds_t* xds; char* buffer; size_t buffer_size; xds_int64_t values[] = { 0x0000000000000000LL, 0x123456789abcdef0LL, -0x123456789abcdef0LL, 0xabcdef01cc45bb9aLL, -0xabcdef01cc45bb9aLL, 0x7fffffffffffffffLL }; size_t i; /* Encode the values array, then decode it back and compare the numbers. */ xds = xds_init(XDS_ENCODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); return 1; } if (xds_register(xds, "int", &xml_encode_int64, NULL) != XDS_OK) { printf("Failed to register my encoding engines.\n"); return 1; } for (i = 0; i < sizeof(values)/sizeof(xds_int64_t); ++i) { if (xds_encode(xds, "int", values[i]) != XDS_OK) { printf("xds_encode(values[%d]) failed!\n", i); return 1; } } if (xds_getbuffer(xds, XDS_GIFT, (void**)&buffer, &buffer_size) != XDS_OK) { printf("getbuffer() failed.\n"); return 1; } xds_destroy(xds); xds = xds_init(XDS_DECODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); return 1; } if (xds_register(xds, "int", &xml_decode_int64, NULL) != XDS_OK) { printf("Failed to register my decoding engines.\n"); return 1; } if (xds_setbuffer(xds, XDS_GIFT, buffer, buffer_size) != XDS_OK) { printf("setbuffer() failed.\n"); return 1; } for (i = 0; i < sizeof(values)/sizeof(xds_int64_t); ++i) { xds_int64_t val; if (xds_decode(xds, "int", &val) != XDS_OK) { printf("xds_decode(values[%d]) failed!\n", i); return 1; } if (val != values[i]) { printf("Decoded value (%Ld) does not match the original value (%Ld)!\n", val, values[i]); return 1; } } xds_destroy(xds); /* Everything went fine. */ return 0; } Index: ossp-pkg/srpc/libxds/regression-tests/xml-uint32.c ============================================================ $ cvs update -p -r1.1 xml-uint32.c /* XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) This file is part of OSSP XDS, an extensible data serialization library which can be found at http://www.ossp.com/pkg/xds/. 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. */ #include #include #include #include #include "../internal.h" int main() { xds_t* xds; char* buffer; size_t buffer_size; xds_uint32_t values[] = { 0x00000000, 0x12345678, 0xabcdef01, 0xc500b3ef, 0xffffffff }; size_t i; /* Encode the values array, then decode it back and compare the numbers. */ xds = xds_init(XDS_ENCODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); return 1; } if (xds_register(xds, "int", &xml_encode_uint32, NULL) != XDS_OK) { printf("Failed to register my encoding engines.\n"); return 1; } for (i = 0; i < sizeof(values)/sizeof(xds_uint32_t); ++i) { if (xds_encode(xds, "int", values[i]) != XDS_OK) { printf("xds_encode(values[%d]) failed!\n", i); return 1; } } if (xds_getbuffer(xds, XDS_GIFT, (void**)&buffer, &buffer_size) != XDS_OK) { printf("getbuffer() failed.\n"); return 1; } xds_destroy(xds); xds = xds_init(XDS_DECODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); return 1; } if (xds_register(xds, "int", &xml_decode_uint32, NULL) != XDS_OK) { printf("Failed to register my decoding engines.\n"); return 1; } if (xds_setbuffer(xds, XDS_GIFT, buffer, buffer_size) != XDS_OK) { printf("setbuffer() failed.\n"); return 1; } for (i = 0; i < sizeof(values)/sizeof(xds_uint32_t); ++i) { xds_uint32_t val; if (xds_decode(xds, "int", &val) != XDS_OK) { printf("xds_decode(values[%d]) failed!\n", i); return 1; } if (val != values[i]) { printf("Decoded value (%d) does not match the original value (%d)!\n", val, values[i]); return 1; } } xds_destroy(xds); /* Everything went fine. */ return 0; } Index: ossp-pkg/srpc/libxds/regression-tests/xml-uint64.c ============================================================ $ cvs update -p -r1.1 xml-uint64.c /* XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) This file is part of OSSP XDS, an extensible data serialization library which can be found at http://www.ossp.com/pkg/xds/. 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. */ #include #include #include #include #include "../internal.h" int main() { xds_t* xds; char* buffer; size_t buffer_size; xds_uint64_t values[] = { 0x0000000000000000ULL, 0x123456789abcdef0ULL, 0xabcdef01cc45bb9aULL, 0xc500b3efdd34ca9eULL, 0xffffffffffffffffULL }; size_t i; /* Encode the values array, then decode it back and compare the numbers. */ xds = xds_init(XDS_ENCODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); return 1; } if (xds_register(xds, "int", &xml_encode_uint64, NULL) != XDS_OK) { printf("Failed to register my encoding engines.\n"); return 1; } for (i = 0; i < sizeof(values)/sizeof(xds_uint64_t); ++i) { if (xds_encode(xds, "int", values[i]) != XDS_OK) { printf("xds_encode(values[%d]) failed!\n", i); return 1; } } if (xds_getbuffer(xds, XDS_GIFT, (void**)&buffer, &buffer_size) != XDS_OK) { printf("getbuffer() failed.\n"); return 1; } xds_destroy(xds); xds = xds_init(XDS_DECODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); return 1; } if (xds_register(xds, "int", &xml_decode_uint64, NULL) != XDS_OK) { printf("Failed to register my decoding engines.\n"); return 1; } if (xds_setbuffer(xds, XDS_GIFT, buffer, buffer_size) != XDS_OK) { printf("setbuffer() failed.\n"); return 1; } for (i = 0; i < sizeof(values)/sizeof(xds_uint64_t); ++i) { xds_uint64_t val; if (xds_decode(xds, "int", &val) != XDS_OK) { printf("xds_decode(values[%d]) failed!\n", i); return 1; } if (val != values[i]) { printf("Decoded value (%Lu) does not match the original value (%Lu)!\n", val, values[i]); return 1; } } xds_destroy(xds); /* Everything went fine. */ return 0; } Index: ossp-pkg/srpc/libxds/xds.h.in ============================================================ $ cvs diff -u -r1.3 -r1.4 xds.h.in --- ossp-pkg/srpc/libxds/xds.h.in 2001/07/23 15:33:23 1.3 +++ ossp-pkg/srpc/libxds/xds.h.in 2001/07/23 16:17:43 1.4 @@ -103,4 +103,13 @@ int xml_encode_int32(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); int xml_decode_int32(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); +int xml_encode_uint32(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); +int xml_decode_uint32(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); + +int xml_encode_int64(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); +int xml_decode_int64(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); + +int xml_encode_uint64(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); +int xml_decode_uint64(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); + #endif /* !defined(__LIBXDS_H__) */ Index: ossp-pkg/srpc/libxds/xml-decode-int64.c ============================================================ $ cvs update -p -r1.1 xml-decode-int64.c /* XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) This file is part of OSSP XDS, an extensible data serialization library which can be found at http://www.ossp.com/pkg/xds/. 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. */ #include #include #include "internal.h" int xml_decode_int64(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) { int rc; xds_int64_t* value; int len; /* Consistency checks. */ assert(xds != NULL); assert(buffer != NULL); assert(buffer_size != 0); assert(args != NULL); if (xds == NULL || buffer == NULL || buffer_size == 0 || args == NULL) return XDS_ERR_INVALID_ARG; /* Format value into buffer. */ value = va_arg(*args, xds_int64_t*); rc = sscanf(buffer, "%Ld%n", value, &len); if (rc <= 0) return XDS_ERR_UNDERFLOW; return len; } Index: ossp-pkg/srpc/libxds/xml-decode-uint32.c ============================================================ $ cvs update -p -r1.1 xml-decode-uint32.c /* XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) This file is part of OSSP XDS, an extensible data serialization library which can be found at http://www.ossp.com/pkg/xds/. 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. */ #include #include #include "internal.h" int xml_decode_uint32(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) { int rc; xds_uint32_t* value; int len; /* Consistency checks. */ assert(xds != NULL); assert(buffer != NULL); assert(buffer_size != 0); assert(args != NULL); if (xds == NULL || buffer == NULL || buffer_size == 0 || args == NULL) return XDS_ERR_INVALID_ARG; /* Format value into buffer. */ value = va_arg(*args, xds_uint32_t*); rc = sscanf(buffer, "%u%n", value, &len); if (rc <= 0) return XDS_ERR_UNDERFLOW; return len; } Index: ossp-pkg/srpc/libxds/xml-decode-uint64.c ============================================================ $ cvs update -p -r1.1 xml-decode-uint64.c /* XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) This file is part of OSSP XDS, an extensible data serialization library which can be found at http://www.ossp.com/pkg/xds/. 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. */ #include #include #include "internal.h" int xml_decode_uint64(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) { int rc; xds_uint64_t* value; int len; /* Consistency checks. */ assert(xds != NULL); assert(buffer != NULL); assert(buffer_size != 0); assert(args != NULL); if (xds == NULL || buffer == NULL || buffer_size == 0 || args == NULL) return XDS_ERR_INVALID_ARG; /* Format value into buffer. */ value = va_arg(*args, xds_uint64_t*); rc = sscanf(buffer, "%Lu%n", value, &len); if (rc <= 0) return XDS_ERR_UNDERFLOW; return len; } Index: ossp-pkg/srpc/libxds/xml-encode-int64.c ============================================================ $ cvs update -p -r1.1 xml-encode-int64.c /* XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) This file is part of OSSP XDS, an extensible data serialization library which can be found at http://www.ossp.com/pkg/xds/. 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. */ #include #include #include "internal.h" int xml_encode_int64(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) { int rc; xds_int64_t value; /* Consistency checks. */ assert(xds != NULL); assert(buffer != NULL); assert(buffer_size != 0); assert(args != NULL); if (xds == NULL || buffer == NULL || buffer_size == 0 || args == NULL) return XDS_ERR_INVALID_ARG; /* Format value into buffer. */ value = va_arg(*args, xds_int64_t); rc = snprintf(buffer, buffer_size, "%Ld", value); if (rc < 0) return buffer_size*2; assert(rc >= 15); return rc; } Index: ossp-pkg/srpc/libxds/xml-encode-uint32.c ============================================================ $ cvs update -p -r1.1 xml-encode-uint32.c /* XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) This file is part of OSSP XDS, an extensible data serialization library which can be found at http://www.ossp.com/pkg/xds/. 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. */ #include #include #include "internal.h" int xml_encode_uint32(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) { int rc; xds_uint32_t value; /* Consistency checks. */ assert(xds != NULL); assert(buffer != NULL); assert(buffer_size != 0); assert(args != NULL); if (xds == NULL || buffer == NULL || buffer_size == 0 || args == NULL) return XDS_ERR_INVALID_ARG; /* Format value into buffer. */ value = va_arg(*args, xds_uint32_t); rc = snprintf(buffer, buffer_size, "%u", value); if (rc < 0) return buffer_size*2; assert(rc >= 15); return rc; } Index: ossp-pkg/srpc/libxds/xml-encode-uint64.c ============================================================ $ cvs update -p -r1.1 xml-encode-uint64.c /* XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) This file is part of OSSP XDS, an extensible data serialization library which can be found at http://www.ossp.com/pkg/xds/. 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. */ #include #include #include "internal.h" int xml_encode_uint64(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) { int rc; xds_uint64_t value; /* Consistency checks. */ assert(xds != NULL); assert(buffer != NULL); assert(buffer_size != 0); assert(args != NULL); if (xds == NULL || buffer == NULL || buffer_size == 0 || args == NULL) return XDS_ERR_INVALID_ARG; /* Format value into buffer. */ value = va_arg(*args, xds_uint64_t); rc = snprintf(buffer, buffer_size, "%Lu", value); if (rc < 0) return buffer_size*2; assert(rc >= 15); return rc; } From ossp-cvs-owner@ossp.org Mon Jul 23 18:33:06 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f6NGX5G28306; Mon, 23 Jul 2001 18:33:05 +0200 (CEST) Date: Mon, 23 Jul 2001 18:33:05 +0200 (CEST) Message-Id: <200107231633.f6NGX5G28306@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds Makefile.in ossp-pkg/srpc/libxds/regr... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 23-Jul-2001 18:33:05 Branch: HEAD Handle: 2001072317330301 Added files: ossp-pkg/srpc/libxds xml-decode-double.c xml-encode-double.c ossp-pkg/srpc/libxds/regression-tests xml-double.c Modified files: ossp-pkg/srpc/libxds Makefile.in xds.h.in ossp-pkg/srpc/libxds/regression-tests Makefile.in Log: Implemented encoding and decoding of doubles in XML. Summary: Revision Changes Path 1.9 +2 -1 ossp-pkg/srpc/libxds/Makefile.in 1.9 +1 -1 ossp-pkg/srpc/libxds/regression-tests/Makefile.in 1.1 +113 -0 ossp-pkg/srpc/libxds/regression-tests/xml-double.c 1.5 +4 -0 ossp-pkg/srpc/libxds/xds.h.in 1.1 +55 -0 ossp-pkg/srpc/libxds/xml-decode-double.c 1.1 +55 -0 ossp-pkg/srpc/libxds/xml-encode-double.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/Makefile.in ============================================================ $ cvs diff -u -r1.8 -r1.9 Makefile.in --- ossp-pkg/srpc/libxds/Makefile.in 2001/07/23 16:17:43 1.8 +++ ossp-pkg/srpc/libxds/Makefile.in 2001/07/23 16:33:03 1.9 @@ -17,7 +17,8 @@ xdr-encode-string.o xdr-decode-string.o xdr-encode-double.o \ xdr-decode-double.o xml-encode-int32.o xml-decode-int32.o \ xml-decode-int64.o xml-decode-uint32.o xml-decode-uint64.o \ - xml-encode-int64.o xml-encode-uint32.o xml-encode-uint64.o + xml-encode-int64.o xml-encode-uint32.o xml-encode-uint64.o \ + xml-encode-double.o xml-decode-double.o .c.o: $(CC) $(CPPFLAGS) $(WARNFLAGS) $(OPTFLAGS) $(CFLAGS) -c $< Index: ossp-pkg/srpc/libxds/regression-tests/Makefile.in ============================================================ $ cvs diff -u -r1.8 -r1.9 Makefile.in --- ossp-pkg/srpc/libxds/regression-tests/Makefile.in 2001/07/23 16:17:44 1.8 +++ ossp-pkg/srpc/libxds/regression-tests/Makefile.in 2001/07/23 16:33:04 1.9 @@ -13,7 +13,7 @@ xdr-uint32.exe xdr-int32.exe xdr-uint64.exe xdr-int64.exe \ xdr-octetstream.exe xdr-octetstream-empty.exe xdr-string.exe \ xdr-string-empty.exe xds-mystruct.exe xml-uint32.exe xml-int32.exe \ - xml-uint64.exe xml-int64.exe + xml-uint64.exe xml-int64.exe xml-double.exe .SUFFIXES: .SUFFIXES: .c .exe Index: ossp-pkg/srpc/libxds/regression-tests/xml-double.c ============================================================ $ cvs update -p -r1.1 xml-double.c /* XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) This file is part of OSSP XDS, an extensible data serialization library which can be found at http://www.ossp.com/pkg/xds/. 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. */ #include #include #include #include #include "../internal.h" int main() { xds_t* xds; char* buffer; size_t buffer_size; xds_double_t values[] = { 3.14159265358979323844 }; size_t i; /* Encode the values array, then decode it back and compare the numbers. */ xds = xds_init(XDS_ENCODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); return 1; } if (xds_register(xds, "int", &xml_encode_double, NULL) != XDS_OK) { printf("Failed to register my encoding engines.\n"); return 1; } for (i = 0; i < sizeof(values)/sizeof(xds_double_t); ++i) { if (xds_encode(xds, "int", values[i]) != XDS_OK) { printf("xds_encode(values[%d]) failed!\n", i); return 1; } } if (xds_getbuffer(xds, XDS_GIFT, (void**)&buffer, &buffer_size) != XDS_OK) { printf("getbuffer() failed.\n"); return 1; } xds_destroy(xds); printf("%s\n", buffer); xds = xds_init(XDS_DECODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); return 1; } if (xds_register(xds, "int", &xml_decode_double, NULL) != XDS_OK) { printf("Failed to register my decoding engines.\n"); return 1; } if (xds_setbuffer(xds, XDS_GIFT, buffer, buffer_size) != XDS_OK) { printf("setbuffer() failed.\n"); return 1; } for (i = 0; i < sizeof(values)/sizeof(xds_double_t); ++i) { xds_double_t val; if (xds_decode(xds, "int", &val) != XDS_OK) { printf("xds_decode(values[%d]) failed!\n", i); return 1; } if (val != values[i]) { printf("Decoded value (%E) does not match the original value (%E)!\n", val, values[i]); return 1; } } xds_destroy(xds); /* Everything went fine. */ return 0; } Index: ossp-pkg/srpc/libxds/xds.h.in ============================================================ $ cvs diff -u -r1.4 -r1.5 xds.h.in --- ossp-pkg/srpc/libxds/xds.h.in 2001/07/23 16:17:43 1.4 +++ ossp-pkg/srpc/libxds/xds.h.in 2001/07/23 16:33:03 1.5 @@ -42,6 +42,7 @@ typedef @xds_int16_t@ xds_int16_t; typedef @xds_int32_t@ xds_int32_t; typedef @xds_int64_t@ xds_int64_t; +typedef double xds_double_t; enum { @@ -111,5 +112,8 @@ int xml_encode_uint64(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); int xml_decode_uint64(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); + +int xml_encode_double(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); +int xml_decode_double(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); #endif /* !defined(__LIBXDS_H__) */ Index: ossp-pkg/srpc/libxds/xml-decode-double.c ============================================================ $ cvs update -p -r1.1 xml-decode-double.c /* XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) This file is part of OSSP XDS, an extensible data serialization library which can be found at http://www.ossp.com/pkg/xds/. 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. */ #include #include #include "internal.h" int xml_decode_double(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) { int rc; xds_double_t* value; int len; /* Consistency checks. */ assert(xds != NULL); assert(buffer != NULL); assert(buffer_size != 0); assert(args != NULL); if (xds == NULL || buffer == NULL || buffer_size == 0 || args == NULL) return XDS_ERR_INVALID_ARG; /* Format value into buffer. */ value = va_arg(*args, xds_double_t*); rc = sscanf(buffer, "%lE%n", value, &len); if (rc <= 0) return XDS_ERR_UNDERFLOW; return len; } Index: ossp-pkg/srpc/libxds/xml-encode-double.c ============================================================ $ cvs update -p -r1.1 xml-encode-double.c /* XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) This file is part of OSSP XDS, an extensible data serialization library which can be found at http://www.ossp.com/pkg/xds/. 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. */ #include #include #include "internal.h" int xml_encode_double(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) { int rc; xds_double_t value; /* Consistency checks. */ assert(xds != NULL); assert(buffer != NULL); assert(buffer_size != 0); assert(args != NULL); if (xds == NULL || buffer == NULL || buffer_size == 0 || args == NULL) return XDS_ERR_INVALID_ARG; /* Format value into buffer. */ value = va_arg(*args, xds_double_t); rc = snprintf(buffer, buffer_size, "%E", value); if (rc < 0) return buffer_size*2; assert(rc >= 15); return rc; } From ossp-cvs-owner@ossp.org Mon Jul 23 18:40:40 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f6NGedD28842; Mon, 23 Jul 2001 18:40:39 +0200 (CEST) Date: Mon, 23 Jul 2001 18:40:39 +0200 (CEST) Message-Id: <200107231640.f6NGedD28842@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds xml-decode-int64.c xml-decode-uint64.... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 23-Jul-2001 18:40:39 Branch: HEAD Handle: 2001072317403800 Modified files: ossp-pkg/srpc/libxds xml-decode-int64.c xml-decode-uint64.c xml-encode-int64.c xml-encode-uint64.c Log: Use 'll' modifier for formatting long long values rather than 'L', which seems to be unsupported on FreeBSD and Solaris. Summary: Revision Changes Path 1.2 +1 -1 ossp-pkg/srpc/libxds/xml-decode-int64.c 1.2 +1 -1 ossp-pkg/srpc/libxds/xml-decode-uint64.c 1.2 +1 -1 ossp-pkg/srpc/libxds/xml-encode-int64.c 1.2 +1 -1 ossp-pkg/srpc/libxds/xml-encode-uint64.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/xml-decode-int64.c ============================================================ $ cvs diff -u -r1.1 -r1.2 xml-decode-int64.c --- ossp-pkg/srpc/libxds/xml-decode-int64.c 2001/07/23 16:17:43 1.1 +++ ossp-pkg/srpc/libxds/xml-decode-int64.c 2001/07/23 16:40:38 1.2 @@ -47,7 +47,7 @@ /* Format value into buffer. */ value = va_arg(*args, xds_int64_t*); - rc = sscanf(buffer, "%Ld%n", value, &len); + rc = sscanf(buffer, "%lld%n", value, &len); if (rc <= 0) return XDS_ERR_UNDERFLOW; Index: ossp-pkg/srpc/libxds/xml-decode-uint64.c ============================================================ $ cvs diff -u -r1.1 -r1.2 xml-decode-uint64.c --- ossp-pkg/srpc/libxds/xml-decode-uint64.c 2001/07/23 16:17:43 1.1 +++ ossp-pkg/srpc/libxds/xml-decode-uint64.c 2001/07/23 16:40:38 1.2 @@ -47,7 +47,7 @@ /* Format value into buffer. */ value = va_arg(*args, xds_uint64_t*); - rc = sscanf(buffer, "%Lu%n", value, &len); + rc = sscanf(buffer, "%llu%n", value, &len); if (rc <= 0) return XDS_ERR_UNDERFLOW; Index: ossp-pkg/srpc/libxds/xml-encode-int64.c ============================================================ $ cvs diff -u -r1.1 -r1.2 xml-encode-int64.c --- ossp-pkg/srpc/libxds/xml-encode-int64.c 2001/07/23 16:17:43 1.1 +++ ossp-pkg/srpc/libxds/xml-encode-int64.c 2001/07/23 16:40:38 1.2 @@ -46,7 +46,7 @@ /* Format value into buffer. */ value = va_arg(*args, xds_int64_t); - rc = snprintf(buffer, buffer_size, "%Ld", value); + rc = snprintf(buffer, buffer_size, "%lld", value); if (rc < 0) return buffer_size*2; assert(rc >= 15); Index: ossp-pkg/srpc/libxds/xml-encode-uint64.c ============================================================ $ cvs diff -u -r1.1 -r1.2 xml-encode-uint64.c --- ossp-pkg/srpc/libxds/xml-encode-uint64.c 2001/07/23 16:17:43 1.1 +++ ossp-pkg/srpc/libxds/xml-encode-uint64.c 2001/07/23 16:40:38 1.2 @@ -46,7 +46,7 @@ /* Format value into buffer. */ value = va_arg(*args, xds_uint64_t); - rc = snprintf(buffer, buffer_size, "%Lu", value); + rc = snprintf(buffer, buffer_size, "%llu", value); if (rc < 0) return buffer_size*2; assert(rc >= 15); From ossp-cvs-owner@ossp.org Mon Jul 23 18:45:12 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f6NGjBl29645; Mon, 23 Jul 2001 18:45:11 +0200 (CEST) Date: Mon, 23 Jul 2001 18:45:11 +0200 (CEST) Message-Id: <200107231645.f6NGjBl29645@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds/regression-tests xml-int64.c xml-uint... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 23-Jul-2001 18:45:11 Branch: HEAD Handle: 2001072317451001 Modified files: ossp-pkg/srpc/libxds/regression-tests xml-int64.c xml-uint64.c Log: Use %lld instead of %Ld. Summary: Revision Changes Path 1.2 +1 -1 ossp-pkg/srpc/libxds/regression-tests/xml-int64.c 1.2 +1 -1 ossp-pkg/srpc/libxds/regression-tests/xml-uint64.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/regression-tests/xml-int64.c ============================================================ $ cvs diff -u -r1.1 -r1.2 xml-int64.c --- ossp-pkg/srpc/libxds/regression-tests/xml-int64.c 2001/07/23 16:17:44 1.1 +++ ossp-pkg/srpc/libxds/regression-tests/xml-int64.c 2001/07/23 16:45:10 1.2 @@ -104,7 +104,7 @@ } if (val != values[i]) { - printf("Decoded value (%Ld) does not match the original value (%Ld)!\n", val, values[i]); + printf("Decoded value (%lld) does not match the original value (%lld)!\n", val, values[i]); return 1; } } Index: ossp-pkg/srpc/libxds/regression-tests/xml-uint64.c ============================================================ $ cvs diff -u -r1.1 -r1.2 xml-uint64.c --- ossp-pkg/srpc/libxds/regression-tests/xml-uint64.c 2001/07/23 16:17:44 1.1 +++ ossp-pkg/srpc/libxds/regression-tests/xml-uint64.c 2001/07/23 16:45:11 1.2 @@ -103,7 +103,7 @@ } if (val != values[i]) { - printf("Decoded value (%Lu) does not match the original value (%Lu)!\n", val, values[i]); + printf("Decoded value (%llu) does not match the original value (%llu)!\n", val, values[i]); return 1; } } From ossp-cvs-owner@ossp.org Tue Jul 24 14:16:34 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f6OCGWZ78605; Tue, 24 Jul 2001 14:16:32 +0200 (CEST) Date: Tue, 24 Jul 2001 14:16:32 +0200 (CEST) Message-Id: <200107241216.f6OCGWZ78605@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc TODO Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 24-Jul-2001 14:16:32 Branch: HEAD Handle: 2001072413163200 Modified files: ossp-pkg/srpc TODO Log: - Added spec of xml_encode_begin() and xml_encode_end(). - Added RFC for UTF-8 encoding. - Added the list of characters to be escaped for XML. - Documented TODO stuff in autoconf script. - Documented design decision concerning the precision of doubles. - Documented design decision against use of snprintf(). Summary: Revision Changes Path 1.7 +27 -1 ossp-pkg/srpc/TODO ____________________________________________________________________________ Index: ossp-pkg/srpc/TODO ============================================================ $ cvs diff -u -r1.6 -r1.7 TODO --- ossp-pkg/srpc/TODO 2001/07/19 11:07:15 1.6 +++ ossp-pkg/srpc/TODO 2001/07/24 12:16:32 1.7 @@ -1,4 +1,3 @@ - TODO LIST AND MILESTONES ======================== @@ -49,6 +48,33 @@ - XML: 1234 uint32, int64, uint64, + + - xml_encode_begin(): + + + + + - xml_encode_end(): + + - UFT-8 RFC: rfc2279.txt + + Escape: < <--> < + & <--> & + ]]> <--> ]]> + + + + - libm may be used. We don't depend on sprintf() but convert out + numbers ourselves for portability. + + - IEEE values ranges for floating point numbers will be used for + accurarcy in XML presentation. + + - autoconf should find the types for int32 etc. even if they're not + defined in sys/types.h. + + - autoconf should specify the compiler flags depending on what the + compiler supports. o M5 (peti+rse) [1 week until 30-Jul-2001] - [peti] documentation for libxds (xds.pod) From ossp-cvs-owner@ossp.org Tue Jul 24 15:04:45 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f6OD4it85246; Tue, 24 Jul 2001 15:04:44 +0200 (CEST) Date: Tue, 24 Jul 2001 15:04:44 +0200 (CEST) Message-Id: <200107241304.f6OD4it85246@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds xml-decode-double.c xml-encode-double... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 24-Jul-2001 15:04:44 Branch: HEAD Handle: 2001072414044300 Modified files: ossp-pkg/srpc/libxds xml-decode-double.c xml-encode-double.c Log: Encoding or decoding of doubles is not implemented yet. Summary: Revision Changes Path 1.2 +1 -21 ossp-pkg/srpc/libxds/xml-decode-double.c 1.2 +1 -21 ossp-pkg/srpc/libxds/xml-encode-double.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/xml-decode-double.c ============================================================ $ cvs diff -u -r1.1 -r1.2 xml-decode-double.c --- ossp-pkg/srpc/libxds/xml-decode-double.c 2001/07/23 16:33:03 1.1 +++ ossp-pkg/srpc/libxds/xml-decode-double.c 2001/07/24 13:04:43 1.2 @@ -31,25 +31,5 @@ int xml_decode_double(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) { - int rc; - xds_double_t* value; - int len; - - /* Consistency checks. */ - - assert(xds != NULL); - assert(buffer != NULL); - assert(buffer_size != 0); - assert(args != NULL); - if (xds == NULL || buffer == NULL || buffer_size == 0 || args == NULL) - return XDS_ERR_INVALID_ARG; - - /* Format value into buffer. */ - - value = va_arg(*args, xds_double_t*); - rc = sscanf(buffer, "%lE%n", value, &len); - if (rc <= 0) - return XDS_ERR_UNDERFLOW; - - return len; + return -1; } Index: ossp-pkg/srpc/libxds/xml-encode-double.c ============================================================ $ cvs diff -u -r1.1 -r1.2 xml-encode-double.c --- ossp-pkg/srpc/libxds/xml-encode-double.c 2001/07/23 16:33:03 1.1 +++ ossp-pkg/srpc/libxds/xml-encode-double.c 2001/07/24 13:04:43 1.2 @@ -31,25 +31,5 @@ int xml_encode_double(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) { - int rc; - xds_double_t value; - - /* Consistency checks. */ - - assert(xds != NULL); - assert(buffer != NULL); - assert(buffer_size != 0); - assert(args != NULL); - if (xds == NULL || buffer == NULL || buffer_size == 0 || args == NULL) - return XDS_ERR_INVALID_ARG; - - /* Format value into buffer. */ - - value = va_arg(*args, xds_double_t); - rc = snprintf(buffer, buffer_size, "%E", value); - if (rc < 0) - return buffer_size*2; - assert(rc >= 15); - - return rc; + return -1; } From ossp-cvs-owner@ossp.org Tue Jul 24 15:49:35 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f6ODnYr91617; Tue, 24 Jul 2001 15:49:34 +0200 (CEST) Date: Tue, 24 Jul 2001 15:49:34 +0200 (CEST) Message-Id: <200107241349.f6ODnYr91617@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds/regression-tests xml-double.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 24-Jul-2001 15:49:34 Branch: HEAD Handle: 2001072414493400 Modified files: ossp-pkg/srpc/libxds/regression-tests xml-double.c Log: Don't run this test at the moment, we know it fails. Summary: Revision Changes Path 1.2 +2 -1 ossp-pkg/srpc/libxds/regression-tests/xml-double.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/regression-tests/xml-double.c ============================================================ $ cvs diff -u -r1.1 -r1.2 xml-double.c --- ossp-pkg/srpc/libxds/regression-tests/xml-double.c 2001/07/23 16:33:04 1.1 +++ ossp-pkg/srpc/libxds/regression-tests/xml-double.c 2001/07/24 13:49:34 1.2 @@ -33,6 +33,7 @@ int main() { +#if 0 xds_t* xds; char* buffer; size_t buffer_size; @@ -108,6 +109,6 @@ xds_destroy(xds); /* Everything went fine. */ - +#endif return 0; } From ossp-cvs-owner@ossp.org Tue Jul 24 15:50:17 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f6ODoGU91715; Tue, 24 Jul 2001 15:50:16 +0200 (CEST) Date: Tue, 24 Jul 2001 15:50:16 +0200 (CEST) Message-Id: <200107241350.f6ODoGU91715@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds/regression-tests xml-int64.c xml-uint... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 24-Jul-2001 15:50:16 Branch: HEAD Handle: 2001072414501500 Modified files: ossp-pkg/srpc/libxds/regression-tests xml-int64.c xml-uint64.c Log: Removed printing of long long values so that the tests don't run into portability problems. Summary: Revision Changes Path 1.3 +1 -1 ossp-pkg/srpc/libxds/regression-tests/xml-int64.c 1.3 +1 -1 ossp-pkg/srpc/libxds/regression-tests/xml-uint64.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/regression-tests/xml-int64.c ============================================================ $ cvs diff -u -r1.2 -r1.3 xml-int64.c --- ossp-pkg/srpc/libxds/regression-tests/xml-int64.c 2001/07/23 16:45:10 1.2 +++ ossp-pkg/srpc/libxds/regression-tests/xml-int64.c 2001/07/24 13:50:15 1.3 @@ -104,7 +104,7 @@ } if (val != values[i]) { - printf("Decoded value (%lld) does not match the original value (%lld)!\n", val, values[i]); + printf("Decoded value does not match the original!\n"); return 1; } } Index: ossp-pkg/srpc/libxds/regression-tests/xml-uint64.c ============================================================ $ cvs diff -u -r1.2 -r1.3 xml-uint64.c --- ossp-pkg/srpc/libxds/regression-tests/xml-uint64.c 2001/07/23 16:45:11 1.2 +++ ossp-pkg/srpc/libxds/regression-tests/xml-uint64.c 2001/07/24 13:50:15 1.3 @@ -103,7 +103,7 @@ } if (val != values[i]) { - printf("Decoded value (%llu) does not match the original value (%llu)!\n", val, values[i]); + printf("Decoded value does not match the original!\n"); return 1; } } From ossp-cvs-owner@ossp.org Tue Jul 24 15:52:43 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f6ODqgm92245; Tue, 24 Jul 2001 15:52:42 +0200 (CEST) Date: Tue, 24 Jul 2001 15:52:42 +0200 (CEST) Message-Id: <200107241352.f6ODqgm92245@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds xml-decode-double.c xml-decode-int32.... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 24-Jul-2001 15:52:42 Branch: HEAD Handle: 2001072414524100 Modified files: ossp-pkg/srpc/libxds xml-decode-double.c xml-decode-int32.c xml-decode-int64.c xml-decode-uint32.c xml-decode-uint64.c xml-encode-double.c xml-encode-int32.c xml-encode-int64.c xml-encode-uint32.c xml-encode-uint64.c Log: If there are any ladies reading this: Please pardon my language in the following paragraph! Fuck snprintf(). Since apparently the Unix vendors are too bloody stupid to provide a working snprintf() implementation that conforms to an 8 year old standard, we don't use snprintf() at all but convert the numbers ourselves. I re-implemented all XML callbacks to do maths on their own. Summary: Revision Changes Path 1.3 +0 -2 ossp-pkg/srpc/libxds/xml-decode-double.c 1.2 +41 -7 ossp-pkg/srpc/libxds/xml-decode-int32.c 1.3 +41 -7 ossp-pkg/srpc/libxds/xml-decode-int64.c 1.2 +31 -7 ossp-pkg/srpc/libxds/xml-decode-uint32.c 1.3 +31 -7 ossp-pkg/srpc/libxds/xml-decode-uint64.c 1.3 +0 -2 ossp-pkg/srpc/libxds/xml-encode-double.c 1.3 +40 -8 ossp-pkg/srpc/libxds/xml-encode-int32.c 1.3 +40 -8 ossp-pkg/srpc/libxds/xml-encode-int64.c 1.2 +30 -8 ossp-pkg/srpc/libxds/xml-encode-uint32.c 1.3 +30 -8 ossp-pkg/srpc/libxds/xml-encode-uint64.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/xml-decode-double.c ============================================================ $ cvs diff -u -r1.2 -r1.3 xml-decode-double.c --- ossp-pkg/srpc/libxds/xml-decode-double.c 2001/07/24 13:04:43 1.2 +++ ossp-pkg/srpc/libxds/xml-decode-double.c 2001/07/24 13:52:41 1.3 @@ -25,8 +25,6 @@ SUCH DAMAGE. */ -#include -#include #include "internal.h" int xml_decode_double(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) Index: ossp-pkg/srpc/libxds/xml-decode-int32.c ============================================================ $ cvs diff -u -r1.1 -r1.2 xml-decode-int32.c --- ossp-pkg/srpc/libxds/xml-decode-int32.c 2001/07/23 15:57:47 1.1 +++ ossp-pkg/srpc/libxds/xml-decode-int32.c 2001/07/24 13:52:41 1.2 @@ -25,15 +25,16 @@ SUCH DAMAGE. */ -#include +#include +#include #include #include "internal.h" int xml_decode_int32(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) { - int rc; xds_int32_t* value; - int len; + char* p; + int negative; /* Consistency checks. */ @@ -44,12 +45,45 @@ if (xds == NULL || buffer == NULL || buffer_size == 0 || args == NULL) return XDS_ERR_INVALID_ARG; - /* Format value into buffer. */ + /* The buffer must contain at least opening tag, closing tag and + one digit. Check whether it is large enough. */ + if (buffer_size < 7 + 8 + 1) + return XDS_ERR_UNDERFLOW; + + /* Does the opening XML tag match? */ + + if (strncmp(buffer, "", 7) != 0) + return XDS_ERR_TYPE_MISMATCH; + + /* Decode the representation of the value. */ + value = va_arg(*args, xds_int32_t*); - rc = sscanf(buffer, "%d%n", value, &len); - if (rc <= 0) + *value = 0; + p = (char*)buffer + 7; + if (*p == '-') + { + negative = XDS_TRUE; + ++p; + } + else + negative = XDS_FALSE; + while(isdigit(*p)) + { + if (p >= (char*)buffer + buffer_size) + return XDS_ERR_UNDERFLOW; + *value *= 10; + *value += *p++ - '0'; + } + if (negative) + *value = 0 - *value; + + /* Does the closing XML tag match? */ + + if (p+8 > (char*)buffer + buffer_size) return XDS_ERR_UNDERFLOW; + else if (strncmp(p, "", 8) != 0) + return XDS_ERR_TYPE_MISMATCH; - return len; + return p + 8 - (char*)buffer; } Index: ossp-pkg/srpc/libxds/xml-decode-int64.c ============================================================ $ cvs diff -u -r1.2 -r1.3 xml-decode-int64.c --- ossp-pkg/srpc/libxds/xml-decode-int64.c 2001/07/23 16:40:38 1.2 +++ ossp-pkg/srpc/libxds/xml-decode-int64.c 2001/07/24 13:52:41 1.3 @@ -25,15 +25,16 @@ SUCH DAMAGE. */ -#include +#include +#include #include #include "internal.h" int xml_decode_int64(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) { - int rc; xds_int64_t* value; - int len; + char* p; + int negative; /* Consistency checks. */ @@ -44,12 +45,45 @@ if (xds == NULL || buffer == NULL || buffer_size == 0 || args == NULL) return XDS_ERR_INVALID_ARG; - /* Format value into buffer. */ + /* The buffer must contain at least opening tag, closing tag and + one digit. Check whether it is large enough. */ + if (buffer_size < 7 + 8 + 1) + return XDS_ERR_UNDERFLOW; + + /* Does the opening XML tag match? */ + + if (strncmp(buffer, "", 7) != 0) + return XDS_ERR_TYPE_MISMATCH; + + /* Decode the representation of the value. */ + value = va_arg(*args, xds_int64_t*); - rc = sscanf(buffer, "%lld%n", value, &len); - if (rc <= 0) + *value = 0; + p = (char*)buffer + 7; + if (*p == '-') + { + negative = XDS_TRUE; + ++p; + } + else + negative = XDS_FALSE; + while(isdigit(*p)) + { + if (p >= (char*)buffer + buffer_size) + return XDS_ERR_UNDERFLOW; + *value *= 10; + *value += *p++ - '0'; + } + if (negative) + *value = 0 - *value; + + /* Does the closing XML tag match? */ + + if (p+8 > (char*)buffer + buffer_size) return XDS_ERR_UNDERFLOW; + else if (strncmp(p, "", 8) != 0) + return XDS_ERR_TYPE_MISMATCH; - return len; + return p + 8 - (char*)buffer; } Index: ossp-pkg/srpc/libxds/xml-decode-uint32.c ============================================================ $ cvs diff -u -r1.1 -r1.2 xml-decode-uint32.c --- ossp-pkg/srpc/libxds/xml-decode-uint32.c 2001/07/23 16:17:43 1.1 +++ ossp-pkg/srpc/libxds/xml-decode-uint32.c 2001/07/24 13:52:41 1.2 @@ -25,15 +25,15 @@ SUCH DAMAGE. */ -#include +#include +#include #include #include "internal.h" int xml_decode_uint32(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) { - int rc; xds_uint32_t* value; - int len; + char* p; /* Consistency checks. */ @@ -44,12 +44,36 @@ if (xds == NULL || buffer == NULL || buffer_size == 0 || args == NULL) return XDS_ERR_INVALID_ARG; - /* Format value into buffer. */ + /* The buffer must contain at least opening tag, closing tag and + one digit. Check whether it is large enough. */ + if (buffer_size < 8 + 9 + 1) + return XDS_ERR_UNDERFLOW; + + /* Does the opening XML tag match? */ + + if (strncmp(buffer, "", 8) != 0) + return XDS_ERR_TYPE_MISMATCH; + + /* Decode the representation of the value. */ + value = va_arg(*args, xds_uint32_t*); - rc = sscanf(buffer, "%u%n", value, &len); - if (rc <= 0) + *value = 0; + p = (char*)buffer + 8; + while(isdigit(*p)) + { + if (p >= (char*)buffer + buffer_size) + return XDS_ERR_UNDERFLOW; + *value *= 10; + *value += *p++ - '0'; + } + + /* Does the closing XML tag match? */ + + if (p+9 > (char*)buffer + buffer_size) return XDS_ERR_UNDERFLOW; + else if (strncmp(p, "", 9) != 0) + return XDS_ERR_TYPE_MISMATCH; - return len; + return p + 9 - (char*)buffer; } Index: ossp-pkg/srpc/libxds/xml-decode-uint64.c ============================================================ $ cvs diff -u -r1.2 -r1.3 xml-decode-uint64.c --- ossp-pkg/srpc/libxds/xml-decode-uint64.c 2001/07/23 16:40:38 1.2 +++ ossp-pkg/srpc/libxds/xml-decode-uint64.c 2001/07/24 13:52:41 1.3 @@ -25,15 +25,15 @@ SUCH DAMAGE. */ -#include +#include +#include #include #include "internal.h" int xml_decode_uint64(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) { - int rc; xds_uint64_t* value; - int len; + char* p; /* Consistency checks. */ @@ -44,12 +44,36 @@ if (xds == NULL || buffer == NULL || buffer_size == 0 || args == NULL) return XDS_ERR_INVALID_ARG; - /* Format value into buffer. */ + /* The buffer must contain at least opening tag, closing tag and + one digit. Check whether it is large enough. */ + if (buffer_size < 8 + 9 + 1) + return XDS_ERR_UNDERFLOW; + + /* Does the opening XML tag match? */ + + if (strncmp(buffer, "", 8) != 0) + return XDS_ERR_TYPE_MISMATCH; + + /* Decode the representation of the value. */ + value = va_arg(*args, xds_uint64_t*); - rc = sscanf(buffer, "%llu%n", value, &len); - if (rc <= 0) + *value = 0; + p = (char*)buffer + 8; + while(isdigit(*p)) + { + if (p >= (char*)buffer + buffer_size) + return XDS_ERR_UNDERFLOW; + *value *= 10; + *value += *p++ - '0'; + } + + /* Does the closing XML tag match? */ + + if (p+9 > (char*)buffer + buffer_size) return XDS_ERR_UNDERFLOW; + else if (strncmp(p, "", 9) != 0) + return XDS_ERR_TYPE_MISMATCH; - return len; + return p + 9 - (char*)buffer; } Index: ossp-pkg/srpc/libxds/xml-encode-double.c ============================================================ $ cvs diff -u -r1.2 -r1.3 xml-encode-double.c --- ossp-pkg/srpc/libxds/xml-encode-double.c 2001/07/24 13:04:43 1.2 +++ ossp-pkg/srpc/libxds/xml-encode-double.c 2001/07/24 13:52:41 1.3 @@ -25,8 +25,6 @@ SUCH DAMAGE. */ -#include -#include #include "internal.h" int xml_encode_double(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) Index: ossp-pkg/srpc/libxds/xml-encode-int32.c ============================================================ $ cvs diff -u -r1.2 -r1.3 xml-encode-int32.c --- ossp-pkg/srpc/libxds/xml-encode-int32.c 2001/07/23 15:57:47 1.2 +++ ossp-pkg/srpc/libxds/xml-encode-int32.c 2001/07/24 13:52:41 1.3 @@ -25,14 +25,17 @@ SUCH DAMAGE. */ -#include +#include #include #include "internal.h" int xml_encode_int32(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) { - int rc; xds_int32_t value; + char buf[32]; + size_t i, j; + char* p; + int negative; /* Consistency checks. */ @@ -43,13 +46,42 @@ if (xds == NULL || buffer == NULL || buffer_size == 0 || args == NULL) return XDS_ERR_INVALID_ARG; - /* Format value into buffer. */ + /* Format value into our buffer. */ value = va_arg(*args, xds_int32_t); - rc = snprintf(buffer, buffer_size, "%d", value); - if (rc < 0) - return buffer_size*2; - assert(rc >= 15); + if (value < 0) + { + negative = XDS_TRUE; + value = 0 - value; + } + else + negative = XDS_FALSE; + i = 0; + do + { + unsigned char remainder = value % 10; + value = value / 10; + buf[i++] = '0' + remainder; + } + while (value != 0); + if (negative) + buf[i++] = '-'; + + /* Check the buffer size. */ + + if (buffer_size < 7 + 8 + i) + return 7 + 8 + i; + + /* Write result into the buffer. */ + + p = buffer; + strcpy(p, ""); + p += 7; + for (j = i; j > 0; ) + { + *p++ = buf[--j]; + } + strcpy(p, ""); - return rc; + return 7 + 8 + i; } Index: ossp-pkg/srpc/libxds/xml-encode-int64.c ============================================================ $ cvs diff -u -r1.2 -r1.3 xml-encode-int64.c --- ossp-pkg/srpc/libxds/xml-encode-int64.c 2001/07/23 16:40:38 1.2 +++ ossp-pkg/srpc/libxds/xml-encode-int64.c 2001/07/24 13:52:41 1.3 @@ -25,14 +25,17 @@ SUCH DAMAGE. */ -#include +#include #include #include "internal.h" int xml_encode_int64(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) { - int rc; xds_int64_t value; + char buf[64]; + size_t i, j; + char* p; + int negative; /* Consistency checks. */ @@ -43,13 +46,42 @@ if (xds == NULL || buffer == NULL || buffer_size == 0 || args == NULL) return XDS_ERR_INVALID_ARG; - /* Format value into buffer. */ + /* Format value into our buffer. */ value = va_arg(*args, xds_int64_t); - rc = snprintf(buffer, buffer_size, "%lld", value); - if (rc < 0) - return buffer_size*2; - assert(rc >= 15); + if (value < 0) + { + negative = XDS_TRUE; + value = 0 - value; + } + else + negative = XDS_FALSE; + i = 0; + do + { + unsigned char remainder = value % 10; + value = value / 10; + buf[i++] = '0' + remainder; + } + while (value != 0); + if (negative) + buf[i++] = '-'; + + /* Check the buffer size. */ + + if (buffer_size < 7 + 8 + i) + return 7 + 8 + i; + + /* Write result into the buffer. */ + + p = buffer; + strcpy(p, ""); + p += 7; + for (j = i; j > 0; ) + { + *p++ = buf[--j]; + } + strcpy(p, ""); - return rc; + return 7 + 8 + i; } Index: ossp-pkg/srpc/libxds/xml-encode-uint32.c ============================================================ $ cvs diff -u -r1.1 -r1.2 xml-encode-uint32.c --- ossp-pkg/srpc/libxds/xml-encode-uint32.c 2001/07/23 16:17:43 1.1 +++ ossp-pkg/srpc/libxds/xml-encode-uint32.c 2001/07/24 13:52:41 1.2 @@ -25,14 +25,16 @@ SUCH DAMAGE. */ -#include +#include #include #include "internal.h" int xml_encode_uint32(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) { - int rc; xds_uint32_t value; + char buf[32]; + size_t i, j; + char* p; /* Consistency checks. */ @@ -43,13 +45,33 @@ if (xds == NULL || buffer == NULL || buffer_size == 0 || args == NULL) return XDS_ERR_INVALID_ARG; - /* Format value into buffer. */ + /* Format value into our buffer. */ value = va_arg(*args, xds_uint32_t); - rc = snprintf(buffer, buffer_size, "%u", value); - if (rc < 0) - return buffer_size*2; - assert(rc >= 15); + i = 0; + do + { + unsigned char remainder = value % 10; + value = value / 10; + buf[i++] = '0' + remainder; + } + while (value != 0); + + /* Check the buffer size. */ + + if (buffer_size < 8 + 9 + i) + return 8 + 9 + i; + + /* Write result into the buffer. */ + + p = buffer; + strcpy(p, ""); + p += 8; + for (j = i; j > 0; ) + { + *p++ = buf[--j]; + } + strcpy(p, ""); - return rc; + return 8 + 9 + i; } Index: ossp-pkg/srpc/libxds/xml-encode-uint64.c ============================================================ $ cvs diff -u -r1.2 -r1.3 xml-encode-uint64.c --- ossp-pkg/srpc/libxds/xml-encode-uint64.c 2001/07/23 16:40:38 1.2 +++ ossp-pkg/srpc/libxds/xml-encode-uint64.c 2001/07/24 13:52:41 1.3 @@ -25,14 +25,16 @@ SUCH DAMAGE. */ -#include +#include #include #include "internal.h" int xml_encode_uint64(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) { - int rc; xds_uint64_t value; + char buf[64]; + size_t i, j; + char* p; /* Consistency checks. */ @@ -43,13 +45,33 @@ if (xds == NULL || buffer == NULL || buffer_size == 0 || args == NULL) return XDS_ERR_INVALID_ARG; - /* Format value into buffer. */ + /* Format value into our buffer. */ value = va_arg(*args, xds_uint64_t); - rc = snprintf(buffer, buffer_size, "%llu", value); - if (rc < 0) - return buffer_size*2; - assert(rc >= 15); + i = 0; + do + { + unsigned char remainder = value % 10; + value = value / 10; + buf[i++] = '0' + remainder; + } + while (value != 0); + + /* Check the buffer size. */ + + if (buffer_size < 8 + 9 + i) + return 8 + 9 + i; + + /* Write result into the buffer. */ + + p = buffer; + strcpy(p, ""); + p += 8; + for (j = i; j > 0; ) + { + *p++ = buf[--j]; + } + strcpy(p, ""); - return rc; + return 8 + 9 + i; } From ossp-cvs-owner@ossp.org Tue Jul 24 16:23:18 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f6OENHO96401; Tue, 24 Jul 2001 16:23:17 +0200 (CEST) Date: Tue, 24 Jul 2001 16:23:17 +0200 (CEST) Message-Id: <200107241423.f6OENHO96401@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds/regression-tests xdr-int32.c xdr-int6... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 24-Jul-2001 16:23:17 Branch: HEAD Handle: 2001072415231600 Modified files: ossp-pkg/srpc/libxds/regression-tests xdr-int32.c xdr-int64.c xml-int32.c xml-int64.c Log: The test values I used were too large to fit into a signed integer. Fixed that. Summary: Revision Changes Path 1.5 +2 -2 ossp-pkg/srpc/libxds/regression-tests/xdr-int32.c 1.5 +2 -2 ossp-pkg/srpc/libxds/regression-tests/xdr-int64.c 1.2 +2 -2 ossp-pkg/srpc/libxds/regression-tests/xml-int32.c 1.4 +2 -2 ossp-pkg/srpc/libxds/regression-tests/xml-int64.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/regression-tests/xdr-int32.c ============================================================ $ cvs diff -u -r1.4 -r1.5 xdr-int32.c --- ossp-pkg/srpc/libxds/regression-tests/xdr-int32.c 2001/07/20 10:56:02 1.4 +++ ossp-pkg/srpc/libxds/regression-tests/xdr-int32.c 2001/07/24 14:23:16 1.5 @@ -46,8 +46,8 @@ 0x00000000, 0x12345678, -0x12345678, - 0xabcdef01, - -0xabcdef01, + 0x7bcdef01, + -0x7bcdef01, 0x7fffffff }; Index: ossp-pkg/srpc/libxds/regression-tests/xdr-int64.c ============================================================ $ cvs diff -u -r1.4 -r1.5 xdr-int64.c --- ossp-pkg/srpc/libxds/regression-tests/xdr-int64.c 2001/07/20 10:56:02 1.4 +++ ossp-pkg/srpc/libxds/regression-tests/xdr-int64.c 2001/07/24 14:23:16 1.5 @@ -46,8 +46,8 @@ 0x0000000000000000LL, 0x123456789abcdef0LL, -0x123456789abcdef0LL, - 0xabcdef01cc45bb9aLL, - -0xabcdef01cc45bb9aLL, + 0x7bcdef01cc45bb9aLL, + -0x7bcdef01cc45bb9aLL, 0x7fffffffffffffffLL }; Index: ossp-pkg/srpc/libxds/regression-tests/xml-int32.c ============================================================ $ cvs diff -u -r1.1 -r1.2 xml-int32.c --- ossp-pkg/srpc/libxds/regression-tests/xml-int32.c 2001/07/23 15:57:48 1.1 +++ ossp-pkg/srpc/libxds/regression-tests/xml-int32.c 2001/07/24 14:23:16 1.2 @@ -42,8 +42,8 @@ 0x00000000, 0x12345678, -0x12345678, - 0xabcdef01, - -0xabcdef01, + 0x7bcdef01, + -0x7bcdef01, 0x7fffffff }; Index: ossp-pkg/srpc/libxds/regression-tests/xml-int64.c ============================================================ $ cvs diff -u -r1.3 -r1.4 xml-int64.c --- ossp-pkg/srpc/libxds/regression-tests/xml-int64.c 2001/07/24 13:50:15 1.3 +++ ossp-pkg/srpc/libxds/regression-tests/xml-int64.c 2001/07/24 14:23:16 1.4 @@ -42,8 +42,8 @@ 0x0000000000000000LL, 0x123456789abcdef0LL, -0x123456789abcdef0LL, - 0xabcdef01cc45bb9aLL, - -0xabcdef01cc45bb9aLL, + 0x7bcdef01cc45bb9aLL, + -0x7bcdef01cc45bb9aLL, 0x7fffffffffffffffLL }; From ossp-cvs-owner@ossp.org Tue Jul 24 16:55:58 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f6OEtvs01047; Tue, 24 Jul 2001 16:55:57 +0200 (CEST) Date: Tue, 24 Jul 2001 16:55:57 +0200 (CEST) Message-Id: <200107241455.f6OEtvs01047@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds Makefile.in ossp-pkg/srpc/libxds/regr... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 24-Jul-2001 16:55:57 Branch: HEAD Handle: 2001072415555600 Modified files: ossp-pkg/srpc/libxds Makefile.in ossp-pkg/srpc/libxds/regression-tests Makefile.in Log: Removed rules for compiling C++ code: We don't have any. Summary: Revision Changes Path 1.10 +0 -3 ossp-pkg/srpc/libxds/Makefile.in 1.10 +0 -3 ossp-pkg/srpc/libxds/regression-tests/Makefile.in ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/Makefile.in ============================================================ $ cvs diff -u -r1.9 -r1.10 Makefile.in --- ossp-pkg/srpc/libxds/Makefile.in 2001/07/23 16:33:03 1.9 +++ ossp-pkg/srpc/libxds/Makefile.in 2001/07/24 14:55:56 1.10 @@ -23,9 +23,6 @@ .c.o: $(CC) $(CPPFLAGS) $(WARNFLAGS) $(OPTFLAGS) $(CFLAGS) -c $< -.cpp.o: - $(CXX) $(CPPFLAGS) $(WARNFLAGS) $(OPTFLAGS) $(CXXFLAGS) -c $< - all: libxds.a xds.3 libxds.a: $(OBJS) Index: ossp-pkg/srpc/libxds/regression-tests/Makefile.in ============================================================ $ cvs diff -u -r1.9 -r1.10 Makefile.in --- ossp-pkg/srpc/libxds/regression-tests/Makefile.in 2001/07/23 16:33:04 1.9 +++ ossp-pkg/srpc/libxds/regression-tests/Makefile.in 2001/07/24 14:55:56 1.10 @@ -21,9 +21,6 @@ .c.exe: $(CC) $(CPPFLAGS) $(WARNFLAGS) $(OPTFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $< -lxds -.cpp.exe: - $(CXX) $(CPPFLAGS) $(WARNFLAGS) $(OPTFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ $< -lxds - all: $(TESTS) check: all From ossp-cvs-owner@ossp.org Tue Jul 24 17:20:19 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f6OFKIP04306; Tue, 24 Jul 2001 17:20:18 +0200 (CEST) Date: Tue, 24 Jul 2001 17:20:18 +0200 (CEST) Message-Id: <200107241520.f6OFKIP04306@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds/regression-tests xds-setbuffer.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 24-Jul-2001 17:20:18 Branch: HEAD Handle: 2001072416201700 Modified files: ossp-pkg/srpc/libxds/regression-tests xds-setbuffer.c Log: The test wanted to provoke reallocation of the buffer, but the buffer it provided was large enough to hold all data. Hence the test failed. I fixed this by providing a 32 byte buffer instead of a 64 byte one. Summary: Revision Changes Path 1.3 +4 -4 ossp-pkg/srpc/libxds/regression-tests/xds-setbuffer.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/regression-tests/xds-setbuffer.c ============================================================ $ cvs diff -u -r1.2 -r1.3 xds-setbuffer.c --- ossp-pkg/srpc/libxds/regression-tests/xds-setbuffer.c 2001/07/18 17:37:49 1.2 +++ ossp-pkg/srpc/libxds/regression-tests/xds-setbuffer.c 2001/07/24 15:20:17 1.3 @@ -64,16 +64,16 @@ return 1; } - /* Give the library a buffer of 64 byte, call the engine once, get + /* Give the library a buffer of 32 byte, call the engine once, get the buffer back and see whether it has been enlarged or not. */ - buffer = malloc(64); + buffer_size = 32; + buffer = malloc(buffer_size); if (buffer == NULL) { printf("Failed to allocate my memory.\n"); return 1; } - buffer_size = 64; if (xds_setbuffer(xds, XDS_GIFT, buffer, buffer_size) != XDS_OK) { printf("xds_setbuffer() failed!\n"); @@ -89,7 +89,7 @@ printf("xds_getbuffer() failed!\n"); return 1; } - if (buffer_size == 64) + if (buffer_size < 64) { printf("xds_encode() did not enlarge the buffer after processing the callback\n"); printf("even though all capacity was used up!\n"); From ossp-cvs-owner@ossp.org Tue Jul 24 17:44:19 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f6OFiIv07003; Tue, 24 Jul 2001 17:44:18 +0200 (CEST) Date: Tue, 24 Jul 2001 17:44:18 +0200 (CEST) Message-Id: <200107241544.f6OFiIv07003@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds/regression-tests xds-mystruct.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 24-Jul-2001 17:44:18 Branch: HEAD Handle: 2001072416441800 Modified files: ossp-pkg/srpc/libxds/regression-tests xds-mystruct.c Log: Comparing the new structure instance with the old one by memcmp() was bound to fail because on some architectures padding is inserted -- and those padding bytes didn't match even though the structure's values were identical. Thus we do now compare element by element. Furthermore, the encoding and decoding engines way of predicting the correct buffer size ("sizeof(struct mystruct)") failed also because it didn't take padding into account. Fixed that also. Summary: Revision Changes Path 1.5 +30 -22 ossp-pkg/srpc/libxds/regression-tests/xds-mystruct.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/regression-tests/xds-mystruct.c ============================================================ $ cvs diff -u -r1.4 -r1.5 xds-mystruct.c --- ossp-pkg/srpc/libxds/regression-tests/xds-mystruct.c 2001/07/23 15:33:43 1.4 +++ ossp-pkg/srpc/libxds/regression-tests/xds-mystruct.c 2001/07/24 15:44:18 1.5 @@ -47,17 +47,12 @@ assert(buffer_size != 0); assert(args != NULL); - if (buffer_size >= sizeof(struct mystruct)) - { - ms = va_arg(*args, struct mystruct*); - rc = xds_encode(xds, "int32 int64 uint32", ms->small, ms->big, ms->positive); - if (rc != XDS_OK) - return rc; - } + ms = va_arg(*args, struct mystruct*); + rc = xds_encode(xds, "int32 int64 uint32", ms->small, ms->big, ms->positive); + if (rc == XDS_OK) + return 0; else - return sizeof(struct mystruct); - - return 0; + return rc; } static int decode_mystruct_engine(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) @@ -70,17 +65,12 @@ assert(buffer_size != 0); assert(args != NULL); - if (buffer_size >= sizeof(struct mystruct)) - { - ms = va_arg(*args, struct mystruct*); - rc = xds_decode(xds, "int32 int64 uint32", &(ms->small), &(ms->big), &(ms->positive)); - if (rc != XDS_OK) - return rc; - } + ms = va_arg(*args, struct mystruct*); + rc = xds_decode(xds, "int32 int64 uint32", &(ms->small), &(ms->big), &(ms->positive)); + if (rc == XDS_OK) + return 0; else - return XDS_ERR_UNDERFLOW; - - return 0; + return rc; } int main() @@ -111,17 +101,35 @@ printf("Failed to register my encoding engines.\n"); return 1; } + buffer_size = 4; + buffer = malloc(buffer_size); + if (buffer == NULL) + { + printf("Failed to allocate memory for buffer.\n"); + return 1; + } + if (xds_setbuffer(xds, XDS_GIFT, buffer, buffer_size) != XDS_OK) + { + printf("xds_setbuffer() failed!\n"); + return 1; + } if (xds_encode(xds, "mystruct", &ms) != XDS_OK) { printf("xds_encode() failed!\n"); return 1; } + if (xds->buffer_capacity <= buffer_size) + { + printf("Buffer should have been enlarged after xds_encode()!\n"); + return 1; + } if (xds_getbuffer(xds, XDS_GIFT, (void**)&buffer, &buffer_size) != XDS_OK) { - printf("xds_setbuffer() failed!\n"); + printf("xds_getbuffer() failed!\n"); return 1; } xds_destroy(xds); + printf("The encoded representation is %u bytes long.\n", buffer_size); /* Now create a decoding context and decode the whole thing again. */ @@ -153,7 +161,7 @@ /* Both structures must be identical. */ - if (memcmp(&ms, &new_ms, sizeof(struct mystruct)) != 0) + if (ms.small != new_ms.small || ms.big != new_ms.big || ms.positive != new_ms.positive) { printf("Decoded data does not match the original!\n"); return 1; From ossp-cvs-owner@ossp.org Tue Jul 24 17:46:20 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f6OFkJp07387; Tue, 24 Jul 2001 17:46:19 +0200 (CEST) Date: Tue, 24 Jul 2001 17:46:19 +0200 (CEST) Message-Id: <200107241546.f6OFkJp07387@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds vdecode.c vencode.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 24-Jul-2001 17:46:19 Branch: HEAD Handle: 2001072416461800 Modified files: ossp-pkg/srpc/libxds vdecode.c vencode.c Log: xds_encode() and xds_decode() had two problems: - In case any of the callbacks returns with an error, the original xds->buffer_len value must be restored or the buffer is messed up with values from successful callback executions. The routines wouldn't be atomic in that case. - If an encoding callback uses up all buffer space but formatted the value successfully nonetheless, the xds->buffer_len wasn't incremented. Both problems have been fixed. Summary: Revision Changes Path 1.4 +4 -0 ossp-pkg/srpc/libxds/vdecode.c 1.11 +7 -0 ossp-pkg/srpc/libxds/vencode.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/vdecode.c ============================================================ $ cvs diff -u -r1.3 -r1.4 vdecode.c --- ossp-pkg/srpc/libxds/vdecode.c 2001/07/16 17:50:07 1.3 +++ ossp-pkg/srpc/libxds/vdecode.c 2001/07/24 15:46:18 1.4 @@ -32,6 +32,7 @@ int xds_vdecode(xds_t* xds, const char* fmt_arg, va_list args) { + size_t buffer_len_backup; char* name; char* p; char* fmt; @@ -58,6 +59,7 @@ fmt = p = strdup(fmt_arg); if (fmt == NULL) return XDS_ERR_NO_MEM; + buffer_len_backup = xds->buffer_len; for(name = p; *p != '\0'; name = p) { while(isalnum(*p) || *p == '-' || *p == '_') @@ -94,5 +96,7 @@ /* Clean up and leave. */ leave: free(fmt); + if (rc != XDS_OK) + xds->buffer_len = buffer_len_backup; return rc; } Index: ossp-pkg/srpc/libxds/vencode.c ============================================================ $ cvs diff -u -r1.10 -r1.11 vencode.c --- ossp-pkg/srpc/libxds/vencode.c 2001/07/19 15:21:35 1.10 +++ ossp-pkg/srpc/libxds/vencode.c 2001/07/24 15:46:18 1.11 @@ -33,6 +33,7 @@ int xds_vencode(xds_t* xds, const char* fmt_arg, va_list args) { va_list args_backup; + size_t buffer_len_backup; char* name; char* p; char* fmt; @@ -90,6 +91,7 @@ fmt = p = strdup(fmt_arg); if (fmt == NULL) return XDS_ERR_NO_MEM; + buffer_len_backup = xds->buffer_len; for(name = p; *p != '\0'; name = p) { while(isalnum(*p) || *p == '-' || *p == '_') @@ -125,7 +127,10 @@ args = args_backup; } else + { restart_engine = XDS_FALSE; + xds->buffer_len += rc; + } if (!xds->we_own_buffer) { @@ -165,5 +170,7 @@ /* Clean up and leave. */ leave: free(fmt); + if (rc != XDS_OK) + xds->buffer_len = buffer_len_backup; return rc; } From ossp-cvs-owner@ossp.org Sun Jul 29 18:50:55 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f6TGor629313; Sun, 29 Jul 2001 18:50:53 +0200 (CEST) Date: Sun, 29 Jul 2001 18:50:53 +0200 (CEST) Message-Id: <200107291650.f6TGor629313@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc TODO Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 29-Jul-2001 18:50:53 Branch: HEAD Handle: 2001072917505300 Modified files: ossp-pkg/srpc TODO Log: It is clear that we unfortunately no longer have a chance to meet the arranged date of beginning of September for XDS/AMP. Shift the deadline by two weeks now. One additional week because of XDS plus one week in advance for AMP. Summary: Revision Changes Path 1.8 +6 -5 ossp-pkg/srpc/TODO ____________________________________________________________________________ Index: ossp-pkg/srpc/TODO ============================================================ $ cvs diff -u -r1.7 -r1.8 TODO --- ossp-pkg/srpc/TODO 2001/07/24 12:16:32 1.7 +++ ossp-pkg/srpc/TODO 2001/07/29 16:50:53 1.8 @@ -16,7 +16,7 @@ - design libxds API done: 100% [-> libxds/xds.h + libxds/xds.pod] -o M4 (peti) [3 weeks until 23-Jul-2001] +o M4 (peti) [4 weeks until 30-Jul-2001] - implementation of libxds library framework done: 100% [-> libxds/*.c] - implementation of libxds SunRPC/XDR and XML-RPC backends @@ -76,18 +76,19 @@ - autoconf should specify the compiler flags depending on what the compiler supports. -o M5 (peti+rse) [1 week until 30-Jul-2001] +o M5 (peti+rse) [1 week until 06-Aug-2001] - [peti] documentation for libxds (xds.pod) - [rse] OSSP adjustments for libxds -o M6 (peti+rse) [1 week until 06-Aug-2001] +o M6 (peti+rse) [1 week until 13-Aug-2001] - design API for libamp -o M7 (peti) [3 week until 27-Aug-2001] +o M7 (peti) [4 weeks until 10-Sep-2001] - implementation of libamp library framework - implementation of libamp backends SHM, TCP and UDP - regression tests for libamp -o M8 (peti+rse) [1 week until 03-Sep-2001] +o M8 (peti+rse) [1 week until 17-Sep-2001] - [peti] documentation for libamp - [rse] OSSP adjustments for libamp + From ossp-cvs-owner@ossp.org Mon Jul 30 10:58:48 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f6U8wlh45982; Mon, 30 Jul 2001 10:58:47 +0200 (CEST) Date: Mon, 30 Jul 2001 10:58:47 +0200 (CEST) Message-Id: <200107300858.f6U8wlh45982@ossp.org> From: "OSSP Project Master" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: CVSROOT modules Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: OSSP Project Master Root: /e/ossp/cvs Email: ossp@ossp.org Module: CVSROOT Date: 30-Jul-2001 10:58:47 Branch: HEAD Handle: 2001073009584600 Modified files: CVSROOT modules Log: add xds Summary: Revision Changes Path 1.26 +2 -0 CVSROOT/modules ____________________________________________________________________________ Index: CVSROOT/modules ============================================================ $ cvs diff -u -r1.25 -r1.26 modules --- CVSROOT/modules 2001/06/12 13:45:34 1.25 +++ CVSROOT/modules 2001/07/30 08:58:46 1.26 @@ -74,4 +74,6 @@ sugar ossp-pkg/sugar l2 ossp-pkg/l2 srpc ossp-pkg/srpc +xds ossp-pkg/srpc/libxds + From ossp-cvs-owner@ossp.org Tue Jul 31 08:33:57 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f6V6XtM09594; Tue, 31 Jul 2001 08:33:55 +0200 (CEST) Date: Tue, 31 Jul 2001 08:33:55 +0200 (CEST) Message-Id: <200107310633.f6V6XtM09594@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds destroy.c setbuffer.c vencode.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 31-Jul-2001 08:33:55 Branch: HEAD Handle: 2001073107335500 Modified files: ossp-pkg/srpc/libxds destroy.c setbuffer.c vencode.c Log: Fixed three bugs revealed by RSE's review of the code. Summary: Revision Changes Path 1.7 +8 -0 ossp-pkg/srpc/libxds/destroy.c 1.6 +1 -1 ossp-pkg/srpc/libxds/setbuffer.c 1.12 +1 -1 ossp-pkg/srpc/libxds/vencode.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/destroy.c ============================================================ $ cvs diff -u -r1.6 -r1.7 destroy.c --- ossp-pkg/srpc/libxds/destroy.c 2001/07/09 17:18:20 1.6 +++ ossp-pkg/srpc/libxds/destroy.c 2001/07/31 06:33:55 1.7 @@ -45,7 +45,15 @@ assert(xds->engines != NULL || xds->engines_capacity == 0); if (xds->engines != NULL) + { + size_t i; + for (i = 0; i < xds->engines_len; ++i) + { + assert(xds->engines[i].name != NULL); + free(xds->engines[i].name); + } free(xds->engines); + } free(xds); } Index: ossp-pkg/srpc/libxds/setbuffer.c ============================================================ $ cvs diff -u -r1.5 -r1.6 setbuffer.c --- ossp-pkg/srpc/libxds/setbuffer.c 2001/07/18 17:49:51 1.5 +++ ossp-pkg/srpc/libxds/setbuffer.c 2001/07/31 06:33:55 1.6 @@ -41,7 +41,7 @@ /* Free the old buffer if there is one. */ - if (xds->buffer != NULL) + if (xds->buffer != NULL && xds->we_own_buffer) free(xds->buffer); xds->buffer_len = 0; Index: ossp-pkg/srpc/libxds/vencode.c ============================================================ $ cvs diff -u -r1.11 -r1.12 vencode.c --- ossp-pkg/srpc/libxds/vencode.c 2001/07/24 15:46:18 1.11 +++ ossp-pkg/srpc/libxds/vencode.c 2001/07/31 06:33:55 1.12 @@ -62,7 +62,7 @@ if (rc != XDS_OK) return rc; xds->buffer_len = 0; - xds->we_own_buffer = XDS_FALSE; + xds->we_own_buffer = XDS_TRUE; } /* Ensure the buffer has free space. */ From ossp-cvs-owner@ossp.org Tue Jul 31 17:10:10 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f6VFA8m72623; Tue, 31 Jul 2001 17:10:08 +0200 (CEST) Date: Tue, 31 Jul 2001 17:10:08 +0200 (CEST) Message-Id: <200107311510.f6VFA8m72623@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc TODO Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 31-Jul-2001 17:10:08 Branch: HEAD Handle: 2001073116100700 Modified files: ossp-pkg/srpc TODO Log: Documented a bug that needs to be fixed ASAP. Summary: Revision Changes Path 1.9 +4 -1 ossp-pkg/srpc/TODO ____________________________________________________________________________ Index: ossp-pkg/srpc/TODO ============================================================ $ cvs diff -u -r1.8 -r1.9 TODO --- ossp-pkg/srpc/TODO 2001/07/29 16:50:53 1.8 +++ ossp-pkg/srpc/TODO 2001/07/31 15:10:07 1.9 @@ -62,7 +62,10 @@ & <--> & ]]> <--> ]]> - + - strcpy() copies one byte more than the length of the text itself + because the trailing \0 is written to. Currently, this behavior is + not taken into account when calculating the correct buffer size in + the xml-encode-*-.c modules. This has to be fixed! - libm may be used. We don't depend on sprintf() but convert out numbers ourselves for portability. From ossp-cvs-owner@ossp.org Tue Jul 31 17:26:23 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f6VFQM074482; Tue, 31 Jul 2001 17:26:22 +0200 (CEST) Date: Tue, 31 Jul 2001 17:26:22 +0200 (CEST) Message-Id: <200107311526.f6VFQM074482@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds/regression-tests xml-int32.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 31-Jul-2001 17:26:22 Branch: HEAD Handle: 2001073116262100 Modified files: ossp-pkg/srpc/libxds/regression-tests xml-int32.c Log: Changed test case to use xml_(en|de)code_(begin|end). Summary: Revision Changes Path 1.3 +26 -2 ossp-pkg/srpc/libxds/regression-tests/xml-int32.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/regression-tests/xml-int32.c ============================================================ $ cvs diff -u -r1.2 -r1.3 xml-int32.c --- ossp-pkg/srpc/libxds/regression-tests/xml-int32.c 2001/07/24 14:23:16 1.2 +++ ossp-pkg/srpc/libxds/regression-tests/xml-int32.c 2001/07/31 15:26:21 1.3 @@ -58,11 +58,18 @@ printf("Failed to initialize XDS context.\n"); return 1; } - if (xds_register(xds, "int", &xml_encode_int32, NULL) != XDS_OK) + if (xds_register(xds, "begin", &xml_encode_begin, NULL) != XDS_OK || + xds_register(xds, "end", &xml_encode_end, NULL) != XDS_OK || + xds_register(xds, "int", &xml_encode_int32, NULL) != XDS_OK) { printf("Failed to register my encoding engines.\n"); return 1; } + if (xds_encode(xds, "begin") != XDS_OK) + { + printf("xds_encode_begin() failed!\n"); + return 1; + } for (i = 0; i < sizeof(values)/sizeof(xds_int32_t); ++i) { if (xds_encode(xds, "int", values[i]) != XDS_OK) @@ -71,6 +78,11 @@ return 1; } } + if (xds_encode(xds, "end") != XDS_OK) + { + printf("xds_encode_end() failed!\n"); + return 1; + } if (xds_getbuffer(xds, XDS_GIFT, (void**)&buffer, &buffer_size) != XDS_OK) { printf("getbuffer() failed.\n"); @@ -84,7 +96,9 @@ printf("Failed to initialize XDS context.\n"); return 1; } - if (xds_register(xds, "int", &xml_decode_int32, NULL) != XDS_OK) + if (xds_register(xds, "begin", &xml_decode_begin, NULL) != XDS_OK || + xds_register(xds, "end", &xml_decode_end, NULL) != XDS_OK || + xds_register(xds, "int", &xml_decode_int32, NULL) != XDS_OK) { printf("Failed to register my decoding engines.\n"); return 1; @@ -94,6 +108,11 @@ printf("setbuffer() failed.\n"); return 1; } + if (xds_decode(xds, "begin") != XDS_OK) + { + printf("xds_decode_begin() failed!\n"); + return 1; + } for (i = 0; i < sizeof(values)/sizeof(xds_int32_t); ++i) { xds_int32_t val; @@ -107,6 +126,11 @@ printf("Decoded value (%d) does not match the original value (%d)!\n", val, values[i]); return 1; } + } + if (xds_decode(xds, "end") != XDS_OK) + { + printf("xds_decode_end() failed!\n"); + return 1; } xds_destroy(xds); From ossp-cvs-owner@ossp.org Tue Jul 31 17:27:46 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f6VFRkU74628; Tue, 31 Jul 2001 17:27:46 +0200 (CEST) Date: Tue, 31 Jul 2001 17:27:46 +0200 (CEST) Message-Id: <200107311527.f6VFRkU74628@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds Makefile.in internal.h xds.h.in xml-d... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 31-Jul-2001 17:27:46 Branch: HEAD Handle: 2001073116274500 Added files: ossp-pkg/srpc/libxds xml-decode-begin.c xml-encode-begin.c Modified files: ossp-pkg/srpc/libxds Makefile.in internal.h xds.h.in Log: Implemented xml_encode_begin(), xml_decode_begin(), xml_encode_end(), and xml_decode_end(). Summary: Revision Changes Path 1.11 +3 -1 ossp-pkg/srpc/libxds/Makefile.in 1.7 +3 -0 ossp-pkg/srpc/libxds/internal.h 1.6 +5 -0 ossp-pkg/srpc/libxds/xds.h.in 1.1 +50 -0 ossp-pkg/srpc/libxds/xml-decode-begin.c 1.1 +52 -0 ossp-pkg/srpc/libxds/xml-encode-begin.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/Makefile.in ============================================================ $ cvs diff -u -r1.10 -r1.11 Makefile.in --- ossp-pkg/srpc/libxds/Makefile.in 2001/07/24 14:55:56 1.10 +++ ossp-pkg/srpc/libxds/Makefile.in 2001/07/31 15:27:45 1.11 @@ -18,7 +18,9 @@ xdr-decode-double.o xml-encode-int32.o xml-decode-int32.o \ xml-decode-int64.o xml-decode-uint32.o xml-decode-uint64.o \ xml-encode-int64.o xml-encode-uint32.o xml-encode-uint64.o \ - xml-encode-double.o xml-decode-double.o + xml-encode-double.o xml-decode-double.o \ + xml-encode-begin.o xml-decode-begin.o \ + xml-encode-end.o xml-decode-end.o .c.o: $(CC) $(CPPFLAGS) $(WARNFLAGS) $(OPTFLAGS) $(CFLAGS) -c $< Index: ossp-pkg/srpc/libxds/internal.h ============================================================ $ cvs diff -u -r1.6 -r1.7 internal.h --- ossp-pkg/srpc/libxds/internal.h 2001/07/18 17:49:51 1.6 +++ ossp-pkg/srpc/libxds/internal.h 2001/07/31 15:27:45 1.7 @@ -63,4 +63,7 @@ int xds_find_engine(const engine_map_t* engines, size_t last, const char* name, size_t* pos); int xds_set_capacity(void** array, size_t* array_capacity, size_t new_capacity, size_t elem_size, size_t initial_capacity); +extern const char xds_xml_begin_text[]; +extern const char xds_xml_end_text[]; + #endif /* !defined(__INTERNAL_H__) */ Index: ossp-pkg/srpc/libxds/xds.h.in ============================================================ $ cvs diff -u -r1.5 -r1.6 xds.h.in --- ossp-pkg/srpc/libxds/xds.h.in 2001/07/23 16:33:03 1.5 +++ ossp-pkg/srpc/libxds/xds.h.in 2001/07/31 15:27:45 1.6 @@ -116,4 +116,9 @@ int xml_encode_double(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); int xml_decode_double(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); +int xml_encode_begin(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); +int xml_decode_begin(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); +int xml_encode_end(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); +int xml_decode_end(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); + #endif /* !defined(__LIBXDS_H__) */ Index: ossp-pkg/srpc/libxds/xml-decode-begin.c ============================================================ $ cvs update -p -r1.1 xml-decode-begin.c /* XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) This file is part of OSSP XDS, an extensible data serialization library which can be found at http://www.ossp.com/pkg/xds/. 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. */ #include #include #include "internal.h" int xml_decode_begin(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) { /* Consistency checks. */ assert(xds != NULL); assert(buffer != NULL); assert(buffer_size != 0); assert(args != NULL); if (xds == NULL || buffer == NULL || buffer_size == 0 || args == NULL) return XDS_ERR_INVALID_ARG; if (buffer_size < strlen(xds_xml_begin_text)) return XDS_ERR_UNDERFLOW; if (strncasecmp(buffer, xds_xml_begin_text, strlen(xds_xml_begin_text)) != 0) return XDS_ERR_TYPE_MISMATCH; return strlen(xds_xml_begin_text); } Index: ossp-pkg/srpc/libxds/xml-encode-begin.c ============================================================ $ cvs update -p -r1.1 xml-encode-begin.c /* XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) This file is part of OSSP XDS, an extensible data serialization library which can be found at http://www.ossp.com/pkg/xds/. 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. */ #include #include #include "internal.h" const char xds_xml_begin_text[] = \ "\n" \ "\n" \ "\n"; int xml_encode_begin(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) { /* Consistency checks. */ assert(xds != NULL); assert(buffer != NULL); assert(buffer_size != 0); assert(args != NULL); if (xds == NULL || buffer == NULL || buffer_size == 0 || args == NULL) return XDS_ERR_INVALID_ARG; if (buffer_size >= strlen(xds_xml_begin_text)) memmove(buffer, xds_xml_begin_text, strlen(xds_xml_begin_text)); return strlen(xds_xml_begin_text); } From ossp-cvs-owner@ossp.org Tue Jul 31 17:28:16 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f6VFSE174698; Tue, 31 Jul 2001 17:28:14 +0200 (CEST) Date: Tue, 31 Jul 2001 17:28:14 +0200 (CEST) Message-Id: <200107311528.f6VFSE174698@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds xml-decode-end.c xml-encode-end.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 31-Jul-2001 17:28:14 Branch: HEAD Handle: 2001073116281400 Added files: ossp-pkg/srpc/libxds xml-decode-end.c xml-encode-end.c Log: Implemented xml_encode_begin(), xml_decode_begin(), xml_encode_end(), and xml_decode_end(). Summary: Revision Changes Path 1.1 +50 -0 ossp-pkg/srpc/libxds/xml-decode-end.c 1.1 +49 -0 ossp-pkg/srpc/libxds/xml-encode-end.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/xml-decode-end.c ============================================================ $ cvs update -p -r1.1 xml-decode-end.c /* XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) This file is part of OSSP XDS, an extensible data serialization library which can be found at http://www.ossp.com/pkg/xds/. 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. */ #include #include #include "internal.h" int xml_decode_end(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) { /* Consistency checks. */ assert(xds != NULL); assert(buffer != NULL); assert(buffer_size != 0); assert(args != NULL); if (xds == NULL || buffer == NULL || buffer_size == 0 || args == NULL) return XDS_ERR_INVALID_ARG; if (buffer_size < strlen(xds_xml_end_text)) return XDS_ERR_UNDERFLOW; if (strncasecmp(buffer, xds_xml_end_text, strlen(xds_xml_end_text)) != 0) return XDS_ERR_TYPE_MISMATCH; return strlen(xds_xml_end_text); } Index: ossp-pkg/srpc/libxds/xml-encode-end.c ============================================================ $ cvs update -p -r1.1 xml-encode-end.c /* XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) This file is part of OSSP XDS, an extensible data serialization library which can be found at http://www.ossp.com/pkg/xds/. 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. */ #include #include #include "internal.h" const char xds_xml_end_text[] = "\n"; int xml_encode_end(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) { /* Consistency checks. */ assert(xds != NULL); assert(buffer != NULL); assert(buffer_size != 0); assert(args != NULL); if (xds == NULL || buffer == NULL || buffer_size == 0 || args == NULL) return XDS_ERR_INVALID_ARG; if (buffer_size >= strlen(xds_xml_end_text)) memmove(buffer, xds_xml_end_text, strlen(xds_xml_end_text)); return strlen(xds_xml_end_text); } From ossp-cvs-owner@ossp.org Tue Jul 31 17:34:08 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f6VFY7d75586; Tue, 31 Jul 2001 17:34:07 +0200 (CEST) Date: Tue, 31 Jul 2001 17:34:07 +0200 (CEST) Message-Id: <200107311534.f6VFY7d75586@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc TODO Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 31-Jul-2001 17:34:07 Branch: HEAD Handle: 2001073116340600 Modified files: ossp-pkg/srpc TODO Log: Removed the C++ prototype item from the TODO list: We decided against a C++-specific interface. Summary: Revision Changes Path 1.10 +0 -2 ossp-pkg/srpc/TODO ____________________________________________________________________________ Index: ossp-pkg/srpc/TODO ============================================================ $ cvs diff -u -r1.9 -r1.10 TODO --- ossp-pkg/srpc/TODO 2001/07/31 15:10:07 1.9 +++ ossp-pkg/srpc/TODO 2001/07/31 15:34:06 1.10 @@ -4,8 +4,6 @@ o M1 (peti) [11-Jun-2001] - evaluation checklist for XDS and AMP done: 50% [-> EVAL] - - prototype C++ - done: 0% o M2 (peti+rse) [25-Jun-2001] - design/architecture paper (authentication+encryption framework) From ossp-cvs-owner@ossp.org Tue Jul 31 17:45:15 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f6VFjFs76820; Tue, 31 Jul 2001 17:45:15 +0200 (CEST) Date: Tue, 31 Jul 2001 17:45:15 +0200 (CEST) Message-Id: <200107311545.f6VFjFs76820@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc TODO Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 31-Jul-2001 17:45:15 Branch: HEAD Handle: 2001073116451400 Modified files: ossp-pkg/srpc TODO Log: Documented problem with 16-bit integers when passed through "...". Summary: Revision Changes Path 1.11 +9 -0 ossp-pkg/srpc/TODO ____________________________________________________________________________ Index: ossp-pkg/srpc/TODO ============================================================ $ cvs diff -u -r1.10 -r1.11 TODO --- ossp-pkg/srpc/TODO 2001/07/31 15:34:06 1.10 +++ ossp-pkg/srpc/TODO 2001/07/31 15:45:14 1.11 @@ -44,6 +44,15 @@ [u]string,octets} - regression tests for libxds (make check) + - 16bit Integers mean trouble when passing them through "...": + + | xdr-encode-uint16.c:46: `xds_uint16_t' is promoted to `int' when passed through `...' + | xdr-encode-uint16.c:46: (so you should pass `int' not `xds_uint16_t' to `va_arg') + + Maybe we should skip int16 support at all? Currently I work around + this problem by implicitely assuming that the short is promoted to + an int. + - XML: 1234 uint32, int64, uint64, From ossp-cvs-owner@ossp.org Tue Jul 31 18:03:02 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f6VG32R79097; Tue, 31 Jul 2001 18:03:02 +0200 (CEST) Date: Tue, 31 Jul 2001 18:03:02 +0200 (CEST) Message-Id: <200107311603.f6VG32R79097@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc TODO Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 31-Jul-2001 18:03:02 Branch: HEAD Handle: 2001073117030100 Modified files: ossp-pkg/srpc TODO Log: Things are even worse with 16-bit integers. Summary: Revision Changes Path 1.12 +4 -0 ossp-pkg/srpc/TODO ____________________________________________________________________________ Index: ossp-pkg/srpc/TODO ============================================================ $ cvs diff -u -r1.11 -r1.12 TODO --- ossp-pkg/srpc/TODO 2001/07/31 15:45:14 1.11 +++ ossp-pkg/srpc/TODO 2001/07/31 16:03:01 1.12 @@ -53,6 +53,10 @@ this problem by implicitely assuming that the short is promoted to an int. + To make matters even worse: The RFC doesn't even define how XDR + deals with 16-bit integers! The mere existance of such a datatype + is not positively confirmed. + - XML: 1234 uint32, int64, uint64, From ossp-cvs-owner@ossp.org Wed Aug 1 11:22:51 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f719Mok10846; Wed, 1 Aug 2001 11:22:50 +0200 (CEST) Date: Wed, 1 Aug 2001 11:22:50 +0200 (CEST) Message-Id: <200108010922.f719Mok10846@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds init.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 01-Aug-2001 11:22:50 Branch: HEAD Handle: 2001080110225000 Modified files: ossp-pkg/srpc/libxds init.c Log: Initialize the elements of xds_context explicitely rather than relying on calloc(). This increases chances of portability. Summary: Revision Changes Path 1.5 +15 -2 ossp-pkg/srpc/libxds/init.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/init.c ============================================================ $ cvs diff -u -r1.4 -r1.5 init.c --- ossp-pkg/srpc/libxds/init.c 2001/07/08 15:22:00 1.4 +++ ossp-pkg/srpc/libxds/init.c 2001/08/01 09:22:50 1.5 @@ -45,7 +45,7 @@ /* Allocate context structure. */ - ctx = calloc(1, sizeof(struct xds_context)); + ctx = malloc(sizeof(struct xds_context)); if (ctx == NULL) return NULL; /* errno is set by calloc() */ @@ -53,7 +53,20 @@ ctx->mode = mode; - /* We are initialized. */ + /* Initialize buffer handling. */ + + ctx->buffer = NULL; + ctx->buffer_len = 0; + ctx->buffer_capacity = 0; + ctx->we_own_buffer = XDS_FALSE; + + /* Initialize engines map. */ + + ctx->engines = NULL; + ctx->engines_len = 0; + ctx->engines_capacity = 0; + + /* Done. */ return ctx; } From ossp-cvs-owner@ossp.org Wed Aug 1 17:25:52 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f71FPp058085; Wed, 1 Aug 2001 17:25:51 +0200 (CEST) Date: Wed, 1 Aug 2001 17:25:51 +0200 (CEST) Message-Id: <200108011525.f71FPp058085@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds Makefile.in destroy.c find-engine.c g... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 01-Aug-2001 17:25:51 Branch: HEAD Handle: 2001080116254703 Modified files: ossp-pkg/srpc/libxds Makefile.in destroy.c find-engine.c getbuffer.c init.c internal.h register.c set-capacity.c setbuffer.c unregister.c vdecode.c vencode.c xdr-decode-double.c xdr-decode-int32.c xdr-decode-int64.c xdr-decode-octetstream.c xdr-decode-string.c xdr-decode-uint32.c xdr-decode-uint64.c xdr-encode-double.c xdr-encode-int32.c xdr-encode-int64.c xdr-encode-octetstream.c xdr-encode-string.c xdr-encode-uint32.c xdr-encode-uint64.c xds.h.in xml-decode-begin.c xml-decode-double.c xml-decode-end.c xml-decode-int32.c xml-decode-int64.c xml-decode-uint32.c xml-decode-uint64.c xml-encode-begin.c xml-encode-double.c xml-encode-end.c xml-encode-int32.c xml-encode-int64.c xml-encode-uint32.c xml-encode-uint64.c ossp-pkg/srpc/libxds/regression-tests Makefile.in xdr-octetstream-empty.c xdr-octetstream.c xdr-string-empty.c xdr-string.c xds-decode.c xds-encode.c xds-engine-restart.c xds-getbuffer.c xds-mystruct.c xds-register.c xds-setbuffer.c Log: Merged the whole contents of branch "callback-semantic-rewrite" into the main branch. The changes there include: - A change of the callback semantics; callbacks do now return XDS_ERR_(UNDER|OVER)FLOW in case the buffer size doesn't fit. Rather than passing the differing byte size through the return code, it is stored in the location used_buffer_size points to -- a new parameter provided to all callbacks. In order to implement this, the framework, all callbacks and most of the test suits had to be adapted. - internal.h now provides the macro xds_check_parameter(), which can be used to verify the contents of function parameters with assert() and if in one line. If assert()s are deactivated, the routine will still return XDS_ERR_INVALID_ARG. Because of this change, internal.h now includes the system header assert.h. This means that this include coulde be removed from almost all modules. - internal.h now provides the macros xds_init_(en|de)coding_engine(). These can be used to comfortably verify a callback's parameters and to verify the buffer size. All engines have been rewritten to use these. Summary: Revision Changes Path 1.12 +17 -11 ossp-pkg/srpc/libxds/Makefile.in 1.8 +0 -1 ossp-pkg/srpc/libxds/destroy.c 1.4 +3 -4 ossp-pkg/srpc/libxds/find-engine.c 1.3 +4 -7 ossp-pkg/srpc/libxds/getbuffer.c 1.6 +0 -1 ossp-pkg/srpc/libxds/init.c 1.8 +35 -0 ossp-pkg/srpc/libxds/internal.h 1.7 +3 -6 ossp-pkg/srpc/libxds/register.c 1.11 +2 -2 ossp-pkg/srpc/libxds/regression-tests/Makefile.in 1.2 +1 -1 ossp-pkg/srpc/libxds/regression-tests/xdr-octetstream-empty.c 1.2 +1 -1 ossp-pkg/srpc/libxds/regression-tests/xdr-octetstream.c 1.3 +1 -1 ossp-pkg/srpc/libxds/regression-tests/xdr-string-empty.c 1.3 +1 -1 ossp-pkg/srpc/libxds/regression-tests/xdr-string.c 1.4 +16 -3 ossp-pkg/srpc/libxds/regression-tests/xds-decode.c 1.6 +16 -6 ossp-pkg/srpc/libxds/regression-tests/xds-encode.c 1.2 +13 -2 ossp-pkg/srpc/libxds/regression-tests/xds-engine-restart.c 1.5 +14 -7 ossp-pkg/srpc/libxds/regression-tests/xds-getbuffer.c 1.6 +10 -15 ossp-pkg/srpc/libxds/regression-tests/xds-mystruct.c 1.7 +3 -2 ossp-pkg/srpc/libxds/regression-tests/xds-register.c 1.4 +10 -5 ossp-pkg/srpc/libxds/regression-tests/xds-setbuffer.c 1.4 +4 -5 ossp-pkg/srpc/libxds/set-capacity.c 1.7 +3 -7 ossp-pkg/srpc/libxds/setbuffer.c 1.5 +2 -5 ossp-pkg/srpc/libxds/unregister.c 1.5 +8 -8 ossp-pkg/srpc/libxds/vdecode.c 1.13 +64 -75 ossp-pkg/srpc/libxds/vencode.c 1.2 +3 -1 ossp-pkg/srpc/libxds/xdr-decode-double.c 1.4 +6 -13 ossp-pkg/srpc/libxds/xdr-decode-int32.c 1.4 +6 -13 ossp-pkg/srpc/libxds/xdr-decode-int64.c 1.4 +13 -25 ossp-pkg/srpc/libxds/xdr-decode-octetstream.c 1.5 +13 -25 ossp-pkg/srpc/libxds/xdr-decode-string.c 1.4 +6 -13 ossp-pkg/srpc/libxds/xdr-decode-uint32.c 1.4 +6 -13 ossp-pkg/srpc/libxds/xdr-decode-uint64.c 1.2 +3 -1 ossp-pkg/srpc/libxds/xdr-encode-double.c 1.4 +17 -24 ossp-pkg/srpc/libxds/xdr-encode-int32.c 1.4 +21 -28 ossp-pkg/srpc/libxds/xdr-encode-int64.c 1.5 +19 -21 ossp-pkg/srpc/libxds/xdr-encode-octetstream.c 1.6 +19 -21 ossp-pkg/srpc/libxds/xdr-encode-string.c 1.4 +11 -18 ossp-pkg/srpc/libxds/xdr-encode-uint32.c 1.4 +15 -22 ossp-pkg/srpc/libxds/xdr-encode-uint64.c 1.7 +42 -43 ossp-pkg/srpc/libxds/xds.h.in 1.2 +5 -16 ossp-pkg/srpc/libxds/xml-decode-begin.c 1.4 +3 -1 ossp-pkg/srpc/libxds/xml-decode-double.c 1.2 +5 -16 ossp-pkg/srpc/libxds/xml-decode-end.c 1.3 +8 -19 ossp-pkg/srpc/libxds/xml-decode-int32.c 1.4 +8 -19 ossp-pkg/srpc/libxds/xml-decode-int64.c 1.3 +8 -19 ossp-pkg/srpc/libxds/xml-decode-uint32.c 1.4 +8 -19 ossp-pkg/srpc/libxds/xml-decode-uint64.c 1.2 +6 -15 ossp-pkg/srpc/libxds/xml-encode-begin.c 1.4 +3 -1 ossp-pkg/srpc/libxds/xml-encode-double.c 1.2 +6 -15 ossp-pkg/srpc/libxds/xml-encode-end.c 1.4 +12 -20 ossp-pkg/srpc/libxds/xml-encode-int32.c 1.4 +9 -16 ossp-pkg/srpc/libxds/xml-encode-int64.c 1.3 +9 -16 ossp-pkg/srpc/libxds/xml-encode-uint32.c 1.4 +9 -16 ossp-pkg/srpc/libxds/xml-encode-uint64.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/Makefile.in ============================================================ $ cvs diff -u -r1.11 -r1.12 Makefile.in --- ossp-pkg/srpc/libxds/Makefile.in 2001/07/31 15:27:45 1.11 +++ ossp-pkg/srpc/libxds/Makefile.in 2001/08/01 15:25:47 1.12 @@ -8,19 +8,25 @@ CFLAGS = @CFLAGS@ LDFLAGS = @LDFLAGS@ +XML_OBJS = xml-encode-int32.o xml-decode-int32.o \ + xml-encode-uint32.o xml-decode-uint32.o \ + xml-encode-int64.o xml-decode-int64.o \ + xml-encode-uint64.o xml-decode-uint64.o \ + xml-encode-double.o xml-decode-double.o \ + xml-encode-begin.o xml-decode-begin.o \ + xml-encode-end.o xml-decode-end.o + +XDR_OBJS = xdr-encode-int32.o xdr-decode-int32.o \ + xdr-encode-uint32.o xdr-decode-uint32.o \ + xdr-encode-int64.o xdr-decode-int64.o \ + xdr-encode-uint64.o xdr-decode-uint64.o \ + xdr-encode-double.o xdr-decode-double.o \ + xdr-encode-octetstream.o xdr-decode-octetstream.o \ + xdr-encode-string.o xdr-decode-string.o \ + OBJS = decode.o destroy.o encode.o getbuffer.o init.o register.o \ setbuffer.o unregister.o vdecode.o vencode.o find-engine.o \ - set-capacity.o xdr-encode-int32.o xdr-encode-int64.o \ - xdr-encode-uint32.o xdr-encode-uint64.o xdr-decode-int32.o \ - xdr-decode-int64.o xdr-decode-uint32.o xdr-decode-uint64.o \ - xdr-encode-octetstream.o xdr-decode-octetstream.o \ - xdr-encode-string.o xdr-decode-string.o xdr-encode-double.o \ - xdr-decode-double.o xml-encode-int32.o xml-decode-int32.o \ - xml-decode-int64.o xml-decode-uint32.o xml-decode-uint64.o \ - xml-encode-int64.o xml-encode-uint32.o xml-encode-uint64.o \ - xml-encode-double.o xml-decode-double.o \ - xml-encode-begin.o xml-decode-begin.o \ - xml-encode-end.o xml-decode-end.o + set-capacity.o $(XDR_OBJS) $(XML_OBJS) .c.o: $(CC) $(CPPFLAGS) $(WARNFLAGS) $(OPTFLAGS) $(CFLAGS) -c $< Index: ossp-pkg/srpc/libxds/destroy.c ============================================================ $ cvs diff -u -r1.7 -r1.8 destroy.c --- ossp-pkg/srpc/libxds/destroy.c 2001/07/31 06:33:55 1.7 +++ ossp-pkg/srpc/libxds/destroy.c 2001/08/01 15:25:47 1.8 @@ -26,7 +26,6 @@ */ #include -#include #include "internal.h" void xds_destroy(xds_t* xds) Index: ossp-pkg/srpc/libxds/find-engine.c ============================================================ $ cvs diff -u -r1.3 -r1.4 find-engine.c --- ossp-pkg/srpc/libxds/find-engine.c 2001/07/18 17:49:51 1.3 +++ ossp-pkg/srpc/libxds/find-engine.c 2001/08/01 15:25:47 1.4 @@ -26,7 +26,6 @@ */ #include -#include #include "internal.h" int xds_find_engine(const engine_map_t* engines, size_t last, const char* name, size_t* pos) @@ -35,9 +34,9 @@ /* Sanity checks. */ - assert(engines != NULL || last == 0); - assert(name != NULL); - assert(pos != NULL); + xds_check_parameter(engines != NULL || last == 0); + xds_check_parameter(name != NULL); + xds_check_parameter(pos != NULL); /* Use binary search to find "name" in "engines". */ Index: ossp-pkg/srpc/libxds/getbuffer.c ============================================================ $ cvs diff -u -r1.2 -r1.3 getbuffer.c --- ossp-pkg/srpc/libxds/getbuffer.c 2001/07/09 17:22:03 1.2 +++ ossp-pkg/srpc/libxds/getbuffer.c 2001/08/01 15:25:47 1.3 @@ -25,19 +25,16 @@ SUCH DAMAGE. */ -#include "assert.h" #include "internal.h" int xds_getbuffer(xds_t* xds, xds_scope_t flag, void** buffer, size_t* buffer_len) { /* Sanity checks. */ - assert(xds != NULL); - assert(flag == XDS_GIFT || flag == XDS_LOAN); - assert(buffer != NULL); - assert(buffer_len != NULL); - if (xds == NULL || buffer == NULL || buffer_len == NULL || (flag != XDS_GIFT && flag != XDS_LOAN)) - return XDS_ERR_INVALID_ARG; + xds_check_parameter(xds != NULL); + xds_check_parameter(flag == XDS_GIFT || flag == XDS_LOAN); + xds_check_parameter(buffer != NULL); + xds_check_parameter(buffer_len != NULL); /* Return the buffer to the caller. */ Index: ossp-pkg/srpc/libxds/init.c ============================================================ $ cvs diff -u -r1.5 -r1.6 init.c --- ossp-pkg/srpc/libxds/init.c 2001/08/01 09:22:50 1.5 +++ ossp-pkg/srpc/libxds/init.c 2001/08/01 15:25:47 1.6 @@ -27,7 +27,6 @@ #include #include -#include #include "internal.h" xds_t* xds_init(xds_mode_t mode) Index: ossp-pkg/srpc/libxds/internal.h ============================================================ $ cvs diff -u -r1.7 -r1.8 internal.h --- ossp-pkg/srpc/libxds/internal.h 2001/07/31 15:27:45 1.7 +++ ossp-pkg/srpc/libxds/internal.h 2001/08/01 15:25:47 1.8 @@ -30,6 +30,7 @@ #ifndef __INTERNAL_H__ #define __INTERNAL_H__ +#include #include "xds.h" #define XDS_TRUE (1==1) @@ -65,5 +66,39 @@ extern const char xds_xml_begin_text[]; extern const char xds_xml_end_text[]; + +#define xds_check_parameter(condition) \ + do \ + { \ + assert(condition); \ + if (!(condition)) \ + return XDS_ERR_INVALID_ARG; \ + } while(XDS_FALSE) + +#define xds_init_encoding_engine(size) \ + do \ + { \ + xds_check_parameter(xds != NULL); \ + xds_check_parameter(buffer != NULL); \ + xds_check_parameter(buffer_size != 0); \ + xds_check_parameter(used_buffer_size != NULL && *used_buffer_size == 0); \ + xds_check_parameter(args != NULL); \ + *used_buffer_size = size; \ + if (buffer_size < size) \ + return XDS_ERR_OVERFLOW; \ + } while(XDS_FALSE) + +#define xds_init_decoding_engine(size) \ + do \ + { \ + xds_check_parameter(xds != NULL); \ + xds_check_parameter(buffer != NULL); \ + xds_check_parameter(buffer_size != 0); \ + xds_check_parameter(used_buffer_size != NULL && *used_buffer_size == 0); \ + xds_check_parameter(args != NULL); \ + *used_buffer_size = size; \ + if (buffer_size < size) \ + return XDS_ERR_UNDERFLOW; \ + } while(XDS_FALSE) #endif /* !defined(__INTERNAL_H__) */ Index: ossp-pkg/srpc/libxds/register.c ============================================================ $ cvs diff -u -r1.6 -r1.7 register.c --- ossp-pkg/srpc/libxds/register.c 2001/07/09 17:23:38 1.6 +++ ossp-pkg/srpc/libxds/register.c 2001/08/01 15:25:47 1.7 @@ -28,7 +28,6 @@ #include #include #include -#include #include "internal.h" int xds_register(xds_t* xds, const char* name, xds_engine_t engine, void* engine_context) @@ -37,11 +36,9 @@ /* Sanity checks. */ - assert(xds != NULL); - assert(name != NULL); - assert(engine != NULL); - if (xds == NULL || name == NULL || engine == NULL) - return XDS_ERR_INVALID_ARG; + xds_check_parameter(xds != NULL); + xds_check_parameter(name != NULL); + xds_check_parameter(engine != NULL); for(pos = 0; name[pos] != '\0'; ++pos) { if (!isalnum(name[pos]) && name[pos] != '-' && name[pos] != '_') Index: ossp-pkg/srpc/libxds/regression-tests/Makefile.in ============================================================ $ cvs diff -u -r1.10 -r1.11 Makefile.in --- ossp-pkg/srpc/libxds/regression-tests/Makefile.in 2001/07/24 14:55:56 1.10 +++ ossp-pkg/srpc/libxds/regression-tests/Makefile.in 2001/08/01 15:25:50 1.11 @@ -12,8 +12,8 @@ xds-getbuffer.exe xds-decode.exe xds-setbuffer.exe xds-engine-restart.exe \ xdr-uint32.exe xdr-int32.exe xdr-uint64.exe xdr-int64.exe \ xdr-octetstream.exe xdr-octetstream-empty.exe xdr-string.exe \ - xdr-string-empty.exe xds-mystruct.exe xml-uint32.exe xml-int32.exe \ - xml-uint64.exe xml-int64.exe xml-double.exe + xdr-string-empty.exe xds-mystruct.exe \ + xml-uint32.exe xml-int32.exe xml-uint64.exe xml-int64.exe xml-double.exe .SUFFIXES: .SUFFIXES: .c .exe Index: ossp-pkg/srpc/libxds/regression-tests/xdr-octetstream-empty.c ============================================================ $ cvs diff -u -r1.1 -r1.2 xdr-octetstream-empty.c --- ossp-pkg/srpc/libxds/regression-tests/xdr-octetstream-empty.c 2001/07/20 09:22:26 1.1 +++ ossp-pkg/srpc/libxds/regression-tests/xdr-octetstream-empty.c 2001/08/01 15:25:50 1.2 @@ -96,7 +96,7 @@ printf("The size of the decoded message is wrong.\n"); return 1; } - if (strncmp(msg, new_msg, new_msg_size) != 0) + if (memcmp(msg, new_msg, new_msg_size) != 0) { printf("The decoded octet stream is not correct.\n"); return 1; Index: ossp-pkg/srpc/libxds/regression-tests/xdr-octetstream.c ============================================================ $ cvs diff -u -r1.1 -r1.2 xdr-octetstream.c --- ossp-pkg/srpc/libxds/regression-tests/xdr-octetstream.c 2001/07/20 09:22:26 1.1 +++ ossp-pkg/srpc/libxds/regression-tests/xdr-octetstream.c 2001/08/01 15:25:50 1.2 @@ -96,7 +96,7 @@ printf("The size of the decoded message is wrong.\n"); return 1; } - if (strncmp(msg, new_msg, new_msg_size) != 0) + if (memcmp(msg, new_msg, new_msg_size) != 0) { printf("The decoded octet stream is not correct.\n"); return 1; Index: ossp-pkg/srpc/libxds/regression-tests/xdr-string-empty.c ============================================================ $ cvs diff -u -r1.2 -r1.3 xdr-string-empty.c --- ossp-pkg/srpc/libxds/regression-tests/xdr-string-empty.c 2001/07/20 09:22:26 1.2 +++ ossp-pkg/srpc/libxds/regression-tests/xdr-string-empty.c 2001/08/01 15:25:50 1.3 @@ -96,7 +96,7 @@ printf("The size of the decoded message is wrong.\n"); return 1; } - if (strncmp(msg, new_msg, new_msg_size) != 0) + if (memcmp(msg, new_msg, new_msg_size) != 0) { printf("The decoded string is not correct.\n"); return 1; Index: ossp-pkg/srpc/libxds/regression-tests/xdr-string.c ============================================================ $ cvs diff -u -r1.2 -r1.3 xdr-string.c --- ossp-pkg/srpc/libxds/regression-tests/xdr-string.c 2001/07/20 09:22:26 1.2 +++ ossp-pkg/srpc/libxds/regression-tests/xdr-string.c 2001/08/01 15:25:50 1.3 @@ -96,7 +96,7 @@ printf("The size of the decoded message is wrong: %d.\n", new_msg_size); return 1; } - if (strncmp(msg, new_msg, new_msg_size) != 0) + if (memcmp(msg, new_msg, new_msg_size) != 0) { printf("The decoded string is not correct.\n"); return 1; Index: ossp-pkg/srpc/libxds/regression-tests/xds-decode.c ============================================================ $ cvs diff -u -r1.3 -r1.4 xds-decode.c --- ossp-pkg/srpc/libxds/regression-tests/xds-decode.c 2001/07/18 17:37:49 1.3 +++ ossp-pkg/srpc/libxds/regression-tests/xds-decode.c 2001/08/01 15:25:50 1.4 @@ -29,7 +29,9 @@ #include #include "../internal.h" -static int dummy_engine(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) +static int dummy_engine(xds_t* xds, void* engine_context, + void* buffer, size_t buffer_size, size_t* used_buffer_size, + va_list* args) { if (xds == NULL) { @@ -51,17 +53,28 @@ printf("Buffer size passed to engine is zero!\n"); exit(1); } + if (used_buffer_size == NULL) + { + printf("used_buffer_size passed to engine is zero!\n"); + exit(1); + } if (args == NULL) { printf("args pointer passed to engine is NULL!\n"); exit(1); + } + if (buffer_size < 6) + { + printf("The buffer is too small; can't verify my encoded string.\n"); + exit(1); } - if (strncmp(buffer, "Hallo!", 6) != 0) + if (memcmp(buffer, "Hallo!", 6) != 0) { printf("The contents of the decode buffer are not what we expected.\n"); exit(1); } - return 6; + *used_buffer_size = 6; + return XDS_OK; } int main() Index: ossp-pkg/srpc/libxds/regression-tests/xds-encode.c ============================================================ $ cvs diff -u -r1.5 -r1.6 xds-encode.c --- ossp-pkg/srpc/libxds/regression-tests/xds-encode.c 2001/07/18 17:37:49 1.5 +++ ossp-pkg/srpc/libxds/regression-tests/xds-encode.c 2001/08/01 15:25:50 1.6 @@ -29,7 +29,9 @@ #include #include "../internal.h" -static int dummy_engine(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) +static int dummy_engine(xds_t* xds, void* engine_context, + void* buffer, size_t buffer_size, size_t* used_buffer_size, + va_list* args) { if (xds == NULL) { @@ -48,16 +50,24 @@ } if (buffer_size == 0) { - printf("Buffer size passed to engine is zero!\n"); + printf("buffer_size passed to engine is zero!\n"); exit(1); } + if (used_buffer_size == NULL) + { + printf("used_buffer_size pointer passed to engine is NULL!\n"); + exit(1); + } if (args == NULL) { printf("args pointer passed to engine is NULL!\n"); exit(1); } - strncpy(buffer, "Hallo ", buffer_size); - return 6; + *used_buffer_size = 6; + if (buffer_size < 6) + return XDS_ERR_OVERFLOW; + memmove(buffer, "Hallo ", 6); + return XDS_OK; } int main() @@ -88,10 +98,10 @@ if (xds_encode(xds, "int:text double double float") != XDS_OK) { - printf("xds_encode() failed!"); + printf("xds_encode() failed!\n"); return 1; } - if (strcmp(xds->buffer, "Hallo Hallo Hallo Hallo Hallo ") != 0) + if (memcmp(xds->buffer, "Hallo Hallo Hallo Hallo Hallo ", 30) != 0) { printf("xds_encode() did not yield the expected result.\n"); return 1; Index: ossp-pkg/srpc/libxds/regression-tests/xds-engine-restart.c ============================================================ $ cvs diff -u -r1.1 -r1.2 xds-engine-restart.c --- ossp-pkg/srpc/libxds/regression-tests/xds-engine-restart.c 2001/07/18 17:38:37 1.1 +++ ossp-pkg/srpc/libxds/regression-tests/xds-engine-restart.c 2001/08/01 15:25:50 1.2 @@ -29,7 +29,9 @@ #include #include "../internal.h" -static int dummy_engine(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) +static int dummy_engine(xds_t* xds, void* engine_context, + void* buffer, size_t buffer_size, size_t* used_buffer_size, + va_list* args) { if (xds == NULL) { @@ -51,6 +53,11 @@ printf("Buffer size passed to engine is zero!\n"); exit(1); } + if (used_buffer_size == NULL) + { + printf("used_buffer_size pointer passed to engine is NULL!\n"); + exit(1); + } if (args == NULL) { printf("args pointer passed to engine is NULL!\n"); @@ -61,7 +68,11 @@ printf("The varadic argument is not what the engine expected!\n"); exit(1); } - return 64; + if (buffer_size < 64) + return XDS_ERR_OVERFLOW; + else + *used_buffer_size = 64; + return XDS_OK; } int main() Index: ossp-pkg/srpc/libxds/regression-tests/xds-getbuffer.c ============================================================ $ cvs diff -u -r1.4 -r1.5 xds-getbuffer.c --- ossp-pkg/srpc/libxds/regression-tests/xds-getbuffer.c 2001/07/18 19:00:40 1.4 +++ ossp-pkg/srpc/libxds/regression-tests/xds-getbuffer.c 2001/08/01 15:25:50 1.5 @@ -29,10 +29,17 @@ #include #include "../internal.h" -static int dummy_engine(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) +static int dummy_engine(xds_t* xds, void* engine_context, + void* buffer, size_t buffer_size, size_t* used_buffer_size, + va_list* args) { - strncpy(buffer, "Hallo!", buffer_size); - return 6; + if (buffer_size < 6) + return XDS_ERR_OVERFLOW; + else + *used_buffer_size = 6; + + memmove(buffer, "Hallo!", 6); + return XDS_OK; } int main() @@ -85,8 +92,8 @@ printf("xds_getbuffer() failed for the second buffer!\n"); return 1; } - if ((strcmp(old, "Hallo!Hallo!") != 0 || old_len != 12) && - (strcmp(new, "Hallo!") != 0 || new_len != 6)) + if ((memcmp(old, "Hallo!Hallo!", 12) != 0 || old_len != 12) && + (memcmp(new, "Hallo!", 6) != 0 || new_len != 6)) { printf("xds_encode() did not yield the expected result.\n"); return 1; @@ -108,7 +115,7 @@ printf("xds_getbuffer() failed for the first buffer!\n"); return 1; } - if (strcmp(old, "Hallo!Hallo!") != 0 || old_len != 12) + if (memcmp(old, "Hallo!Hallo!", 12) != 0 || old_len != 12) { printf("xds_encode() did not yield the expected result.\n"); return 1; @@ -128,7 +135,7 @@ printf("xds_encode() allocated a new buffer even though we used XDS_LOAN.\n"); return 1; } - if (strcmp(new, "Hallo!") != 0 || new_len != 6) + if (memcmp(new, "Hallo!", 6) != 0 || new_len != 6) { printf("xds_encode() did not yield the expected result.\n"); return 1; Index: ossp-pkg/srpc/libxds/regression-tests/xds-mystruct.c ============================================================ $ cvs diff -u -r1.5 -r1.6 xds-mystruct.c --- ossp-pkg/srpc/libxds/regression-tests/xds-mystruct.c 2001/07/24 15:44:18 1.5 +++ ossp-pkg/srpc/libxds/regression-tests/xds-mystruct.c 2001/08/01 15:25:50 1.6 @@ -27,7 +27,6 @@ #include #include -#include #include "../internal.h" struct mystruct @@ -37,40 +36,36 @@ xds_uint32_t positive; }; -static int encode_mystruct_engine(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) +static int encode_mystruct_engine(xds_t* xds, void* engine_context, + void* buffer, size_t buffer_size, size_t* used_buffer_size, + va_list* args) { - int rc; struct mystruct* ms; assert(xds != NULL); assert(buffer != NULL); assert(buffer_size != 0); + assert(used_buffer_size != NULL); assert(args != NULL); ms = va_arg(*args, struct mystruct*); - rc = xds_encode(xds, "int32 int64 uint32", ms->small, ms->big, ms->positive); - if (rc == XDS_OK) - return 0; - else - return rc; + return xds_encode(xds, "int32 int64 uint32", ms->small, ms->big, ms->positive); } -static int decode_mystruct_engine(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) +static int decode_mystruct_engine(xds_t* xds, void* engine_context, + void* buffer, size_t buffer_size, size_t* used_buffer_size, + va_list* args) { - int rc; struct mystruct* ms; assert(xds != NULL); assert(buffer != NULL); assert(buffer_size != 0); + assert(used_buffer_size != NULL); assert(args != NULL); ms = va_arg(*args, struct mystruct*); - rc = xds_decode(xds, "int32 int64 uint32", &(ms->small), &(ms->big), &(ms->positive)); - if (rc == XDS_OK) - return 0; - else - return rc; + return xds_decode(xds, "int32 int64 uint32", &(ms->small), &(ms->big), &(ms->positive)); } int main() Index: ossp-pkg/srpc/libxds/regression-tests/xds-register.c ============================================================ $ cvs diff -u -r1.6 -r1.7 xds-register.c --- ossp-pkg/srpc/libxds/regression-tests/xds-register.c 2001/07/16 17:50:08 1.6 +++ ossp-pkg/srpc/libxds/regression-tests/xds-register.c 2001/08/01 15:25:50 1.7 @@ -27,10 +27,11 @@ #include #include -#include #include "../internal.h" -static int dummy_engine(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) +static int dummy_engine(xds_t* xds, void* engine_context, + void* buffer, size_t buffer_size, size_t* used_buffer_size, + va_list* args) { return 0; } Index: ossp-pkg/srpc/libxds/regression-tests/xds-setbuffer.c ============================================================ $ cvs diff -u -r1.3 -r1.4 xds-setbuffer.c --- ossp-pkg/srpc/libxds/regression-tests/xds-setbuffer.c 2001/07/24 15:20:17 1.3 +++ ossp-pkg/srpc/libxds/regression-tests/xds-setbuffer.c 2001/08/01 15:25:50 1.4 @@ -27,18 +27,23 @@ #include #include -#include #include "../internal.h" -static int dummy_engine(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) +static int dummy_engine(xds_t* xds, void* engine_context, + void* buffer, size_t buffer_size, size_t* used_buffer_size, + va_list* args) { assert(xds != NULL); assert(buffer != NULL); assert(buffer_size != 0); + assert(used_buffer_size != NULL); assert(args != NULL); - if (buffer_size >= 64) - memset(buffer, 'a', 64); - return 64; + if (buffer_size < 64) + return XDS_ERR_OVERFLOW; + else + *used_buffer_size = 64; + memset(buffer, 'a', 64); + return XDS_OK; } int main() Index: ossp-pkg/srpc/libxds/set-capacity.c ============================================================ $ cvs diff -u -r1.3 -r1.4 set-capacity.c --- ossp-pkg/srpc/libxds/set-capacity.c 2001/07/16 18:26:58 1.3 +++ ossp-pkg/srpc/libxds/set-capacity.c 2001/08/01 15:25:47 1.4 @@ -26,7 +26,6 @@ */ #include -#include #include "internal.h" int xds_set_capacity(void** array, size_t* array_capacity, size_t new_capacity, size_t elem_size, size_t initial_capacity) @@ -36,10 +35,10 @@ /* Sanity checks. */ - assert(array != NULL); - assert(array_capacity != NULL); - assert(elem_size != 0); - assert(initial_capacity != 0); + xds_check_parameter(array != NULL); + xds_check_parameter(array_capacity != NULL); + xds_check_parameter(elem_size != 0); + xds_check_parameter(initial_capacity != 0); /* Do we need to re-allocate? */ Index: ossp-pkg/srpc/libxds/setbuffer.c ============================================================ $ cvs diff -u -r1.6 -r1.7 setbuffer.c --- ossp-pkg/srpc/libxds/setbuffer.c 2001/07/31 06:33:55 1.6 +++ ossp-pkg/srpc/libxds/setbuffer.c 2001/08/01 15:25:47 1.7 @@ -25,19 +25,15 @@ SUCH DAMAGE. */ -#include "assert.h" #include "internal.h" int xds_setbuffer(xds_t* xds, xds_scope_t flag, void* buffer, size_t buffer_len) { /* Sanity checks. */ - assert(xds != NULL); - assert(flag == XDS_GIFT || flag == XDS_LOAN); - assert((buffer != NULL && buffer_len != 0) || flag == XDS_GIFT); - if (xds == NULL || (flag != XDS_GIFT && flag != XDS_LOAN) || - (flag == XDS_LOAN && (buffer == NULL || buffer_len == 0))) - return XDS_ERR_INVALID_ARG; + xds_check_parameter(xds != NULL); + xds_check_parameter(flag == XDS_GIFT || flag == XDS_LOAN); + xds_check_parameter((buffer != NULL && buffer_len != 0) || flag == XDS_GIFT); /* Free the old buffer if there is one. */ Index: ossp-pkg/srpc/libxds/unregister.c ============================================================ $ cvs diff -u -r1.4 -r1.5 unregister.c --- ossp-pkg/srpc/libxds/unregister.c 2001/07/09 17:23:38 1.4 +++ ossp-pkg/srpc/libxds/unregister.c 2001/08/01 15:25:47 1.5 @@ -28,7 +28,6 @@ #include #include #include -#include #include "internal.h" int xds_unregister(xds_t* xds, const char* name) @@ -38,10 +37,8 @@ /* Sanity checks. */ - assert(xds != NULL); - assert(name != NULL); - if (xds == NULL || name == NULL) - return XDS_ERR_INVALID_ARG; + xds_check_parameter(xds != NULL); + xds_check_parameter(name != NULL); for(pos = 0; name[pos] != '\0'; ++pos) { if (!isalnum(name[pos]) && name[pos] != '-' && name[pos] != '_') Index: ossp-pkg/srpc/libxds/vdecode.c ============================================================ $ cvs diff -u -r1.4 -r1.5 vdecode.c --- ossp-pkg/srpc/libxds/vdecode.c 2001/07/24 15:46:18 1.4 +++ ossp-pkg/srpc/libxds/vdecode.c 2001/08/01 15:25:47 1.5 @@ -27,7 +27,6 @@ #include #include -#include #include "internal.h" int xds_vdecode(xds_t* xds, const char* fmt_arg, va_list args) @@ -40,11 +39,9 @@ /* Sanity checks. */ - assert(xds != NULL); - assert(fmt_arg != NULL); + xds_check_parameter(xds != NULL); + xds_check_parameter(fmt_arg != NULL); assert(xds->mode == XDS_DECODE); - if (xds == NULL || fmt_arg == NULL) - return XDS_ERR_INVALID_ARG; if (xds->mode != XDS_DECODE) return XDS_ERR_INVALID_MODE; @@ -72,17 +69,20 @@ if (strlen(name) > 0) { size_t pos; + size_t used_buffer_size = 0; if (xds_find_engine(xds->engines, xds->engines_len, name, &pos)) { rc = (*xds->engines[pos].engine)(xds, xds->engines[pos].context, xds->buffer + xds->buffer_len, xds->buffer_capacity - xds->buffer_len, + &used_buffer_size, &args); - if (rc < 0) - goto leave; + assert(rc <= 0); + if (rc == XDS_OK) + xds->buffer_len += used_buffer_size; else - xds->buffer_len += rc; + goto leave; } else { Index: ossp-pkg/srpc/libxds/vencode.c ============================================================ $ cvs diff -u -r1.12 -r1.13 vencode.c --- ossp-pkg/srpc/libxds/vencode.c 2001/07/31 06:33:55 1.12 +++ ossp-pkg/srpc/libxds/vencode.c 2001/08/01 15:25:47 1.13 @@ -27,7 +27,6 @@ #include #include -#include #include "internal.h" int xds_vencode(xds_t* xds, const char* fmt_arg, va_list args) @@ -41,11 +40,9 @@ /* Sanity checks. */ - assert(xds != NULL); - assert(fmt_arg != NULL); + xds_check_parameter(xds != NULL); + xds_check_parameter(fmt_arg != NULL); assert(xds->mode == XDS_ENCODE); - if (xds == NULL || fmt_arg == NULL) - return XDS_ERR_INVALID_ARG; if (xds->mode != XDS_ENCODE) return XDS_ERR_INVALID_MODE; @@ -65,26 +62,6 @@ xds->we_own_buffer = XDS_TRUE; } - /* Ensure the buffer has free space. */ - - assert(xds->buffer_len <= xds->buffer_capacity); - if (xds->buffer_len == xds->buffer_capacity) - { - if (xds->we_own_buffer) - { - rc = xds_set_capacity((void**)&xds->buffer, - &xds->buffer_capacity, - xds->buffer_len + 1, - sizeof(char), - XDS_INITIAL_BUFFER_CAPACITY); - assert(rc == XDS_OK || rc == XDS_ERR_NO_MEM); - if (rc != XDS_OK) - return rc; - } - else - return XDS_ERR_OVERFLOW; - } - /* Iterate through the items in the format string and execute the apropriate engines. */ @@ -103,66 +80,78 @@ if (strlen(name) > 0) { + int restart_engine; + size_t used_buffer_size; size_t pos; - if (xds_find_engine(xds->engines, xds->engines_len, name, &pos)) + + if (xds_find_engine(xds->engines, xds->engines_len, name, &pos) == XDS_FALSE) { - int restart_engine; - do - { - args_backup = args; - rc = (*xds->engines[pos].engine)(xds, - xds->engines[pos].context, - xds->buffer + xds->buffer_len, - xds->buffer_capacity - xds->buffer_len, - &args); - if (rc < 0) - goto leave; - else if (rc >= xds->buffer_capacity - xds->buffer_len) - { /* enlarge buffer */ - int rc2; - - if (rc > xds->buffer_capacity - xds->buffer_len) - { - restart_engine = XDS_TRUE; - args = args_backup; - } - else - { - restart_engine = XDS_FALSE; - xds->buffer_len += rc; - } - - if (!xds->we_own_buffer) - { - rc = XDS_ERR_OVERFLOW; - goto leave; - } + rc = XDS_ERR_UNKNOWN_ENGINE; + goto leave; + } + + do + { + /* Ensure the buffer has free space. */ - rc2 = xds_set_capacity((void**)&xds->buffer, - &xds->buffer_capacity, - xds->buffer_capacity + rc, - sizeof(char), - XDS_INITIAL_BUFFER_CAPACITY); - assert(rc2 == XDS_OK || rc2 == XDS_ERR_NO_MEM); - if (rc2 != XDS_OK) - { - rc = rc2; + assert(xds->buffer_len <= xds->buffer_capacity); + if (xds->buffer_len == xds->buffer_capacity) + { + if (xds->we_own_buffer) + { + rc = xds_set_capacity((void**)&xds->buffer, + &xds->buffer_capacity, + xds->buffer_len + 1, + sizeof(char), + XDS_INITIAL_BUFFER_CAPACITY); + assert(rc == XDS_OK || rc == XDS_ERR_NO_MEM); + if (rc != XDS_OK) goto leave; - } } else { - restart_engine = XDS_FALSE; - xds->buffer_len += rc; + rc = XDS_ERR_OVERFLOW; + goto leave; } } - while (restart_engine); - } - else - { - rc = XDS_ERR_UNKNOWN_ENGINE; - goto leave; + + /* Execute the engine. */ + + used_buffer_size = 0; + args_backup = args; + rc = (*xds->engines[pos].engine)(xds, + xds->engines[pos].context, + xds->buffer + xds->buffer_len, + xds->buffer_capacity - xds->buffer_len, + &used_buffer_size, + &args); + assert(rc <= 0); + if (rc == XDS_OK) + { + restart_engine = XDS_FALSE; + xds->buffer_len += used_buffer_size; + } + else if (rc == XDS_ERR_OVERFLOW) + { /* enlarge buffer */ + if (!xds->we_own_buffer) + goto leave; + + restart_engine = XDS_TRUE; + args = args_backup; + + rc = xds_set_capacity((void**)&xds->buffer, + &xds->buffer_capacity, + xds->buffer_capacity + ((used_buffer_size == 0) ? 1 : used_buffer_size), + sizeof(char), + XDS_INITIAL_BUFFER_CAPACITY); + assert(rc == XDS_OK || rc == XDS_ERR_NO_MEM); + if (rc != XDS_OK) + goto leave; + } + else + goto leave; } + while (restart_engine); } } rc = XDS_OK; Index: ossp-pkg/srpc/libxds/xdr-decode-double.c ============================================================ $ cvs diff -u -r1.1 -r1.2 xdr-decode-double.c --- ossp-pkg/srpc/libxds/xdr-decode-double.c 2001/07/23 13:04:06 1.1 +++ ossp-pkg/srpc/libxds/xdr-decode-double.c 2001/08/01 15:25:47 1.2 @@ -27,7 +27,9 @@ #include "internal.h" -int xdr_decode_double(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) +int xdr_decode_double(xds_t* xds, void* engine_context, + void* buffer, size_t buffer_size, size_t* used_buffer_size, + va_list* args) { return -1; } Index: ossp-pkg/srpc/libxds/xdr-decode-int32.c ============================================================ $ cvs diff -u -r1.3 -r1.4 xdr-decode-int32.c --- ossp-pkg/srpc/libxds/xdr-decode-int32.c 2001/07/23 15:33:42 1.3 +++ ossp-pkg/srpc/libxds/xdr-decode-int32.c 2001/08/01 15:25:47 1.4 @@ -25,28 +25,21 @@ SUCH DAMAGE. */ -#include #include "internal.h" -int xdr_decode_int32(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) +int xdr_decode_int32(xds_t* xds, void* engine_context, + void* buffer, size_t buffer_size, size_t* used_buffer_size, + va_list* args) { xds_int32_t* value; xds_uint32_t tmp; - /* Consistency checks. */ + xds_init_decoding_engine(4); - assert(xds != NULL); - assert(buffer != NULL); - assert(args != NULL); - if (xds == NULL || buffer == NULL || buffer_size == 0 || args == NULL) - return XDS_ERR_INVALID_ARG; - if (buffer_size < 4) - return XDS_ERR_UNDERFLOW; - /* Get value and format it into the buffer. */ value = va_arg(*args, xds_int32_t*); - assert(value != NULL); + xds_check_parameter(value != NULL); if (((xds_uint8_t*)buffer)[0] & 0x80) { /* negative number */ @@ -67,5 +60,5 @@ /* Done. */ - return 4; + return XDS_OK; } Index: ossp-pkg/srpc/libxds/xdr-decode-int64.c ============================================================ $ cvs diff -u -r1.3 -r1.4 xdr-decode-int64.c --- ossp-pkg/srpc/libxds/xdr-decode-int64.c 2001/07/23 15:33:42 1.3 +++ ossp-pkg/srpc/libxds/xdr-decode-int64.c 2001/08/01 15:25:47 1.4 @@ -25,28 +25,21 @@ SUCH DAMAGE. */ -#include #include "internal.h" -int xdr_decode_int64(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) +int xdr_decode_int64(xds_t* xds, void* engine_context, + void* buffer, size_t buffer_size, size_t* used_buffer_size, + va_list* args) { xds_int64_t* value; xds_uint64_t tmp; - /* Consistency checks. */ + xds_init_decoding_engine(8); - assert(xds != NULL); - assert(buffer != NULL); - assert(args != NULL); - if (xds == NULL || buffer == NULL || buffer_size == 0 || args == NULL) - return XDS_ERR_INVALID_ARG; - if (buffer_size < 8) - return XDS_ERR_UNDERFLOW; - /* Get value and format it into the buffer. */ value = va_arg(*args, xds_int64_t*); - assert(value != NULL); + xds_check_parameter(value != NULL); if (((xds_uint8_t*)buffer)[0] & 0x80) { /* negative number */ @@ -75,5 +68,5 @@ /* Done. */ - return 8; + return XDS_OK; } Index: ossp-pkg/srpc/libxds/xdr-decode-octetstream.c ============================================================ $ cvs diff -u -r1.3 -r1.4 xdr-decode-octetstream.c --- ossp-pkg/srpc/libxds/xdr-decode-octetstream.c 2001/07/23 15:33:42 1.3 +++ ossp-pkg/srpc/libxds/xdr-decode-octetstream.c 2001/08/01 15:25:47 1.4 @@ -26,42 +26,29 @@ */ #include -#include #include "internal.h" -int xdr_decode_octetstream(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) +int xdr_decode_octetstream(xds_t* xds, void* engine_context, + void* buffer, size_t buffer_size, size_t* used_buffer_size, + va_list* args) { void** p; size_t* p_len; size_t padding; - /* Consistency checks. */ + xds_init_decoding_engine(4); - assert(xds != NULL); - assert(buffer != NULL); - assert(buffer_size != 0); - assert(args != NULL); - if (xds == NULL || buffer == NULL || buffer_size == 0 || args == NULL) - return XDS_ERR_INVALID_ARG; - - /* Get pointers from the stack. */ - p = va_arg(*args, void**); p_len = va_arg(*args, size_t*); - assert(p != NULL); - assert(p_len != NULL); + xds_check_parameter(p != NULL); + xds_check_parameter(p_len != NULL); /* Read the size of the message. */ - if (buffer_size >= 4) - { - *p_len = ((xds_uint8_t*)buffer)[0]; *p_len = *p_len << 8; - *p_len += ((xds_uint8_t*)buffer)[1]; *p_len = *p_len << 8; - *p_len += ((xds_uint8_t*)buffer)[2]; *p_len = *p_len << 8; - *p_len += ((xds_uint8_t*)buffer)[3]; - } - else - return XDS_ERR_UNDERFLOW; + *p_len = ((xds_uint8_t*)buffer)[0]; *p_len = *p_len << 8; + *p_len += ((xds_uint8_t*)buffer)[1]; *p_len = *p_len << 8; + *p_len += ((xds_uint8_t*)buffer)[2]; *p_len = *p_len << 8; + *p_len += ((xds_uint8_t*)buffer)[3]; /* Calculate padding. */ @@ -69,7 +56,8 @@ /* Do we have enough data?. */ - if (buffer_size < 4 + *p_len + padding) + *used_buffer_size = 4 + *p_len + padding; + if (buffer_size < *used_buffer_size) return XDS_ERR_UNDERFLOW; /* Allocate buffer for the data. */ @@ -84,5 +72,5 @@ /* Done. */ - return 4 + *p_len + padding; + return XDS_OK; } Index: ossp-pkg/srpc/libxds/xdr-decode-string.c ============================================================ $ cvs diff -u -r1.4 -r1.5 xdr-decode-string.c --- ossp-pkg/srpc/libxds/xdr-decode-string.c 2001/07/23 15:33:42 1.4 +++ ossp-pkg/srpc/libxds/xdr-decode-string.c 2001/08/01 15:25:47 1.5 @@ -26,42 +26,29 @@ */ #include -#include #include "internal.h" -int xdr_decode_string(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) +int xdr_decode_string(xds_t* xds, void* engine_context, + void* buffer, size_t buffer_size, size_t* used_buffer_size, + va_list* args) { char** p; size_t* p_len; size_t padding; - /* Consistency checks. */ + xds_init_decoding_engine(4); - assert(xds != NULL); - assert(buffer != NULL); - assert(buffer_size != 0); - assert(args != NULL); - if (xds == NULL || buffer == NULL || buffer_size == 0 || args == NULL) - return XDS_ERR_INVALID_ARG; - - /* Get pointers from the stack. */ - p = va_arg(*args, char**); p_len = va_arg(*args, size_t*); - assert(p != NULL); - assert(p_len != NULL); + xds_check_parameter(p != NULL); + xds_check_parameter(p_len != NULL); /* Read the size of the message. */ - if (buffer_size >= 4) - { - *p_len = ((xds_uint8_t*)buffer)[0]; *p_len = *p_len << 8; - *p_len += ((xds_uint8_t*)buffer)[1]; *p_len = *p_len << 8; - *p_len += ((xds_uint8_t*)buffer)[2]; *p_len = *p_len << 8; - *p_len += ((xds_uint8_t*)buffer)[3]; - } - else - return XDS_ERR_UNDERFLOW; + *p_len = ((xds_uint8_t*)buffer)[0]; *p_len = *p_len << 8; + *p_len += ((xds_uint8_t*)buffer)[1]; *p_len = *p_len << 8; + *p_len += ((xds_uint8_t*)buffer)[2]; *p_len = *p_len << 8; + *p_len += ((xds_uint8_t*)buffer)[3]; /* Calculate padding. */ @@ -69,7 +56,8 @@ /* Do we have enough data?. */ - if (buffer_size < 4 + *p_len + padding) + *used_buffer_size = 4 + *p_len + padding; + if (buffer_size < *used_buffer_size) return XDS_ERR_UNDERFLOW; /* Allocate buffer for the data. */ @@ -85,5 +73,5 @@ /* Done. */ - return 4 + *p_len + padding; + return XDS_OK; } Index: ossp-pkg/srpc/libxds/xdr-decode-uint32.c ============================================================ $ cvs diff -u -r1.3 -r1.4 xdr-decode-uint32.c --- ossp-pkg/srpc/libxds/xdr-decode-uint32.c 2001/07/23 15:33:42 1.3 +++ ossp-pkg/srpc/libxds/xdr-decode-uint32.c 2001/08/01 15:25:47 1.4 @@ -25,27 +25,20 @@ SUCH DAMAGE. */ -#include #include "internal.h" -int xdr_decode_uint32(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) +int xdr_decode_uint32(xds_t* xds, void* engine_context, + void* buffer, size_t buffer_size, size_t* used_buffer_size, + va_list* args) { xds_uint32_t* value; - /* Consistency checks. */ + xds_init_decoding_engine(4); - assert(xds != NULL); - assert(buffer != NULL); - assert(args != NULL); - if (xds == NULL || buffer == NULL || buffer_size == 0 || args == NULL) - return XDS_ERR_INVALID_ARG; - if (buffer_size < 4) - return XDS_ERR_UNDERFLOW; - /* Get value and format it into the buffer. */ value = va_arg(*args, xds_uint32_t*); - assert(value != NULL); + xds_check_parameter(value != NULL); *value = ((xds_uint8_t*)buffer)[0]; *value = *value << 8; *value += ((xds_uint8_t*)buffer)[1]; *value = *value << 8; @@ -54,5 +47,5 @@ /* Done. */ - return 4; + return XDS_OK; } Index: ossp-pkg/srpc/libxds/xdr-decode-uint64.c ============================================================ $ cvs diff -u -r1.3 -r1.4 xdr-decode-uint64.c --- ossp-pkg/srpc/libxds/xdr-decode-uint64.c 2001/07/23 15:33:42 1.3 +++ ossp-pkg/srpc/libxds/xdr-decode-uint64.c 2001/08/01 15:25:47 1.4 @@ -25,27 +25,20 @@ SUCH DAMAGE. */ -#include #include "internal.h" -int xdr_decode_uint64(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) +int xdr_decode_uint64(xds_t* xds, void* engine_context, + void* buffer, size_t buffer_size, size_t* used_buffer_size, + va_list* args) { xds_uint64_t* value; - /* Consistency checks. */ + xds_init_decoding_engine(8); - assert(xds != NULL); - assert(buffer != NULL); - assert(args != NULL); - if (xds == NULL || buffer == NULL || buffer_size == 0 || args == NULL) - return XDS_ERR_INVALID_ARG; - if (buffer_size < 8) - return XDS_ERR_UNDERFLOW; - /* Get value and format it into the buffer. */ value = va_arg(*args, xds_uint64_t*); - assert(value != NULL); + xds_check_parameter(value != NULL); *value = ((xds_uint8_t*)buffer)[0]; *value = *value << 8; *value += ((xds_uint8_t*)buffer)[1]; *value = *value << 8; @@ -58,5 +51,5 @@ /* Done. */ - return 8; + return XDS_OK; } Index: ossp-pkg/srpc/libxds/xdr-encode-double.c ============================================================ $ cvs diff -u -r1.1 -r1.2 xdr-encode-double.c --- ossp-pkg/srpc/libxds/xdr-encode-double.c 2001/07/23 13:04:06 1.1 +++ ossp-pkg/srpc/libxds/xdr-encode-double.c 2001/08/01 15:25:47 1.2 @@ -27,7 +27,9 @@ #include "internal.h" -int xdr_decode_double(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) +int xdr_encode_double(xds_t* xds, void* engine_context, + void* buffer, size_t buffer_size, size_t* used_buffer_size, + va_list* args) { return -1; } Index: ossp-pkg/srpc/libxds/xdr-encode-int32.c ============================================================ $ cvs diff -u -r1.3 -r1.4 xdr-encode-int32.c --- ossp-pkg/srpc/libxds/xdr-encode-int32.c 2001/07/23 15:33:42 1.3 +++ ossp-pkg/srpc/libxds/xdr-encode-int32.c 2001/08/01 15:25:47 1.4 @@ -25,40 +25,33 @@ SUCH DAMAGE. */ -#include #include "internal.h" -int xdr_encode_int32(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) +int xdr_encode_int32(xds_t* xds, void* engine_context, + void* buffer, size_t buffer_size, size_t* used_buffer_size, + va_list* args) { - /* Consistency checks. */ + xds_uint32_t tmp; + xds_int32_t value; - assert(xds != NULL); - assert(buffer != NULL); - assert(buffer_size != 0); - assert(args != NULL); - if (xds == NULL || buffer == NULL || buffer_size == 0 || args == NULL) - return XDS_ERR_INVALID_ARG; + xds_init_encoding_engine(4); /* Get value and format it into the buffer. */ - if (buffer_size >= 4) + value = va_arg(*args, xds_uint32_t); + if (value < 0) { - xds_uint32_t tmp; - xds_int32_t value = va_arg(*args, xds_uint32_t); - if (value < 0) - { - value = 0 - value; - tmp = 0 - (xds_uint32_t)value; - } - else - tmp = (xds_uint32_t)value; - ((xds_uint8_t*)buffer)[0] = (tmp >> 24) & 0x000000ff; - ((xds_uint8_t*)buffer)[1] = (tmp >> 16) & 0x000000ff; - ((xds_uint8_t*)buffer)[2] = (tmp >> 8) & 0x000000ff; - ((xds_uint8_t*)buffer)[3] = (tmp >> 0) & 0x000000ff; + value = 0 - value; + tmp = 0 - (xds_uint32_t)value; } + else + tmp = (xds_uint32_t)value; + ((xds_uint8_t*)buffer)[0] = (tmp >> 24) & 0x000000ff; + ((xds_uint8_t*)buffer)[1] = (tmp >> 16) & 0x000000ff; + ((xds_uint8_t*)buffer)[2] = (tmp >> 8) & 0x000000ff; + ((xds_uint8_t*)buffer)[3] = (tmp >> 0) & 0x000000ff; /* Done. */ - return 4; + return XDS_OK; } Index: ossp-pkg/srpc/libxds/xdr-encode-int64.c ============================================================ $ cvs diff -u -r1.3 -r1.4 xdr-encode-int64.c --- ossp-pkg/srpc/libxds/xdr-encode-int64.c 2001/07/23 15:33:42 1.3 +++ ossp-pkg/srpc/libxds/xdr-encode-int64.c 2001/08/01 15:25:47 1.4 @@ -25,44 +25,37 @@ SUCH DAMAGE. */ -#include #include "internal.h" -int xdr_encode_int64(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) +int xdr_encode_int64(xds_t* xds, void* engine_context, + void* buffer, size_t buffer_size, size_t* used_buffer_size, + va_list* args) { - /* Consistency checks. */ + xds_uint64_t tmp; + xds_int64_t value; - assert(xds != NULL); - assert(buffer != NULL); - assert(buffer_size != 0); - assert(args != NULL); - if (xds == NULL || buffer == NULL || buffer_size == 0 || args == NULL) - return XDS_ERR_INVALID_ARG; + xds_init_encoding_engine(8); /* Get value and format it into the buffer. */ - if (buffer_size >= 8) + value = va_arg(*args, xds_uint64_t); + if (value < 0) { - xds_uint64_t tmp; - xds_int64_t value = va_arg(*args, xds_uint64_t); - if (value < 0) - { - value = 0 - value; - tmp = 0 - (xds_uint64_t)value; - } - else - tmp = (xds_uint64_t)value; - ((xds_uint8_t*)buffer)[0] = (tmp >> 56) & 0x000000ff; - ((xds_uint8_t*)buffer)[1] = (tmp >> 48) & 0x000000ff; - ((xds_uint8_t*)buffer)[2] = (tmp >> 40) & 0x000000ff; - ((xds_uint8_t*)buffer)[3] = (tmp >> 32) & 0x000000ff; - ((xds_uint8_t*)buffer)[4] = (tmp >> 24) & 0x000000ff; - ((xds_uint8_t*)buffer)[5] = (tmp >> 16) & 0x000000ff; - ((xds_uint8_t*)buffer)[6] = (tmp >> 8) & 0x000000ff; - ((xds_uint8_t*)buffer)[7] = (tmp >> 0) & 0x000000ff; + value = 0 - value; + tmp = 0 - (xds_uint64_t)value; } + else + tmp = (xds_uint64_t)value; + ((xds_uint8_t*)buffer)[0] = (tmp >> 56) & 0x000000ff; + ((xds_uint8_t*)buffer)[1] = (tmp >> 48) & 0x000000ff; + ((xds_uint8_t*)buffer)[2] = (tmp >> 40) & 0x000000ff; + ((xds_uint8_t*)buffer)[3] = (tmp >> 32) & 0x000000ff; + ((xds_uint8_t*)buffer)[4] = (tmp >> 24) & 0x000000ff; + ((xds_uint8_t*)buffer)[5] = (tmp >> 16) & 0x000000ff; + ((xds_uint8_t*)buffer)[6] = (tmp >> 8) & 0x000000ff; + ((xds_uint8_t*)buffer)[7] = (tmp >> 0) & 0x000000ff; /* Done. */ - return 8; + return XDS_OK; } Index: ossp-pkg/srpc/libxds/xdr-encode-octetstream.c ============================================================ $ cvs diff -u -r1.4 -r1.5 xdr-encode-octetstream.c --- ossp-pkg/srpc/libxds/xdr-encode-octetstream.c 2001/07/23 15:33:42 1.4 +++ ossp-pkg/srpc/libxds/xdr-encode-octetstream.c 2001/08/01 15:25:47 1.5 @@ -25,47 +25,45 @@ SUCH DAMAGE. */ -#include #include #include "internal.h" -int xdr_encode_octetstream(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) +int xdr_encode_octetstream(xds_t* xds, void* engine_context, + void* buffer, size_t buffer_size, size_t* used_buffer_size, + va_list* args) { xds_uint8_t* p; size_t p_len; size_t padding; - /* Consistency checks. */ + xds_init_encoding_engine(4); - assert(xds != NULL); - assert(buffer != NULL); - assert(buffer_size != 0); - assert(args != NULL); - if (xds == NULL || buffer == NULL || buffer_size == 0 || args == NULL) - return XDS_ERR_INVALID_ARG; - /* Get value from stack and calculate the correct amount of padding. */ p = (xds_uint8_t*)va_arg(*args, void*); - assert(p != NULL); + xds_check_parameter(p != NULL); p_len = va_arg(*args, size_t); padding = (4 - (p_len & 0x03)) & 0x03; assert((p_len + padding) % 4 == 0); + /* We need (4 + p_len + padding) bytes in the buffer to format our + parameter. If we don't have them, return an underflow error. */ + + *used_buffer_size = 4 + p_len + padding; + if (buffer_size < *used_buffer_size) + return XDS_ERR_OVERFLOW; + /* Format the values into the buffer. */ - if (buffer_size >= 4 + p_len + padding) - { - ((xds_uint8_t*)buffer)[0] = (p_len >> 24) & 0x000000ff; - ((xds_uint8_t*)buffer)[1] = (p_len >> 16) & 0x000000ff; - ((xds_uint8_t*)buffer)[2] = (p_len >> 8) & 0x000000ff; - ((xds_uint8_t*)buffer)[3] = (p_len >> 0) & 0x000000ff; - memmove((xds_uint8_t*)buffer+4, p, p_len); - memset((xds_uint8_t*)buffer+4+p_len, 0, padding); - } + ((xds_uint8_t*)buffer)[0] = (p_len >> 24) & 0x000000ff; + ((xds_uint8_t*)buffer)[1] = (p_len >> 16) & 0x000000ff; + ((xds_uint8_t*)buffer)[2] = (p_len >> 8) & 0x000000ff; + ((xds_uint8_t*)buffer)[3] = (p_len >> 0) & 0x000000ff; + memmove((xds_uint8_t*)buffer+4, p, p_len); + memset((xds_uint8_t*)buffer+4+p_len, 0, padding); /* Done. */ - return 4 + p_len + padding; + return XDS_OK; } Index: ossp-pkg/srpc/libxds/xdr-encode-string.c ============================================================ $ cvs diff -u -r1.5 -r1.6 xdr-encode-string.c --- ossp-pkg/srpc/libxds/xdr-encode-string.c 2001/07/23 15:33:42 1.5 +++ ossp-pkg/srpc/libxds/xdr-encode-string.c 2001/08/01 15:25:47 1.6 @@ -25,47 +25,45 @@ SUCH DAMAGE. */ -#include #include #include "internal.h" -int xdr_encode_string(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) +int xdr_encode_string(xds_t* xds, void* engine_context, + void* buffer, size_t buffer_size, size_t* used_buffer_size, + va_list* args) { char* p; size_t p_len; size_t padding; - /* Consistency checks. */ + xds_init_encoding_engine(4); - assert(xds != NULL); - assert(buffer != NULL); - assert(buffer_size != 0); - assert(args != NULL); - if (xds == NULL || buffer == NULL || buffer_size == 0 || args == NULL) - return XDS_ERR_INVALID_ARG; - /* Get value from stack and calculate the correct amount of padding. */ p = va_arg(*args, char*); - assert(p != NULL); + xds_check_parameter(p != NULL); p_len = strlen(p); padding = (4 - (p_len & 0x03)) & 0x03; assert((p_len + padding) % 4 == 0); + /* We need (4 + p_len + padding) bytes in the buffer to format our + parameter. If we don't have them, return an underflow error. */ + + *used_buffer_size = 4 + p_len + padding; + if (buffer_size < *used_buffer_size) + return XDS_ERR_OVERFLOW; + /* Format the values into the buffer. */ - if (buffer_size >= 4 + p_len + padding) - { - ((xds_uint8_t*)buffer)[0] = (p_len >> 24) & 0x000000ff; - ((xds_uint8_t*)buffer)[1] = (p_len >> 16) & 0x000000ff; - ((xds_uint8_t*)buffer)[2] = (p_len >> 8) & 0x000000ff; - ((xds_uint8_t*)buffer)[3] = (p_len >> 0) & 0x000000ff; - memmove((xds_uint8_t*)buffer+4, p, p_len); - memset((xds_uint8_t*)buffer+4+p_len, 0, padding); - } + ((xds_uint8_t*)buffer)[0] = (p_len >> 24) & 0x000000ff; + ((xds_uint8_t*)buffer)[1] = (p_len >> 16) & 0x000000ff; + ((xds_uint8_t*)buffer)[2] = (p_len >> 8) & 0x000000ff; + ((xds_uint8_t*)buffer)[3] = (p_len >> 0) & 0x000000ff; + memmove((xds_uint8_t*)buffer+4, p, p_len); + memset((xds_uint8_t*)buffer+4+p_len, 0, padding); /* Done. */ - return 4 + p_len + padding; + return XDS_OK; } Index: ossp-pkg/srpc/libxds/xdr-encode-uint32.c ============================================================ $ cvs diff -u -r1.3 -r1.4 xdr-encode-uint32.c --- ossp-pkg/srpc/libxds/xdr-encode-uint32.c 2001/07/23 15:33:42 1.3 +++ ossp-pkg/srpc/libxds/xdr-encode-uint32.c 2001/08/01 15:25:47 1.4 @@ -25,32 +25,25 @@ SUCH DAMAGE. */ -#include #include "internal.h" -int xdr_encode_uint32(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) +int xdr_encode_uint32(xds_t* xds, void* engine_context, + void* buffer, size_t buffer_size, size_t* used_buffer_size, + va_list* args) { - /* Consistency checks. */ + xds_uint32_t value; - assert(xds != NULL); - assert(buffer != NULL); - assert(buffer_size != 0); - assert(args != NULL); - if (xds == NULL || buffer == NULL || buffer_size == 0 || args == NULL) - return XDS_ERR_INVALID_ARG; + xds_init_encoding_engine(4); /* Get value and format it into the buffer. */ - if (buffer_size >= 4) - { - xds_uint32_t value = va_arg(*args, xds_uint32_t); - ((xds_uint8_t*)buffer)[0] = (value >> 24) & 0x000000ff; - ((xds_uint8_t*)buffer)[1] = (value >> 16) & 0x000000ff; - ((xds_uint8_t*)buffer)[2] = (value >> 8) & 0x000000ff; - ((xds_uint8_t*)buffer)[3] = (value >> 0) & 0x000000ff; - } + value = va_arg(*args, xds_uint32_t); + ((xds_uint8_t*)buffer)[0] = (value >> 24) & 0x000000ff; + ((xds_uint8_t*)buffer)[1] = (value >> 16) & 0x000000ff; + ((xds_uint8_t*)buffer)[2] = (value >> 8) & 0x000000ff; + ((xds_uint8_t*)buffer)[3] = (value >> 0) & 0x000000ff; /* Done. */ - return 4; + return XDS_OK; } Index: ossp-pkg/srpc/libxds/xdr-encode-uint64.c ============================================================ $ cvs diff -u -r1.3 -r1.4 xdr-encode-uint64.c --- ossp-pkg/srpc/libxds/xdr-encode-uint64.c 2001/07/23 15:33:42 1.3 +++ ossp-pkg/srpc/libxds/xdr-encode-uint64.c 2001/08/01 15:25:47 1.4 @@ -25,36 +25,29 @@ SUCH DAMAGE. */ -#include #include "internal.h" -int xdr_encode_uint64(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) +int xdr_encode_uint64(xds_t* xds, void* engine_context, + void* buffer, size_t buffer_size, size_t* used_buffer_size, + va_list* args) { - /* Consistency checks. */ + xds_uint64_t value; - assert(xds != NULL); - assert(buffer != NULL); - assert(buffer_size != 0); - assert(args != NULL); - if (xds == NULL || buffer == NULL || buffer_size == 0 || args == NULL) - return XDS_ERR_INVALID_ARG; + xds_init_encoding_engine(8); /* Get value and format it into the buffer. */ - if (buffer_size >= 8) - { - xds_uint64_t value = va_arg(*args, xds_uint64_t); - ((xds_uint8_t*)buffer)[0] = (value >> 56) & 0x000000ff; - ((xds_uint8_t*)buffer)[1] = (value >> 48) & 0x000000ff; - ((xds_uint8_t*)buffer)[2] = (value >> 40) & 0x000000ff; - ((xds_uint8_t*)buffer)[3] = (value >> 32) & 0x000000ff; - ((xds_uint8_t*)buffer)[4] = (value >> 24) & 0x000000ff; - ((xds_uint8_t*)buffer)[5] = (value >> 16) & 0x000000ff; - ((xds_uint8_t*)buffer)[6] = (value >> 8) & 0x000000ff; - ((xds_uint8_t*)buffer)[7] = (value >> 0) & 0x000000ff; - } + value = va_arg(*args, xds_uint64_t); + ((xds_uint8_t*)buffer)[0] = (value >> 56) & 0x000000ff; + ((xds_uint8_t*)buffer)[1] = (value >> 48) & 0x000000ff; + ((xds_uint8_t*)buffer)[2] = (value >> 40) & 0x000000ff; + ((xds_uint8_t*)buffer)[3] = (value >> 32) & 0x000000ff; + ((xds_uint8_t*)buffer)[4] = (value >> 24) & 0x000000ff; + ((xds_uint8_t*)buffer)[5] = (value >> 16) & 0x000000ff; + ((xds_uint8_t*)buffer)[6] = (value >> 8) & 0x000000ff; + ((xds_uint8_t*)buffer)[7] = (value >> 0) & 0x000000ff; /* Done. */ - return 8; + return XDS_OK; } Index: ossp-pkg/srpc/libxds/xds.h.in ============================================================ $ cvs diff -u -r1.6 -r1.7 xds.h.in --- ossp-pkg/srpc/libxds/xds.h.in 2001/07/31 15:27:45 1.6 +++ ossp-pkg/srpc/libxds/xds.h.in 2001/08/01 15:25:47 1.7 @@ -61,10 +61,8 @@ struct xds_context; typedef struct xds_context xds_t; -typedef int (*xds_engine_t)(xds_t* xds, - void* engine_context, - void* buffer, - size_t buffer_size, +typedef int (*xds_engine_t)(xds_t* xds, void* engine_context, + void* buffer, size_t buffer_size, size_t* used_buffer_size, va_list* args); xds_t* xds_init(xds_mode_t); @@ -73,7 +71,7 @@ int xds_register(xds_t* xds, const char* name, xds_engine_t engine, void* engine_context); int xds_unregister(xds_t* xds, const char* name); -int xds_setbuffer(xds_t* xds, xds_scope_t flag, void* buffer, size_t buffer_len); +int xds_setbuffer(xds_t* xds, xds_scope_t flag, void* buffer, size_t buffer_len); int xds_getbuffer(xds_t* xds, xds_scope_t flag, void** buffer, size_t* buffer_len); int xds_encode(xds_t* xds, const char* fmt, ...); @@ -81,44 +79,45 @@ int xds_vencode(xds_t* xds, const char* fmt, va_list args); int xds_vdecode(xds_t* xds, const char* fmt, va_list args); -int xdr_encode_uint32(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); -int xdr_encode_int32(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); -int xdr_encode_uint64(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); -int xdr_encode_int64(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); +#define declare_formatting_engine(x) \ + int x(xds_t* xds, void* engine_context, \ + void* buffer, size_t buffer_size, size_t* used_buffer_size, \ + va_list* args) + +declare_formatting_engine(xdr_encode_uint32); +declare_formatting_engine(xdr_decode_uint32); +declare_formatting_engine(xdr_encode_int32); +declare_formatting_engine(xdr_decode_int32); +declare_formatting_engine(xdr_encode_uint64); +declare_formatting_engine(xdr_decode_uint64); +declare_formatting_engine(xdr_encode_int64); +declare_formatting_engine(xdr_decode_int64); +declare_formatting_engine(xdr_encode_double); +declare_formatting_engine(xdr_decode_double); +declare_formatting_engine(xdr_encode_octetstream); +declare_formatting_engine(xdr_decode_octetstream); +declare_formatting_engine(xdr_encode_string); +declare_formatting_engine(xdr_decode_string); + +declare_formatting_engine(xml_encode_begin); +declare_formatting_engine(xml_decode_begin); +declare_formatting_engine(xml_encode_end); +declare_formatting_engine(xml_decode_end); +declare_formatting_engine(xml_encode_uint32); +declare_formatting_engine(xml_decode_uint32); +declare_formatting_engine(xml_encode_int32); +declare_formatting_engine(xml_decode_int32); +declare_formatting_engine(xml_encode_uint64); +declare_formatting_engine(xml_decode_uint64); +declare_formatting_engine(xml_encode_int64); +declare_formatting_engine(xml_decode_int64); +declare_formatting_engine(xml_encode_double); +declare_formatting_engine(xml_decode_double); +declare_formatting_engine(xml_encode_octetstream); +declare_formatting_engine(xml_decode_octetstream); +declare_formatting_engine(xml_encode_string); +declare_formatting_engine(xml_decode_string); -int xdr_decode_uint32(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); -int xdr_decode_int32(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); -int xdr_decode_uint64(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); -int xdr_decode_int64(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); - -int xdr_encode_octetstream(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); -int xdr_decode_octetstream(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); - -int xdr_encode_string(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); -int xdr_decode_string(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); - -int xdr_encode_double(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); -int xdr_decode_double(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); - - -int xml_encode_int32(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); -int xml_decode_int32(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); - -int xml_encode_uint32(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); -int xml_decode_uint32(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); - -int xml_encode_int64(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); -int xml_decode_int64(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); - -int xml_encode_uint64(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); -int xml_decode_uint64(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); - -int xml_encode_double(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); -int xml_decode_double(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); - -int xml_encode_begin(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); -int xml_decode_begin(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); -int xml_encode_end(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); -int xml_decode_end(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); +#undef declare_formatting_engine #endif /* !defined(__LIBXDS_H__) */ Index: ossp-pkg/srpc/libxds/xml-decode-begin.c ============================================================ $ cvs diff -u -r1.1 -r1.2 xml-decode-begin.c --- ossp-pkg/srpc/libxds/xml-decode-begin.c 2001/07/31 15:27:45 1.1 +++ ossp-pkg/srpc/libxds/xml-decode-begin.c 2001/08/01 15:25:47 1.2 @@ -26,25 +26,14 @@ */ #include -#include #include "internal.h" -int xml_decode_begin(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) +int xml_decode_begin(xds_t* xds, void* engine_context, + void* buffer, size_t buffer_size, size_t* used_buffer_size, + va_list* args) { - /* Consistency checks. */ - - assert(xds != NULL); - assert(buffer != NULL); - assert(buffer_size != 0); - assert(args != NULL); - if (xds == NULL || buffer == NULL || buffer_size == 0 || args == NULL) - return XDS_ERR_INVALID_ARG; - - if (buffer_size < strlen(xds_xml_begin_text)) - return XDS_ERR_UNDERFLOW; - + xds_init_encoding_engine(strlen(xds_xml_begin_text)); if (strncasecmp(buffer, xds_xml_begin_text, strlen(xds_xml_begin_text)) != 0) return XDS_ERR_TYPE_MISMATCH; - - return strlen(xds_xml_begin_text); + return XDS_OK; } Index: ossp-pkg/srpc/libxds/xml-decode-double.c ============================================================ $ cvs diff -u -r1.3 -r1.4 xml-decode-double.c --- ossp-pkg/srpc/libxds/xml-decode-double.c 2001/07/24 13:52:41 1.3 +++ ossp-pkg/srpc/libxds/xml-decode-double.c 2001/08/01 15:25:47 1.4 @@ -27,7 +27,9 @@ #include "internal.h" -int xml_decode_double(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) +int xml_decode_double(xds_t* xds, void* engine_context, + void* buffer, size_t buffer_size, size_t* used_buffer_size, + va_list* args) { return -1; } Index: ossp-pkg/srpc/libxds/xml-decode-end.c ============================================================ $ cvs diff -u -r1.1 -r1.2 xml-decode-end.c --- ossp-pkg/srpc/libxds/xml-decode-end.c 2001/07/31 15:28:14 1.1 +++ ossp-pkg/srpc/libxds/xml-decode-end.c 2001/08/01 15:25:47 1.2 @@ -26,25 +26,14 @@ */ #include -#include #include "internal.h" -int xml_decode_end(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) +int xml_decode_end(xds_t* xds, void* engine_context, + void* buffer, size_t buffer_size, size_t* used_buffer_size, + va_list* args) { - /* Consistency checks. */ - - assert(xds != NULL); - assert(buffer != NULL); - assert(buffer_size != 0); - assert(args != NULL); - if (xds == NULL || buffer == NULL || buffer_size == 0 || args == NULL) - return XDS_ERR_INVALID_ARG; - - if (buffer_size < strlen(xds_xml_end_text)) - return XDS_ERR_UNDERFLOW; - + xds_init_decoding_engine(strlen(xds_xml_end_text)); if (strncasecmp(buffer, xds_xml_end_text, strlen(xds_xml_end_text)) != 0) return XDS_ERR_TYPE_MISMATCH; - - return strlen(xds_xml_end_text); + return XDS_OK; } Index: ossp-pkg/srpc/libxds/xml-decode-int32.c ============================================================ $ cvs diff -u -r1.2 -r1.3 xml-decode-int32.c --- ossp-pkg/srpc/libxds/xml-decode-int32.c 2001/07/24 13:52:41 1.2 +++ ossp-pkg/srpc/libxds/xml-decode-int32.c 2001/08/01 15:25:47 1.3 @@ -27,33 +27,21 @@ #include #include -#include #include "internal.h" -int xml_decode_int32(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) +int xml_decode_int32(xds_t* xds, void* engine_context, + void* buffer, size_t buffer_size, size_t* used_buffer_size, + va_list* args) { xds_int32_t* value; char* p; int negative; - /* Consistency checks. */ + xds_init_decoding_engine(7 + 8 + 1); - assert(xds != NULL); - assert(buffer != NULL); - assert(buffer_size != 0); - assert(args != NULL); - if (xds == NULL || buffer == NULL || buffer_size == 0 || args == NULL) - return XDS_ERR_INVALID_ARG; - - /* The buffer must contain at least opening tag, closing tag and - one digit. Check whether it is large enough. */ - - if (buffer_size < 7 + 8 + 1) - return XDS_ERR_UNDERFLOW; - /* Does the opening XML tag match? */ - if (strncmp(buffer, "", 7) != 0) + if (strncasecmp(buffer, "", 7) != 0) return XDS_ERR_TYPE_MISMATCH; /* Decode the representation of the value. */ @@ -82,8 +70,9 @@ if (p+8 > (char*)buffer + buffer_size) return XDS_ERR_UNDERFLOW; - else if (strncmp(p, "", 8) != 0) + else if (strncasecmp(p, "", 8) != 0) return XDS_ERR_TYPE_MISMATCH; - return p + 8 - (char*)buffer; + *used_buffer_size = p + 8 - (char*)buffer; + return XDS_OK; } Index: ossp-pkg/srpc/libxds/xml-decode-int64.c ============================================================ $ cvs diff -u -r1.3 -r1.4 xml-decode-int64.c --- ossp-pkg/srpc/libxds/xml-decode-int64.c 2001/07/24 13:52:41 1.3 +++ ossp-pkg/srpc/libxds/xml-decode-int64.c 2001/08/01 15:25:47 1.4 @@ -27,33 +27,21 @@ #include #include -#include #include "internal.h" -int xml_decode_int64(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) +int xml_decode_int64(xds_t* xds, void* engine_context, + void* buffer, size_t buffer_size, size_t* used_buffer_size, + va_list* args) { xds_int64_t* value; char* p; int negative; - /* Consistency checks. */ + xds_init_decoding_engine(7 + 8 + 1); - assert(xds != NULL); - assert(buffer != NULL); - assert(buffer_size != 0); - assert(args != NULL); - if (xds == NULL || buffer == NULL || buffer_size == 0 || args == NULL) - return XDS_ERR_INVALID_ARG; - - /* The buffer must contain at least opening tag, closing tag and - one digit. Check whether it is large enough. */ - - if (buffer_size < 7 + 8 + 1) - return XDS_ERR_UNDERFLOW; - /* Does the opening XML tag match? */ - if (strncmp(buffer, "", 7) != 0) + if (strncasecmp(buffer, "", 7) != 0) return XDS_ERR_TYPE_MISMATCH; /* Decode the representation of the value. */ @@ -82,8 +70,9 @@ if (p+8 > (char*)buffer + buffer_size) return XDS_ERR_UNDERFLOW; - else if (strncmp(p, "", 8) != 0) + else if (strncasecmp(p, "", 8) != 0) return XDS_ERR_TYPE_MISMATCH; - return p + 8 - (char*)buffer; + *used_buffer_size = p + 8 - (char*)buffer; + return XDS_OK; } Index: ossp-pkg/srpc/libxds/xml-decode-uint32.c ============================================================ $ cvs diff -u -r1.2 -r1.3 xml-decode-uint32.c --- ossp-pkg/srpc/libxds/xml-decode-uint32.c 2001/07/24 13:52:41 1.2 +++ ossp-pkg/srpc/libxds/xml-decode-uint32.c 2001/08/01 15:25:47 1.3 @@ -27,32 +27,20 @@ #include #include -#include #include "internal.h" -int xml_decode_uint32(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) +int xml_decode_uint32(xds_t* xds, void* engine_context, + void* buffer, size_t buffer_size, size_t* used_buffer_size, + va_list* args) { xds_uint32_t* value; char* p; - /* Consistency checks. */ + xds_init_decoding_engine(8 + 9 + 1); - assert(xds != NULL); - assert(buffer != NULL); - assert(buffer_size != 0); - assert(args != NULL); - if (xds == NULL || buffer == NULL || buffer_size == 0 || args == NULL) - return XDS_ERR_INVALID_ARG; - - /* The buffer must contain at least opening tag, closing tag and - one digit. Check whether it is large enough. */ - - if (buffer_size < 8 + 9 + 1) - return XDS_ERR_UNDERFLOW; - /* Does the opening XML tag match? */ - if (strncmp(buffer, "", 8) != 0) + if (strncasecmp(buffer, "", 8) != 0) return XDS_ERR_TYPE_MISMATCH; /* Decode the representation of the value. */ @@ -72,8 +60,9 @@ if (p+9 > (char*)buffer + buffer_size) return XDS_ERR_UNDERFLOW; - else if (strncmp(p, "", 9) != 0) + else if (strncasecmp(p, "", 9) != 0) return XDS_ERR_TYPE_MISMATCH; - return p + 9 - (char*)buffer; + *used_buffer_size = p + 9 - (char*)buffer; + return XDS_OK; } Index: ossp-pkg/srpc/libxds/xml-decode-uint64.c ============================================================ $ cvs diff -u -r1.3 -r1.4 xml-decode-uint64.c --- ossp-pkg/srpc/libxds/xml-decode-uint64.c 2001/07/24 13:52:41 1.3 +++ ossp-pkg/srpc/libxds/xml-decode-uint64.c 2001/08/01 15:25:47 1.4 @@ -27,32 +27,20 @@ #include #include -#include #include "internal.h" -int xml_decode_uint64(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) +int xml_decode_uint64(xds_t* xds, void* engine_context, + void* buffer, size_t buffer_size, size_t* used_buffer_size, + va_list* args) { xds_uint64_t* value; char* p; - /* Consistency checks. */ + xds_init_decoding_engine(8 + 9 + 1); - assert(xds != NULL); - assert(buffer != NULL); - assert(buffer_size != 0); - assert(args != NULL); - if (xds == NULL || buffer == NULL || buffer_size == 0 || args == NULL) - return XDS_ERR_INVALID_ARG; - - /* The buffer must contain at least opening tag, closing tag and - one digit. Check whether it is large enough. */ - - if (buffer_size < 8 + 9 + 1) - return XDS_ERR_UNDERFLOW; - /* Does the opening XML tag match? */ - if (strncmp(buffer, "", 8) != 0) + if (strncasecmp(buffer, "", 8) != 0) return XDS_ERR_TYPE_MISMATCH; /* Decode the representation of the value. */ @@ -72,8 +60,9 @@ if (p+9 > (char*)buffer + buffer_size) return XDS_ERR_UNDERFLOW; - else if (strncmp(p, "", 9) != 0) + else if (strncasecmp(p, "", 9) != 0) return XDS_ERR_TYPE_MISMATCH; - return p + 9 - (char*)buffer; + *used_buffer_size = p + 9 - (char*)buffer; + return XDS_OK; } Index: ossp-pkg/srpc/libxds/xml-encode-begin.c ============================================================ $ cvs diff -u -r1.1 -r1.2 xml-encode-begin.c --- ossp-pkg/srpc/libxds/xml-encode-begin.c 2001/07/31 15:27:45 1.1 +++ ossp-pkg/srpc/libxds/xml-encode-begin.c 2001/08/01 15:25:47 1.2 @@ -26,7 +26,6 @@ */ #include -#include #include "internal.h" const char xds_xml_begin_text[] = \ @@ -34,19 +33,11 @@ "\n" \ "\n"; -int xml_encode_begin(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) +int xml_encode_begin(xds_t* xds, void* engine_context, + void* buffer, size_t buffer_size, size_t* used_buffer_size, + va_list* args) { - /* Consistency checks. */ - - assert(xds != NULL); - assert(buffer != NULL); - assert(buffer_size != 0); - assert(args != NULL); - if (xds == NULL || buffer == NULL || buffer_size == 0 || args == NULL) - return XDS_ERR_INVALID_ARG; - - if (buffer_size >= strlen(xds_xml_begin_text)) - memmove(buffer, xds_xml_begin_text, strlen(xds_xml_begin_text)); - - return strlen(xds_xml_begin_text); + xds_init_encoding_engine(strlen(xds_xml_begin_text)); + memmove(buffer, xds_xml_begin_text, strlen(xds_xml_begin_text)); + return XDS_OK; } Index: ossp-pkg/srpc/libxds/xml-encode-double.c ============================================================ $ cvs diff -u -r1.3 -r1.4 xml-encode-double.c --- ossp-pkg/srpc/libxds/xml-encode-double.c 2001/07/24 13:52:41 1.3 +++ ossp-pkg/srpc/libxds/xml-encode-double.c 2001/08/01 15:25:47 1.4 @@ -27,7 +27,9 @@ #include "internal.h" -int xml_encode_double(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) +int xml_encode_double(xds_t* xds, void* engine_context, + void* buffer, size_t buffer_size, size_t* used_buffer_size, + va_list* args) { return -1; } Index: ossp-pkg/srpc/libxds/xml-encode-end.c ============================================================ $ cvs diff -u -r1.1 -r1.2 xml-encode-end.c --- ossp-pkg/srpc/libxds/xml-encode-end.c 2001/07/31 15:28:14 1.1 +++ ossp-pkg/srpc/libxds/xml-encode-end.c 2001/08/01 15:25:47 1.2 @@ -26,24 +26,15 @@ */ #include -#include #include "internal.h" const char xds_xml_end_text[] = "\n"; -int xml_encode_end(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) +int xml_encode_end(xds_t* xds, void* engine_context, + void* buffer, size_t buffer_size, size_t* used_buffer_size, + va_list* args) { - /* Consistency checks. */ - - assert(xds != NULL); - assert(buffer != NULL); - assert(buffer_size != 0); - assert(args != NULL); - if (xds == NULL || buffer == NULL || buffer_size == 0 || args == NULL) - return XDS_ERR_INVALID_ARG; - - if (buffer_size >= strlen(xds_xml_end_text)) - memmove(buffer, xds_xml_end_text, strlen(xds_xml_end_text)); - - return strlen(xds_xml_end_text); + xds_init_encoding_engine(strlen(xds_xml_end_text)); + memmove(buffer, xds_xml_end_text, strlen(xds_xml_end_text)); + return XDS_OK; } Index: ossp-pkg/srpc/libxds/xml-encode-int32.c ============================================================ $ cvs diff -u -r1.3 -r1.4 xml-encode-int32.c --- ossp-pkg/srpc/libxds/xml-encode-int32.c 2001/07/24 13:52:41 1.3 +++ ossp-pkg/srpc/libxds/xml-encode-int32.c 2001/08/01 15:25:47 1.4 @@ -26,10 +26,11 @@ */ #include -#include #include "internal.h" -int xml_encode_int32(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) +int xml_encode_int32(xds_t* xds, void* engine_context, + void* buffer, size_t buffer_size, size_t* used_buffer_size, + va_list* args) { xds_int32_t value; char buf[32]; @@ -37,17 +38,11 @@ char* p; int negative; - /* Consistency checks. */ + xds_init_encoding_engine(7 + 8 + 11); - assert(xds != NULL); - assert(buffer != NULL); - assert(buffer_size != 0); - assert(args != NULL); - if (xds == NULL || buffer == NULL || buffer_size == 0 || args == NULL) - return XDS_ERR_INVALID_ARG; + /* Get the value and format it into our buffer. Keep track of the + length of the formatted result. */ - /* Format value into our buffer. */ - value = va_arg(*args, xds_int32_t); if (value < 0) { @@ -66,22 +61,19 @@ while (value != 0); if (negative) buf[i++] = '-'; - - /* Check the buffer size. */ - - if (buffer_size < 7 + 8 + i) - return 7 + 8 + i; - /* Write result into the buffer. */ + /* Now that we know the correct size of our data's representation, + write it into the buffer. */ + *used_buffer_size = 7 + 8 + i; p = buffer; - strcpy(p, ""); + memmove(p, "", 7); p += 7; for (j = i; j > 0; ) { *p++ = buf[--j]; } - strcpy(p, ""); + memmove(p, "", 8); - return 7 + 8 + i; + return XDS_OK; } Index: ossp-pkg/srpc/libxds/xml-encode-int64.c ============================================================ $ cvs diff -u -r1.3 -r1.4 xml-encode-int64.c --- ossp-pkg/srpc/libxds/xml-encode-int64.c 2001/07/24 13:52:41 1.3 +++ ossp-pkg/srpc/libxds/xml-encode-int64.c 2001/08/01 15:25:47 1.4 @@ -26,10 +26,11 @@ */ #include -#include #include "internal.h" -int xml_encode_int64(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) +int xml_encode_int64(xds_t* xds, void* engine_context, + void* buffer, size_t buffer_size, size_t* used_buffer_size, + va_list* args) { xds_int64_t value; char buf[64]; @@ -37,15 +38,8 @@ char* p; int negative; - /* Consistency checks. */ + xds_init_encoding_engine(7 + 8 + 21); - assert(xds != NULL); - assert(buffer != NULL); - assert(buffer_size != 0); - assert(args != NULL); - if (xds == NULL || buffer == NULL || buffer_size == 0 || args == NULL) - return XDS_ERR_INVALID_ARG; - /* Format value into our buffer. */ value = va_arg(*args, xds_int64_t); @@ -67,21 +61,20 @@ if (negative) buf[i++] = '-'; - /* Check the buffer size. */ + /* Store the correct buffer size. */ - if (buffer_size < 7 + 8 + i) - return 7 + 8 + i; + *used_buffer_size = 7 + 8 + i; /* Write result into the buffer. */ p = buffer; - strcpy(p, ""); + memmove(p, "", 7); p += 7; for (j = i; j > 0; ) { *p++ = buf[--j]; } - strcpy(p, ""); + memmove(p, "", 8); - return 7 + 8 + i; + return XDS_OK; } Index: ossp-pkg/srpc/libxds/xml-encode-uint32.c ============================================================ $ cvs diff -u -r1.2 -r1.3 xml-encode-uint32.c --- ossp-pkg/srpc/libxds/xml-encode-uint32.c 2001/07/24 13:52:41 1.2 +++ ossp-pkg/srpc/libxds/xml-encode-uint32.c 2001/08/01 15:25:47 1.3 @@ -26,25 +26,19 @@ */ #include -#include #include "internal.h" -int xml_encode_uint32(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) +int xml_encode_uint32(xds_t* xds, void* engine_context, + void* buffer, size_t buffer_size, size_t* used_buffer_size, + va_list* args) { xds_uint32_t value; char buf[32]; size_t i, j; char* p; - /* Consistency checks. */ + xds_init_encoding_engine(8 + 9 + 10); - assert(xds != NULL); - assert(buffer != NULL); - assert(buffer_size != 0); - assert(args != NULL); - if (xds == NULL || buffer == NULL || buffer_size == 0 || args == NULL) - return XDS_ERR_INVALID_ARG; - /* Format value into our buffer. */ value = va_arg(*args, xds_uint32_t); @@ -57,21 +51,20 @@ } while (value != 0); - /* Check the buffer size. */ + /* Store the correct buffer size. */ - if (buffer_size < 8 + 9 + i) - return 8 + 9 + i; + *used_buffer_size = 8 + 9 + i; /* Write result into the buffer. */ p = buffer; - strcpy(p, ""); + memmove(p, "", 8); p += 8; for (j = i; j > 0; ) { *p++ = buf[--j]; } - strcpy(p, ""); + memmove(p, "", 9); - return 8 + 9 + i; + return XDS_OK; } Index: ossp-pkg/srpc/libxds/xml-encode-uint64.c ============================================================ $ cvs diff -u -r1.3 -r1.4 xml-encode-uint64.c --- ossp-pkg/srpc/libxds/xml-encode-uint64.c 2001/07/24 13:52:41 1.3 +++ ossp-pkg/srpc/libxds/xml-encode-uint64.c 2001/08/01 15:25:47 1.4 @@ -26,25 +26,19 @@ */ #include -#include #include "internal.h" -int xml_encode_uint64(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args) +int xml_encode_uint64(xds_t* xds, void* engine_context, + void* buffer, size_t buffer_size, size_t* used_buffer_size, + va_list* args) { xds_uint64_t value; char buf[64]; size_t i, j; char* p; - /* Consistency checks. */ + xds_init_encoding_engine(8 + 9 + 20); - assert(xds != NULL); - assert(buffer != NULL); - assert(buffer_size != 0); - assert(args != NULL); - if (xds == NULL || buffer == NULL || buffer_size == 0 || args == NULL) - return XDS_ERR_INVALID_ARG; - /* Format value into our buffer. */ value = va_arg(*args, xds_uint64_t); @@ -57,21 +51,20 @@ } while (value != 0); - /* Check the buffer size. */ + /* Store the correct buffer size. */ - if (buffer_size < 8 + 9 + i) - return 8 + 9 + i; + *used_buffer_size = 8 + 9 + i; /* Write result into the buffer. */ p = buffer; - strcpy(p, ""); + memmove(p, "", 8); p += 8; for (j = i; j > 0; ) { *p++ = buf[--j]; } - strcpy(p, ""); + memmove(p, "", 9); - return 8 + 9 + i; + return XDS_OK; } From ossp-cvs-owner@ossp.org Thu Aug 2 10:10:16 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f728AFm75567; Thu, 2 Aug 2001 10:10:15 +0200 (CEST) Date: Thu, 2 Aug 2001 10:10:15 +0200 (CEST) Message-Id: <200108020810.f728AFm75567@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds xdr-decode-double.c xdr-decode-int32.... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 02-Aug-2001 10:10:15 Branch: HEAD Handle: 2001080209101201 Modified files: ossp-pkg/srpc/libxds xdr-decode-double.c xdr-decode-int32.c xdr-decode-int64.c xdr-decode-octetstream.c xdr-decode-string.c xdr-decode-uint32.c xdr-decode-uint64.c xdr-encode-double.c xdr-encode-int32.c xdr-encode-int64.c xdr-encode-octetstream.c xdr-encode-string.c xdr-encode-uint32.c xdr-encode-uint64.c xml-decode-begin.c xml-decode-double.c xml-decode-end.c xml-decode-int32.c xml-decode-int64.c xml-decode-uint32.c xml-decode-uint64.c xml-encode-begin.c xml-encode-double.c xml-encode-end.c xml-encode-int32.c xml-encode-int64.c xml-encode-uint32.c xml-encode-uint64.c Log: Include xds.h, not internal.h! Summary: Revision Changes Path 1.3 +1 -1 ossp-pkg/srpc/libxds/xdr-decode-double.c 1.5 +1 -1 ossp-pkg/srpc/libxds/xdr-decode-int32.c 1.5 +1 -1 ossp-pkg/srpc/libxds/xdr-decode-int64.c 1.5 +1 -1 ossp-pkg/srpc/libxds/xdr-decode-octetstream.c 1.6 +1 -1 ossp-pkg/srpc/libxds/xdr-decode-string.c 1.5 +1 -1 ossp-pkg/srpc/libxds/xdr-decode-uint32.c 1.5 +1 -1 ossp-pkg/srpc/libxds/xdr-decode-uint64.c 1.3 +1 -1 ossp-pkg/srpc/libxds/xdr-encode-double.c 1.5 +1 -1 ossp-pkg/srpc/libxds/xdr-encode-int32.c 1.5 +1 -1 ossp-pkg/srpc/libxds/xdr-encode-int64.c 1.6 +1 -1 ossp-pkg/srpc/libxds/xdr-encode-octetstream.c 1.7 +1 -1 ossp-pkg/srpc/libxds/xdr-encode-string.c 1.5 +1 -1 ossp-pkg/srpc/libxds/xdr-encode-uint32.c 1.5 +1 -1 ossp-pkg/srpc/libxds/xdr-encode-uint64.c 1.3 +1 -1 ossp-pkg/srpc/libxds/xml-decode-begin.c 1.5 +1 -1 ossp-pkg/srpc/libxds/xml-decode-double.c 1.3 +1 -1 ossp-pkg/srpc/libxds/xml-decode-end.c 1.4 +1 -1 ossp-pkg/srpc/libxds/xml-decode-int32.c 1.5 +1 -1 ossp-pkg/srpc/libxds/xml-decode-int64.c 1.4 +1 -1 ossp-pkg/srpc/libxds/xml-decode-uint32.c 1.5 +1 -1 ossp-pkg/srpc/libxds/xml-decode-uint64.c 1.3 +1 -1 ossp-pkg/srpc/libxds/xml-encode-begin.c 1.5 +1 -1 ossp-pkg/srpc/libxds/xml-encode-double.c 1.3 +1 -1 ossp-pkg/srpc/libxds/xml-encode-end.c 1.5 +1 -1 ossp-pkg/srpc/libxds/xml-encode-int32.c 1.5 +1 -1 ossp-pkg/srpc/libxds/xml-encode-int64.c 1.4 +1 -1 ossp-pkg/srpc/libxds/xml-encode-uint32.c 1.5 +1 -1 ossp-pkg/srpc/libxds/xml-encode-uint64.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/xdr-decode-double.c ============================================================ $ cvs diff -u -r1.2 -r1.3 xdr-decode-double.c --- ossp-pkg/srpc/libxds/xdr-decode-double.c 2001/08/01 15:25:47 1.2 +++ ossp-pkg/srpc/libxds/xdr-decode-double.c 2001/08/02 08:10:13 1.3 @@ -25,7 +25,7 @@ SUCH DAMAGE. */ -#include "internal.h" +#include "xds.h" int xdr_decode_double(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, size_t* used_buffer_size, Index: ossp-pkg/srpc/libxds/xdr-decode-int32.c ============================================================ $ cvs diff -u -r1.4 -r1.5 xdr-decode-int32.c --- ossp-pkg/srpc/libxds/xdr-decode-int32.c 2001/08/01 15:25:47 1.4 +++ ossp-pkg/srpc/libxds/xdr-decode-int32.c 2001/08/02 08:10:13 1.5 @@ -25,7 +25,7 @@ SUCH DAMAGE. */ -#include "internal.h" +#include "xds.h" int xdr_decode_int32(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, size_t* used_buffer_size, Index: ossp-pkg/srpc/libxds/xdr-decode-int64.c ============================================================ $ cvs diff -u -r1.4 -r1.5 xdr-decode-int64.c --- ossp-pkg/srpc/libxds/xdr-decode-int64.c 2001/08/01 15:25:47 1.4 +++ ossp-pkg/srpc/libxds/xdr-decode-int64.c 2001/08/02 08:10:13 1.5 @@ -25,7 +25,7 @@ SUCH DAMAGE. */ -#include "internal.h" +#include "xds.h" int xdr_decode_int64(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, size_t* used_buffer_size, Index: ossp-pkg/srpc/libxds/xdr-decode-octetstream.c ============================================================ $ cvs diff -u -r1.4 -r1.5 xdr-decode-octetstream.c --- ossp-pkg/srpc/libxds/xdr-decode-octetstream.c 2001/08/01 15:25:47 1.4 +++ ossp-pkg/srpc/libxds/xdr-decode-octetstream.c 2001/08/02 08:10:13 1.5 @@ -26,7 +26,7 @@ */ #include -#include "internal.h" +#include "xds.h" int xdr_decode_octetstream(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, size_t* used_buffer_size, Index: ossp-pkg/srpc/libxds/xdr-decode-string.c ============================================================ $ cvs diff -u -r1.5 -r1.6 xdr-decode-string.c --- ossp-pkg/srpc/libxds/xdr-decode-string.c 2001/08/01 15:25:47 1.5 +++ ossp-pkg/srpc/libxds/xdr-decode-string.c 2001/08/02 08:10:13 1.6 @@ -26,7 +26,7 @@ */ #include -#include "internal.h" +#include "xds.h" int xdr_decode_string(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, size_t* used_buffer_size, Index: ossp-pkg/srpc/libxds/xdr-decode-uint32.c ============================================================ $ cvs diff -u -r1.4 -r1.5 xdr-decode-uint32.c --- ossp-pkg/srpc/libxds/xdr-decode-uint32.c 2001/08/01 15:25:47 1.4 +++ ossp-pkg/srpc/libxds/xdr-decode-uint32.c 2001/08/02 08:10:13 1.5 @@ -25,7 +25,7 @@ SUCH DAMAGE. */ -#include "internal.h" +#include "xds.h" int xdr_decode_uint32(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, size_t* used_buffer_size, Index: ossp-pkg/srpc/libxds/xdr-decode-uint64.c ============================================================ $ cvs diff -u -r1.4 -r1.5 xdr-decode-uint64.c --- ossp-pkg/srpc/libxds/xdr-decode-uint64.c 2001/08/01 15:25:47 1.4 +++ ossp-pkg/srpc/libxds/xdr-decode-uint64.c 2001/08/02 08:10:13 1.5 @@ -25,7 +25,7 @@ SUCH DAMAGE. */ -#include "internal.h" +#include "xds.h" int xdr_decode_uint64(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, size_t* used_buffer_size, Index: ossp-pkg/srpc/libxds/xdr-encode-double.c ============================================================ $ cvs diff -u -r1.2 -r1.3 xdr-encode-double.c --- ossp-pkg/srpc/libxds/xdr-encode-double.c 2001/08/01 15:25:47 1.2 +++ ossp-pkg/srpc/libxds/xdr-encode-double.c 2001/08/02 08:10:13 1.3 @@ -25,7 +25,7 @@ SUCH DAMAGE. */ -#include "internal.h" +#include "xds.h" int xdr_encode_double(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, size_t* used_buffer_size, Index: ossp-pkg/srpc/libxds/xdr-encode-int32.c ============================================================ $ cvs diff -u -r1.4 -r1.5 xdr-encode-int32.c --- ossp-pkg/srpc/libxds/xdr-encode-int32.c 2001/08/01 15:25:47 1.4 +++ ossp-pkg/srpc/libxds/xdr-encode-int32.c 2001/08/02 08:10:13 1.5 @@ -25,7 +25,7 @@ SUCH DAMAGE. */ -#include "internal.h" +#include "xds.h" int xdr_encode_int32(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, size_t* used_buffer_size, Index: ossp-pkg/srpc/libxds/xdr-encode-int64.c ============================================================ $ cvs diff -u -r1.4 -r1.5 xdr-encode-int64.c --- ossp-pkg/srpc/libxds/xdr-encode-int64.c 2001/08/01 15:25:47 1.4 +++ ossp-pkg/srpc/libxds/xdr-encode-int64.c 2001/08/02 08:10:13 1.5 @@ -25,7 +25,7 @@ SUCH DAMAGE. */ -#include "internal.h" +#include "xds.h" int xdr_encode_int64(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, size_t* used_buffer_size, Index: ossp-pkg/srpc/libxds/xdr-encode-octetstream.c ============================================================ $ cvs diff -u -r1.5 -r1.6 xdr-encode-octetstream.c --- ossp-pkg/srpc/libxds/xdr-encode-octetstream.c 2001/08/01 15:25:47 1.5 +++ ossp-pkg/srpc/libxds/xdr-encode-octetstream.c 2001/08/02 08:10:13 1.6 @@ -26,7 +26,7 @@ */ #include -#include "internal.h" +#include "xds.h" int xdr_encode_octetstream(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, size_t* used_buffer_size, Index: ossp-pkg/srpc/libxds/xdr-encode-string.c ============================================================ $ cvs diff -u -r1.6 -r1.7 xdr-encode-string.c --- ossp-pkg/srpc/libxds/xdr-encode-string.c 2001/08/01 15:25:47 1.6 +++ ossp-pkg/srpc/libxds/xdr-encode-string.c 2001/08/02 08:10:13 1.7 @@ -26,7 +26,7 @@ */ #include -#include "internal.h" +#include "xds.h" int xdr_encode_string(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, size_t* used_buffer_size, Index: ossp-pkg/srpc/libxds/xdr-encode-uint32.c ============================================================ $ cvs diff -u -r1.4 -r1.5 xdr-encode-uint32.c --- ossp-pkg/srpc/libxds/xdr-encode-uint32.c 2001/08/01 15:25:47 1.4 +++ ossp-pkg/srpc/libxds/xdr-encode-uint32.c 2001/08/02 08:10:13 1.5 @@ -25,7 +25,7 @@ SUCH DAMAGE. */ -#include "internal.h" +#include "xds.h" int xdr_encode_uint32(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, size_t* used_buffer_size, Index: ossp-pkg/srpc/libxds/xdr-encode-uint64.c ============================================================ $ cvs diff -u -r1.4 -r1.5 xdr-encode-uint64.c --- ossp-pkg/srpc/libxds/xdr-encode-uint64.c 2001/08/01 15:25:47 1.4 +++ ossp-pkg/srpc/libxds/xdr-encode-uint64.c 2001/08/02 08:10:13 1.5 @@ -25,7 +25,7 @@ SUCH DAMAGE. */ -#include "internal.h" +#include "xds.h" int xdr_encode_uint64(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, size_t* used_buffer_size, Index: ossp-pkg/srpc/libxds/xml-decode-begin.c ============================================================ $ cvs diff -u -r1.2 -r1.3 xml-decode-begin.c --- ossp-pkg/srpc/libxds/xml-decode-begin.c 2001/08/01 15:25:47 1.2 +++ ossp-pkg/srpc/libxds/xml-decode-begin.c 2001/08/02 08:10:12 1.3 @@ -26,7 +26,7 @@ */ #include -#include "internal.h" +#include "xds.h" int xml_decode_begin(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, size_t* used_buffer_size, Index: ossp-pkg/srpc/libxds/xml-decode-double.c ============================================================ $ cvs diff -u -r1.4 -r1.5 xml-decode-double.c --- ossp-pkg/srpc/libxds/xml-decode-double.c 2001/08/01 15:25:47 1.4 +++ ossp-pkg/srpc/libxds/xml-decode-double.c 2001/08/02 08:10:13 1.5 @@ -25,7 +25,7 @@ SUCH DAMAGE. */ -#include "internal.h" +#include "xds.h" int xml_decode_double(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, size_t* used_buffer_size, Index: ossp-pkg/srpc/libxds/xml-decode-end.c ============================================================ $ cvs diff -u -r1.2 -r1.3 xml-decode-end.c --- ossp-pkg/srpc/libxds/xml-decode-end.c 2001/08/01 15:25:47 1.2 +++ ossp-pkg/srpc/libxds/xml-decode-end.c 2001/08/02 08:10:13 1.3 @@ -26,7 +26,7 @@ */ #include -#include "internal.h" +#include "xds.h" int xml_decode_end(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, size_t* used_buffer_size, Index: ossp-pkg/srpc/libxds/xml-decode-int32.c ============================================================ $ cvs diff -u -r1.3 -r1.4 xml-decode-int32.c --- ossp-pkg/srpc/libxds/xml-decode-int32.c 2001/08/01 15:25:47 1.3 +++ ossp-pkg/srpc/libxds/xml-decode-int32.c 2001/08/02 08:10:13 1.4 @@ -27,7 +27,7 @@ #include #include -#include "internal.h" +#include "xds.h" int xml_decode_int32(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, size_t* used_buffer_size, Index: ossp-pkg/srpc/libxds/xml-decode-int64.c ============================================================ $ cvs diff -u -r1.4 -r1.5 xml-decode-int64.c --- ossp-pkg/srpc/libxds/xml-decode-int64.c 2001/08/01 15:25:47 1.4 +++ ossp-pkg/srpc/libxds/xml-decode-int64.c 2001/08/02 08:10:13 1.5 @@ -27,7 +27,7 @@ #include #include -#include "internal.h" +#include "xds.h" int xml_decode_int64(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, size_t* used_buffer_size, Index: ossp-pkg/srpc/libxds/xml-decode-uint32.c ============================================================ $ cvs diff -u -r1.3 -r1.4 xml-decode-uint32.c --- ossp-pkg/srpc/libxds/xml-decode-uint32.c 2001/08/01 15:25:47 1.3 +++ ossp-pkg/srpc/libxds/xml-decode-uint32.c 2001/08/02 08:10:13 1.4 @@ -27,7 +27,7 @@ #include #include -#include "internal.h" +#include "xds.h" int xml_decode_uint32(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, size_t* used_buffer_size, Index: ossp-pkg/srpc/libxds/xml-decode-uint64.c ============================================================ $ cvs diff -u -r1.4 -r1.5 xml-decode-uint64.c --- ossp-pkg/srpc/libxds/xml-decode-uint64.c 2001/08/01 15:25:47 1.4 +++ ossp-pkg/srpc/libxds/xml-decode-uint64.c 2001/08/02 08:10:13 1.5 @@ -27,7 +27,7 @@ #include #include -#include "internal.h" +#include "xds.h" int xml_decode_uint64(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, size_t* used_buffer_size, Index: ossp-pkg/srpc/libxds/xml-encode-begin.c ============================================================ $ cvs diff -u -r1.2 -r1.3 xml-encode-begin.c --- ossp-pkg/srpc/libxds/xml-encode-begin.c 2001/08/01 15:25:47 1.2 +++ ossp-pkg/srpc/libxds/xml-encode-begin.c 2001/08/02 08:10:13 1.3 @@ -26,7 +26,7 @@ */ #include -#include "internal.h" +#include "xds.h" const char xds_xml_begin_text[] = \ "\n" \ Index: ossp-pkg/srpc/libxds/xml-encode-double.c ============================================================ $ cvs diff -u -r1.4 -r1.5 xml-encode-double.c --- ossp-pkg/srpc/libxds/xml-encode-double.c 2001/08/01 15:25:47 1.4 +++ ossp-pkg/srpc/libxds/xml-encode-double.c 2001/08/02 08:10:13 1.5 @@ -25,7 +25,7 @@ SUCH DAMAGE. */ -#include "internal.h" +#include "xds.h" int xml_encode_double(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, size_t* used_buffer_size, Index: ossp-pkg/srpc/libxds/xml-encode-end.c ============================================================ $ cvs diff -u -r1.2 -r1.3 xml-encode-end.c --- ossp-pkg/srpc/libxds/xml-encode-end.c 2001/08/01 15:25:47 1.2 +++ ossp-pkg/srpc/libxds/xml-encode-end.c 2001/08/02 08:10:13 1.3 @@ -26,7 +26,7 @@ */ #include -#include "internal.h" +#include "xds.h" const char xds_xml_end_text[] = "\n"; Index: ossp-pkg/srpc/libxds/xml-encode-int32.c ============================================================ $ cvs diff -u -r1.4 -r1.5 xml-encode-int32.c --- ossp-pkg/srpc/libxds/xml-encode-int32.c 2001/08/01 15:25:47 1.4 +++ ossp-pkg/srpc/libxds/xml-encode-int32.c 2001/08/02 08:10:13 1.5 @@ -26,7 +26,7 @@ */ #include -#include "internal.h" +#include "xds.h" int xml_encode_int32(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, size_t* used_buffer_size, Index: ossp-pkg/srpc/libxds/xml-encode-int64.c ============================================================ $ cvs diff -u -r1.4 -r1.5 xml-encode-int64.c --- ossp-pkg/srpc/libxds/xml-encode-int64.c 2001/08/01 15:25:47 1.4 +++ ossp-pkg/srpc/libxds/xml-encode-int64.c 2001/08/02 08:10:13 1.5 @@ -26,7 +26,7 @@ */ #include -#include "internal.h" +#include "xds.h" int xml_encode_int64(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, size_t* used_buffer_size, Index: ossp-pkg/srpc/libxds/xml-encode-uint32.c ============================================================ $ cvs diff -u -r1.3 -r1.4 xml-encode-uint32.c --- ossp-pkg/srpc/libxds/xml-encode-uint32.c 2001/08/01 15:25:47 1.3 +++ ossp-pkg/srpc/libxds/xml-encode-uint32.c 2001/08/02 08:10:13 1.4 @@ -26,7 +26,7 @@ */ #include -#include "internal.h" +#include "xds.h" int xml_encode_uint32(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, size_t* used_buffer_size, Index: ossp-pkg/srpc/libxds/xml-encode-uint64.c ============================================================ $ cvs diff -u -r1.4 -r1.5 xml-encode-uint64.c --- ossp-pkg/srpc/libxds/xml-encode-uint64.c 2001/08/01 15:25:47 1.4 +++ ossp-pkg/srpc/libxds/xml-encode-uint64.c 2001/08/02 08:10:13 1.5 @@ -26,7 +26,7 @@ */ #include -#include "internal.h" +#include "xds.h" int xml_encode_uint64(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, size_t* used_buffer_size, From ossp-cvs-owner@ossp.org Thu Aug 2 10:12:27 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f728CRK75756; Thu, 2 Aug 2001 10:12:27 +0200 (CEST) Date: Thu, 2 Aug 2001 10:12:27 +0200 (CEST) Message-Id: <200108020812.f728CRK75756@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds internal.h xds.h.in Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 02-Aug-2001 10:12:26 Branch: HEAD Handle: 2001080209122600 Modified files: ossp-pkg/srpc/libxds internal.h xds.h.in Log: - Moved definition of xds_check_parameter(), xds_init_encoding_engine(), and xds_init_decoding_engine() from internal.h to xds.h so that the callbacks don't need to include internal.h. - Renamed declare_formatting_engine() to xds_declare_formatting_engine(). Summary: Revision Changes Path 1.9 +0 -41 ossp-pkg/srpc/libxds/internal.h 1.8 +76 -38 ossp-pkg/srpc/libxds/xds.h.in ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/internal.h ============================================================ $ cvs diff -u -r1.8 -r1.9 internal.h --- ossp-pkg/srpc/libxds/internal.h 2001/08/01 15:25:47 1.8 +++ ossp-pkg/srpc/libxds/internal.h 2001/08/02 08:12:26 1.9 @@ -30,12 +30,8 @@ #ifndef __INTERNAL_H__ #define __INTERNAL_H__ -#include #include "xds.h" -#define XDS_TRUE (1==1) -#define XDS_FALSE (1!=1) - #define XDS_INITIAL_BUFFER_CAPACITY 512 #define XDS_INITIAL_ENGINES_CAPACITY 32 @@ -63,42 +59,5 @@ int xds_find_engine(const engine_map_t* engines, size_t last, const char* name, size_t* pos); int xds_set_capacity(void** array, size_t* array_capacity, size_t new_capacity, size_t elem_size, size_t initial_capacity); - -extern const char xds_xml_begin_text[]; -extern const char xds_xml_end_text[]; - -#define xds_check_parameter(condition) \ - do \ - { \ - assert(condition); \ - if (!(condition)) \ - return XDS_ERR_INVALID_ARG; \ - } while(XDS_FALSE) - -#define xds_init_encoding_engine(size) \ - do \ - { \ - xds_check_parameter(xds != NULL); \ - xds_check_parameter(buffer != NULL); \ - xds_check_parameter(buffer_size != 0); \ - xds_check_parameter(used_buffer_size != NULL && *used_buffer_size == 0); \ - xds_check_parameter(args != NULL); \ - *used_buffer_size = size; \ - if (buffer_size < size) \ - return XDS_ERR_OVERFLOW; \ - } while(XDS_FALSE) - -#define xds_init_decoding_engine(size) \ - do \ - { \ - xds_check_parameter(xds != NULL); \ - xds_check_parameter(buffer != NULL); \ - xds_check_parameter(buffer_size != 0); \ - xds_check_parameter(used_buffer_size != NULL && *used_buffer_size == 0); \ - xds_check_parameter(args != NULL); \ - *used_buffer_size = size; \ - if (buffer_size < size) \ - return XDS_ERR_UNDERFLOW; \ - } while(XDS_FALSE) #endif /* !defined(__INTERNAL_H__) */ Index: ossp-pkg/srpc/libxds/xds.h.in ============================================================ $ cvs diff -u -r1.7 -r1.8 xds.h.in --- ossp-pkg/srpc/libxds/xds.h.in 2001/08/01 15:25:47 1.7 +++ ossp-pkg/srpc/libxds/xds.h.in 2001/08/02 08:12:26 1.8 @@ -33,7 +33,11 @@ #include #include #include +#include +#define XDS_TRUE (1==1) +#define XDS_FALSE (1!=1) + typedef @xds_uint8_t@ xds_uint8_t; typedef @xds_uint16_t@ xds_uint16_t; typedef @xds_uint32_t@ xds_uint32_t; @@ -79,45 +83,79 @@ int xds_vencode(xds_t* xds, const char* fmt, va_list args); int xds_vdecode(xds_t* xds, const char* fmt, va_list args); -#define declare_formatting_engine(x) \ - int x(xds_t* xds, void* engine_context, \ - void* buffer, size_t buffer_size, size_t* used_buffer_size, \ +#define xds_check_parameter(condition) \ + do \ + { \ + assert(condition); \ + if (!(condition)) \ + return XDS_ERR_INVALID_ARG; \ + } while(XDS_FALSE) + +#define xds_init_encoding_engine(size) \ + do \ + { \ + xds_check_parameter(xds != NULL); \ + xds_check_parameter(buffer != NULL); \ + xds_check_parameter(buffer_size != 0); \ + xds_check_parameter(used_buffer_size != NULL && *used_buffer_size == 0); \ + xds_check_parameter(args != NULL); \ + *used_buffer_size = size; \ + if (buffer_size < size) \ + return XDS_ERR_OVERFLOW; \ + } while(XDS_FALSE) + +#define xds_init_decoding_engine(size) \ + do \ + { \ + xds_check_parameter(xds != NULL); \ + xds_check_parameter(buffer != NULL); \ + xds_check_parameter(buffer_size != 0); \ + xds_check_parameter(used_buffer_size != NULL && *used_buffer_size == 0); \ + xds_check_parameter(args != NULL); \ + *used_buffer_size = size; \ + if (buffer_size < size) \ + return XDS_ERR_UNDERFLOW; \ + } while(XDS_FALSE) + +#define xds_declare_formatting_engine(x) \ + int x(xds_t* xds, void* engine_context, \ + void* buffer, size_t buffer_size, size_t* used_buffer_size, \ va_list* args) - -declare_formatting_engine(xdr_encode_uint32); -declare_formatting_engine(xdr_decode_uint32); -declare_formatting_engine(xdr_encode_int32); -declare_formatting_engine(xdr_decode_int32); -declare_formatting_engine(xdr_encode_uint64); -declare_formatting_engine(xdr_decode_uint64); -declare_formatting_engine(xdr_encode_int64); -declare_formatting_engine(xdr_decode_int64); -declare_formatting_engine(xdr_encode_double); -declare_formatting_engine(xdr_decode_double); -declare_formatting_engine(xdr_encode_octetstream); -declare_formatting_engine(xdr_decode_octetstream); -declare_formatting_engine(xdr_encode_string); -declare_formatting_engine(xdr_decode_string); - -declare_formatting_engine(xml_encode_begin); -declare_formatting_engine(xml_decode_begin); -declare_formatting_engine(xml_encode_end); -declare_formatting_engine(xml_decode_end); -declare_formatting_engine(xml_encode_uint32); -declare_formatting_engine(xml_decode_uint32); -declare_formatting_engine(xml_encode_int32); -declare_formatting_engine(xml_decode_int32); -declare_formatting_engine(xml_encode_uint64); -declare_formatting_engine(xml_decode_uint64); -declare_formatting_engine(xml_encode_int64); -declare_formatting_engine(xml_decode_int64); -declare_formatting_engine(xml_encode_double); -declare_formatting_engine(xml_decode_double); -declare_formatting_engine(xml_encode_octetstream); -declare_formatting_engine(xml_decode_octetstream); -declare_formatting_engine(xml_encode_string); -declare_formatting_engine(xml_decode_string); -#undef declare_formatting_engine +xds_declare_formatting_engine(xdr_encode_uint32); +xds_declare_formatting_engine(xdr_decode_uint32); +xds_declare_formatting_engine(xdr_encode_int32); +xds_declare_formatting_engine(xdr_decode_int32); +xds_declare_formatting_engine(xdr_encode_uint64); +xds_declare_formatting_engine(xdr_decode_uint64); +xds_declare_formatting_engine(xdr_encode_int64); +xds_declare_formatting_engine(xdr_decode_int64); +xds_declare_formatting_engine(xdr_encode_double); +xds_declare_formatting_engine(xdr_decode_double); +xds_declare_formatting_engine(xdr_encode_octetstream); +xds_declare_formatting_engine(xdr_decode_octetstream); +xds_declare_formatting_engine(xdr_encode_string); +xds_declare_formatting_engine(xdr_decode_string); + +xds_declare_formatting_engine(xml_encode_begin); +xds_declare_formatting_engine(xml_decode_begin); +xds_declare_formatting_engine(xml_encode_end); +xds_declare_formatting_engine(xml_decode_end); +xds_declare_formatting_engine(xml_encode_uint32); +xds_declare_formatting_engine(xml_decode_uint32); +xds_declare_formatting_engine(xml_encode_int32); +xds_declare_formatting_engine(xml_decode_int32); +xds_declare_formatting_engine(xml_encode_uint64); +xds_declare_formatting_engine(xml_decode_uint64); +xds_declare_formatting_engine(xml_encode_int64); +xds_declare_formatting_engine(xml_decode_int64); +xds_declare_formatting_engine(xml_encode_double); +xds_declare_formatting_engine(xml_decode_double); +xds_declare_formatting_engine(xml_encode_octetstream); +xds_declare_formatting_engine(xml_decode_octetstream); +xds_declare_formatting_engine(xml_encode_string); +xds_declare_formatting_engine(xml_decode_string); +extern const char xds_xml_begin_text[]; +extern const char xds_xml_end_text[]; #endif /* !defined(__LIBXDS_H__) */ From ossp-cvs-owner@ossp.org Thu Aug 2 10:29:18 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f728THu77739; Thu, 2 Aug 2001 10:29:17 +0200 (CEST) Date: Thu, 2 Aug 2001 10:29:17 +0200 (CEST) Message-Id: <200108020829.f728THu77739@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds configure.ac Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 02-Aug-2001 10:29:17 Branch: HEAD Handle: 2001080209291700 Modified files: ossp-pkg/srpc/libxds configure.ac Log: Remove the writable flag from file generated by autoconf. Summary: Revision Changes Path 1.8 +2 -1 ossp-pkg/srpc/libxds/configure.ac ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/configure.ac ============================================================ $ cvs diff -u -r1.7 -r1.8 configure.ac --- ossp-pkg/srpc/libxds/configure.ac 2001/07/22 17:24:31 1.7 +++ ossp-pkg/srpc/libxds/configure.ac 2001/08/02 08:29:17 1.8 @@ -1,6 +1,6 @@ dnl configure.in -- Process this file with autoconf to produce a configure script. -AC_INIT(libxds, [$Revision: 1.7 $]) +AC_INIT(libxds, [$Revision: 1.8 $]) dnl Get rid of the lousy -g and -O defaults in CFLAGS. dnl @@ -76,4 +76,5 @@ dnl Write results. dnl AC_CONFIG_FILES(xds.h Makefile regression-tests/Makefile) +AC_CONFIG_COMMANDS([default], [chmod -w xds.h Makefile regression-tests/Makefile]) AC_OUTPUT From ossp-cvs-owner@ossp.org Thu Aug 2 10:36:35 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f728aXn78496; Thu, 2 Aug 2001 10:36:33 +0200 (CEST) Date: Thu, 2 Aug 2001 10:36:33 +0200 (CEST) Message-Id: <200108020836.f728aXn78496@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds configure.ac Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 02-Aug-2001 10:36:33 Branch: HEAD Handle: 2001080209363300 Modified files: ossp-pkg/srpc/libxds configure.ac Log: Added AC_PREREQ and AC_REVISION statements. Summary: Revision Changes Path 1.9 +3 -1 ossp-pkg/srpc/libxds/configure.ac ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/configure.ac ============================================================ $ cvs diff -u -r1.8 -r1.9 configure.ac --- ossp-pkg/srpc/libxds/configure.ac 2001/08/02 08:29:17 1.8 +++ ossp-pkg/srpc/libxds/configure.ac 2001/08/02 08:36:33 1.9 @@ -1,6 +1,8 @@ dnl configure.in -- Process this file with autoconf to produce a configure script. -AC_INIT(libxds, [$Revision: 1.8 $]) +AC_INIT(libxds) +AC_PREREQ(2.52) +AC_REVISION($Revision: 1.9 $) dnl Get rid of the lousy -g and -O defaults in CFLAGS. dnl From ossp-cvs-owner@ossp.org Thu Aug 2 12:52:00 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f72ApwT94136; Thu, 2 Aug 2001 12:51:58 +0200 (CEST) Date: Thu, 2 Aug 2001 12:51:58 +0200 (CEST) Message-Id: <200108021051.f72ApwT94136@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds destroy.c init.c register.c set-capac... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 02-Aug-2001 12:51:58 Branch: HEAD Handle: 2001080211515700 Modified files: ossp-pkg/srpc/libxds destroy.c init.c register.c set-capacity.c unregister.c Log: Remove stdlib.h include here because it is included in xds.h already. Summary: Revision Changes Path 1.9 +0 -1 ossp-pkg/srpc/libxds/destroy.c 1.7 +0 -1 ossp-pkg/srpc/libxds/init.c 1.8 +0 -1 ossp-pkg/srpc/libxds/register.c 1.5 +0 -1 ossp-pkg/srpc/libxds/set-capacity.c 1.6 +0 -1 ossp-pkg/srpc/libxds/unregister.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/destroy.c ============================================================ $ cvs diff -u -r1.8 -r1.9 destroy.c --- ossp-pkg/srpc/libxds/destroy.c 2001/08/01 15:25:47 1.8 +++ ossp-pkg/srpc/libxds/destroy.c 2001/08/02 10:51:57 1.9 @@ -25,7 +25,6 @@ SUCH DAMAGE. */ -#include #include "internal.h" void xds_destroy(xds_t* xds) Index: ossp-pkg/srpc/libxds/init.c ============================================================ $ cvs diff -u -r1.6 -r1.7 init.c --- ossp-pkg/srpc/libxds/init.c 2001/08/01 15:25:47 1.6 +++ ossp-pkg/srpc/libxds/init.c 2001/08/02 10:51:57 1.7 @@ -25,7 +25,6 @@ SUCH DAMAGE. */ -#include #include #include "internal.h" Index: ossp-pkg/srpc/libxds/register.c ============================================================ $ cvs diff -u -r1.7 -r1.8 register.c --- ossp-pkg/srpc/libxds/register.c 2001/08/01 15:25:47 1.7 +++ ossp-pkg/srpc/libxds/register.c 2001/08/02 10:51:57 1.8 @@ -25,7 +25,6 @@ SUCH DAMAGE. */ -#include #include #include #include "internal.h" Index: ossp-pkg/srpc/libxds/set-capacity.c ============================================================ $ cvs diff -u -r1.4 -r1.5 set-capacity.c --- ossp-pkg/srpc/libxds/set-capacity.c 2001/08/01 15:25:47 1.4 +++ ossp-pkg/srpc/libxds/set-capacity.c 2001/08/02 10:51:57 1.5 @@ -25,7 +25,6 @@ SUCH DAMAGE. */ -#include #include "internal.h" int xds_set_capacity(void** array, size_t* array_capacity, size_t new_capacity, size_t elem_size, size_t initial_capacity) Index: ossp-pkg/srpc/libxds/unregister.c ============================================================ $ cvs diff -u -r1.5 -r1.6 unregister.c --- ossp-pkg/srpc/libxds/unregister.c 2001/08/01 15:25:47 1.5 +++ ossp-pkg/srpc/libxds/unregister.c 2001/08/02 10:51:57 1.6 @@ -25,7 +25,6 @@ SUCH DAMAGE. */ -#include #include #include #include "internal.h" From ossp-cvs-owner@ossp.org Thu Aug 2 12:54:29 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f72AsSu94338; Thu, 2 Aug 2001 12:54:28 +0200 (CEST) Date: Thu, 2 Aug 2001 12:54:28 +0200 (CEST) Message-Id: <200108021054.f72AsSu94338@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds Makefile.in Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 02-Aug-2001 12:54:28 Branch: HEAD Handle: 2001080211542700 Modified files: ossp-pkg/srpc/libxds Makefile.in Log: Improved dependencies to be more accurate. Summary: Revision Changes Path 1.13 +6 -3 ossp-pkg/srpc/libxds/Makefile.in ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/Makefile.in ============================================================ $ cvs diff -u -r1.12 -r1.13 Makefile.in --- ossp-pkg/srpc/libxds/Makefile.in 2001/08/01 15:25:47 1.12 +++ ossp-pkg/srpc/libxds/Makefile.in 2001/08/02 10:54:27 1.13 @@ -24,10 +24,12 @@ xdr-encode-octetstream.o xdr-decode-octetstream.o \ xdr-encode-string.o xdr-decode-string.o \ -OBJS = decode.o destroy.o encode.o getbuffer.o init.o register.o \ +XDS_OBJS = decode.o destroy.o encode.o getbuffer.o init.o register.o \ setbuffer.o unregister.o vdecode.o vencode.o find-engine.o \ - set-capacity.o $(XDR_OBJS) $(XML_OBJS) + set-capacity.o +OBJS = $(XDS_OBJS) $(XDR_OBJS) $(XML_OBJS) + .c.o: $(CC) $(CPPFLAGS) $(WARNFLAGS) $(OPTFLAGS) $(CFLAGS) -c $< @@ -58,4 +60,5 @@ # Dependencies -$(OBJS): internal.h xds.h +$(XDS_OBJS): internal.h xds.h +$(XDR_OBJS) $(XML_OBJS): xds.h From ossp-cvs-owner@ossp.org Thu Aug 2 13:52:14 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f72BqCY01196; Thu, 2 Aug 2001 13:52:12 +0200 (CEST) Date: Thu, 2 Aug 2001 13:52:12 +0200 (CEST) Message-Id: <200108021152.f72BqCY01196@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds/regression-tests xdr-string-empty.c x... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 02-Aug-2001 13:52:12 Branch: HEAD Handle: 2001080212521101 Modified files: ossp-pkg/srpc/libxds xdr-decode-string.c ossp-pkg/srpc/libxds/regression-tests xdr-string-empty.c xdr-string.c Log: xdr_decode_string() will no longer return the length of the decoded string. Use strlen() to determine that length or use xdr_(en|de)code_octetstream() to begin with. Summary: Revision Changes Path 1.4 +5 -11 ossp-pkg/srpc/libxds/regression-tests/xdr-string-empty.c 1.4 +7 -8 ossp-pkg/srpc/libxds/regression-tests/xdr-string.c 1.7 +10 -12 ossp-pkg/srpc/libxds/xdr-decode-string.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/regression-tests/xdr-string-empty.c ============================================================ $ cvs diff -u -r1.3 -r1.4 xdr-string-empty.c --- ossp-pkg/srpc/libxds/regression-tests/xdr-string-empty.c 2001/08/01 15:25:50 1.3 +++ ossp-pkg/srpc/libxds/regression-tests/xdr-string-empty.c 2001/08/02 11:52:12 1.4 @@ -37,7 +37,6 @@ char msg[] = ""; char* new_msg; - size_t new_msg_size; /* Encode the string as octet stream. Then erase the buffer and decode the string back, verifying that it hasn't changed. */ @@ -48,12 +47,12 @@ printf("Failed to initialize XDS context.\n"); return 1; } - if (xds_register(xds, "os", &xdr_encode_string, NULL) != XDS_OK) + if (xds_register(xds, "string", &xdr_encode_string, NULL) != XDS_OK) { printf("Failed to register my encoding engines.\n"); return 1; } - if (xds_encode(xds, "os", msg, 0) != XDS_OK) + if (xds_encode(xds, "string", msg, 0) != XDS_OK) { printf("xds_encode() failed.\n"); return 1; @@ -76,7 +75,7 @@ printf("Failed to initialize XDS context.\n"); return 1; } - if (xds_register(xds, "os", &xdr_decode_string, NULL) != XDS_OK) + if (xds_register(xds, "string", &xdr_decode_string, NULL) != XDS_OK) { printf("Failed to register my decoding engines.\n"); return 1; @@ -86,19 +85,14 @@ printf("xds_setbuffer() failed.\n"); return 1; } - if (xds_decode(xds, "os", &new_msg, &new_msg_size) != XDS_OK) + if (xds_decode(xds, "string", &new_msg) != XDS_OK) { printf("xds_decode() failed.\n"); return 1; } - if (new_msg_size != 0) + if (strlen(new_msg) != 0) { printf("The size of the decoded message is wrong.\n"); - return 1; - } - if (memcmp(msg, new_msg, new_msg_size) != 0) - { - printf("The decoded string is not correct.\n"); return 1; } xds_destroy(xds); Index: ossp-pkg/srpc/libxds/regression-tests/xdr-string.c ============================================================ $ cvs diff -u -r1.3 -r1.4 xdr-string.c --- ossp-pkg/srpc/libxds/regression-tests/xdr-string.c 2001/08/01 15:25:50 1.3 +++ ossp-pkg/srpc/libxds/regression-tests/xdr-string.c 2001/08/02 11:52:12 1.4 @@ -37,7 +37,6 @@ char msg[] = "Hello World"; char* new_msg; - size_t new_msg_size; /* Encode the string as octet stream. Then erase the buffer and decode the string back, verifying that it hasn't changed. */ @@ -48,12 +47,12 @@ printf("Failed to initialize XDS context.\n"); return 1; } - if (xds_register(xds, "os", &xdr_encode_string, NULL) != XDS_OK) + if (xds_register(xds, "string", &xdr_encode_string, NULL) != XDS_OK) { printf("Failed to register my encoding engines.\n"); return 1; } - if (xds_encode(xds, "os", msg) != XDS_OK) + if (xds_encode(xds, "string", msg) != XDS_OK) { printf("xds_encode() failed.\n"); return 1; @@ -76,7 +75,7 @@ printf("Failed to initialize XDS context.\n"); return 1; } - if (xds_register(xds, "os", &xdr_decode_string, NULL) != XDS_OK) + if (xds_register(xds, "string", &xdr_decode_string, NULL) != XDS_OK) { printf("Failed to register my decoding engines.\n"); return 1; @@ -86,17 +85,17 @@ printf("xds_setbuffer() failed.\n"); return 1; } - if (xds_decode(xds, "os", &new_msg, &new_msg_size) != XDS_OK) + if (xds_decode(xds, "string", &new_msg) != XDS_OK) { printf("xds_decode() failed.\n"); return 1; } - if (new_msg_size != strlen(msg)) + if (strlen(new_msg) != strlen(msg)) { - printf("The size of the decoded message is wrong: %d.\n", new_msg_size); + printf("The size of the decoded message is wrong.\n"); return 1; } - if (memcmp(msg, new_msg, new_msg_size) != 0) + if (memcmp(msg, new_msg, strlen(new_msg)) != 0) { printf("The decoded string is not correct.\n"); return 1; Index: ossp-pkg/srpc/libxds/xdr-decode-string.c ============================================================ $ cvs diff -u -r1.6 -r1.7 xdr-decode-string.c --- ossp-pkg/srpc/libxds/xdr-decode-string.c 2001/08/02 08:10:13 1.6 +++ ossp-pkg/srpc/libxds/xdr-decode-string.c 2001/08/02 11:52:11 1.7 @@ -33,43 +33,41 @@ va_list* args) { char** p; - size_t* p_len; + size_t p_len; size_t padding; xds_init_decoding_engine(4); p = va_arg(*args, char**); - p_len = va_arg(*args, size_t*); xds_check_parameter(p != NULL); - xds_check_parameter(p_len != NULL); /* Read the size of the message. */ - *p_len = ((xds_uint8_t*)buffer)[0]; *p_len = *p_len << 8; - *p_len += ((xds_uint8_t*)buffer)[1]; *p_len = *p_len << 8; - *p_len += ((xds_uint8_t*)buffer)[2]; *p_len = *p_len << 8; - *p_len += ((xds_uint8_t*)buffer)[3]; + p_len = ((xds_uint8_t*)buffer)[0]; p_len = p_len << 8; + p_len += ((xds_uint8_t*)buffer)[1]; p_len = p_len << 8; + p_len += ((xds_uint8_t*)buffer)[2]; p_len = p_len << 8; + p_len += ((xds_uint8_t*)buffer)[3]; /* Calculate padding. */ - padding = (4 - (*p_len & 0x03)) & 0x03; + padding = (4 - (p_len & 0x03)) & 0x03; /* Do we have enough data?. */ - *used_buffer_size = 4 + *p_len + padding; + *used_buffer_size = 4 + p_len + padding; if (buffer_size < *used_buffer_size) return XDS_ERR_UNDERFLOW; /* Allocate buffer for the data. */ - *p = (char*)malloc(*p_len + 1); + *p = (char*)malloc(p_len + 1); if (*p == NULL) return XDS_ERR_NO_MEM; /* Copy data into the buffer. */ - memmove(*p, (xds_uint8_t*)buffer+4, *p_len); - ((xds_uint8_t*)buffer)[4+*p_len] = '\0'; + memmove(*p, (xds_uint8_t*)buffer+4, p_len); + ((xds_uint8_t*)buffer)[4+p_len] = '\0'; /* Done. */ From ossp-cvs-owner@ossp.org Thu Aug 2 14:19:15 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f72CJEM04522; Thu, 2 Aug 2001 14:19:14 +0200 (CEST) Date: Thu, 2 Aug 2001 14:19:14 +0200 (CEST) Message-Id: <200108021219.f72CJEM04522@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds/docs decode.c encode.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 02-Aug-2001 14:19:14 Branch: HEAD Handle: 2001080213191400 Added files: ossp-pkg/srpc/libxds/docs decode.c encode.c Log: Example programs used in the documentation. Summary: Revision Changes Path 1.1 +66 -0 ossp-pkg/srpc/libxds/docs/decode.c 1.1 +51 -0 ossp-pkg/srpc/libxds/docs/encode.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/docs/decode.c ============================================================ $ cvs update -p -r1.1 decode.c #include #include #include #include #include static void error_exit(int rc, const char* msg, ...) { va_list args; va_start(args, msg); vfprintf(stderr, msg, args); va_end(args); exit(rc); } int main() { xds_t* xds; char buffer[1024]; size_t buffer_len; int rc; xds_int32_t int32; xds_uint32_t uint32; char* string; buffer_len = 0; do { rc = read(STDIN_FILENO, buffer + buffer_len, sizeof(buffer) - buffer_len); if (rc < 0) error_exit(1, "read() failed: %s\n", strerror(errno)); else if (rc > 0) buffer_len += rc; } while (rc > 0 && buffer_len < sizeof(buffer)); if (buffer_len >= sizeof(buffer)) error_exit(1, "Too much input data for our buffer.\n"); xds = xds_init(XDS_DECODE); if (xds == NULL) error_exit(1, "Failed to initialize XDS context: %s\n", strerror(errno)); if (xds_register(xds, "int32", &xdr_decode_int32, NULL) != XDS_OK || xds_register(xds, "uint32", &xdr_decode_uint32, NULL) != XDS_OK || xds_register(xds, "string", &xdr_decode_string, NULL) != XDS_OK) error_exit(1, "Failed to register my decoding engines!\n"); if (xds_setbuffer(xds, XDS_LOAN, buffer, buffer_len) != XDS_OK) error_exit(1, "setbuffer() failed.\n"); if (xds_decode(xds, "int32 uint32 string", &int32, &uint32, &string) != XDS_OK) error_exit(1, "xds_decode() failed!\n"); xds_destroy(xds); fprintf(stderr, "Decoded data:\n"); fprintf(stderr, "\tint32 = %d\n", int32); fprintf(stderr, "\tuint32 = 0x%x\n", uint32); fprintf(stderr, "\tstring = \"%s\"\n", string); free(string); return 0; } Index: ossp-pkg/srpc/libxds/docs/encode.c ============================================================ $ cvs update -p -r1.1 encode.c #include #include #include #include #include static void error_exit(int rc, const char* msg, ...) { va_list args; va_start(args, msg); vfprintf(stderr, msg, args); va_end(args); exit(rc); } int main() { xds_t* xds; char* buffer; size_t buffer_size; xds_int32_t int32 = -42; xds_uint32_t uint32 = 0x12345678; const char* string = "This is a test."; xds = xds_init(XDS_ENCODE); if (xds == NULL) error_exit(1, "Failed to initialize XDS context: %s\n", strerror(errno)); if (xds_register(xds, "int32", &xdr_encode_int32, NULL) != XDS_OK || xds_register(xds, "uint32", &xdr_encode_uint32, NULL) != XDS_OK || xds_register(xds, "string", &xdr_encode_string, NULL) != XDS_OK) error_exit(1, "Failed to register my encoding engines!\n"); if (xds_encode(xds, "int32 uint32 string", int32, uint32, string) != XDS_OK) error_exit(1, "xds_encode() failed!\n"); if (xds_getbuffer(xds, XDS_GIFT, (void**)&buffer, &buffer_size) != XDS_OK) error_exit(1, "getbuffer() failed.\n"); xds_destroy(xds); write(STDOUT_FILENO, buffer, buffer_size); fprintf(stderr, "Encoded data:\n"); fprintf(stderr, "\tint32 = %d\n", int32); fprintf(stderr, "\tuint32 = 0x%x\n", uint32); fprintf(stderr, "\tstring = \"%s\"\n", string); return 0; } From ossp-cvs-owner@ossp.org Thu Aug 2 14:19:36 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f72CJYG04593; Thu, 2 Aug 2001 14:19:34 +0200 (CEST) Date: Thu, 2 Aug 2001 14:19:34 +0200 (CEST) Message-Id: <200108021219.f72CJYG04593@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds/docs architecture.dia architecture.ep... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 02-Aug-2001 14:19:34 Branch: HEAD Handle: 2001080213193300 Added files: ossp-pkg/srpc/libxds/docs architecture.dia architecture.eps data-exchange.dia data-exchange.eps Log: Diagrams used in the documentation. Summary: Revision Changes Path 1.1 +2 -0 ossp-pkg/srpc/libxds/docs/architecture.dia 1.1 +569 -0 ossp-pkg/srpc/libxds/docs/architecture.eps 1.1 +14 -0 ossp-pkg/srpc/libxds/docs/data-exchange.dia 1.1 +485 -0 ossp-pkg/srpc/libxds/docs/data-exchange.eps ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/docs/architecture.dia ============================================================ $ cvs update -p -r1.1 architecture.dia #A4##xds_init()##xds_destroy()##xds_encode()##xds_getbuffer()##xds_setbuffer()##xds_unregister()##xds_register()##xds_decode()##engines##buffer##mode##Framework##Context##xdr_encode_int32()##xdr_decode_int32()##xml_encode_int32()##xml_decode_unt32()##XML Engines##XDR engines# Index: ossp-pkg/srpc/libxds/docs/architecture.eps ============================================================ $ cvs update -p -r1.1 architecture.eps %!PS-Adobe-2.0 EPSF-2.0 %%Title: architecture.dia %%Creator: Dia v0.88.1 %%CreationDate: Tue Jul 31 14:23:46 2001 %%For: simons %%Magnification: 1.0000 %%Orientation: Portrait %%BoundingBox: 0 0 1279 542 %%Pages: 1 %%BeginSetup %%EndSetup %%EndComments %%BeginProlog [ /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quoteright /parenleft /parenright /asterisk /plus /comma /hyphen /period /slash /zero /one /two /three /four /five /six /seven /eight /nine /colon /semicolon /less /equal /greater /question /at /A /B /C /D /E /F /G /H /I /J /K /L /M /N /O /P /Q /R /S /T /U /V /W /X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore /quoteleft /a /b /c /d /e /f /g /h /i /j /k /l /m /n /o /p /q /r /s /t /u /v /w /x /y /z /braceleft /bar /braceright /asciitilde /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /space /exclamdown /cent /sterling /currency /yen /brokenbar /section /dieresis /copyright /ordfeminine /guillemotleft /logicalnot /hyphen /registered /macron /degree /plusminus /twosuperior /threesuperior /acute /mu /paragraph /periodcentered /cedilla /onesuperior /ordmasculine /guillemotright /onequarter /onehalf /threequarters /questiondown /Agrave /Aacute /Acircumflex /Atilde /Adieresis /Aring /AE /Ccedilla /Egrave /Eacute /Ecircumflex /Edieresis /Igrave /Iacute /Icircumflex /Idieresis /Eth /Ntilde /Ograve /Oacute /Ocircumflex /Otilde /Odieresis /multiply /Oslash /Ugrave /Uacute /Ucircumflex /Udieresis /Yacute /Thorn /germandbls /agrave /aacute /acircumflex /atilde /adieresis /aring /ae /ccedilla /egrave /eacute /ecircumflex /edieresis /igrave /iacute /icircumflex /idieresis /eth /ntilde /ograve /oacute /ocircumflex /otilde /odieresis /divide /oslash /ugrave /uacute /ucircumflex /udieresis /yacute /thorn /ydieresis] /isolatin1encoding exch def /Times-Roman-latin1 /Times-Roman findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /Times-Italic-latin1 /Times-Italic findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /Times-Bold-latin1 /Times-Bold findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /Times-BoldItalic-latin1 /Times-BoldItalic findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /AvantGarde-Book-latin1 /AvantGarde-Book findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /AvantGarde-BookOblique-latin1 /AvantGarde-BookOblique findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /AvantGarde-Demi-latin1 /AvantGarde-Demi findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /AvantGarde-DemiOblique-latin1 /AvantGarde-DemiOblique findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /Bookman-Light-latin1 /Bookman-Light findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /Bookman-LightItalic-latin1 /Bookman-LightItalic findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /Bookman-Demi-latin1 /Bookman-Demi findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /Bookman-DemiItalic-latin1 /Bookman-DemiItalic findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /Courier-latin1 /Courier findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /Courier-Oblique-latin1 /Courier-Oblique findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /Courier-Bold-latin1 /Courier-Bold findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /Courier-BoldOblique-latin1 /Courier-BoldOblique findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /Helvetica-latin1 /Helvetica findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /Helvetica-Oblique-latin1 /Helvetica-Oblique findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /Helvetica-Bold-latin1 /Helvetica-Bold findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /Helvetica-BoldOblique-latin1 /Helvetica-BoldOblique findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /Helvetica-Narrow-latin1 /Helvetica-Narrow findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /Helvetica-Narrow-Oblique-latin1 /Helvetica-Narrow-Oblique findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /Helvetica-Narrow-Bold-latin1 /Helvetica-Narrow-Bold findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /Helvetica-Narrow-BoldOblique-latin1 /Helvetica-Narrow-BoldOblique findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /NewCenturySchoolbook-Roman-latin1 /NewCenturySchoolbook-Roman findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /NewCenturySchoolbook-Italic-latin1 /NewCenturySchoolbook-Italic findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /NewCenturySchoolbook-Bold-latin1 /NewCenturySchoolbook-Bold findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /NewCenturySchoolbook-BoldItalic-latin1 /NewCenturySchoolbook-BoldItalic findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /Palatino-Roman-latin1 /Palatino-Roman findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /Palatino-Italic-latin1 /Palatino-Italic findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /Palatino-Bold-latin1 /Palatino-Bold findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /Palatino-BoldItalic-latin1 /Palatino-BoldItalic findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /Symbol-latin1 /Symbol findfont definefont pop /ZapfChancery-MediumItalic-latin1 /ZapfChancery-MediumItalic findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /ZapfDingbats-latin1 /ZapfDingbats findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /cp {closepath} bind def /c {curveto} bind def /f {fill} bind def /a {arc} bind def /ef {eofill} bind def /ex {exch} bind def /gr {grestore} bind def /gs {gsave} bind def /sa {save} bind def /rs {restore} bind def /l {lineto} bind def /m {moveto} bind def /rm {rmoveto} bind def /n {newpath} bind def /s {stroke} bind def /sh {show} bind def /slc {setlinecap} bind def /slj {setlinejoin} bind def /slw {setlinewidth} bind def /srgb {setrgbcolor} bind def /rot {rotate} bind def /sc {scale} bind def /sd {setdash} bind def /ff {findfont} bind def /sf {setfont} bind def /scf {scalefont} bind def /sw {stringwidth pop} bind def /tr {translate} bind def /ellipsedict 8 dict def ellipsedict /mtrx matrix put /ellipse { ellipsedict begin /endangle exch def /startangle exch def /yrad exch def /xrad exch def /y exch def /x exch def /savematrix mtrx currentmatrix def x y tr xrad yrad sc 0 0 1 startangle endangle arc savematrix setmatrix end } def /mergeprocs { dup length 3 -1 roll dup length dup 5 1 roll 3 -1 roll add array cvx dup 3 -1 roll 0 exch putinterval dup 4 2 roll putinterval } bind def 28.346000 -28.346000 scale -0.950000 -25.050000 translate %%EndProlog 1.000000 1.000000 1.000000 srgb n 32.000000 16.000000 m 32.000000 25.000000 l 46.000000 25.000000 l 46.000000 16.000000 l f 0.100000 slw [] 0 sd [] 0 sd 0 slj 0.000000 0.000000 0.000000 srgb n 32.000000 16.000000 m 32.000000 25.000000 l 46.000000 25.000000 l 46.000000 16.000000 l cp s 1.000000 1.000000 1.000000 srgb n 32.000000 6.000000 m 32.000000 15.000000 l 46.000000 15.000000 l 46.000000 6.000000 l f 0.100000 slw [] 0 sd [] 0 sd 0 slj 0.000000 0.000000 0.000000 srgb n 32.000000 6.000000 m 32.000000 15.000000 l 46.000000 15.000000 l 46.000000 6.000000 l cp s 1.000000 1.000000 1.000000 srgb n 19.000000 11.000000 m 19.000000 20.000000 l 28.000000 20.000000 l 28.000000 11.000000 l f 0.100000 slw [] 0 sd [] 0 sd 0 slj 0.000000 0.000000 0.000000 srgb n 19.000000 11.000000 m 19.000000 20.000000 l 28.000000 20.000000 l 28.000000 11.000000 l cp s 1.000000 1.000000 1.000000 srgb n 1.000000 6.000000 m 1.000000 25.000000 l 15.000000 25.000000 l 15.000000 6.000000 l f 0.100000 slw [] 0 sd [] 0 sd 0 slj 0.000000 0.000000 0.000000 srgb n 1.000000 6.000000 m 1.000000 25.000000 l 15.000000 25.000000 l 15.000000 6.000000 l cp s 1.000000 1.000000 1.000000 srgb n 4.000000 8.000000 m 4.000000 10.000000 l 14.000000 10.000000 l 14.000000 8.000000 l f 0.100000 slw [] 0 sd [] 0 sd 0 slj 0.000000 0.000000 0.000000 srgb n 4.000000 8.000000 m 4.000000 10.000000 l 14.000000 10.000000 l 14.000000 8.000000 l cp s /Courier-latin1 ff 0.800000 scf sf (xds_init\(\)) dup sw 2 div 9.000000 ex sub 9.234483 m gs 1 -1 sc sh gr 1.000000 1.000000 1.000000 srgb n 4.000000 10.000000 m 4.000000 12.000000 l 14.000000 12.000000 l 14.000000 10.000000 l f 0.100000 slw [] 0 sd [] 0 sd 0 slj 0.000000 0.000000 0.000000 srgb n 4.000000 10.000000 m 4.000000 12.000000 l 14.000000 12.000000 l 14.000000 10.000000 l cp s /Courier-latin1 ff 0.800000 scf sf (xds_destroy\(\)) dup sw 2 div 9.000000 ex sub 11.234483 m gs 1 -1 sc sh gr 1.000000 1.000000 1.000000 srgb n 4.000000 20.000000 m 4.000000 22.000000 l 14.000000 22.000000 l 14.000000 20.000000 l f 0.100000 slw [] 0 sd [] 0 sd 0 slj 0.000000 0.000000 0.000000 srgb n 4.000000 20.000000 m 4.000000 22.000000 l 14.000000 22.000000 l 14.000000 20.000000 l cp s /Courier-latin1 ff 0.800000 scf sf (xds_encode\(\)) dup sw 2 div 9.000000 ex sub 21.234483 m gs 1 -1 sc sh gr 1.000000 1.000000 1.000000 srgb n 4.000000 18.000000 m 4.000000 20.000000 l 14.000000 20.000000 l 14.000000 18.000000 l f 0.100000 slw [] 0 sd [] 0 sd 0 slj 0.000000 0.000000 0.000000 srgb n 4.000000 18.000000 m 4.000000 20.000000 l 14.000000 20.000000 l 14.000000 18.000000 l cp s /Courier-latin1 ff 0.800000 scf sf (xds_getbuffer\(\)) dup sw 2 div 9.000000 ex sub 19.234483 m gs 1 -1 sc sh gr 1.000000 1.000000 1.000000 srgb n 4.000000 16.000000 m 4.000000 18.000000 l 14.000000 18.000000 l 14.000000 16.000000 l f 0.100000 slw [] 0 sd [] 0 sd 0 slj 0.000000 0.000000 0.000000 srgb n 4.000000 16.000000 m 4.000000 18.000000 l 14.000000 18.000000 l 14.000000 16.000000 l cp s /Courier-latin1 ff 0.800000 scf sf (xds_setbuffer\(\)) dup sw 2 div 9.000000 ex sub 17.234483 m gs 1 -1 sc sh gr 1.000000 1.000000 1.000000 srgb n 4.000000 14.000000 m 4.000000 16.000000 l 14.000000 16.000000 l 14.000000 14.000000 l f 0.100000 slw [] 0 sd [] 0 sd 0 slj 0.000000 0.000000 0.000000 srgb n 4.000000 14.000000 m 4.000000 16.000000 l 14.000000 16.000000 l 14.000000 14.000000 l cp s /Courier-latin1 ff 0.800000 scf sf (xds_unregister\(\)) dup sw 2 div 9.000000 ex sub 15.234483 m gs 1 -1 sc sh gr 1.000000 1.000000 1.000000 srgb n 4.000000 12.000000 m 4.000000 14.000000 l 14.000000 14.000000 l 14.000000 12.000000 l f 0.100000 slw [] 0 sd [] 0 sd 0 slj 0.000000 0.000000 0.000000 srgb n 4.000000 12.000000 m 4.000000 14.000000 l 14.000000 14.000000 l 14.000000 12.000000 l cp s /Courier-latin1 ff 0.800000 scf sf (xds_register\(\)) dup sw 2 div 9.000000 ex sub 13.234483 m gs 1 -1 sc sh gr 1.000000 1.000000 1.000000 srgb n 4.000000 22.000000 m 4.000000 24.000000 l 14.000000 24.000000 l 14.000000 22.000000 l f 0.100000 slw [] 0 sd [] 0 sd 0 slj 0.000000 0.000000 0.000000 srgb n 4.000000 22.000000 m 4.000000 24.000000 l 14.000000 24.000000 l 14.000000 22.000000 l cp s /Courier-latin1 ff 0.800000 scf sf (xds_decode\(\)) dup sw 2 div 9.000000 ex sub 23.234483 m gs 1 -1 sc sh gr 1.000000 1.000000 1.000000 srgb n 21.000000 15.000000 m 21.000000 17.000000 l 27.000000 17.000000 l 27.000000 15.000000 l f 0.100000 slw [] 0 sd [] 0 sd 0 slj 0.000000 0.000000 0.000000 srgb n 21.000000 15.000000 m 21.000000 17.000000 l 27.000000 17.000000 l 27.000000 15.000000 l cp s /Courier-latin1 ff 0.800000 scf sf (engines) dup sw 2 div 24.000000 ex sub 16.234483 m gs 1 -1 sc sh gr 1.000000 1.000000 1.000000 srgb n 21.000000 17.000000 m 21.000000 19.000000 l 27.000000 19.000000 l 27.000000 17.000000 l f 0.100000 slw [] 0 sd [] 0 sd 0 slj 0.000000 0.000000 0.000000 srgb n 21.000000 17.000000 m 21.000000 19.000000 l 27.000000 19.000000 l 27.000000 17.000000 l cp s /Courier-latin1 ff 0.800000 scf sf (buffer) dup sw 2 div 24.000000 ex sub 18.234483 m gs 1 -1 sc sh gr 1.000000 1.000000 1.000000 srgb n 21.000000 13.000000 m 21.000000 15.000000 l 27.000000 15.000000 l 27.000000 13.000000 l f 0.100000 slw [] 0 sd [] 0 sd 0 slj 0.000000 0.000000 0.000000 srgb n 21.000000 13.000000 m 21.000000 15.000000 l 27.000000 15.000000 l 27.000000 13.000000 l cp s /Courier-latin1 ff 0.800000 scf sf (mode) dup sw 2 div 24.000000 ex sub 14.234483 m gs 1 -1 sc sh gr /Times-Roman-latin1 ff 1.000000 scf sf (Framework) dup sw 2 div 3.750000 ex sub 7.300000 m gs 1 -1 sc sh gr /Times-Roman-latin1 ff 1.000000 scf sf (Context) dup sw 2 div 20.850000 ex sub 12.200000 m gs 1 -1 sc sh gr 1.000000 1.000000 1.000000 srgb n 34.000000 8.000000 m 34.000000 10.000000 l 45.000000 10.000000 l 45.000000 8.000000 l f 0.100000 slw [] 0 sd [] 0 sd 0 slj 0.000000 0.000000 0.000000 srgb n 34.000000 8.000000 m 34.000000 10.000000 l 45.000000 10.000000 l 45.000000 8.000000 l cp s /Courier-latin1 ff 0.800000 scf sf (xdr_encode_int32\(\)) dup sw 2 div 39.500000 ex sub 9.234483 m gs 1 -1 sc sh gr 1.000000 1.000000 1.000000 srgb n 34.000000 10.000000 m 34.000000 12.000000 l 45.000000 12.000000 l 45.000000 10.000000 l f 0.100000 slw [] 0 sd [] 0 sd 0 slj 0.000000 0.000000 0.000000 srgb n 34.000000 10.000000 m 34.000000 12.000000 l 45.000000 12.000000 l 45.000000 10.000000 l cp s /Courier-latin1 ff 0.800000 scf sf (xdr_decode_int32\(\)) dup sw 2 div 39.500000 ex sub 11.234483 m gs 1 -1 sc sh gr 1.000000 1.000000 1.000000 srgb n 34.000000 18.000000 m 34.000000 20.000000 l 45.000000 20.000000 l 45.000000 18.000000 l f 0.100000 slw [] 0 sd [] 0 sd 0 slj 0.000000 0.000000 0.000000 srgb n 34.000000 18.000000 m 34.000000 20.000000 l 45.000000 20.000000 l 45.000000 18.000000 l cp s /Courier-latin1 ff 0.800000 scf sf (xml_encode_int32\(\)) dup sw 2 div 39.500000 ex sub 19.234483 m gs 1 -1 sc sh gr 1.000000 1.000000 1.000000 srgb n 34.000000 20.000000 m 34.000000 22.000000 l 45.000000 22.000000 l 45.000000 20.000000 l f 0.100000 slw [] 0 sd [] 0 sd 0 slj 0.000000 0.000000 0.000000 srgb n 34.000000 20.000000 m 34.000000 22.000000 l 45.000000 22.000000 l 45.000000 20.000000 l cp s /Courier-latin1 ff 0.800000 scf sf (xml_decode_unt32\(\)) dup sw 2 div 39.500000 ex sub 21.234483 m gs 1 -1 sc sh gr /Times-Roman-latin1 ff 1.000000 scf sf (XML Engines) dup sw 2 div 35.135600 ex sub 17.299118 m gs 1 -1 sc sh gr /Times-Roman-latin1 ff 1.000000 scf sf (XDR engines) dup sw 2 div 34.985600 ex sub 7.349118 m gs 1 -1 sc sh gr n 39.434315 24.059358 0.106066 0.100161 0 360 ellipse f 0.100000 slw [] 0 sd [] 0 sd n 39.434315 24.059358 0.106066 0.100161 0 360 ellipse cp s n 39.434315 23.456016 0.106066 0.100161 0 360 ellipse f 0.100000 slw [] 0 sd [] 0 sd n 39.434315 23.456016 0.106066 0.100161 0 360 ellipse cp s n 39.434315 22.852674 0.106066 0.100161 0 360 ellipse f 0.100000 slw [] 0 sd [] 0 sd n 39.434315 22.852674 0.106066 0.100161 0 360 ellipse cp s n 39.518566 14.037661 0.106066 0.100161 0 360 ellipse f 0.100000 slw [] 0 sd [] 0 sd n 39.518566 14.037661 0.106066 0.100161 0 360 ellipse cp s n 39.518566 13.434319 0.106066 0.100161 0 360 ellipse f 0.100000 slw [] 0 sd [] 0 sd n 39.518566 13.434319 0.106066 0.100161 0 360 ellipse cp s n 39.518566 12.830977 0.106066 0.100161 0 360 ellipse f 0.100000 slw [] 0 sd [] 0 sd n 39.518566 12.830977 0.106066 0.100161 0 360 ellipse cp s showpage Index: ossp-pkg/srpc/libxds/docs/data-exchange.dia ============================================================ $ cvs update -p -r1.1 data-exchange.dia #A4##Network##$1234##libxds##libxds##$1234##The value in Host A's representation##Transfer encoded value over the network.##Encode value from host format to standard format.##The value in Host B's representation##Decode value from standard format to host format.# Index: ossp-pkg/srpc/libxds/docs/data-exchange.eps ============================================================ $ cvs update -p -r1.1 data-exchange.eps %!PS-Adobe-2.0 EPSF-2.0 %%Title: /home/simons/projects/srpc/libxds/docs/data-exchange.dia %%Creator: Dia v0.88.1 %%CreationDate: Tue Jul 31 15:42:54 2001 %%For: simons %%Magnification: 1.0000 %%Orientation: Portrait %%BoundingBox: 0 0 1244 483 %%Pages: 1 %%BeginSetup %%EndSetup %%EndComments %%BeginProlog [ /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quoteright /parenleft /parenright /asterisk /plus /comma /hyphen /period /slash /zero /one /two /three /four /five /six /seven /eight /nine /colon /semicolon /less /equal /greater /question /at /A /B /C /D /E /F /G /H /I /J /K /L /M /N /O /P /Q /R /S /T /U /V /W /X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore /quoteleft /a /b /c /d /e /f /g /h /i /j /k /l /m /n /o /p /q /r /s /t /u /v /w /x /y /z /braceleft /bar /braceright /asciitilde /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /space /exclamdown /cent /sterling /currency /yen /brokenbar /section /dieresis /copyright /ordfeminine /guillemotleft /logicalnot /hyphen /registered /macron /degree /plusminus /twosuperior /threesuperior /acute /mu /paragraph /periodcentered /cedilla /onesuperior /ordmasculine /guillemotright /onequarter /onehalf /threequarters /questiondown /Agrave /Aacute /Acircumflex /Atilde /Adieresis /Aring /AE /Ccedilla /Egrave /Eacute /Ecircumflex /Edieresis /Igrave /Iacute /Icircumflex /Idieresis /Eth /Ntilde /Ograve /Oacute /Ocircumflex /Otilde /Odieresis /multiply /Oslash /Ugrave /Uacute /Ucircumflex /Udieresis /Yacute /Thorn /germandbls /agrave /aacute /acircumflex /atilde /adieresis /aring /ae /ccedilla /egrave /eacute /ecircumflex /edieresis /igrave /iacute /icircumflex /idieresis /eth /ntilde /ograve /oacute /ocircumflex /otilde /odieresis /divide /oslash /ugrave /uacute /ucircumflex /udieresis /yacute /thorn /ydieresis] /isolatin1encoding exch def /Times-Roman-latin1 /Times-Roman findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /Times-Italic-latin1 /Times-Italic findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /Times-Bold-latin1 /Times-Bold findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /Times-BoldItalic-latin1 /Times-BoldItalic findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /AvantGarde-Book-latin1 /AvantGarde-Book findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /AvantGarde-BookOblique-latin1 /AvantGarde-BookOblique findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /AvantGarde-Demi-latin1 /AvantGarde-Demi findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /AvantGarde-DemiOblique-latin1 /AvantGarde-DemiOblique findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /Bookman-Light-latin1 /Bookman-Light findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /Bookman-LightItalic-latin1 /Bookman-LightItalic findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /Bookman-Demi-latin1 /Bookman-Demi findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /Bookman-DemiItalic-latin1 /Bookman-DemiItalic findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /Courier-latin1 /Courier findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /Courier-Oblique-latin1 /Courier-Oblique findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /Courier-Bold-latin1 /Courier-Bold findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /Courier-BoldOblique-latin1 /Courier-BoldOblique findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /Helvetica-latin1 /Helvetica findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /Helvetica-Oblique-latin1 /Helvetica-Oblique findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /Helvetica-Bold-latin1 /Helvetica-Bold findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /Helvetica-BoldOblique-latin1 /Helvetica-BoldOblique findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /Helvetica-Narrow-latin1 /Helvetica-Narrow findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /Helvetica-Narrow-Oblique-latin1 /Helvetica-Narrow-Oblique findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /Helvetica-Narrow-Bold-latin1 /Helvetica-Narrow-Bold findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /Helvetica-Narrow-BoldOblique-latin1 /Helvetica-Narrow-BoldOblique findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /NewCenturySchoolbook-Roman-latin1 /NewCenturySchoolbook-Roman findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /NewCenturySchoolbook-Italic-latin1 /NewCenturySchoolbook-Italic findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /NewCenturySchoolbook-Bold-latin1 /NewCenturySchoolbook-Bold findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /NewCenturySchoolbook-BoldItalic-latin1 /NewCenturySchoolbook-BoldItalic findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /Palatino-Roman-latin1 /Palatino-Roman findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /Palatino-Italic-latin1 /Palatino-Italic findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /Palatino-Bold-latin1 /Palatino-Bold findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /Palatino-BoldItalic-latin1 /Palatino-BoldItalic findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /Symbol-latin1 /Symbol findfont definefont pop /ZapfChancery-MediumItalic-latin1 /ZapfChancery-MediumItalic findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /ZapfDingbats-latin1 /ZapfDingbats findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /cp {closepath} bind def /c {curveto} bind def /f {fill} bind def /a {arc} bind def /ef {eofill} bind def /ex {exch} bind def /gr {grestore} bind def /gs {gsave} bind def /sa {save} bind def /rs {restore} bind def /l {lineto} bind def /m {moveto} bind def /rm {rmoveto} bind def /n {newpath} bind def /s {stroke} bind def /sh {show} bind def /slc {setlinecap} bind def /slj {setlinejoin} bind def /slw {setlinewidth} bind def /srgb {setrgbcolor} bind def /rot {rotate} bind def /sc {scale} bind def /sd {setdash} bind def /ff {findfont} bind def /sf {setfont} bind def /scf {scalefont} bind def /sw {stringwidth pop} bind def /tr {translate} bind def /ellipsedict 8 dict def ellipsedict /mtrx matrix put /ellipse { ellipsedict begin /endangle exch def /startangle exch def /yrad exch def /xrad exch def /y exch def /x exch def /savematrix mtrx currentmatrix def x y tr xrad yrad sc 0 0 1 startangle endangle arc savematrix setmatrix end } def /mergeprocs { dup length 3 -1 roll dup length dup 5 1 roll 3 -1 roll add array cvx dup 3 -1 roll 0 exch putinterval dup 4 2 roll putinterval } bind def 28.346000 -28.346000 scale -9.066950 -17.005000 translate %%EndProlog 0.100000 slw [] 0 sd [] 0 sd 0 slc 0 slj 0 slc 0 slj [] 0 sd 1.000000 1.000000 1.000000 srgb n 28.578343 13.328139 m 28.029049 13.317177 26.963752 13.547390 27.113560 14.040704 c 27.263366 14.534017 27.979113 14.643638 28.278728 14.501130 c 28.578343 14.358617 27.812660 15.191765 29.277445 15.411015 c 30.742216 15.630266 31.491254 15.279465 31.274865 15.027327 c 31.058477 14.775189 32.556552 15.619304 33.255654 15.136952 c 33.954756 14.654601 32.539907 14.194179 32.839522 14.259954 c 33.139137 14.325729 34.054627 14.238029 33.755012 13.415840 c 33.455397 12.593650 30.758861 13.229477 31.058477 13.108889 c 31.358092 12.988301 30.609054 12.385361 29.676932 12.505949 c 28.744796 12.626537 28.678681 12.845360 28.578809 13.327712 c 28.578343 13.328139 l f 0.000000 0.000000 0.000000 srgb n 28.578343 13.328139 m 28.029049 13.317177 26.963752 13.547390 27.113560 14.040704 c 27.263366 14.534017 27.979113 14.643638 28.278728 14.501130 c 28.578343 14.358617 27.812660 15.191765 29.277445 15.411015 c 30.742216 15.630266 31.491254 15.279465 31.274865 15.027327 c 31.058477 14.775189 32.556552 15.619304 33.255654 15.136952 c 33.954756 14.654601 32.539907 14.194179 32.839522 14.259954 c 33.139137 14.325729 34.054627 14.238029 33.755012 13.415840 c 33.455397 12.593650 30.758861 13.229477 31.058477 13.108889 c 31.358092 12.988301 30.609054 12.385361 29.676932 12.505949 c 28.744796 12.626537 28.678681 12.845360 28.578809 13.327712 c 28.578343 13.328139 l s /Helvetica-latin1 ff 0.800000 scf sf (Network) dup sw 2 div 30.699271 ex sub 14.305014 m gs 1 -1 sc sh gr 1.000000 1.000000 1.000000 srgb n 11.000000 8.000000 m 11.000000 10.000000 l 14.724000 10.000000 l 14.724000 8.000000 l f 0.100000 slw [] 0 sd [] 0 sd 0 slj 0.000000 0.000000 0.000000 srgb n 11.000000 8.000000 m 11.000000 10.000000 l 14.724000 10.000000 l 14.724000 8.000000 l cp s /Helvetica-latin1 ff 0.800000 scf sf ($1234) dup sw 2 div 12.862000 ex sub 9.240000 m gs 1 -1 sc sh gr 0.100000 slw [] 0 sd 1.000000 1.000000 1.000000 srgb n 18.250000 12.222453 m 18.250000 15.722453 l 22.237680 15.722453 l 22.237680 12.222453 l f 0.000000 0.000000 0.000000 srgb n 18.250000 12.222453 m 18.250000 15.722453 l 22.237680 15.722453 l 22.237680 12.222453 l cp s 1.000000 1.000000 1.000000 srgb n 17.250000 12.922453 m 17.250000 13.622453 l 19.250000 13.622453 l 19.250000 12.922453 l f 0.000000 0.000000 0.000000 srgb n 17.250000 12.922453 m 17.250000 13.622453 l 19.250000 13.622453 l 19.250000 12.922453 l cp s 1.000000 1.000000 1.000000 srgb n 17.250000 14.322453 m 17.250000 15.022453 l 19.250000 15.022453 l 19.250000 14.322453 l f 0.000000 0.000000 0.000000 srgb n 17.250000 14.322453 m 17.250000 15.022453 l 19.250000 15.022453 l 19.250000 14.322453 l cp s /Helvetica-latin1 ff 0.800000 scf sf (libxds) 19.650000 13.562453 m gs 1 -1 sc sh gr 0.100000 slw [] 0 sd 1.000000 1.000000 1.000000 srgb n 40.000000 12.222453 m 40.000000 15.722453 l 43.987680 15.722453 l 43.987680 12.222453 l f 0.000000 0.000000 0.000000 srgb n 40.000000 12.222453 m 40.000000 15.722453 l 43.987680 15.722453 l 43.987680 12.222453 l cp s 1.000000 1.000000 1.000000 srgb n 39.000000 12.922453 m 39.000000 13.622453 l 41.000000 13.622453 l 41.000000 12.922453 l f 0.000000 0.000000 0.000000 srgb n 39.000000 12.922453 m 39.000000 13.622453 l 41.000000 13.622453 l 41.000000 12.922453 l cp s 1.000000 1.000000 1.000000 srgb n 39.000000 14.322453 m 39.000000 15.022453 l 41.000000 15.022453 l 41.000000 14.322453 l f 0.000000 0.000000 0.000000 srgb n 39.000000 14.322453 m 39.000000 15.022453 l 41.000000 15.022453 l 41.000000 14.322453 l cp s /Helvetica-latin1 ff 0.800000 scf sf (libxds) 41.400000 13.562453 m gs 1 -1 sc sh gr 1.000000 1.000000 1.000000 srgb n 47.000000 8.000000 m 47.000000 10.000000 l 50.724000 10.000000 l 50.724000 8.000000 l f 0.100000 slw [] 0 sd [] 0 sd 0 slj 0.000000 0.000000 0.000000 srgb n 47.000000 8.000000 m 47.000000 10.000000 l 50.724000 10.000000 l 50.724000 8.000000 l cp s /Helvetica-latin1 ff 0.800000 scf sf ($1234) dup sw 2 div 48.862000 ex sub 9.240000 m gs 1 -1 sc sh gr 0.100000 slw [] 0 sd [] 0 sd 0 slc n 17.544095 9.237859 4.743719 4.743719 93.554427 170.754606 ellipse s 0 slj n 16.426740 14.322086 m 17.250000 13.972453 l 16.476338 13.523625 l f 0.100000 slw [] 0 sd [] 0 sd 0 slc n 43.739542 8.691284 5.286995 5.286995 14.331690 87.309911 ellipse s 0 slj n 49.051524 10.874117 m 48.862000 10.000000 l 48.276420 10.676089 l f 0.100000 slw [] 0 sd [] 0 sd 0 slc n 22.237680 13.972453 m 27.096130 13.959822 l s 0 slj n 26.297172 14.361901 m 27.096130 13.959822 l 26.295092 13.561903 l f 0.100000 slw [] 0 sd [] 0 sd 0 slc n 33.781947 13.996742 m 38.931947 13.984242 l s 0 slj n 38.132920 14.386182 m 38.931947 13.984242 l 38.130978 13.586185 l f /Times-Roman-latin1 ff 1.000000 scf sf (The value in) dup sw 2 div 12.000000 ex sub 1.000000 m gs 1 -1 sc sh gr (Host A's) dup sw 2 div 12.000000 ex sub 2.000000 m gs 1 -1 sc sh gr (representation) dup sw 2 div 12.000000 ex sub 3.000000 m gs 1 -1 sc sh gr 0.010000 slw [0.200000] 0 sd [0.200000] 0 sd 0 slc n 16.000000 0.000000 m 16.000000 17.000000 l s 0.010000 slw [0.200000] 0 sd [0.200000] 0 sd 0 slc n 46.000000 0.000000 m 46.000000 17.000000 l s 0.010000 slw [0.200000] 0 sd [0.200000] 0 sd 0 slc n 36.000000 0.000000 m 36.000000 17.000000 l s 0.010000 slw [0.200000] 0 sd [0.200000] 0 sd 0 slc n 24.000000 0.000000 m 24.000000 17.000000 l s /Times-Roman-latin1 ff 1.000000 scf sf (Transfer encoded) dup sw 2 div 30.000000 ex sub 1.000000 m gs 1 -1 sc sh gr (value over the) dup sw 2 div 30.000000 ex sub 2.000000 m gs 1 -1 sc sh gr (network.) dup sw 2 div 30.000000 ex sub 3.000000 m gs 1 -1 sc sh gr /Times-Roman-latin1 ff 1.000000 scf sf (Encode value) dup sw 2 div 20.000000 ex sub 1.000000 m gs 1 -1 sc sh gr (from host) dup sw 2 div 20.000000 ex sub 2.000000 m gs 1 -1 sc sh gr (format to) dup sw 2 div 20.000000 ex sub 3.000000 m gs 1 -1 sc sh gr (standard format.) dup sw 2 div 20.000000 ex sub 4.000000 m gs 1 -1 sc sh gr /Times-Roman-latin1 ff 1.000000 scf sf (The value in) dup sw 2 div 50.000000 ex sub 1.000000 m gs 1 -1 sc sh gr (Host B's) dup sw 2 div 50.000000 ex sub 2.000000 m gs 1 -1 sc sh gr (representation) dup sw 2 div 50.000000 ex sub 3.000000 m gs 1 -1 sc sh gr /Times-Roman-latin1 ff 1.000000 scf sf (Decode value) dup sw 2 div 41.000000 ex sub 1.000000 m gs 1 -1 sc sh gr (from standard) dup sw 2 div 41.000000 ex sub 2.000000 m gs 1 -1 sc sh gr (format to host) dup sw 2 div 41.000000 ex sub 3.000000 m gs 1 -1 sc sh gr (format.) dup sw 2 div 41.000000 ex sub 4.000000 m gs 1 -1 sc sh gr showpage From ossp-cvs-owner@ossp.org Thu Aug 2 14:19:47 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f72CJln04639; Thu, 2 Aug 2001 14:19:47 +0200 (CEST) Date: Thu, 2 Aug 2001 14:19:47 +0200 (CEST) Message-Id: <200108021219.f72CJln04639@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds/docs .cvsignore Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 02-Aug-2001 14:19:47 Branch: HEAD Handle: 2001080213194600 Added files: ossp-pkg/srpc/libxds/docs .cvsignore Log: Ignore dependent files. Summary: Revision Changes Path 1.1 +2 -0 ossp-pkg/srpc/libxds/docs/.cvsignore ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/docs/.cvsignore ============================================================ $ cvs update -p -r1.1 .cvsignore libxds.aux libxds.dvi libxds.log libxds.ps encode decode From ossp-cvs-owner@ossp.org Thu Aug 2 15:57:14 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f72DvDE15342; Thu, 2 Aug 2001 15:57:13 +0200 (CEST) Date: Thu, 2 Aug 2001 15:57:13 +0200 (CEST) Message-Id: <200108021357.f72DvDE15342@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds/docs encode.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 02-Aug-2001 15:57:13 Branch: HEAD Handle: 2001080214571200 Modified files: ossp-pkg/srpc/libxds/docs encode.c Log: Free the buffer created by xds_encode() before leaving. Summary: Revision Changes Path 1.2 +2 -0 ossp-pkg/srpc/libxds/docs/encode.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/docs/encode.c ============================================================ $ cvs diff -u -r1.1 -r1.2 encode.c --- ossp-pkg/srpc/libxds/docs/encode.c 2001/08/02 12:19:14 1.1 +++ ossp-pkg/srpc/libxds/docs/encode.c 2001/08/02 13:57:12 1.2 @@ -42,6 +42,8 @@ write(STDOUT_FILENO, buffer, buffer_size); + free(buffer); + fprintf(stderr, "Encoded data:\n"); fprintf(stderr, "\tint32 = %d\n", int32); fprintf(stderr, "\tuint32 = 0x%x\n", uint32); From ossp-cvs-owner@ossp.org Thu Aug 2 15:58:09 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f72Dw7I15712; Thu, 2 Aug 2001 15:58:07 +0200 (CEST) Date: Thu, 2 Aug 2001 15:58:07 +0200 (CEST) Message-Id: <200108021358.f72Dw7I15712@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds/docs libxds.tex Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 02-Aug-2001 15:58:07 Branch: HEAD Handle: 2001080214580700 Added files: ossp-pkg/srpc/libxds/docs libxds.tex Log: Currently, the manual contains an introduction, a description of the architecture and two example programs demonstrating how to encode and decode. Much remains to be written. Summary: Revision Changes Path 1.1 +0 -0 ossp-pkg/srpc/libxds/docs/libxds.tex ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/docs/libxds.tex ============================================================ $ cvs update -p -r1.1 libxds.tex % -*- mode: LaTeX; fill-column: 75; -*- % % $Id: libxds.tex,v 1.1 2001/08/02 13:58:07 simons Exp $ % \documentclass[a4paper,10pt,pointlessnumbers,bibtotoc]{scrartcl} \usepackage[dvips,xdvi]{graphicx} \usepackage{fancyvrb} \typearea[2cm]{12} \fussy \begin{document} \subject{Cable \& Wireless Application Development} \title{XDS -- eXtensible Data Serialization} \author{Peter Simons $<$simons@computer.org$>$} \date{2001-08-01} \maketitle \section{Introduction} In today's networked world, computer systems of all brands and flavours communicate with each other. Unfortunately, these systems are far from being identical: Many systems use different internal representations for the same thing. Look at the (hexadecimal) number \$1234 for instance: On a big endian machine, this number will be stored in memory the way you'd intuitively expect: \$12~\$34 --- the more significant byte preceeds the less significant one. On a little endian machine, though, the number \$1234 will be stored like this: \$34~\$12 --- exactly the other way round. As a result, you cannot just write the number \$1234 to a socket and expect the other end to understand it correctly, because if the endians differ, the reader will read a different number than the writer sent. Things will get even more complicated when you start exchanging floating point numbers, for which about a dozen different encodings exist! Solving these problems is the domain of libxds; its purpose is to encode data in a way that allows this data to be exchanged between computer systems of different types. Assume you'd want to reliably transfer the value \$1234 from host A to host B. Then you would encode the value using libxds, transfer the encoded data via the network, and decode the value again at the other end. Every application that follows this process will read the correct value no matter what native representation its hosting platform uses internally. \begin{figure}[tbh] \begin{center} \includegraphics[width=\textwidth]{data-exchange.eps} \caption{Data exchange using libxds} \label{data exchange} \end{center} \end{figure} There is a rich variety of applications for such a functionality: libxds may be used to encode data before it is written to disk or read from the disk, it may be used to encode data to be exchanged between processes over the network, etc. Because of this variety, special attention has been paid to the library design. \paragraph{The library has been designed to be extensible.} The functionality is split into a generic encoding and decoding framework and a set of formatting engines. These engines can be plugged into the framework at run-time to actually encode and decode data. Because of this architecture, libxds can be customized to deploy any data format the developer sees fit. Included in the distribution are formatting engines for the XDR format specified in \cite{xdr} and for the XML format specified in \cite{xml}. \paragraph{The library is convenient to use.} An arbitrary number of variables can be encoded or decoded with one single function call. All memory management is done by libxds, the developer doesn't need bother to allocate or to manage buffers for the encoded or decoded data. Automatic buffer management can be switched off at run-time, though, for maximum performance. \paragraph{Performance.} Since all transferred data has to wander through libxds, the library has been written to encode and decode with maximim performance. The generic encoding framework adds almost no run-time overhead to the encoding process. If non-automatic buffer management has been selected, hardly anything but the actual formatting engines is executed. \paragraph{Robustness.} In order to verify that the library is working correctly, a set of regression tests is included in the distribution. The test suits will --- among other things --- encode known values and compare the result with the expected (correct) values. This ensures that libxds works correctly on any platform. \paragraph{Use standard formats.} The supported formats XDR and XML and widely known and accepted formats, which are most likely interoperable with other marshaling implementations. For XDR for example, it would be possible to encode data with libxds and to decode it with an entirely different XDR implementation or vice versa. \paragraph{Portability.} libxds has been written with portability in mind. Development took place on FreeBSD, Linux and Solaris; other platforms has been used to test the results. It is expected that libxds will compile and function on virtually any POSIX.1-compilant system with a moderately modern ISO-C compiler. Gnu's CC (gcc) is known to compile the library just fine. For maximum portability, GNU autoconf has been used to determine the target system's properties. \section{Architecture of libxds} \begin{figure}[htb] \begin{center} \includegraphics[width=\textwidth]{architecture.eps} \caption{Components of libxds} \label{libxds components} \end{center} \end{figure} The architecture of libxds is illustrated in figure~\ref{libxds components}. libxds consists of three components: The generic encoding and decoding framework, a set of formatting engines to encode and decode values in a certain forman, and a run-time context, which is used to manage buffers, registered engines, etc. In order to use the library, the first thing the developer has to do is to create a valid XDS context by calling {\sf xds\_init()}. The routine requires one parameter that determines whether to operate in encoding- or decoding mode. A context can be used for encoding or decoding only; it is not possible to use the same context for both operations. Once a valid XDS context has been obtained, the routine {\sf xds\_register()} can be used to register an arbitrary number of formatting engines within the context. A set of formatting engines has been included in the library. These routines will handle any elementary datatype included in the ISO-C language such as 32-bit integers, 64-bit integers, unsigned integers (of both 32- and 64-bit), floating point numbers, strings and octet streams. Once all required formatting engines are registered, the routines {\sf xds\_encode()} or {\sf xds\_\-decode()} may be used to actually perform the encoding or decoding process. Any data type for which a formatting engine has been registered can be handled by the library. This means, that it is possible for the developer to write custom formatting engines for any data type he desires to use and to register them in the context as long as these engines adhere to the {\sf xds\_engine\_t} interface defined in {\sf xds.h}. In particular it is possible to register meta formatting engines. That is a formatting engine designed to encode or decode structures --- data types which consist of several elementary data types. The formatting engine for such a structure will simply re-use the existing engines in order to encode or decode the whole structure. The clou here is that the meta engine doesn't even need to know \emph{which} low-level formatting engines are registered in order to use them. Hence, a meta engine may format the whole structure in XDR, XML, or any other format without needing to know anything about the details. This topic is addressed in great detail in section~\ref{meta engines} of this document, but before we come to that rather advanced topic, let us start by studying two simple examples of how data is encoded and decoded using libxds. \section{Using the XDS library} \subsection{Encoding} The following example program will encode three variables using the XDR formatting engines. The result of the process will then be written to the standard output stream, which can be redirected to a file or piped into the decoding program described in the next section. Just take a look at the source code for a moment, we will then go on to discuss all relevant sections line by line. \begin{Verbatim}[numbers=left,fontsize=\small,frame=lines] #include #include #include #include #include static void error_exit(int rc, const char* msg, ...) { va_list args; va_start(args, msg); vfprintf(stderr, msg, args); va_end(args); exit(rc); } int main() { xds_t* xds; char* buffer; size_t buffer_size; xds_int32_t int32 = -42; xds_uint32_t uint32 = 0x12345678; const char* string = "This is a test."; xds = xds_init(XDS_ENCODE); if (xds == NULL) error_exit(1, "Failed to initialize XDS context: %s\n", strerror(errno)); if (xds_register(xds, "int32", &xdr_encode_int32, NULL) != XDS_OK || xds_register(xds, "uint32", &xdr_encode_uint32, NULL) != XDS_OK || xds_register(xds, "string", &xdr_encode_string, NULL) != XDS_OK) error_exit(1, "Failed to register my encoding engines!\n"); if (xds_encode(xds, "int32 uint32 string", int32, uint32, string) != XDS_OK) error_exit(1, "xds_encode() failed!\n"); if (xds_getbuffer(xds, XDS_GIFT, (void**)&buffer, &buffer_size) != XDS_OK) error_exit(1, "getbuffer() failed.\n"); xds_destroy(xds); write(STDOUT_FILENO, buffer, buffer_size); free(buffer); fprintf(stderr, "Encoded data:\n"); fprintf(stderr, "\tint32 = %d\n", int32); fprintf(stderr, "\tuint32 = 0x%x\n", uint32); fprintf(stderr, "\tstring = \"%s\"\n", string); return 0; } \end{Verbatim} \paragraph{Lines 1--5.} The program starts by including several system headers, which define the prototypes for some routines we use. The most interesting header in our case is of course {\sf xds.h} --- the header of libxds. Please note that all declarations required to use libxds are included in that file. \paragraph{Lines 7--13.} The {\sf error\_exit()} routine is not relevant for the example; we just define it to make the rest of the source code shorter and easier to read. \paragraph{Lines 16--53.} This is the interesting part: The {\sf main()} routine. This function will create the variables to be encoded on the stack, assign values to them, initialize the XDS library, use it to encode the values, and write the result of the encoding process to the standard output stream. Read on for further details. \paragraph{Lines 26--28.} First of all we have to obtain a XDS context for all further operation. This is done by calling {\sf xds\_init()}. Since we intend to \emph{encode} data, we initialize the context in encoding mode. The only other mode of operation would be decoding mode, but this is demonstrated in the next section. All routines in libxds return a code from a small list of return codes defined in {\sf xds.h}, but {\sf xds\_init()} is different: It will return a pointer to an {\sf xds\_t} in case of success and {\sf NULL} in case of failure. One reason why {\sf xds\_init()} would fail is because it can't allocate the memory required to initialize the context. In this case, the system variable {\sf errno} is set to {\sf ENOMEM}. Another reason why {\sf xds\_init()} would fail is because the mode parameter is invalid, in which case {\sf errno} woulde be set to {\sf EINVAL}. If libxds has been compiled with assertions enabled, such an error would result in an assertion error, terminating the program with a diagnostic message immediately. \paragraph{Lines 30--33.} Once we have obtained a valid XDS context, we register the formatting engines we need. In this example, we'll encode a signed 32-bit integer, an unsigned 32-bit integer, and a string. We'll be using XDR encoding in this case, so the engines to register are {\sf xdr\_encode\_int32()}, {\sf xdr\_encode\_uint32()}, and {\sf xdr\_encode\_string()}. (A complete list of available formatting engines can be found in {\sf xds.h} or in section~\ref{xdr}~and~\ref{xml}. Please note that we could switch the deployed encoding format simply be using the corresponding {\sf xml\_encode\_XXX()} engines here. We could even mix XDR and XML encoding as we see fit but it's hard to think of a case where this would make sense. As you can see in the code, the developer is free to choose a name he'd like to register the engine under. These names may only contain alphanumerical characters plus the hyphon (``\verb#-#'') and the underscore (``\verb#_#''). You can choose any name you want, but it is recommended to follow the naming scheme of the corresponding formatting engine. Why this is recommended will be seen in section~\ref{meta engines}. \paragraph{Lines 35--36.} This is the place where the actual encoding takes place. As parameters, {\sf xds\_encode()} requires a valid encoding context plus a format string that describes how the following parameters are to be interpreted. While the concept is obviously identical to {\sf sprintf()}, the syntax is different. The format string may contain an arbitrary number of names, which are delimited by an arbitrary number of any character that is not a legal character for engine names. Thus you can delimit the names by colons, blanks, or whatever you like. For each valid engine name in the format string, a corresponding parameter must follow. What these parameters mean depends on the engine you're using. The engines provided with the libxds library will expect the value to encode, but theoretically developers are free to write formatting engines that expect virtually any kind of information here. More about this will explained in section~\ref{meta engines}. \paragraph{Lines 38--39.} We have encoded all values we wanted to encode, now we can get the result from the library. This happens by calling {\sf xds\_getbuffer()}. The routine will store the buffer's address and length at the locations we provided as parameters. Please note that we can choose whether we want the buffer as a ``gift'' ({\sf XDS\_GIFT}) or as a ``loan'' ({\sf XDS\_LOAN}). The buffer being a ``loan'' means that the buffer is still owned by the library -- we're only allowed to peak at it. But any call to an libxds routine may potentially modify the buffer or even change the buffers location. Hence the result of a {\sf xds\_getbuffer()} call with loaning semantics is only valid until the next libxds routine is called. After that, it is invalid. If we choose the gift semantics, the buffer we receive will be owned by us; the library will not touch the buffer again. This means of course, that we're responsible for {\sf free()}ing the buffer when we don't need it anymore. \paragraph{Line 41.} Destroy the XDS context and all data associated with it. This is possible because we requested the buffer as ``gift''; the buffer is not associated with libxds anymore. \paragraph{Line 43.} Write the buffer with the encoded data to the standard output stream. \paragraph{Line 45.} Now that we don't need the buffer anymore, we have to return the memory it uses to the system. libxds won't do that for us. \paragraph{Lines 47--50.} Write a short report of what we have done to the standard error channel. \bigskip Finally, let us compile and execute the example program shown above. For convenience, it is included in the distribution under the name {\sf docs/encode.c}. You can compile and execute the program as follows: \begin{quote} \begin{verbatim} simons@dev13:~/libxds$ cd docs simons@dev13:~/libxds/docs$ gcc -I.. encode.c -o encode -L.. -lxds simons@dev13:~/libxds/docs$ ./encode >output Encoded data: int32 = -42 uint32 = 0x12345678 string = "This is a test." simons@dev13:~/libxds/docs$ ls -l output -rw-r--r-- 1 simons simons 28 Aug 2 15:21 output \end{verbatim} \end{quote} The result of executing the programm --- the file {\sf output} --- can be displayed with {\sf hexdump(1)} or {\sf od(1)} and should look like this: \begin{quote} \begin{Verbatim}[fontsize=\small] simons@dev13:~/libxds/docs$ hexdump -C output 00000000 ff ff ff d6 12 34 56 78 00 00 00 0f 54 68 69 73 |.....4Vx....This| 00000010 20 69 73 20 61 20 74 65 73 74 2e 00 | is a test..| 0000001c \end{Verbatim} \end{quote} \noindent We will also re-use this file in the next section, where we'll read it and decode those values again. \subsection{Decoding} The following example program will read the result of the encoding example shown in the previous section and decode the values back into the native representation. Then it will print those values to the standard error stream so that the user can see the values are correct. Please take a look at the source now, we'll discuss all relevant details in the following paragraphs. \begin{Verbatim}[numbers=left,fontsize=\small,frame=lines] #include #include #include #include #include static void error_exit(int rc, const char* msg, ...) { va_list args; va_start(args, msg); vfprintf(stderr, msg, args); va_end(args); exit(rc); } int main() { xds_t* xds; char buffer[1024]; size_t buffer_len; int rc; xds_int32_t int32; xds_uint32_t uint32; char* string; buffer_len = 0; do { rc = read(STDIN_FILENO, buffer + buffer_len, sizeof(buffer) - buffer_len); if (rc < 0) error_exit(1, "read() failed: %s\n", strerror(errno)); else if (rc > 0) buffer_len += rc; } while (rc > 0 && buffer_len < sizeof(buffer)); if (buffer_len >= sizeof(buffer)) error_exit(1, "Too much input data for our buffer.\n"); xds = xds_init(XDS_DECODE); if (xds == NULL) error_exit(1, "Failed to initialize XDS context: %s\n", strerror(errno)); if (xds_register(xds, "int32", &xdr_decode_int32, NULL) != XDS_OK || xds_register(xds, "uint32", &xdr_decode_uint32, NULL) != XDS_OK || xds_register(xds, "string", &xdr_decode_string, NULL) != XDS_OK) error_exit(1, "Failed to register my decoding engines!\n"); if (xds_setbuffer(xds, XDS_LOAN, buffer, buffer_len) != XDS_OK) error_exit(1, "setbuffer() failed.\n"); if (xds_decode(xds, "int32 uint32 string", &int32, &uint32, &string) != XDS_OK) error_exit(1, "xds_decode() failed!\n"); xds_destroy(xds); fprintf(stderr, "Decoded data:\n"); fprintf(stderr, "\tint32 = %d\n", int32); fprintf(stderr, "\tuint32 = 0x%x\n", uint32); fprintf(stderr, "\tstring = \"%s\"\n", string); free(string); return 0; } \end{Verbatim} \paragraph{Lines 1--25.} Include the required header files, define the {\sf error\_exit()} helper function, and create the required variables on the stack. \paragraph{Lines 27--39.} These instructions will read an unspecified number of bytes from the standard input stream --- as long as the input does not exceed the size of the {\sf buffer} variable. In order to provide the program with the apropriate input, redirect the standard input stream to the file {\sf output} created in the previous section or connect the encoding and decoding programs directly by a pipe. \paragraph{Lines 41-43.} Create a context for decoding the values. The semantics are identical to those described in the previous section. \paragraph{Lines 45--48.} Register the decoding engines in the context. Please note that obviously the decoding engines must correspond to the encoding engines used to create the data we're about to process. Using, say, an XML engine to decode XDR data will at best return with an error --- in the worst case, it will return incorrect results! \paragraph{Lines 50-51.} Here we do not get a buffer from the library, we \emph{set} the buffer we've read earlier in the context for decoding. Please note that we use loan semantics in this case, not gift semantics. This is necessary because {\sf buffer} has not been allocated by {\sf malloc()} --- the variable lives on the stack. This means that we cannot give it to libxds because libxds expects to be able to {\sf free()} the buffer when the context is destroyed. Loan semantics are fine, though, all we have to do is to take care that we don't erase or modify the contents of {\sf buffer} while libxds operates on it. The library itself will never touch the buffer in decode mode, no matter whether loan or gift semantics have been chosen. \paragraph{Lines 53--54.} Here come the actual decoding of the buffer's contents using {\sf xds\_decode()}. The syntax is identical to {\sf xds\_encode()}'s, the only difference is that the decoding engines do not expect the values --- like the encoding engines did --- but the location where to store the value. Thus we pass the addresses of the apropriate variables here. If the routine returns with {\sf XDS\_OK}, the decoded values will have been stored in those locations. It should be noted that the decoded string cannot trivially be returned this way. Instead, {\sf xds\_decode()} will use {\sf malloc()} to allocate a buffer barely large enough to hold the string. The address of that buffer is then stored in the pointer {\sf string}. Of course this means that the application has to {\sf free()} the string once it's not required anymore. \paragraph{Line 56.} We don't need the context anymore, so we destroy it and free all used resources. This does not affect {\sf buffer} in any way because we used loan semantics. \paragraph{Lines 58-61.} Print the decoded values to the standard error stream for the user to take a look at them. \paragraph{Line 63.} Now that we don't need the contents of {\sf string} anymore, we must return the buffer allocated in {\sf xds\_decode()} to the system. \bigskip Like the encoding program described earlier, the source code to this program is included in the library distribution as {\sf docs/decode.c}. You can compile and execute the program like this: \begin{quote} \begin{verbatim} simons@dev13:~/libxds$ cd docs simons@dev13:~/libxds/docs$ gcc -I.. decode.c -o decode -L.. -lxds simons@dev13:~/libxds/docs$ ./decode From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds configure.ac Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 02-Aug-2001 16:18:31 Branch: HEAD Handle: 2001080215183000 Modified files: ossp-pkg/srpc/libxds configure.ac Log: Removed the duplicate test for the signed integer variants. Summary: Revision Changes Path 1.10 +17 -26 ossp-pkg/srpc/libxds/configure.ac ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/configure.ac ============================================================ $ cvs diff -u -r1.9 -r1.10 configure.ac --- ossp-pkg/srpc/libxds/configure.ac 2001/08/02 08:36:33 1.9 +++ ossp-pkg/srpc/libxds/configure.ac 2001/08/02 14:18:30 1.10 @@ -2,7 +2,7 @@ AC_INIT(libxds) AC_PREREQ(2.52) -AC_REVISION($Revision: 1.9 $) +AC_REVISION($Revision: 1.10 $) dnl Get rid of the lousy -g and -O defaults in CFLAGS. dnl @@ -24,51 +24,42 @@ AC_CHECK_TYPE(u_int8_t, [xds_uint8_t=u_int8_t], [AC_CHECK_TYPE(uint8_t, [xds_uint8_t=uint8_t], [AC_MSG_ERROR([no unsigned 8 bit data type found])] - )] - ) + )]) AC_SUBST([xds_uint8_t]) AC_CHECK_TYPE(u_int16_t, [xds_uint16_t=u_int16_t], [AC_CHECK_TYPE(uint16_t, [xds_uint16_t=uint16_t], [AC_MSG_ERROR([no unsigned 16 bit data type found])] - )] - ) + )]) AC_SUBST([xds_uint16_t]) AC_CHECK_TYPE(u_int32_t, [xds_uint32_t=u_int32_t], [AC_CHECK_TYPE(uint32_t, [xds_uint32_t=uint32_t], [AC_MSG_ERROR([no unsigned 32 bit data type found])] - )] - ) + )]) AC_SUBST([xds_uint32_t]) AC_CHECK_TYPE(u_int64_t, [xds_uint64_t=u_int64_t], [AC_CHECK_TYPE(uint64_t, [xds_uint64_t=uint64_t], - [AC_MSG_ERROR([no unsigned 64 bit data type found])] - )] - ) + [AC_MSG_ERROR([no unsigned 64 bit data type found]) + ])]) AC_SUBST([xds_uint64_t]) +dnl AC_CHECK_TYPE(int8_t, [xds_int8_t=int8_t], - [AC_CHECK_TYPE(int8_t, [xds_int8_t=int8_t], - [AC_MSG_ERROR([no signed 8 bit data type found])] - )] - ) + [AC_MSG_ERROR([no signed 8 bit data type found]) + ]) AC_SUBST([xds_int8_t]) AC_CHECK_TYPE(int16_t, [xds_int16_t=int16_t], - [AC_CHECK_TYPE(int16_t, [xds_int16_t=int16_t], - [AC_MSG_ERROR([no signed 16 bit data type found])] - )] - ) + [AC_MSG_ERROR([no signed 16 bit data type found]) + ]) AC_SUBST([xds_int16_t]) AC_CHECK_TYPE(int32_t, [xds_int32_t=int32_t], - [AC_CHECK_TYPE(int32_t, [xds_int32_t=int32_t], - [AC_MSG_ERROR([no signed 32 bit data type found])] - )] - ) + [AC_MSG_ERROR([no signed 32 bit data type found]) + ]) AC_SUBST([xds_int32_t]) AC_CHECK_TYPE(int64_t, [xds_int64_t=int64_t], - [AC_CHECK_TYPE(int64_t, [xds_int64_t=int64_t], - [AC_MSG_ERROR([no signed 64 bit data type found])] - )] - ) + [AC_MSG_ERROR([no signed 64 bit data type found]) + ]) AC_SUBST([xds_int64_t]) +dnl +AC_SUBST([have_64_bit_support]) dnl Find the library containing the xdr_xxx() functions. dnl From ossp-cvs-owner@ossp.org Thu Aug 2 16:39:16 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f72EdGJ20548; Thu, 2 Aug 2001 16:39:16 +0200 (CEST) Date: Thu, 2 Aug 2001 16:39:16 +0200 (CEST) Message-Id: <200108021439.f72EdGJ20548@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds configure.ac xds.h.in Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 02-Aug-2001 16:39:15 Branch: HEAD Handle: 2001080215391500 Modified files: ossp-pkg/srpc/libxds configure.ac xds.h.in Log: The configure script will now recognize when any of the 64-bit data types is missing. In this case, the define XDS_HAVE_64_BIT_SUPPORT will _not_ be defined in xds.h; it will be defined otherwise. Depending on whether the define is there or not, the 64-bit engines will not be defined. Summary: Revision Changes Path 1.11 +21 -19 ossp-pkg/srpc/libxds/configure.ac 1.9 +11 -3 ossp-pkg/srpc/libxds/xds.h.in ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/configure.ac ============================================================ $ cvs diff -u -r1.10 -r1.11 configure.ac --- ossp-pkg/srpc/libxds/configure.ac 2001/08/02 14:18:30 1.10 +++ ossp-pkg/srpc/libxds/configure.ac 2001/08/02 14:39:15 1.11 @@ -2,7 +2,7 @@ AC_INIT(libxds) AC_PREREQ(2.52) -AC_REVISION($Revision: 1.10 $) +AC_REVISION($Revision: 1.11 $) dnl Get rid of the lousy -g and -O defaults in CFLAGS. dnl @@ -23,42 +23,44 @@ dnl AC_CHECK_TYPE(u_int8_t, [xds_uint8_t=u_int8_t], [AC_CHECK_TYPE(uint8_t, [xds_uint8_t=uint8_t], - [AC_MSG_ERROR([no unsigned 8 bit data type found])] - )]) -AC_SUBST([xds_uint8_t]) + [AC_MSG_ERROR([no unsigned 8 bit data type found])])]) AC_CHECK_TYPE(u_int16_t, [xds_uint16_t=u_int16_t], [AC_CHECK_TYPE(uint16_t, [xds_uint16_t=uint16_t], - [AC_MSG_ERROR([no unsigned 16 bit data type found])] - )]) -AC_SUBST([xds_uint16_t]) + [AC_MSG_ERROR([no unsigned 16 bit data type found])])]) AC_CHECK_TYPE(u_int32_t, [xds_uint32_t=u_int32_t], [AC_CHECK_TYPE(uint32_t, [xds_uint32_t=uint32_t], - [AC_MSG_ERROR([no unsigned 32 bit data type found])] - )]) -AC_SUBST([xds_uint32_t]) + [AC_MSG_ERROR([no unsigned 32 bit data type found])])]) AC_CHECK_TYPE(u_int64_t, [xds_uint64_t=u_int64_t], [AC_CHECK_TYPE(uint64_t, [xds_uint64_t=uint64_t], - [AC_MSG_ERROR([no unsigned 64 bit data type found]) - ])]) -AC_SUBST([xds_uint64_t]) + [AC_MSG_WARN([no unsigned 64 bit data type found]) + xds_uint64_t=undefined])]) dnl AC_CHECK_TYPE(int8_t, [xds_int8_t=int8_t], [AC_MSG_ERROR([no signed 8 bit data type found]) ]) -AC_SUBST([xds_int8_t]) AC_CHECK_TYPE(int16_t, [xds_int16_t=int16_t], [AC_MSG_ERROR([no signed 16 bit data type found]) ]) -AC_SUBST([xds_int16_t]) AC_CHECK_TYPE(int32_t, [xds_int32_t=int32_t], [AC_MSG_ERROR([no signed 32 bit data type found]) ]) -AC_SUBST([xds_int32_t]) AC_CHECK_TYPE(int64_t, [xds_int64_t=int64_t], - [AC_MSG_ERROR([no signed 64 bit data type found]) - ]) -AC_SUBST([xds_int64_t]) + [AC_MSG_WARN([no signed 64 bit data type found]) + xds_int64_t=undefined]) dnl +if test "$xds_int64_t" = "undefined" -o "$xds_uint64_t" = "undefined"; then + have_64_bit_support="#undef XDS_HAVE_64_BIT_SUPPORT" +else + have_64_bit_support="#define XDS_HAVE_64_BIT_SUPPORT" +fi +AC_SUBST([xds_uint8_t]) +AC_SUBST([xds_uint16_t]) +AC_SUBST([xds_uint32_t]) +AC_SUBST([xds_uint64_t]) +AC_SUBST([xds_int8_t]) +AC_SUBST([xds_int16_t]) +AC_SUBST([xds_int32_t]) +AC_SUBST([xds_int64_t]) AC_SUBST([have_64_bit_support]) dnl Find the library containing the xdr_xxx() functions. Index: ossp-pkg/srpc/libxds/xds.h.in ============================================================ $ cvs diff -u -r1.8 -r1.9 xds.h.in --- ossp-pkg/srpc/libxds/xds.h.in 2001/08/02 08:12:26 1.8 +++ ossp-pkg/srpc/libxds/xds.h.in 2001/08/02 14:39:15 1.9 @@ -38,14 +38,18 @@ #define XDS_TRUE (1==1) #define XDS_FALSE (1!=1) +@have_64_bit_support@ + typedef @xds_uint8_t@ xds_uint8_t; -typedef @xds_uint16_t@ xds_uint16_t; -typedef @xds_uint32_t@ xds_uint32_t; -typedef @xds_uint64_t@ xds_uint64_t; typedef @xds_int8_t@ xds_int8_t; +typedef @xds_uint16_t@ xds_uint16_t; typedef @xds_int16_t@ xds_int16_t; +typedef @xds_uint32_t@ xds_uint32_t; typedef @xds_int32_t@ xds_int32_t; +#ifdef XDS_HAVE_64_BIT_SUPPORT +typedef @xds_uint64_t@ xds_uint64_t; typedef @xds_int64_t@ xds_int64_t; +#endif typedef double xds_double_t; enum @@ -126,10 +130,12 @@ xds_declare_formatting_engine(xdr_decode_uint32); xds_declare_formatting_engine(xdr_encode_int32); xds_declare_formatting_engine(xdr_decode_int32); +#ifdef XDS_HAVE_64_BIT_SUPPORT xds_declare_formatting_engine(xdr_encode_uint64); xds_declare_formatting_engine(xdr_decode_uint64); xds_declare_formatting_engine(xdr_encode_int64); xds_declare_formatting_engine(xdr_decode_int64); +#endif xds_declare_formatting_engine(xdr_encode_double); xds_declare_formatting_engine(xdr_decode_double); xds_declare_formatting_engine(xdr_encode_octetstream); @@ -145,10 +151,12 @@ xds_declare_formatting_engine(xml_decode_uint32); xds_declare_formatting_engine(xml_encode_int32); xds_declare_formatting_engine(xml_decode_int32); +#ifdef XDS_HAVE_64_BIT_SUPPORT xds_declare_formatting_engine(xml_encode_uint64); xds_declare_formatting_engine(xml_decode_uint64); xds_declare_formatting_engine(xml_encode_int64); xds_declare_formatting_engine(xml_decode_int64); +#endif xds_declare_formatting_engine(xml_encode_double); xds_declare_formatting_engine(xml_decode_double); xds_declare_formatting_engine(xml_encode_octetstream); From ossp-cvs-owner@ossp.org Thu Aug 2 16:56:15 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f72EuFq22287; Thu, 2 Aug 2001 16:56:15 +0200 (CEST) Date: Thu, 2 Aug 2001 16:56:15 +0200 (CEST) Message-Id: <200108021456.f72EuFq22287@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds Makefile.in configure.ac ossp-pkg/srp... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 02-Aug-2001 16:56:14 Branch: HEAD Handle: 2001080215561301 Modified files: ossp-pkg/srpc/libxds Makefile.in configure.ac ossp-pkg/srpc/libxds/regression-tests Makefile.in Log: Build modules that need 64-bit support only if 64-bit data types have been found! Summary: Revision Changes Path 1.14 +20 -20 ossp-pkg/srpc/libxds/Makefile.in 1.12 +10 -1 ossp-pkg/srpc/libxds/configure.ac 1.12 +4 -4 ossp-pkg/srpc/libxds/regression-tests/Makefile.in ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/Makefile.in ============================================================ $ cvs diff -u -r1.13 -r1.14 Makefile.in --- ossp-pkg/srpc/libxds/Makefile.in 2001/08/02 10:54:27 1.13 +++ ossp-pkg/srpc/libxds/Makefile.in 2001/08/02 14:56:13 1.14 @@ -1,28 +1,28 @@ # Build libxds. -CC = @CC@ -AR = ar -RANLIB = @RANLIB@ +CC = @CC@ +AR = ar +RANLIB = @RANLIB@ -CPPFLAGS = @CPPFLAGS@ @DEFS@ -D_GNU_SOURCE -CFLAGS = @CFLAGS@ -LDFLAGS = @LDFLAGS@ +CPPFLAGS = @CPPFLAGS@ @DEFS@ -D_GNU_SOURCE +CFLAGS = @CFLAGS@ +LDFLAGS = @LDFLAGS@ -XML_OBJS = xml-encode-int32.o xml-decode-int32.o \ - xml-encode-uint32.o xml-decode-uint32.o \ - xml-encode-int64.o xml-decode-int64.o \ - xml-encode-uint64.o xml-decode-uint64.o \ - xml-encode-double.o xml-decode-double.o \ - xml-encode-begin.o xml-decode-begin.o \ - xml-encode-end.o xml-decode-end.o +XML64_OBJS = @xml_64_bit_objects@ +XML_OBJS = xml-encode-int32.o xml-decode-int32.o \ + xml-encode-uint32.o xml-decode-uint32.o \ + xml-encode-double.o xml-decode-double.o \ + xml-encode-begin.o xml-decode-begin.o \ + xml-encode-end.o xml-decode-end.o \ + $(XML64_OBJS) -XDR_OBJS = xdr-encode-int32.o xdr-decode-int32.o \ - xdr-encode-uint32.o xdr-decode-uint32.o \ - xdr-encode-int64.o xdr-decode-int64.o \ - xdr-encode-uint64.o xdr-decode-uint64.o \ - xdr-encode-double.o xdr-decode-double.o \ - xdr-encode-octetstream.o xdr-decode-octetstream.o \ - xdr-encode-string.o xdr-decode-string.o \ +XDR64_OBJS = @xdr_64_bit_objects@ +XDR_OBJS = xdr-encode-int32.o xdr-decode-int32.o \ + xdr-encode-uint32.o xdr-decode-uint32.o \ + xdr-encode-double.o xdr-decode-double.o \ + xdr-encode-octetstream.o xdr-decode-octetstream.o \ + xdr-encode-string.o xdr-decode-string.o \ + $(XDR64_OBJS) XDS_OBJS = decode.o destroy.o encode.o getbuffer.o init.o register.o \ setbuffer.o unregister.o vdecode.o vencode.o find-engine.o \ Index: ossp-pkg/srpc/libxds/configure.ac ============================================================ $ cvs diff -u -r1.11 -r1.12 configure.ac --- ossp-pkg/srpc/libxds/configure.ac 2001/08/02 14:39:15 1.11 +++ ossp-pkg/srpc/libxds/configure.ac 2001/08/02 14:56:14 1.12 @@ -2,7 +2,7 @@ AC_INIT(libxds) AC_PREREQ(2.52) -AC_REVISION($Revision: 1.11 $) +AC_REVISION($Revision: 1.12 $) dnl Get rid of the lousy -g and -O defaults in CFLAGS. dnl @@ -52,6 +52,12 @@ have_64_bit_support="#undef XDS_HAVE_64_BIT_SUPPORT" else have_64_bit_support="#define XDS_HAVE_64_BIT_SUPPORT" + xdr_64_bit_objects="xdr-encode-int64.o xdr-decode-int64.o" + xdr_64_bit_objects="$xdr_64_bit_objects xdr-encode-uint64.o xdr-decode-uint64.o" + xml_64_bit_objects="xml-encode-int64.o xml-decode-int64.o" + xml_64_bit_objects="$xml_64_bit_objects xml-encode-uint64.o xml-decode-uint64.o" + tests_64_bit="xdr-int64.exe xdr-uint64.exe xml-int64.exe xml-uint64.exe" + tests_64_bit="$tests_64_bit xds-mystruct" fi AC_SUBST([xds_uint8_t]) AC_SUBST([xds_uint16_t]) @@ -62,6 +68,9 @@ AC_SUBST([xds_int32_t]) AC_SUBST([xds_int64_t]) AC_SUBST([have_64_bit_support]) +AC_SUBST([xdr_64_bit_objects]) +AC_SUBST([xml_64_bit_objects]) +AC_SUBST([tests_64_bit]) dnl Find the library containing the xdr_xxx() functions. dnl Index: ossp-pkg/srpc/libxds/regression-tests/Makefile.in ============================================================ $ cvs diff -u -r1.11 -r1.12 Makefile.in --- ossp-pkg/srpc/libxds/regression-tests/Makefile.in 2001/08/01 15:25:50 1.11 +++ ossp-pkg/srpc/libxds/regression-tests/Makefile.in 2001/08/02 14:56:14 1.12 @@ -8,12 +8,12 @@ CFLAGS = @CFLAGS@ LDFLAGS = @LDFLAGS@ @xdr_lib@ -L.. +TESTS64 = @tests_64_bit@ TESTS = xds-core.exe xds-find-engine.exe xds-register.exe xds-encode.exe \ xds-getbuffer.exe xds-decode.exe xds-setbuffer.exe xds-engine-restart.exe \ - xdr-uint32.exe xdr-int32.exe xdr-uint64.exe xdr-int64.exe \ - xdr-octetstream.exe xdr-octetstream-empty.exe xdr-string.exe \ - xdr-string-empty.exe xds-mystruct.exe \ - xml-uint32.exe xml-int32.exe xml-uint64.exe xml-int64.exe xml-double.exe + xdr-uint32.exe xdr-int32.exe xdr-octetstream.exe xdr-octetstream-empty.exe \ + xdr-string.exe xdr-string-empty.exe xml-uint32.exe xml-int32.exe \ + xml-double.exe $(TESTS64) .SUFFIXES: .SUFFIXES: .c .exe From ossp-cvs-owner@ossp.org Thu Aug 2 16:56:55 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f72Euri22363; Thu, 2 Aug 2001 16:56:53 +0200 (CEST) Date: Thu, 2 Aug 2001 16:56:53 +0200 (CEST) Message-Id: <200108021456.f72Euri22363@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds configure.ac Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 02-Aug-2001 16:56:53 Branch: HEAD Handle: 2001080215565300 Modified files: ossp-pkg/srpc/libxds configure.ac Log: Fixed suffix of the mystruct test. Summary: Revision Changes Path 1.13 +2 -2 ossp-pkg/srpc/libxds/configure.ac ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/configure.ac ============================================================ $ cvs diff -u -r1.12 -r1.13 configure.ac --- ossp-pkg/srpc/libxds/configure.ac 2001/08/02 14:56:14 1.12 +++ ossp-pkg/srpc/libxds/configure.ac 2001/08/02 14:56:53 1.13 @@ -2,7 +2,7 @@ AC_INIT(libxds) AC_PREREQ(2.52) -AC_REVISION($Revision: 1.12 $) +AC_REVISION($Revision: 1.13 $) dnl Get rid of the lousy -g and -O defaults in CFLAGS. dnl @@ -57,7 +57,7 @@ xml_64_bit_objects="xml-encode-int64.o xml-decode-int64.o" xml_64_bit_objects="$xml_64_bit_objects xml-encode-uint64.o xml-decode-uint64.o" tests_64_bit="xdr-int64.exe xdr-uint64.exe xml-int64.exe xml-uint64.exe" - tests_64_bit="$tests_64_bit xds-mystruct" + tests_64_bit="$tests_64_bit xds-mystruct.exe" fi AC_SUBST([xds_uint8_t]) AC_SUBST([xds_uint16_t]) From ossp-cvs-owner@ossp.org Thu Aug 2 17:03:53 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f72F3qk23533; Thu, 2 Aug 2001 17:03:52 +0200 (CEST) Date: Thu, 2 Aug 2001 17:03:52 +0200 (CEST) Message-Id: <200108021503.f72F3qk23533@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds Makefile.in Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 02-Aug-2001 17:03:52 Branch: HEAD Handle: 2001080216035100 Modified files: ossp-pkg/srpc/libxds Makefile.in Log: Tabified the makefiles. Summary: Revision Changes Path 1.15 +20 -20 ossp-pkg/srpc/libxds/Makefile.in ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/Makefile.in ============================================================ $ cvs diff -u -r1.14 -r1.15 Makefile.in --- ossp-pkg/srpc/libxds/Makefile.in 2001/08/02 14:56:13 1.14 +++ ossp-pkg/srpc/libxds/Makefile.in 2001/08/02 15:03:51 1.15 @@ -1,28 +1,28 @@ # Build libxds. -CC = @CC@ -AR = ar -RANLIB = @RANLIB@ +CC = @CC@ +AR = ar +RANLIB = @RANLIB@ -CPPFLAGS = @CPPFLAGS@ @DEFS@ -D_GNU_SOURCE -CFLAGS = @CFLAGS@ -LDFLAGS = @LDFLAGS@ +CPPFLAGS = @CPPFLAGS@ @DEFS@ -D_GNU_SOURCE +CFLAGS = @CFLAGS@ +LDFLAGS = @LDFLAGS@ -XML64_OBJS = @xml_64_bit_objects@ -XML_OBJS = xml-encode-int32.o xml-decode-int32.o \ - xml-encode-uint32.o xml-decode-uint32.o \ - xml-encode-double.o xml-decode-double.o \ - xml-encode-begin.o xml-decode-begin.o \ - xml-encode-end.o xml-decode-end.o \ - $(XML64_OBJS) +XML64_OBJS = @xml_64_bit_objects@ +XML_OBJS = xml-encode-int32.o xml-decode-int32.o \ + xml-encode-uint32.o xml-decode-uint32.o \ + xml-encode-double.o xml-decode-double.o \ + xml-encode-begin.o xml-decode-begin.o \ + xml-encode-end.o xml-decode-end.o \ + $(XML64_OBJS) -XDR64_OBJS = @xdr_64_bit_objects@ -XDR_OBJS = xdr-encode-int32.o xdr-decode-int32.o \ - xdr-encode-uint32.o xdr-decode-uint32.o \ - xdr-encode-double.o xdr-decode-double.o \ - xdr-encode-octetstream.o xdr-decode-octetstream.o \ - xdr-encode-string.o xdr-decode-string.o \ - $(XDR64_OBJS) +XDR64_OBJS = @xdr_64_bit_objects@ +XDR_OBJS = xdr-encode-int32.o xdr-decode-int32.o \ + xdr-encode-uint32.o xdr-decode-uint32.o \ + xdr-encode-double.o xdr-decode-double.o \ + xdr-encode-octetstream.o xdr-decode-octetstream.o \ + xdr-encode-string.o xdr-decode-string.o \ + $(XDR64_OBJS) XDS_OBJS = decode.o destroy.o encode.o getbuffer.o init.o register.o \ setbuffer.o unregister.o vdecode.o vencode.o find-engine.o \ From ossp-cvs-owner@ossp.org Thu Aug 2 19:24:52 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f72HOpI39636; Thu, 2 Aug 2001 19:24:51 +0200 (CEST) Date: Thu, 2 Aug 2001 19:24:51 +0200 (CEST) Message-Id: <200108021724.f72HOpI39636@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds Makefile.in ossp-pkg/srpc/libxds/regr... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 02-Aug-2001 19:24:51 Branch: HEAD Handle: 2001080218244901 Added files: ossp-pkg/srpc/libxds xml-decode-octetstream.c xml-encode-octetstream.c ossp-pkg/srpc/libxds/regression-tests xml-octetstream-empty.c xml-octetstream.c Modified files: ossp-pkg/srpc/libxds Makefile.in xds.h.in ossp-pkg/srpc/libxds/regression-tests Makefile.in Log: Implemented XML engines for octet streams. The base64-encoding code still needs some work, though: The test with an empty string currently fails. Also we had to do some weird work-arounds in the decoding routine because base64_decode does not honor srclen. Summary: Revision Changes Path 1.16 +1 -0 ossp-pkg/srpc/libxds/Makefile.in 1.13 +1 -1 ossp-pkg/srpc/libxds/regression-tests/Makefile.in 1.1 +109 -0 ossp-pkg/srpc/libxds/regression-tests/xml-octetstream-empty.c 1.1 +109 -0 ossp-pkg/srpc/libxds/regression-tests/xml-octetstream.c 1.10 +4 -1 ossp-pkg/srpc/libxds/xds.h.in 1.1 +226 -0 ossp-pkg/srpc/libxds/xml-decode-octetstream.c 1.1 +142 -0 ossp-pkg/srpc/libxds/xml-encode-octetstream.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/Makefile.in ============================================================ $ cvs diff -u -r1.15 -r1.16 Makefile.in --- ossp-pkg/srpc/libxds/Makefile.in 2001/08/02 15:03:51 1.15 +++ ossp-pkg/srpc/libxds/Makefile.in 2001/08/02 17:24:49 1.16 @@ -14,6 +14,7 @@ xml-encode-double.o xml-decode-double.o \ xml-encode-begin.o xml-decode-begin.o \ xml-encode-end.o xml-decode-end.o \ + xml-encode-octetstream.o xml-decode-octetstream.o \ $(XML64_OBJS) XDR64_OBJS = @xdr_64_bit_objects@ Index: ossp-pkg/srpc/libxds/regression-tests/Makefile.in ============================================================ $ cvs diff -u -r1.12 -r1.13 Makefile.in --- ossp-pkg/srpc/libxds/regression-tests/Makefile.in 2001/08/02 14:56:14 1.12 +++ ossp-pkg/srpc/libxds/regression-tests/Makefile.in 2001/08/02 17:24:50 1.13 @@ -13,7 +13,7 @@ xds-getbuffer.exe xds-decode.exe xds-setbuffer.exe xds-engine-restart.exe \ xdr-uint32.exe xdr-int32.exe xdr-octetstream.exe xdr-octetstream-empty.exe \ xdr-string.exe xdr-string-empty.exe xml-uint32.exe xml-int32.exe \ - xml-double.exe $(TESTS64) + xml-double.exe xml-octetstream.exe xml-octetstream-empty.exe $(TESTS64) .SUFFIXES: .SUFFIXES: .c .exe Index: ossp-pkg/srpc/libxds/regression-tests/xml-octetstream-empty.c ============================================================ $ cvs update -p -r1.1 xml-octetstream-empty.c /* XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) This file is part of OSSP XDS, an extensible data serialization library which can be found at http://www.ossp.com/pkg/xds/. 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. */ #include #include #include #include "../internal.h" int main() { xds_t* xds; char* buffer; size_t buffer_size; char msg[] = ""; char* new_msg; size_t new_msg_size; /* Encode the string as octet stream. Then erase the buffer and decode the string back, verifying that it hasn't changed. */ xds = xds_init(XDS_ENCODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); return 1; } if (xds_register(xds, "os", &xml_encode_octetstream, NULL) != XDS_OK) { printf("Failed to register my encoding engines.\n"); return 1; } if (xds_encode(xds, "os", msg, strlen(msg)) != XDS_OK) { printf("xds_encode() failed.\n"); return 1; } if (xds_getbuffer(xds, XDS_GIFT, (void**)&buffer, &buffer_size) != XDS_OK) { printf("xds_getbuffer() failed.\n"); return 1; } xds_destroy(xds); write(1, buffer, buffer_size); printf("\n"); xds = xds_init(XDS_DECODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); return 1; } if (xds_register(xds, "os", &xml_decode_octetstream, NULL) != XDS_OK) { printf("Failed to register my decoding engines.\n"); return 1; } if (xds_setbuffer(xds, XDS_GIFT, buffer, buffer_size) != XDS_OK) { printf("xds_setbuffer() failed.\n"); return 1; } if (xds_decode(xds, "os", &new_msg, &new_msg_size) != XDS_OK) { printf("xds_decode() failed.\n"); return 1; } if (new_msg_size != strlen(msg)) { printf("The size of the decoded message is wrong.\n"); return 1; } if (memcmp(msg, new_msg, new_msg_size) != 0) { printf("The decoded octet stream is not correct.\n"); return 1; } xds_destroy(xds); free(new_msg); /* Everything went fine. */ return 0; } Index: ossp-pkg/srpc/libxds/regression-tests/xml-octetstream.c ============================================================ $ cvs update -p -r1.1 xml-octetstream.c /* XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) This file is part of OSSP XDS, an extensible data serialization library which can be found at http://www.ossp.com/pkg/xds/. 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. */ #include #include #include #include "../internal.h" int main() { xds_t* xds; char* buffer; size_t buffer_size; char msg[] = "Hello World"; char* new_msg; size_t new_msg_size; /* Encode the string as octet stream. Then erase the buffer and decode the string back, verifying that it hasn't changed. */ xds = xds_init(XDS_ENCODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); return 1; } if (xds_register(xds, "os", &xml_encode_octetstream, NULL) != XDS_OK) { printf("Failed to register my encoding engines.\n"); return 1; } if (xds_encode(xds, "os", msg, strlen(msg)) != XDS_OK) { printf("xds_encode() failed.\n"); return 1; } if (xds_getbuffer(xds, XDS_GIFT, (void**)&buffer, &buffer_size) != XDS_OK) { printf("xds_getbuffer() failed.\n"); return 1; } xds_destroy(xds); write(1, buffer, buffer_size); printf("\n"); xds = xds_init(XDS_DECODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); return 1; } if (xds_register(xds, "os", &xml_decode_octetstream, NULL) != XDS_OK) { printf("Failed to register my decoding engines.\n"); return 1; } if (xds_setbuffer(xds, XDS_GIFT, buffer, buffer_size) != XDS_OK) { printf("xds_setbuffer() failed.\n"); return 1; } if (xds_decode(xds, "os", &new_msg, &new_msg_size) != XDS_OK) { printf("xds_decode() failed.\n"); return 1; } if (new_msg_size != strlen(msg)) { printf("The size of the decoded message is wrong.\n"); return 1; } if (memcmp(msg, new_msg, new_msg_size) != 0) { printf("The decoded octet stream is not correct.\n"); return 1; } xds_destroy(xds); free(new_msg); /* Everything went fine. */ return 0; } Index: ossp-pkg/srpc/libxds/xds.h.in ============================================================ $ cvs diff -u -r1.9 -r1.10 xds.h.in --- ossp-pkg/srpc/libxds/xds.h.in 2001/08/02 14:39:15 1.9 +++ ossp-pkg/srpc/libxds/xds.h.in 2001/08/02 17:24:49 1.10 @@ -61,7 +61,8 @@ XDS_ERR_TYPE_MISMATCH = -4, XDS_ERR_UNKNOWN_ENGINE = -5, XDS_ERR_INVALID_MODE = -6, - XDS_ERR_UNDERFLOW = -7 + XDS_ERR_UNDERFLOW = -7, + XDS_ERR_UNKNOWN = -8 }; typedef enum { XDS_ENCODE, XDS_DECODE } xds_mode_t; typedef enum { XDS_LOAN, XDS_GIFT } xds_scope_t; @@ -165,5 +166,7 @@ xds_declare_formatting_engine(xml_decode_string); extern const char xds_xml_begin_text[]; extern const char xds_xml_end_text[]; +extern const char xds_base64[]; +extern const char xds_pad64; #endif /* !defined(__LIBXDS_H__) */ Index: ossp-pkg/srpc/libxds/xml-decode-octetstream.c ============================================================ $ cvs update -p -r1.1 xml-decode-octetstream.c /* XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) This file is part of OSSP XDS, an extensible data serialization library which can be found at http://www.ossp.com/pkg/xds/. 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. */ #include #include #include "xds.h" static int base64_decode(unsigned char *dst, size_t dstlen, char const *src, size_t srclen) { int dstidx, state, ch = 0; unsigned char res; char *pos; if (srclen == 0) srclen = strlen(src); state = 0; dstidx = 0; res = 0; while (srclen-- > 0) { ch = *src++; if (isascii(ch) && isspace(ch)) /* Skip whitespace anywhere */ continue; if (ch == xds_pad64) break; pos = strchr(xds_base64, ch); if (pos == 0) /* A non-base64 character */ return -1; switch (state) { case 0: if (dst != NULL) { if ((size_t)dstidx >= dstlen) return -1; dst[dstidx] = ((pos - xds_base64) << 2); } state = 1; break; case 1: if (dst != NULL) { if ((size_t)dstidx >= dstlen) return -1; dst[dstidx] |= ((pos - xds_base64) >> 4); res = (((pos - xds_base64) & 0x0f) << 4); } dstidx++; state = 2; break; case 2: if (dst != NULL) { if ((size_t)dstidx >= dstlen) return -1; dst[dstidx] = res | ((pos - xds_base64) >> 2); res = ((pos - xds_base64) & 0x03) << 6; } dstidx++; state = 3; break; case 3: if (dst != NULL) { if ((size_t)dstidx >= dstlen) return -1; dst[dstidx] = res | (pos - xds_base64); } dstidx++; state = 0; break; default: break; } } /* * We are done decoding Base-64 chars. Let's see if we ended * on a byte boundary, and/or with erroneous trailing characters. */ if (ch == xds_pad64) { /* We got a pad char. */ ch = *src++; /* Skip it, get next. */ switch (state) { case 0: /* Invalid = in first position */ case 1: /* Invalid = in second position */ return -1; case 2: /* Valid, means one byte of info */ /* Skip any number of spaces. */ for (; ch != '\0'; ch = *src++) if (!(isascii(ch) && isspace(ch))) break; /* Make sure there is another trailing = sign. */ if (ch != xds_pad64) return -1; ch = *src++; /* Skip the = */ /* FALLTHROUGH */ case 3: /* Valid, means two bytes of info */ /* * We know this char is an =. Is there anything but * whitespace after it? */ for (; ch != '\0'; ch = *src++) if (!(isascii(ch) && isspace(ch))) return -1; /* * Now make sure for cases 2 and 3 that the "extra" * bits that slopped past the last full byte were * zeros. If we don't check them, they become a * subliminal channel. */ if (dst != NULL && res != 0) return -1; default: break; } } else { /* * We ended by seeing the end of the string. Make sure we * have no partial bytes lying around. */ if (state != 0) return -1; } return dstidx; } int xml_decode_octetstream(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, size_t* used_buffer_size, va_list* args) { char* p; size_t p_len; xds_uint8_t** data; size_t* data_len; /* We need at least 27 byte for the starting and ending tag. */ xds_init_encoding_engine(13 + 14); /* Get parameters from stack. */ data = va_arg(*args, xds_uint8_t**); xds_check_parameter(data != NULL); data_len = va_arg(*args, size_t*); /* Check for the opening tag. */ if (memcmp("", buffer, 13) != 0) return XDS_ERR_TYPE_MISMATCH; /* Find the end of the data and calculate the length of the base64-encoded stuff. */ p = (char*)buffer + 13; while(p < ((char*)buffer+buffer_size) && *p != '<') ++p; if (p == ((char*)buffer+buffer_size)) return XDS_ERR_TYPE_MISMATCH; else { p_len = p - ((char*)buffer + 13); p = (char*)buffer + 13; } /* Now find out how long the decoded data is going to be and allocate a buffer for it. */ p[p_len] = '\0'; *data_len = base64_decode(NULL, 0, p, p_len); p[p_len] = '<'; if (*data_len == (size_t)-1) return XDS_ERR_UNKNOWN; *data = malloc(*data_len); if (*data == NULL) return XDS_ERR_NO_MEM; /* Decode the data. */ p[p_len] = '\0'; base64_decode(*data, *data_len, p, p_len); p[p_len] = '<'; /* Check that we have a closing tag. */ if (memcmp(p + p_len, "", 14) != 0) { free(*data); return XDS_ERR_TYPE_MISMATCH; } /* Done. */ *used_buffer_size = 13 + p_len + 14; return XDS_OK; } Index: ossp-pkg/srpc/libxds/xml-encode-octetstream.c ============================================================ $ cvs update -p -r1.1 xml-encode-octetstream.c /* XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) This file is part of OSSP XDS, an extensible data serialization library which can be found at http://www.ossp.com/pkg/xds/. 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. */ #include #include #include "xds.h" const char xds_base64[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; const char xds_pad64 = '='; static int base64_encode(char *dst, size_t dstlen, unsigned char const *src, size_t srclen) { size_t dstpos; unsigned char input[3]; unsigned char output[4]; int ocnt; size_t i; if (srclen == 0) return -1; if (dst == NULL) { /* just calculate required length of dst */ dstlen = (((srclen + 2) / 3) * 4); return dstlen; } /* bulk encoding */ dstpos = 0; ocnt = 0; while (srclen >= 3) { input[0] = *src++; input[1] = *src++; input[2] = *src++; srclen -= 3; output[0] = (input[0] >> 2); output[1] = ((input[0] & 0x03) << 4) + (input[1] >> 4); output[2] = ((input[1] & 0x0f) << 2) + (input[2] >> 6); output[3] = (input[2] & 0x3f); if (dstpos + 4 > dstlen) return -1; dst[dstpos++] = xds_base64[output[0]]; dst[dstpos++] = xds_base64[output[1]]; dst[dstpos++] = xds_base64[output[2]]; dst[dstpos++] = xds_base64[output[3]]; } /* now worry about padding with remaining 1 or 2 bytes */ if (srclen != 0) { input[0] = input[1] = input[2] = '\0'; for (i = 0; i < srclen; i++) input[i] = *src++; output[0] = (input[0] >> 2); output[1] = ((input[0] & 0x03) << 4) + (input[1] >> 4); output[2] = ((input[1] & 0x0f) << 2) + (input[2] >> 6); if (dstpos + 4 > dstlen) return -1; dst[dstpos++] = xds_base64[output[0]]; dst[dstpos++] = xds_base64[output[1]]; if (srclen == 1) dst[dstpos++] = xds_pad64; else dst[dstpos++] = xds_base64[output[2]]; dst[dstpos++] = xds_pad64; } if (dstpos >= dstlen) return -1; dst[dstpos] = '\0'; return dstpos; } int xml_encode_octetstream(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, size_t* used_buffer_size, va_list* args) { xds_uint8_t* src; size_t src_len; /* We need at least 27 byte for the starting and ending tag. */ xds_init_encoding_engine(13 + 14); /* Get parameters from stack. */ src = (xds_uint8_t*)va_arg(*args, void*); xds_check_parameter(src != NULL); src_len = va_arg(*args, size_t); /* Calculate how many bytes we'll need in buffer and make sure we have them. */ *used_buffer_size = base64_encode(NULL, 0, src, src_len); if (*used_buffer_size == (size_t)-1) return XDS_ERR_UNKNOWN; else *used_buffer_size += 13 + 14; if (buffer_size < *used_buffer_size) return XDS_ERR_OVERFLOW; /* Format the data into the buffer. */ memmove(buffer, "", 13); if (base64_encode((char*)buffer + 13, buffer_size - 13, src, src_len) < 0) return XDS_ERR_UNKNOWN; memmove((char*)buffer + *used_buffer_size - 14, "", 14); /* Done. */ return XDS_OK; } From ossp-cvs-owner@ossp.org Tue Aug 7 13:14:11 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f77BE9H90941; Tue, 7 Aug 2001 13:14:09 +0200 (CEST) Date: Tue, 7 Aug 2001 13:14:09 +0200 (CEST) Message-Id: <200108071114.f77BE9H90941@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds/docs xds.pod ossp-pkg/srpc/libxds xds... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 07-Aug-2001 13:14:09 Branch: HEAD Handle: 19700101010000997179249 Added files: ossp-pkg/srpc/libxds/docs xds.pod Removed files: ossp-pkg/srpc/libxds xds.pod Log: Moved POD documentation into the docs directory. Summary: Revision Changes Path 1.1 +134 -0 ossp-pkg/srpc/libxds/docs/xds.pod NONE +0 -134 ossp-pkg/srpc/libxds/xds.pod ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/docs/xds.pod ============================================================ $ cvs update -p -r1.1 xds.pod =pod =head1 NAME xds - eXtensible Data Serialization =head1 SYNOPSIS =head1 DESCRIPTION =over 4 =item xds_t* B(xds_mode_t I); Valid settings for I are B and B. If successful, a valid handle is returned -- B otherwise. If the routine fails, the system variable B is set apropriately. =item void B(xds_t* I); Free all internally allocated resources associated with this context. I must be a handle obtained by calling B. =item int B(xds_t* I, const char* I, xds_engine_t I, void* I); Register the function I as formatting engine in context I under the name I. The function must have the following prototype: int my_engine(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list args); It must gather its values from I and encode/decode them into I. The encoded/decoded representation must not take up more than I byte of memory, because that's the maximum I can hold. If the buffer is too small, I must return B. In case of no error, I must return the number of bytes it has written to the buffer. (Note that all xds error defines are smaller than >0.) The variable I is passed through to the function every time it is called; it is not touched in any way by the xds library. A valid name I for a callback function consists of an arbitrary number of characters from the class [a-zA-Z0-9_-]. =item int B(xds_t* I, const char* I); Remove encoding/decoding engine I from context I. The function will return B if successful and B if I is not a registered engine. =item int B(xds_t* I, xds_scope_t I, void* I, size_t I); Encoding mode: Set internal buffer used in context I to I. The buffer has a capacity of I byte. I may be set to B or B. A "loaned" buffer is one that is owned by the application; xds will use it, but it will not B the buffer nor will it try to B it if it's too small. A buffer given to xds as a "gift" is henceforth owned by xds and may be Bd or Bed as the library sees fit. If I is B, I must be a pointer obtained from calling the B API. Calling B with a I of B will cause the xds library to allocate a buffer of its own. I is ignored in this case. Decoding mode: I contains the encoded representation of the data to be used for following B calls. The encoded data is I byte long. Unlike in encoding mode, such a buffer is not modified, hence there is no need to extend the buffer. If I is set to B, the library will B I when the context is destroyed. B returns one of the following codes signifying success or failure: B (everything alright), B (failed to allocate new internal buffers), and B (arguments don't make sense). =item int B(xds_t* I, xds_scope_t flag, void** buffer, size_t* buffer_size); This routine will write the address and size of the internal buffer in context I to I and I. The I parameter determines who owns the buffer after that; setting I to B means that the buffer is owned by the xds library and that the user may not rely on its contents still being there after another xds library function call. Furthermore, calling B will flush the registered buffer, meaning that coming B calls will start at the beginning and potentially overwrite the buffer contents. Setting I to B means that the returned buffer is owned by the application programmer from now on, it is no longer modified or used in any way by the library. The application must B the buffer when it's not needed anymore. =item int B(xds_t* I, const char* I, ...); The B function call will encode an arbitrary number of values into the chosen representation. The syntax is very similar to B: As parameters, it requires the I handle obtained from B, a format string I describing the following value parameters, and an arbitrary number of actual values. The format string lists the names of the callback functions to be used in order to format the values; it has the format "name name ...". The names are delimited by any number of characters any of which is not part of the character set allowed for function names here. Hence, you can delimit the names by blanks, tabs, dollar signs or pretty much anyting your want. B will return either B (everything OK), B (failed allocating memory for intenal buffering), B (can't expand internal buffer because it's owned by the application), B (parameters don't make sense), B (specified callback can't handle this data type), and B (unknown call back name used in I). =item int B(xds_t* I, const char* I, ...); Like B, only the other way round. =item int B(xds_t* I, const char* I, va_list I); See B. =item int B(xds_t* I, const char* I, va_list I); See B. =back =cut From ossp-cvs-owner@ossp.org Tue Aug 7 13:14:32 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f77BEUK90999; Tue, 7 Aug 2001 13:14:30 +0200 (CEST) Date: Tue, 7 Aug 2001 13:14:30 +0200 (CEST) Message-Id: <200108071114.f77BEUK90999@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds/docs .cvsignore Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 07-Aug-2001 13:14:30 Branch: HEAD Handle: 2001080712143000 Modified files: ossp-pkg/srpc/libxds/docs .cvsignore Log: Ignore Makefile and xds.3. Summary: Revision Changes Path 1.2 +2 -0 ossp-pkg/srpc/libxds/docs/.cvsignore ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/docs/.cvsignore ============================================================ $ cvs diff -u -r1.1 -r1.2 .cvsignore --- ossp-pkg/srpc/libxds/docs/.cvsignore 2001/08/02 12:19:46 1.1 +++ ossp-pkg/srpc/libxds/docs/.cvsignore 2001/08/07 11:14:30 1.2 @@ -1,2 +1,4 @@ libxds.aux libxds.dvi libxds.log libxds.ps encode decode +Makefile +xds.3 From ossp-cvs-owner@ossp.org Tue Aug 7 13:16:21 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f77BGKe91685; Tue, 7 Aug 2001 13:16:20 +0200 (CEST) Date: Tue, 7 Aug 2001 13:16:20 +0200 (CEST) Message-Id: <200108071116.f77BGKe91685@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds Makefile.in configure.ac ossp-pkg/srp... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 07-Aug-2001 13:16:20 Branch: HEAD Handle: 2001080712161901 Added files: ossp-pkg/srpc/libxds/docs Makefile.in Modified files: ossp-pkg/srpc/libxds Makefile.in configure.ac Log: Added docs directory to the build system. Summary: Revision Changes Path 1.17 +1 -4 ossp-pkg/srpc/libxds/Makefile.in 1.14 +5 -3 ossp-pkg/srpc/libxds/configure.ac 1.1 +25 -0 ossp-pkg/srpc/libxds/docs/Makefile.in ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/Makefile.in ============================================================ $ cvs diff -u -r1.16 -r1.17 Makefile.in --- ossp-pkg/srpc/libxds/Makefile.in 2001/08/02 17:24:49 1.16 +++ ossp-pkg/srpc/libxds/Makefile.in 2001/08/07 11:16:19 1.17 @@ -41,13 +41,10 @@ $(AR) cr $@ $(OBJS) $(RANLIB) $@ -xds.3: xds.pod - pod2man --section=3 --center="XDS Library Programmer API " xds.pod >xds.3 - clean:: @(cd regression-tests && $(MAKE) $@) rm -f $(OBJS) - rm -f libxds.a test.o test xds.3 + rm -f libxds.a distclean:: clean @(cd regression-tests && $(MAKE) $@) Index: ossp-pkg/srpc/libxds/configure.ac ============================================================ $ cvs diff -u -r1.13 -r1.14 configure.ac --- ossp-pkg/srpc/libxds/configure.ac 2001/08/02 14:56:53 1.13 +++ ossp-pkg/srpc/libxds/configure.ac 2001/08/07 11:16:19 1.14 @@ -2,7 +2,7 @@ AC_INIT(libxds) AC_PREREQ(2.52) -AC_REVISION($Revision: 1.13 $) +AC_REVISION($Revision: 1.14 $) dnl Get rid of the lousy -g and -O defaults in CFLAGS. dnl @@ -12,6 +12,8 @@ dnl AC_PROG_CC AC_PROG_RANLIB +AC_CHECK_PROG(LATEX, latex, latex, :) +AC_CHECK_PROG(POD2MAN, pod2man, pod2man, :) dnl Set special flags for gcc. dnl @@ -79,6 +81,6 @@ dnl Write results. dnl -AC_CONFIG_FILES(xds.h Makefile regression-tests/Makefile) -AC_CONFIG_COMMANDS([default], [chmod -w xds.h Makefile regression-tests/Makefile]) +AC_CONFIG_FILES(xds.h Makefile regression-tests/Makefile docs/Makefile) +AC_CONFIG_COMMANDS([default], [chmod -w xds.h Makefile regression-tests/Makefile docs/Makefile]) AC_OUTPUT Index: ossp-pkg/srpc/libxds/docs/Makefile.in ============================================================ $ cvs update -p -r1.1 Makefile.in # Build libxds documentation. LATEX = @LATEX@ POD2MAN = @POD2MAN@ .SUFFIXES: .SUFFIXES: .tex .dvi .ps .pod .3 .tex.dvi: latex \\nonstopmode\\input $<; \ while grep 'Rerun to' $*.log; do \ latex \\nonstopmode\\input $<; \ done .dvi.ps: dvips $< -o $@ .pod.3: $(POD2MAN) --section=3 --center="XDS Library Programmer API " $< >$@ all: libxds.ps xds.3 clean distclean realclean: rm -f libxds.aux libxds.dvi libxds.log libxds.ps libxds.toc rm -f xds.3 From ossp-cvs-owner@ossp.org Tue Aug 7 13:19:15 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f77BJEw92284; Tue, 7 Aug 2001 13:19:14 +0200 (CEST) Date: Tue, 7 Aug 2001 13:19:14 +0200 (CEST) Message-Id: <200108071119.f77BJEw92284@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds Makefile.in ossp-pkg/srpc/libxds/docs... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 07-Aug-2001 13:19:14 Branch: HEAD Handle: 2001080712191300 Modified files: ossp-pkg/srpc/libxds Makefile.in ossp-pkg/srpc/libxds/docs Makefile.in Log: clean and distclean targets will now be executed in docs and regression-tests, too. Summary: Revision Changes Path 1.18 +2 -0 ossp-pkg/srpc/libxds/Makefile.in 1.2 +4 -1 ossp-pkg/srpc/libxds/docs/Makefile.in ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/Makefile.in ============================================================ $ cvs diff -u -r1.17 -r1.18 Makefile.in --- ossp-pkg/srpc/libxds/Makefile.in 2001/08/07 11:16:19 1.17 +++ ossp-pkg/srpc/libxds/Makefile.in 2001/08/07 11:19:13 1.18 @@ -43,11 +43,13 @@ clean:: @(cd regression-tests && $(MAKE) $@) + @(cd docs && $(MAKE) $@) rm -f $(OBJS) rm -f libxds.a distclean:: clean @(cd regression-tests && $(MAKE) $@) + @(cd docs && $(MAKE) $@) rm -f config.log config.status Makefile realclean:: distclean Index: ossp-pkg/srpc/libxds/docs/Makefile.in ============================================================ $ cvs diff -u -r1.1 -r1.2 Makefile.in --- ossp-pkg/srpc/libxds/docs/Makefile.in 2001/08/07 11:16:20 1.1 +++ ossp-pkg/srpc/libxds/docs/Makefile.in 2001/08/07 11:19:13 1.2 @@ -20,6 +20,9 @@ all: libxds.ps xds.3 -clean distclean realclean: +clean: rm -f libxds.aux libxds.dvi libxds.log libxds.ps libxds.toc rm -f xds.3 + +distclean realclean: + rm -f Makefile From ossp-cvs-owner@ossp.org Tue Aug 7 15:12:56 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f77DCse06495; Tue, 7 Aug 2001 15:12:54 +0200 (CEST) Date: Tue, 7 Aug 2001 15:12:54 +0200 (CEST) Message-Id: <200108071312.f77DCse06495@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds/docs setbuffer-logic.dia setbuffer-lo... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 07-Aug-2001 15:12:54 Branch: HEAD Handle: 2001080714125400 Added files: ossp-pkg/srpc/libxds/docs setbuffer-logic.dia setbuffer-logic.eps Log: Nice diagramm illustrating the xds_setbuffer() function. Summary: Revision Changes Path 1.1 +4 -0 ossp-pkg/srpc/libxds/docs/setbuffer-logic.dia 1.1 +571 -0 ossp-pkg/srpc/libxds/docs/setbuffer-logic.eps ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/docs/setbuffer-logic.dia ============================================================ $ cvs update -p -r1.1 setbuffer-logic.dia #A4##flag##xds_setbuffer()##XDS_GIFT##XDS_LOAN##buffer##buffer##NULL##!NULL##NULL##!NULL##Allocate buffer.##Store buffer in XDS context. We own the buffer.##XDS_OK##Store buffer in XDS context. We don't own the buffer.##XDS_ERR_INVALID_ARG# Index: ossp-pkg/srpc/libxds/docs/setbuffer-logic.eps ============================================================ $ cvs update -p -r1.1 setbuffer-logic.eps %!PS-Adobe-2.0 EPSF-2.0 %%Title: /home/simons/projects/srpc/libxds/docs/setbuffer-logic.dia %%Creator: Dia v0.88.1 %%CreationDate: Tue Aug 7 15:09:04 2001 %%For: simons %%Magnification: 1.0000 %%Orientation: Portrait %%BoundingBox: 0 0 1395 829 %%Pages: 1 %%BeginSetup %%EndSetup %%EndComments %%BeginProlog [ /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quoteright /parenleft /parenright /asterisk /plus /comma /hyphen /period /slash /zero /one /two /three /four /five /six /seven /eight /nine /colon /semicolon /less /equal /greater /question /at /A /B /C /D /E /F /G /H /I /J /K /L /M /N /O /P /Q /R /S /T /U /V /W /X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore /quoteleft /a /b /c /d /e /f /g /h /i /j /k /l /m /n /o /p /q /r /s /t /u /v /w /x /y /z /braceleft /bar /braceright /asciitilde /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /space /exclamdown /cent /sterling /currency /yen /brokenbar /section /dieresis /copyright /ordfeminine /guillemotleft /logicalnot /hyphen /registered /macron /degree /plusminus /twosuperior /threesuperior /acute /mu /paragraph /periodcentered /cedilla /onesuperior /ordmasculine /guillemotright /onequarter /onehalf /threequarters /questiondown /Agrave /Aacute /Acircumflex /Atilde /Adieresis /Aring /AE /Ccedilla /Egrave /Eacute /Ecircumflex /Edieresis /Igrave /Iacute /Icircumflex /Idieresis /Eth /Ntilde /Ograve /Oacute /Ocircumflex /Otilde /Odieresis /multiply /Oslash /Ugrave /Uacute /Ucircumflex /Udieresis /Yacute /Thorn /germandbls /agrave /aacute /acircumflex /atilde /adieresis /aring /ae /ccedilla /egrave /eacute /ecircumflex /edieresis /igrave /iacute /icircumflex /idieresis /eth /ntilde /ograve /oacute /ocircumflex /otilde /odieresis /divide /oslash /ugrave /uacute /ucircumflex /udieresis /yacute /thorn /ydieresis] /isolatin1encoding exch def /Times-Roman-latin1 /Times-Roman findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /Times-Italic-latin1 /Times-Italic findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /Times-Bold-latin1 /Times-Bold findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /Times-BoldItalic-latin1 /Times-BoldItalic findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /AvantGarde-Book-latin1 /AvantGarde-Book findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /AvantGarde-BookOblique-latin1 /AvantGarde-BookOblique findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /AvantGarde-Demi-latin1 /AvantGarde-Demi findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /AvantGarde-DemiOblique-latin1 /AvantGarde-DemiOblique findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /Bookman-Light-latin1 /Bookman-Light findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /Bookman-LightItalic-latin1 /Bookman-LightItalic findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /Bookman-Demi-latin1 /Bookman-Demi findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /Bookman-DemiItalic-latin1 /Bookman-DemiItalic findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /Courier-latin1 /Courier findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /Courier-Oblique-latin1 /Courier-Oblique findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /Courier-Bold-latin1 /Courier-Bold findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /Courier-BoldOblique-latin1 /Courier-BoldOblique findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /Helvetica-latin1 /Helvetica findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /Helvetica-Oblique-latin1 /Helvetica-Oblique findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /Helvetica-Bold-latin1 /Helvetica-Bold findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /Helvetica-BoldOblique-latin1 /Helvetica-BoldOblique findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /Helvetica-Narrow-latin1 /Helvetica-Narrow findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /Helvetica-Narrow-Oblique-latin1 /Helvetica-Narrow-Oblique findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /Helvetica-Narrow-Bold-latin1 /Helvetica-Narrow-Bold findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /Helvetica-Narrow-BoldOblique-latin1 /Helvetica-Narrow-BoldOblique findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /NewCenturySchoolbook-Roman-latin1 /NewCenturySchoolbook-Roman findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /NewCenturySchoolbook-Italic-latin1 /NewCenturySchoolbook-Italic findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /NewCenturySchoolbook-Bold-latin1 /NewCenturySchoolbook-Bold findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /NewCenturySchoolbook-BoldItalic-latin1 /NewCenturySchoolbook-BoldItalic findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /Palatino-Roman-latin1 /Palatino-Roman findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /Palatino-Italic-latin1 /Palatino-Italic findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /Palatino-Bold-latin1 /Palatino-Bold findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /Palatino-BoldItalic-latin1 /Palatino-BoldItalic findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /Symbol-latin1 /Symbol findfont definefont pop /ZapfChancery-MediumItalic-latin1 /ZapfChancery-MediumItalic findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /ZapfDingbats-latin1 /ZapfDingbats findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding isolatin1encoding def currentdict end definefont pop /cp {closepath} bind def /c {curveto} bind def /f {fill} bind def /a {arc} bind def /ef {eofill} bind def /ex {exch} bind def /gr {grestore} bind def /gs {gsave} bind def /sa {save} bind def /rs {restore} bind def /l {lineto} bind def /m {moveto} bind def /rm {rmoveto} bind def /n {newpath} bind def /s {stroke} bind def /sh {show} bind def /slc {setlinecap} bind def /slj {setlinejoin} bind def /slw {setlinewidth} bind def /srgb {setrgbcolor} bind def /rot {rotate} bind def /sc {scale} bind def /sd {setdash} bind def /ff {findfont} bind def /sf {setfont} bind def /scf {scalefont} bind def /sw {stringwidth pop} bind def /tr {translate} bind def /ellipsedict 8 dict def ellipsedict /mtrx matrix put /ellipse { ellipsedict begin /endangle exch def /startangle exch def /yrad exch def /xrad exch def /y exch def /x exch def /savematrix mtrx currentmatrix def x y tr xrad yrad sc 0 0 1 startangle endangle arc savematrix setmatrix end } def /mergeprocs { dup length 3 -1 roll dup length dup 5 1 roll 3 -1 roll add array cvx dup 3 -1 roll 0 exch putinterval dup 4 2 roll putinterval } bind def 28.346000 -28.346000 scale -1.550000 -29.345000 translate %%EndProlog 1.000000 1.000000 1.000000 srgb n 26.226707 6.650000 m 28.503414 8.926707 l 26.226707 11.203414 l 23.950000 8.926707 l f 0.100000 slw [] 0 sd [] 0 sd 0 slj 0.000000 0.000000 0.000000 srgb n 26.226707 6.650000 m 28.503414 8.926707 l 26.226707 11.203414 l 23.950000 8.926707 l cp s /Times-Roman-latin1 ff 1.000000 scf sf (flag) dup sw 2 div 26.226707 ex sub 9.220824 m gs 1 -1 sc sh gr 0.100000 slw [] 0 sd [] 0 sd 0 slc 0 slj 0 slc 0 slj [] 0 sd 1.000000 1.000000 1.000000 srgb n 22.651100 0.650000 m 29.809107 0.650000 l 30.797422 0.650000 31.598608 1.054534 31.598608 1.553553 c 31.598608 2.052572 30.797422 2.457107 29.809107 2.457107 c 22.651100 2.457107 l 21.662785 2.457107 20.861598 2.052572 20.861598 1.553553 c 20.861598 1.054534 21.662785 0.650000 22.651100 0.650000 c f 0.000000 0.000000 0.000000 srgb n 22.651100 0.650000 m 29.809107 0.650000 l 30.797422 0.650000 31.598608 1.054534 31.598608 1.553553 c 31.598608 2.052572 30.797422 2.457107 29.809107 2.457107 c 22.651100 2.457107 l 21.662785 2.457107 20.861598 2.052572 20.861598 1.553553 c 20.861598 1.054534 21.662785 0.650000 22.651100 0.650000 c s /Times-Roman-latin1 ff 1.000000 scf sf (xds_setbuffer\(\)) dup sw 2 div 26.230103 ex sub 1.847671 m gs 1 -1 sc sh gr 0.100000 slw [] 0 sd [] 0 sd 0 slc n 26.230103 2.457107 m 26.226707 6.650000 l s 0.100000 slw [] 0 sd 0 slj 0 slc n 25.827355 5.849676 m 26.226707 6.650000 l 26.627355 5.850324 l s 0.100000 slw [] 0 sd [] 0 sd 0 slj 0 slc n 28.503414 8.926707 m 28.503414 8.919400 l 38.584257 8.919400 l 38.584257 12.650000 l s 0.100000 slw [] 0 sd 0 slj 0 slc n 38.184257 11.850000 m 38.584257 12.650000 l 38.984257 11.850000 l s 0.100000 slw [] 0 sd [] 0 sd 0 slj 0 slc n 23.950000 8.926707 m 23.950000 8.919400 l 13.934257 8.919400 l 13.934257 12.800000 l s 0.100000 slw [] 0 sd 0 slj 0 slc n 13.534257 12.000000 m 13.934257 12.800000 l 14.334257 12.000000 l s /Times-Roman-latin1 ff 1.000000 scf sf (XDS_GIFT) dup sw 2 div 32.950000 ex sub 8.650000 m gs 1 -1 sc sh gr /Times-Roman-latin1 ff 1.000000 scf sf (XDS_LOAN) dup sw 2 div 18.950000 ex sub 8.650000 m gs 1 -1 sc sh gr 1.000000 1.000000 1.000000 srgb n 38.584257 12.650000 m 41.218514 15.284257 l 38.584257 17.918514 l 35.950000 15.284257 l f 0.100000 slw [] 0 sd [] 0 sd 0 slj 0.000000 0.000000 0.000000 srgb n 38.584257 12.650000 m 41.218514 15.284257 l 38.584257 17.918514 l 35.950000 15.284257 l cp s /Times-Roman-latin1 ff 1.000000 scf sf (buffer) dup sw 2 div 38.584257 ex sub 15.578374 m gs 1 -1 sc sh gr 1.000000 1.000000 1.000000 srgb n 13.934257 12.800000 m 16.568514 15.434257 l 13.934257 18.068514 l 11.300000 15.434257 l f 0.100000 slw [] 0 sd [] 0 sd 0 slj 0.000000 0.000000 0.000000 srgb n 13.934257 12.800000 m 16.568514 15.434257 l 13.934257 18.068514 l 11.300000 15.434257 l cp s /Times-Roman-latin1 ff 1.000000 scf sf (buffer) dup sw 2 div 13.934257 ex sub 15.728374 m gs 1 -1 sc sh gr 0.100000 slw [] 0 sd [] 0 sd 0 slj 0 slc n 41.218514 15.284257 m 41.218514 15.368293 l 46.867680 15.368293 l 46.867680 19.903041 l s 0.100000 slw [] 0 sd 0 slj 0 slc n 46.467680 19.103041 m 46.867680 19.903041 l 47.267680 19.103041 l s 0.100000 slw [] 0 sd [] 0 sd 0 slj 0 slc n 16.568514 15.434257 m 16.568514 15.434605 l 20.056305 15.434605 l 20.056305 23.119000 l s 0.100000 slw [] 0 sd 0 slj 0 slc n 19.656305 22.319000 m 20.056305 23.119000 l 20.456305 22.319000 l s 0.100000 slw [] 0 sd [] 0 sd 0 slj 0 slc n 11.300000 15.434257 m 11.300000 15.434605 l 7.976700 15.434605 l 7.976700 26.195000 l s 0.100000 slw [] 0 sd 0 slj 0 slc n 7.576700 25.395000 m 7.976700 26.195000 l 8.376700 25.395000 l s 0.100000 slw [] 0 sd [] 0 sd 0 slj 0 slc n 35.950000 15.284257 m 35.950000 15.245000 l 31.466350 15.245000 l 31.466350 19.395000 l s 0.100000 slw [] 0 sd 0 slj 0 slc n 31.066350 18.595000 m 31.466350 19.395000 l 31.866350 18.595000 l s /Times-Roman-latin1 ff 1.000000 scf sf (NULL) dup sw 2 div 18.400000 ex sub 15.150000 m gs 1 -1 sc sh gr /Times-Roman-latin1 ff 1.000000 scf sf (!NULL) dup sw 2 div 9.550000 ex sub 15.150000 m gs 1 -1 sc sh gr /Times-Roman-latin1 ff 1.000000 scf sf (NULL) dup sw 2 div 43.283200 ex sub 14.950000 m gs 1 -1 sc sh gr /Times-Roman-latin1 ff 1.000000 scf sf (!NULL) dup sw 2 div 34.499850 ex sub 14.950000 m gs 1 -1 sc sh gr 1.000000 1.000000 1.000000 srgb n 43.051330 19.903041 m 43.051330 22.003041 l 50.684030 22.003041 l 50.684030 19.903041 l f 0.100000 slw [] 0 sd [] 0 sd 0 slj 0.000000 0.000000 0.000000 srgb n 43.051330 19.903041 m 43.051330 22.003041 l 50.684030 22.003041 l 50.684030 19.903041 l cp s /Times-Roman-latin1 ff 1.000000 scf sf (Allocate buffer.) dup sw 2 div 46.867680 ex sub 21.247159 m gs 1 -1 sc sh gr 1.000000 1.000000 1.000000 srgb n 25.089650 19.395000 m 25.089650 22.495000 l 37.843050 22.495000 l 37.843050 19.395000 l f 0.100000 slw [] 0 sd [] 0 sd 0 slj 0.000000 0.000000 0.000000 srgb n 25.089650 19.395000 m 25.089650 22.495000 l 37.843050 22.495000 l 37.843050 19.395000 l cp s /Times-Roman-latin1 ff 1.000000 scf sf (Store buffer in XDS context.) dup sw 2 div 31.466350 ex sub 20.739118 m gs 1 -1 sc sh gr (We own the buffer.) dup sw 2 div 31.466350 ex sub 21.739118 m gs 1 -1 sc sh gr 0.100000 slw [] 0 sd [] 0 sd 0 slc n 37.843050 20.945000 m 43.051330 20.953041 l s 0.100000 slw [] 0 sd 0 slj 0 slc n 38.643667 20.546236 m 37.843050 20.945000 l 38.642432 21.346235 l s 0.100000 slw [] 0 sd [] 0 sd 0 slc 0 slj 0 slc 0 slj [] 0 sd 1.000000 1.000000 1.000000 srgb n 28.975023 26.830598 m 33.951430 26.830598 l 34.638529 26.830598 35.195532 27.235133 35.195532 27.734152 c 35.195532 28.233171 34.638529 28.637705 33.951430 28.637705 c 28.975023 28.637705 l 28.287924 28.637705 27.730921 28.233171 27.730921 27.734152 c 27.730921 27.235133 28.287924 26.830598 28.975023 26.830598 c f 0.000000 0.000000 0.000000 srgb n 28.975023 26.830598 m 33.951430 26.830598 l 34.638529 26.830598 35.195532 27.235133 35.195532 27.734152 c 35.195532 28.233171 34.638529 28.637705 33.951430 28.637705 c 28.975023 28.637705 l 28.287924 28.637705 27.730921 28.233171 27.730921 27.734152 c 27.730921 27.235133 28.287924 26.830598 28.975023 26.830598 c s /Times-Roman-latin1 ff 1.000000 scf sf (XDS_OK) dup sw 2 div 31.463226 ex sub 28.028269 m gs 1 -1 sc sh gr 0.100000 slw [] 0 sd [] 0 sd 0 slc n 31.463226 26.830598 m 31.466350 22.495000 l s 0.100000 slw [] 0 sd 0 slj 0 slc n 31.063803 26.030310 m 31.463226 26.830598 l 31.863803 26.030887 l s 1.000000 1.000000 1.000000 srgb n 1.600000 26.195000 m 1.600000 29.295000 l 14.353400 29.295000 l 14.353400 26.195000 l f 0.100000 slw [] 0 sd [] 0 sd 0 slj 0.000000 0.000000 0.000000 srgb n 1.600000 26.195000 m 1.600000 29.295000 l 14.353400 29.295000 l 14.353400 26.195000 l cp s /Times-Roman-latin1 ff 1.000000 scf sf (Store buffer in XDS context.) dup sw 2 div 7.976700 ex sub 27.539118 m gs 1 -1 sc sh gr (We don't own the buffer.) dup sw 2 div 7.976700 ex sub 28.539118 m gs 1 -1 sc sh gr 0.100000 slw [] 0 sd [] 0 sd 0 slc 0 slj 0 slc 0 slj [] 0 sd 1.000000 1.000000 1.000000 srgb n 13.674552 23.119000 m 26.438058 23.119000 l 28.200332 23.119000 29.628935 23.523534 29.628935 24.022553 c 29.628935 24.521572 28.200332 24.926107 26.438058 24.926107 c 13.674552 24.926107 l 11.912278 24.926107 10.483675 24.521572 10.483675 24.022553 c 10.483675 23.523534 11.912278 23.119000 13.674552 23.119000 c f 0.000000 0.000000 0.000000 srgb n 13.674552 23.119000 m 26.438058 23.119000 l 28.200332 23.119000 29.628935 23.523534 29.628935 24.022553 c 29.628935 24.521572 28.200332 24.926107 26.438058 24.926107 c 13.674552 24.926107 l 11.912278 24.926107 10.483675 24.521572 10.483675 24.022553 c 10.483675 23.523534 11.912278 23.119000 13.674552 23.119000 c s /Times-Roman-latin1 ff 1.000000 scf sf (XDS_ERR_INVALID_ARG) dup sw 2 div 20.056305 ex sub 24.316671 m gs 1 -1 sc sh gr 0.100000 slw [] 0 sd [] 0 sd 0 slc n 27.730921 27.734152 m 14.353400 27.745000 l s 0.100000 slw [] 0 sd 0 slj 0 slc n 26.931246 28.134800 m 27.730921 27.734152 l 26.930597 27.334801 l s showpage From ossp-cvs-owner@ossp.org Tue Aug 7 16:07:02 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f77E71n14698; Tue, 7 Aug 2001 16:07:01 +0200 (CEST) Date: Tue, 7 Aug 2001 16:07:01 +0200 (CEST) Message-Id: <200108071407.f77E71n14698@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds/docs Makefile.in Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 07-Aug-2001 16:07:01 Branch: HEAD Handle: 2001080715070000 Modified files: ossp-pkg/srpc/libxds/docs Makefile.in Log: Updated dependencies. Summary: Revision Changes Path 1.3 +5 -1 ossp-pkg/srpc/libxds/docs/Makefile.in ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/docs/Makefile.in ============================================================ $ cvs diff -u -r1.2 -r1.3 Makefile.in --- ossp-pkg/srpc/libxds/docs/Makefile.in 2001/08/07 11:19:13 1.2 +++ ossp-pkg/srpc/libxds/docs/Makefile.in 2001/08/07 14:07:00 1.3 @@ -4,7 +4,7 @@ POD2MAN = @POD2MAN@ .SUFFIXES: -.SUFFIXES: .tex .dvi .ps .pod .3 +.SUFFIXES: .tex .dvi .ps .pod .3 .tex.dvi: latex \\nonstopmode\\input $<; \ @@ -26,3 +26,7 @@ distclean realclean: rm -f Makefile + +# Dependencies + +libxds.dvi: architecture.eps data-exchange.eps setbuffer-logic.eps From ossp-cvs-owner@ossp.org Tue Aug 7 16:07:27 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f77E7PI14751; Tue, 7 Aug 2001 16:07:25 +0200 (CEST) Date: Tue, 7 Aug 2001 16:07:25 +0200 (CEST) Message-Id: <200108071407.f77E7PI14751@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds/docs libxds.tex Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 07-Aug-2001 16:07:25 Branch: HEAD Handle: 2001080715072500 Modified files: ossp-pkg/srpc/libxds/docs libxds.tex Log: Added the chapter with reference documentation for the XDS framework. Summary: Revision Changes Path 1.2 +223 -3 ossp-pkg/srpc/libxds/docs/libxds.tex ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/docs/libxds.tex ============================================================ $ cvs diff -u -r1.1 -r1.2 libxds.tex --- ossp-pkg/srpc/libxds/docs/libxds.tex 2001/08/02 13:58:07 1.1 +++ ossp-pkg/srpc/libxds/docs/libxds.tex 2001/08/07 14:07:25 1.2 @@ -1,6 +1,6 @@ % -*- mode: LaTeX; fill-column: 75; -*- % -% $Id: libxds.tex,v 1.1 2001/08/02 13:58:07 simons Exp $ +% $Id: libxds.tex,v 1.2 2001/08/07 14:07:25 simons Exp $ % \documentclass[a4paper,10pt,pointlessnumbers,bibtotoc]{scrartcl} \usepackage[dvips,xdvi]{graphicx} @@ -548,23 +548,243 @@ \section{Extending the XDS library} \label{meta engines} - \section{The XDS Framework} \label{xds} +\subsection{xds\_t* xds\_init(xds\_mode\_t~\underline{mode});} + +This routine creates and initializes a context for use with the XDS +library. The ``mode'' parameter may be either \textsf{XDS\_ENCODE} or +\textsf{XDS\_DECODE}, depending on whether you want to encode or to decode +data. If successful, xds\_init() returns a pointer to the XDS context +structure. In case of failure, though, xds\_init() will return +\textsf{NULL} and set \textsf{errno} to ENOMEM (failed to allocate internal +memory buffers) or EINVAL (``mode'' parameter was invalid). + +A context obtained from xds\_init() should be destroyed by calling +xds\_destroy() when it is not needed any more. + +\subsection{void xds\_destroy(xds\_t*~\underline{xds});} + +xds\_destroy() will destroy an XDS context created by xds\_init(). Doing so +will return all resources associated with this context --- most notably the +memory used to buffer the results of encoding or decoding any values. A +context may not be used anymore after it has been destroyed. + +\subsection{int xds\_register(xds\_t*~\underline{xds}, const~char*~\underline{name}, xds\_engine\_t~\underline{engine}, void*~\underline{engine\_context});} + +This routine will register a formatting engine in the provided XDS context. +A ``formatting engine'' is potentially any function that fullfils the +following interface: + +\begin{quote} +\begin{verbatim} +int engine(xds_t* xds, void* engine_context, + void* buffer, size_t buffer_size, size_t* used_buffer_size, + va_list* args); +\end{verbatim} +\end{quote} + +By calling xds\_register(), the formatting engine ``engine'' will be +registered under the name ``name'' in the XDS context ``xds''. The last +parameter ``engine\_context'' may be specified as the user sees fit: It +will be passed when the engine is actually called and may be used to +implement an engine-specific context. Most engines will not need a context +of their own, in which case \textsf{NULL} should be used here. + +Please note that until the user calls xds\_register() for an XDS context he +obtained from xds\_init(), no engines are registered for that context. Even +the engines included in the library distribution are not registered +automatically. + +For engine names, any combination of the characters ``a--z'', ``A--Z'', +``0--9'', ``-'', and ``\_'' may be used; anything else is not a legal +engine name component. + +xds\_register() may return the following return codes: \textsf{XDS\_OK} + (everything went fine; the engine is registered now), +\textsf{XDS\_ERR\_INVALID\_ARG} (either ``xds'', ``name'', or ``engine'' + are \textsf{NULL} or ``name'' contains illegal characters for an engine + name), or +\textsf{XDS\_ERR\_NO\_MEM} (failed to allocate internally required + buffers). + +\subsection{int xds\_unregister(xds\_t*~\underline{xds}, const~char*~\underline{name});} + +xds\_unregister() will remove the formatting engine ``name'' from XDS +context ``xds''. The function will return \textsf{XDS\_OK} in case +everything went fine, \textsf{XDS\_ERR\_UNKNOWN\_ENGINE} in case the engine +``name'' is not registered in ``xds'', or \textsf{XDS\_ERR\_INVALID\_ARG} +if either ``xds'' or ``name'' are \textsf{NULL} or ``name'' contains +illegal characters for an engine name. + +\subsection{int xds\_setbuffer(xds\_t*~\underline{xds}, xds\_scope\_t~\underline{flag}, void*~\underline{buffer}, size\_t~\underline{buffer\_len});} + +\begin{figure}[tbh] + \begin{center} + \includegraphics[width=\textwidth]{setbuffer-logic.eps} + \caption{xds\_setbuffer() modes of operation} + \label{setbuffer logic} + \end{center} +\end{figure} + +This routine allows the user to control XDS' buffer handling: Calling it +will replace the buffer currently used in ``xds''. The address and size of +that buffer are passed to xds\_setbuffer() via the ``buffer'' and +``buffer\_len'' parameters. The ``xds'' parameter determines for which XDS +context the new buffer will be set. Furthermore, you can set ``flag'' to +either \textsf{XDS\_GIFT} or \textsf{XDS\_LOAN}. + +A setting of \textsf{XDS\_GIFT} will tell libxds that the provided buffer +is now owned by the library and that it may be resized by calling +\textsf{realloc(3)}. Furthermore, the buffer is \textsf{free(3)}ed when +``xds'' is destroyed. If ``flag'' is \textsf{XDS\_GIFT} and ``buffer'' is +\textsf{NULL}, the xds\_setbuffer will simply allocate a buffer of its own +to be set in ``xds''. Please note that a buffer given to libxds as gift +\emph{must} have been allocated using \textsf{malloc(3)} --- it may not +life on the stack because libxds will try to free or to resize the buffer +as it sees fit. + +Passing \textsf{XDS\_LOAN} via ``flag'' tells xds\_setbuffer() that the +buffer is owned by the application and that libxds should not free nor +resize the buffer in any case. In this mode, passing a buffer \textsf{NULL} +will result in an invalid-argument error. + +\subsection{int xds\_getbuffer(xds\_t*~\underline{xds}, xds\_scope\_t~\underline{flag}, void**~\underline{buffer}, size\_t*~\underline{buffer\_len});} + +This routine is the counterpart to xds\_setbuffer(): It will get the buffer +currently used in the XDS context ``xds''. The address of that buffer is +stored in the location ``buffer'' points to; the length of the buffer's +content will be stored in the location ``buffer\_len'' points to. + +The ``flag'' argument may be set to either \textsf{XDS\_GIFT} or +\textsf{XDS\_LOAN}. The first setting means that the buffer is now owned by +the application and that libxds must not use it after this xds\_getbuffer() +call anymore; the library will instead allocate a new buffer for itself. Of +course this also means that the buffer will not be freed in xds\_destroy(): +The application has to \textsf{free(3)} the buffer itself when it is not +needed anymore. + +Setting ``flag'' to \textsf{XDS\_LOAN} tells libxds that the application +just wishes to peek into the buffer and will not modify it. The buffer is +still owned (and used) by libxds. Please note that the loaned address +returned by xds\_getbuffer() may become invalid change after any other +xds\_xxx() function call! If you need a reliable address, use +\textsf{XDS\_GIFT} mode. + +The routine will return \textsf{XDS\_OK} (everything went fine) or +\textsf{XDS\_ERR\_INVALID\_ARG} (``xds'', ``buffer'' or ``buffer\_len'' are +\textsf{NULL} or ``flag'' is invalid) signifying success or failure +respectively. + +Please note: It is perfectly legal for xds\_getbuffer() to return a buffer +of \textsf{NULL} and a buffer length of 0! This happens when +xds\_getbuffer() is called for an XDS context before a buffer has been +allocated. + +\subsection{int xds\_vencode(xds\_t*~\underline{xds}, const~char*~\underline{fmt}, va\_list~\underline{args});} + +This routine will encode one or several values using the apropriate +formatting engines registered in XDS context ``xds''. The parameter ``fmt'' +contains a \textsf{sprintf(3)}-alike descriptions of the values to be +encoded; the actual values are provided in the varadic parameter ``args''. + +The format for ``fmt'' is simple: Just provide the names of the engines to +be used for encode the apropriate value in ``args''. Any non-legal +engine-name character may be used as a delimiter. In order to encode two +32-bit integers followed by a 64-bit integer, the format string +\begin{quote} +\begin{verbatim} +int32 int32 int64 +\end{verbatim} +\end{quote} +could be used. In case you don't like the blank, use the colon instead: +\begin{quote} +\begin{verbatim*} +int32:int32:int64 +\end{verbatim*} +\end{quote} + +Of course the names to be used here have to correspond to the names used to +register the formatting engines in ``xds'' earlier. + +Every time xds\_vencode() is called, it will append the encoded data at the +end of the internal buffer stored in ``xds''. Thus, you can call +xds\_vencode() several times in order to encode several values, but you'll +still get all encoded values stored in one buffer. Calling xds\_setbuffer() +or xds\_getbuffer() at any point during the encoding will re-set the buffer +to the beginning. All values that have been encoded into that buffer +already will eventually be overwritten when xds\_encode() is called again. +Hence: Don't call xds\_setbuffer() or xds\_getbuffer() unless you actually +want to access the data stored in the buffer. + +Also it should be noted that the data you have to provide for ``args'' +depends entirely on what the deployed engines expect to find on the stack +--- there is no ``standard'' on what should be put on the stack here. The +XML and XDR engines included in the distribution will simply expect the +value to be encoded to be found on the stack, but other engines may act +differently. See section~\ref{meta engines} for an example of such an +engine. + +xds\_vencode() will return any of the following return codes: +\textsf{XDS\_OK} (everything worked fine), \textsf{XDS\_ERR\_NO\_MEM} +(failed to allocate or to resize the internal buffer), +\textsf{XDS\_ERR\_OVER\-FLOW} (the internal buffer is too small but is not +owned by us), \textsf{XDS\_ERR\_INVALID\_ARG} (``xds'' or ``fmt'' are +\textsf{NULL}), \textsf{XDS\_ERR\_UNKNOWN\_ENGINE} (an engine name +specified in ``fmt'' is not registered in ``xds''), +\textsf{XDS\_ERR\_INVALID\_MODE} (``xds'' is initialized in decode mode), +or \textsf{XDS\_ERR\_UNKNOWN} (the formatting engine returned an +unspecified error). + +\subsection{int xds\_encode(xds\_t*~\underline{xds}, const~char*~\underline{fmt}, \dots{});} + +This routine is basically identical to xds\_vencode(), only that it uses a +different prototype syntax. + +\subsection{int xds\_vdecode(xds\_t*~\underline{xds}, const~char*~\underline{fmt}, va\_list~\underline{args});} + +This routine is almost identical to xds\_vencode(): It expects an XDS +context, a format string and a set of parameters for the formatting +engines, but xds\_vdecode() does not encode any data, it decodes the data +back into the native format. The format string again determines which +engines are to be called by the framework in order to decode the values +contained in the buffer. The native values will then be stored at the +locations found in the corresponding ``args'' entry. But please note that +the exact behavior of the decoding engines is not specified! The XML and +XDR engines included in this distribution expect a pointer to a location +where to store the decoded value, but other engines may vary. + +xds\_vdecode() may return any of the following return codes: +\textsf{XDS\_OK} (everything went fine), \textsf{XDS\_ERR\_INVALID\_ARG} +(``xds'' or ``fmt'' are \textsf{NULL}), \textsf{XDS\_ERR\_TYPE\_MISMATCH} +(the format string says the next value is of type $A$, but that's not what +we found in the buffer), \textsf{XDS\_ERR\_UNKNOWN\_ENGINE} (an engine name +specified in ``fmt'' is not registered in ``xds''), +\textsf{XDS\_ERR\_INVALID\_MODE} (``xds'' has been initialized in encode +mode), \textsf{XDS\_ERR\_UNDER\-FLOW} (an engine tried to read $n$ byte from +the buffer, but we don't have that much data left), or +\textsf{XDS\_ERR\_UNKNOWN} (an engine returned an unspecified error). + + +\subsection{int xds\_decode(xds\_t*~\underline{xds}, const~char*~\underline{fmt}, \dots{});} + +This routine is basically identical to xds\_vdecode(), only that it uses a +different prototype syntax. + \section{The XDR Engines} \label{xdr} \section{The XML Engines} \label{xml} +\newpage \begin{thebibliography}{xxx} \bibitem{xdr} RFC 1832: ``XDR: External Data Representation Standard'', R.~Srinivasan, August~1995 \bibitem{xml} {\sf http://www.ossp.org/pkg/xds/xds-xml.dtd} - \end{thebibliography} From ossp-cvs-owner@ossp.org Tue Aug 7 16:23:55 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f77ENst16310; Tue, 7 Aug 2001 16:23:54 +0200 (CEST) Date: Tue, 7 Aug 2001 16:23:54 +0200 (CEST) Message-Id: <200108071423.f77ENst16310@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds Makefile.in Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 07-Aug-2001 16:23:54 Branch: HEAD Handle: 2001080715235300 Modified files: ossp-pkg/srpc/libxds Makefile.in Log: xds.3 is no longer in this area... Summary: Revision Changes Path 1.19 +1 -1 ossp-pkg/srpc/libxds/Makefile.in ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/Makefile.in ============================================================ $ cvs diff -u -r1.18 -r1.19 Makefile.in --- ossp-pkg/srpc/libxds/Makefile.in 2001/08/07 11:19:13 1.18 +++ ossp-pkg/srpc/libxds/Makefile.in 2001/08/07 14:23:53 1.19 @@ -34,7 +34,7 @@ .c.o: $(CC) $(CPPFLAGS) $(WARNFLAGS) $(OPTFLAGS) $(CFLAGS) -c $< -all: libxds.a xds.3 +all: libxds.a libxds.a: $(OBJS) @rm -f $@ From ossp-cvs-owner@ossp.org Tue Aug 7 16:41:08 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f77Ef7919050; Tue, 7 Aug 2001 16:41:07 +0200 (CEST) Date: Tue, 7 Aug 2001 16:41:07 +0200 (CEST) Message-Id: <200108071441.f77Ef7919050@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds/docs libxds.tex Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 07-Aug-2001 16:41:07 Branch: HEAD Handle: 2001080715410600 Modified files: ossp-pkg/srpc/libxds/docs libxds.tex Log: Documented the XDR and XML callbacks in tabular form. Summary: Revision Changes Path 1.3 +39 -2 ossp-pkg/srpc/libxds/docs/libxds.tex ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/docs/libxds.tex ============================================================ $ cvs diff -u -r1.2 -r1.3 libxds.tex --- ossp-pkg/srpc/libxds/docs/libxds.tex 2001/08/07 14:07:25 1.2 +++ ossp-pkg/srpc/libxds/docs/libxds.tex 2001/08/07 14:41:06 1.3 @@ -1,6 +1,6 @@ % -*- mode: LaTeX; fill-column: 75; -*- % -% $Id: libxds.tex,v 1.2 2001/08/07 14:07:25 simons Exp $ +% $Id: libxds.tex,v 1.3 2001/08/07 14:41:06 simons Exp $ % \documentclass[a4paper,10pt,pointlessnumbers,bibtotoc]{scrartcl} \usepackage[dvips,xdvi]{graphicx} @@ -766,7 +766,6 @@ the buffer, but we don't have that much data left), or \textsf{XDS\_ERR\_UNKNOWN} (an engine returned an unspecified error). - \subsection{int xds\_decode(xds\_t*~\underline{xds}, const~char*~\underline{fmt}, \dots{});} This routine is basically identical to xds\_vdecode(), only that it uses a @@ -775,8 +774,46 @@ \section{The XDR Engines} \label{xdr} +\begin{tabular}{|c|c|c|c|} \hline +\bf Function Name & \bf Expected ``args'' Data Type & \bf Input Size & \bf Output Size \\ \hline +xdr\_encode\_uint32() & xds\_uint32\_t & 4 byte & 4 byte \\ +xdr\_decode\_uint32() & xds\_uint32\_t* & 4 byte & 4 byte \\[1ex] +xdr\_encode\_int32() & xds\_int32\_t & 4 byte & 4 byte \\ +xdr\_decode\_int32() & xds\_int32\_t* & 4 byte & 4 byte \\[1ex] +xdr\_encode\_uint64() & xds\_uint64\_t & 4 byte & 4 byte \\ +xdr\_decode\_uint64() & xds\_uint64\_t* & 4 byte & 4 byte \\[1ex] +xdr\_encode\_int64() & xds\_int64\_t & 4 byte & 4 byte \\ +xdr\_decode\_int64() & xds\_int64\_t* & 4 byte & 4 byte \\[1ex] +xdr\_encode\_double() & xds\_double\_t & ?? byte & ?? byte \\ +xdr\_decode\_double() & xds\_double\_t* & ?? byte & ?? byte \\[1ex] +xdr\_encode\_octetstream() & void*, size\_t & variable & variable \\ +xdr\_decode\_octetstream() & void**, size\_t* & variable & variable \\[1ex] +xdr\_encode\_string() & char* & variable & variable \\ +xdr\_decode\_string() & char** & variable & variable \\ \hline +\end{tabular} + \section{The XML Engines} \label{xml} + +\subsection{Encoding engines} + +\begin{tabular}{|c|c|c|c|} \hline +\bf Function Name & \bf Expected ``args'' Data Type & \bf Input Size & \bf Output Size \\ \hline +xml\_encode\_uint32() & xds\_uint32\_t & ?? byte & ?? byte \\ +xml\_decode\_uint32() & xds\_uint32\_t* & ?? byte & ?? byte \\[1ex] +xml\_encode\_int32() & xds\_int32\_t & ?? byte & ?? byte \\ +xml\_decode\_int32() & xds\_int32\_t* & ?? byte & ?? byte \\[1ex] +xml\_encode\_uint64() & xds\_uint64\_t & ?? byte & ?? byte \\ +xml\_decode\_uint64() & xds\_uint64\_t* & ?? byte & ?? byte \\[1ex] +xml\_encode\_int64() & xds\_int64\_t & ?? byte & ?? byte \\ +xml\_decode\_int64() & xds\_int64\_t* & ?? byte & ?? byte \\[1ex] +xml\_encode\_double() & xds\_double\_t & ?? byte & ?? byte \\ +xml\_decode\_double() & xds\_double\_t* & ?? byte & ?? byte \\[1ex] +xml\_encode\_octetstream() & void*, size\_t & variable & variable \\ +xml\_decode\_octetstream() & void**, size\_t* & variable & variable \\[1ex] +xml\_encode\_string() & char* & variable & variable \\ +xml\_decode\_string() & char** & variable & variable \\ \hline +\end{tabular} \newpage \begin{thebibliography}{xxx} From ossp-cvs-owner@ossp.org Tue Aug 7 16:42:05 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f77Eg3d19361; Tue, 7 Aug 2001 16:42:03 +0200 (CEST) Date: Tue, 7 Aug 2001 16:42:03 +0200 (CEST) Message-Id: <200108071442.f77Eg3d19361@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds Makefile.in Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 07-Aug-2001 16:42:03 Branch: HEAD Handle: 2001080715420300 Modified files: ossp-pkg/srpc/libxds Makefile.in Log: Added docs target to build the manual. Summary: Revision Changes Path 1.20 +3 -0 ossp-pkg/srpc/libxds/Makefile.in ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/Makefile.in ============================================================ $ cvs diff -u -r1.19 -r1.20 Makefile.in --- ossp-pkg/srpc/libxds/Makefile.in 2001/08/07 14:23:53 1.19 +++ ossp-pkg/srpc/libxds/Makefile.in 2001/08/07 14:42:03 1.20 @@ -58,6 +58,9 @@ check: libxds.a (cd regression-tests && $(MAKE) check) +docs: + @(cd docs && $(MAKE)) + # Dependencies $(XDS_OBJS): internal.h xds.h From ossp-cvs-owner@ossp.org Tue Aug 7 16:46:40 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f77EkdM20190; Tue, 7 Aug 2001 16:46:39 +0200 (CEST) Date: Tue, 7 Aug 2001 16:46:39 +0200 (CEST) Message-Id: <200108071446.f77EkdM20190@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds Makefile.in Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 07-Aug-2001 16:46:39 Branch: HEAD Handle: 2001080715463800 Modified files: ossp-pkg/srpc/libxds Makefile.in Log: Added phony declaration for those targets not associated with a file in the repository. Summary: Revision Changes Path 1.21 +2 -0 ossp-pkg/srpc/libxds/Makefile.in ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/Makefile.in ============================================================ $ cvs diff -u -r1.20 -r1.21 Makefile.in --- ossp-pkg/srpc/libxds/Makefile.in 2001/08/07 14:42:03 1.20 +++ ossp-pkg/srpc/libxds/Makefile.in 2001/08/07 14:46:38 1.21 @@ -34,6 +34,8 @@ .c.o: $(CC) $(CPPFLAGS) $(WARNFLAGS) $(OPTFLAGS) $(CFLAGS) -c $< +.PHONY: clean distclean realclean check docs + all: libxds.a libxds.a: $(OBJS) From ossp-cvs-owner@ossp.org Tue Aug 7 20:56:57 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f77Iuu752262; Tue, 7 Aug 2001 20:56:56 +0200 (CEST) Date: Tue, 7 Aug 2001 20:56:56 +0200 (CEST) Message-Id: <200108071856.f77Iuu752262@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/str ChangeLog shtool Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 07-Aug-2001 20:56:56 Branch: HEAD Handle: 2001080719565600 Modified files: ossp-pkg/str ChangeLog shtool Log: Update to GNU shtool 1.5.4 Summary: Revision Changes Path 1.29 +2 -2 ossp-pkg/str/ChangeLog 1.7 +43 -14 ossp-pkg/str/shtool ____________________________________________________________________________ Index: ossp-pkg/str/ChangeLog ============================================================ $ cvs diff -u -r1.28 -r1.29 ChangeLog --- ossp-pkg/str/ChangeLog 2001/04/27 12:22:21 1.28 +++ ossp-pkg/str/ChangeLog 2001/08/07 18:56:56 1.29 @@ -9,9 +9,9 @@ ChangeLog - Changes between 0.9.4 and 0.9.5 (14-Jul-2000 to xx-May-2001): + Changes between 0.9.4 and 0.9.5 (14-Jul-2000 to xx-Aug-2001): - *) Upgrade to GNU shtool 1.5.3. + *) Upgrade to GNU shtool 1.5.4. [Ralf S. Engelschall] *) Fixed handling of NaN and Inf values in str_format.c Index: ossp-pkg/str/shtool ============================================================ $ cvs diff -u -r1.6 -r1.7 shtool --- ossp-pkg/str/shtool 2001/04/27 12:22:21 1.6 +++ ossp-pkg/str/shtool 2001/08/07 18:56:56 1.7 @@ -6,7 +6,7 @@ ## See http://www.gnu.org/software/shtool/ for more information. ## See ftp://ftp.gnu.org/gnu/shtool/ for latest version. ## -## Version: 1.5.3 (19-Apr-2001) +## Version: 1.5.4 (14-Jun-2001) ## Contents: 6/17 available modules ## @@ -65,11 +65,11 @@ exit 1 fi if [ ".$1" = ".-h" -o ".$1" = ".--help" ]; then - echo "This is GNU shtool, version 1.5.3 (19-Apr-2001)" + echo "This is GNU shtool, version 1.5.4 (14-Jun-2001)" echo "Copyright (c) 1994-2001 Ralf S. Engelschall " echo "Report bugs to " echo '' - echo "Usage: shtool [] [ [] []]" + echo "Usage: shtool [] [ [] []]" echo '' echo 'Available global :' echo ' -v, --version display shtool version information' @@ -105,7 +105,7 @@ exit 0 fi if [ ".$1" = ".-v" -o ".$1" = ."--version" ]; then - echo "GNU shtool 1.5.3 (19-Apr-2001)" + echo "GNU shtool 1.5.4 (14-Jun-2001)" exit 0 fi if [ ".$1" = ".-r" -o ".$1" = ."--recreate" ]; then @@ -389,7 +389,7 @@ fi # determine terminal bold sequence - term_bold='' + term_bold='' term_norm='' if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%[Bb]'`" != . ]; then case $TERM in @@ -440,7 +440,7 @@ # determine user name username='' - if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%[uU]'`" != . ]; then + if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%[uUgG]'`" != . ]; then username="$LOGNAME" if [ ".$username" = . ]; then username="$USER" @@ -482,8 +482,38 @@ fi fi - # determine host name + # determine (primary) group id + groupid='' + if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%[gG]'`" != . ]; then + groupid=`egrep "^${username}:" /etc/passwd 2>/dev/null | \ + sed -e 's/[^:]*:[^:]*:[^:]*://' -e 's/:.*$//'` + if [ ".$groupid" = . ]; then + groupid=`(ypcat passwd) 2>/dev/null | egrep "^${username}:" | \ + sed -e 's/[^:]*:[^:]*:[^:]*://' -e 's/:.*$//'` + if [ ".$groupid" = . ]; then + groupid='?' + fi + fi + fi + + # determine (primary) group name + groupname='' + if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%g'`" != . ]; then + groupname=`egrep "^[^:]*:[^:]*:${groupid}:" /etc/group 2>/dev/null | \ + sed -e 's/:.*$//'` + if [ ".$groupname" = . ]; then + groupname=`(ypcat group) 2>/dev/null | \ + egrep "^[^:]*:[^:]*:${groupid}:" | \ + sed -e 's/:.*$//'` + if [ ".$groupname" = . ]; then + groupname='?' + fi + fi + fi + + # determine host and domain name hostname='' + domainname='' if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%h'`" != . ]; then hostname="`(uname -n) 2>/dev/null |\ awk '{ printf("%s", $1); }'`" @@ -501,9 +531,6 @@ ;; esac fi - - # determine domain name - domainname='' if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%d'`" != . ]; then if [ ".$domainname" = . ]; then if [ -f /etc/resolv.conf ]; then @@ -563,6 +590,8 @@ -e "s/%b/${term_norm}/g" \ -e "s/%u/${username}/g" \ -e "s/%U/${userid}/g" \ + -e "s/%g/${groupname}/g" \ + -e "s/%G/${groupid}/g" \ -e "s/%h/${hostname}/g" \ -e "s/%d/${domainname}/g" \ -e "s/%D/${time_day}/g" \ @@ -592,7 +621,7 @@ ## Originally written for shtool ## - # determine source(s) and destination + # determine source(s) and destination argc=$# srcs="" while [ $# -gt 1 ]; do @@ -1071,7 +1100,7 @@ echo dummy | awk '{ printf("new version: "); }' read triple case $triple in - [0-9]*.[0-9]*[sabp.][0-9]* ) + [0-9]*.[0-9]*[sabp.][0-9]* ) ;; * ) echo "$msgprefix:Error: invalid version string entered: \`$triple'" 1>&2 continue @@ -1155,7 +1184,7 @@ exit 1 ;; esac - else + else # update the version file # pre-generate various strings @@ -1178,7 +1207,7 @@ # generate uppercase prefix prefixupper=`echo $prefix |\ tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - + # create the version file according the the selected language echo "new version: ${vLong}" From ossp-cvs-owner@ossp.org Wed Aug 8 11:15:57 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f789FuC59201; Wed, 8 Aug 2001 11:15:56 +0200 (CEST) Date: Wed, 8 Aug 2001 11:15:56 +0200 (CEST) Message-Id: <200108080915.f789FuC59201@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds/regression-tests xml-octetstream-empt... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 08-Aug-2001 11:15:56 Branch: HEAD Handle: 2001080810155500 Modified files: ossp-pkg/srpc/libxds/regression-tests xml-octetstream-empty.c xml-octetstream.c Log: - Enhanced test cases to use the begin- and end engines. - Use sizeof() rather than strlen() to determine length of fixed strings. Summary: Revision Changes Path 1.2 +9 -5 ossp-pkg/srpc/libxds/regression-tests/xml-octetstream-empty.c 1.2 +10 -6 ossp-pkg/srpc/libxds/regression-tests/xml-octetstream.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/regression-tests/xml-octetstream-empty.c ============================================================ $ cvs diff -u -r1.1 -r1.2 xml-octetstream-empty.c --- ossp-pkg/srpc/libxds/regression-tests/xml-octetstream-empty.c 2001/08/02 17:24:50 1.1 +++ ossp-pkg/srpc/libxds/regression-tests/xml-octetstream-empty.c 2001/08/08 09:15:55 1.2 @@ -50,12 +50,14 @@ printf("Failed to initialize XDS context.\n"); return 1; } - if (xds_register(xds, "os", &xml_encode_octetstream, NULL) != XDS_OK) + if (xds_register(xds, "os", &xml_encode_octetstream, NULL) != XDS_OK || + xds_register(xds, "begin", &xml_encode_begin, NULL) != XDS_OK || + xds_register(xds, "end", &xml_encode_end, NULL) != XDS_OK) { printf("Failed to register my encoding engines.\n"); return 1; } - if (xds_encode(xds, "os", msg, strlen(msg)) != XDS_OK) + if (xds_encode(xds, "begin os end", msg, sizeof(msg)-1) != XDS_OK) { printf("xds_encode() failed.\n"); return 1; @@ -75,7 +77,9 @@ printf("Failed to initialize XDS context.\n"); return 1; } - if (xds_register(xds, "os", &xml_decode_octetstream, NULL) != XDS_OK) + if (xds_register(xds, "os", &xml_decode_octetstream, NULL) != XDS_OK || + xds_register(xds, "begin", &xml_decode_begin, NULL) != XDS_OK || + xds_register(xds, "end", &xml_decode_end, NULL) != XDS_OK) { printf("Failed to register my decoding engines.\n"); return 1; @@ -85,12 +89,12 @@ printf("xds_setbuffer() failed.\n"); return 1; } - if (xds_decode(xds, "os", &new_msg, &new_msg_size) != XDS_OK) + if (xds_decode(xds, "begin os end", &new_msg, &new_msg_size) != XDS_OK) { printf("xds_decode() failed.\n"); return 1; } - if (new_msg_size != strlen(msg)) + if (new_msg_size != sizeof(msg)-1) { printf("The size of the decoded message is wrong.\n"); return 1; Index: ossp-pkg/srpc/libxds/regression-tests/xml-octetstream.c ============================================================ $ cvs diff -u -r1.1 -r1.2 xml-octetstream.c --- ossp-pkg/srpc/libxds/regression-tests/xml-octetstream.c 2001/08/02 17:24:50 1.1 +++ ossp-pkg/srpc/libxds/regression-tests/xml-octetstream.c 2001/08/08 09:15:55 1.2 @@ -37,7 +37,7 @@ char* buffer; size_t buffer_size; - char msg[] = "Hello World"; + char msg[] = "Hallo\000Worl"; char* new_msg; size_t new_msg_size; @@ -50,12 +50,14 @@ printf("Failed to initialize XDS context.\n"); return 1; } - if (xds_register(xds, "os", &xml_encode_octetstream, NULL) != XDS_OK) + if (xds_register(xds, "os", &xml_encode_octetstream, NULL) != XDS_OK || + xds_register(xds, "begin", &xml_encode_begin, NULL) != XDS_OK || + xds_register(xds, "end", &xml_encode_end, NULL) != XDS_OK) { printf("Failed to register my encoding engines.\n"); return 1; } - if (xds_encode(xds, "os", msg, strlen(msg)) != XDS_OK) + if (xds_encode(xds, "begin os end", msg, sizeof(msg)-1) != XDS_OK) { printf("xds_encode() failed.\n"); return 1; @@ -75,7 +77,9 @@ printf("Failed to initialize XDS context.\n"); return 1; } - if (xds_register(xds, "os", &xml_decode_octetstream, NULL) != XDS_OK) + if (xds_register(xds, "os", &xml_decode_octetstream, NULL) != XDS_OK || + xds_register(xds, "begin", &xml_decode_begin, NULL) != XDS_OK || + xds_register(xds, "end", &xml_decode_end, NULL) != XDS_OK) { printf("Failed to register my decoding engines.\n"); return 1; @@ -85,12 +89,12 @@ printf("xds_setbuffer() failed.\n"); return 1; } - if (xds_decode(xds, "os", &new_msg, &new_msg_size) != XDS_OK) + if (xds_decode(xds, "begin os end", &new_msg, &new_msg_size) != XDS_OK) { printf("xds_decode() failed.\n"); return 1; } - if (new_msg_size != strlen(msg)) + if (new_msg_size != sizeof(msg)-1) { printf("The size of the decoded message is wrong.\n"); return 1; From ossp-cvs-owner@ossp.org Wed Aug 8 11:17:29 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f789HT960012; Wed, 8 Aug 2001 11:17:29 +0200 (CEST) Date: Wed, 8 Aug 2001 11:17:29 +0200 (CEST) Message-Id: <200108080917.f789HT960012@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds/regression-tests xdr-octetstream.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 08-Aug-2001 11:17:29 Branch: HEAD Handle: 2001080810172800 Modified files: ossp-pkg/srpc/libxds/regression-tests xdr-octetstream.c Log: - Use sizeof() instead of strlen(). - Use a test message with a zero byte in the midst of the string. Summary: Revision Changes Path 1.3 +3 -3 ossp-pkg/srpc/libxds/regression-tests/xdr-octetstream.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/regression-tests/xdr-octetstream.c ============================================================ $ cvs diff -u -r1.2 -r1.3 xdr-octetstream.c --- ossp-pkg/srpc/libxds/regression-tests/xdr-octetstream.c 2001/08/01 15:25:50 1.2 +++ ossp-pkg/srpc/libxds/regression-tests/xdr-octetstream.c 2001/08/08 09:17:28 1.3 @@ -35,7 +35,7 @@ char* buffer; size_t buffer_size; - char msg[] = "Hello World"; + char msg[] = "Hello\000World"; char* new_msg; size_t new_msg_size; @@ -53,7 +53,7 @@ printf("Failed to register my encoding engines.\n"); return 1; } - if (xds_encode(xds, "os", msg, strlen(msg)) != XDS_OK) + if (xds_encode(xds, "os", msg, sizeof(msg)-1) != XDS_OK) { printf("xds_encode() failed.\n"); return 1; @@ -91,7 +91,7 @@ printf("xds_decode() failed.\n"); return 1; } - if (new_msg_size != strlen(msg)) + if (new_msg_size != sizeof(msg)-1) { printf("The size of the decoded message is wrong.\n"); return 1; From ossp-cvs-owner@ossp.org Wed Aug 8 11:19:36 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f789JZD60202; Wed, 8 Aug 2001 11:19:35 +0200 (CEST) Date: Wed, 8 Aug 2001 11:19:35 +0200 (CEST) Message-Id: <200108080919.f789JZD60202@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds/regression-tests xdr-string.c xds-dec... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 08-Aug-2001 11:19:35 Branch: HEAD Handle: 2001080810193400 Modified files: ossp-pkg/srpc/libxds/regression-tests xdr-string.c xds-decode.c Log: Use sizeof() rather than strlen() to determine the length of fixed strings in the program. Summary: Revision Changes Path 1.5 +2 -2 ossp-pkg/srpc/libxds/regression-tests/xdr-string.c 1.5 +1 -1 ossp-pkg/srpc/libxds/regression-tests/xds-decode.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/regression-tests/xdr-string.c ============================================================ $ cvs diff -u -r1.4 -r1.5 xdr-string.c --- ossp-pkg/srpc/libxds/regression-tests/xdr-string.c 2001/08/02 11:52:12 1.4 +++ ossp-pkg/srpc/libxds/regression-tests/xdr-string.c 2001/08/08 09:19:34 1.5 @@ -90,12 +90,12 @@ printf("xds_decode() failed.\n"); return 1; } - if (strlen(new_msg) != strlen(msg)) + if (strlen(new_msg) != sizeof(msg)-1) { printf("The size of the decoded message is wrong.\n"); return 1; } - if (memcmp(msg, new_msg, strlen(new_msg)) != 0) + if (memcmp(msg, new_msg, sizeof(msg)-1) != 0) { printf("The decoded string is not correct.\n"); return 1; Index: ossp-pkg/srpc/libxds/regression-tests/xds-decode.c ============================================================ $ cvs diff -u -r1.4 -r1.5 xds-decode.c --- ossp-pkg/srpc/libxds/regression-tests/xds-decode.c 2001/08/01 15:25:50 1.4 +++ ossp-pkg/srpc/libxds/regression-tests/xds-decode.c 2001/08/08 09:19:34 1.5 @@ -102,7 +102,7 @@ /* Decode the buffer and have the callback report when something is wrong. */ - if (xds_setbuffer(xds, XDS_LOAN, buffer, strlen(buffer)) != XDS_OK) + if (xds_setbuffer(xds, XDS_LOAN, buffer, sizeof(buffer)-1) != XDS_OK) { printf("xds_decode() failed!"); return 1; From ossp-cvs-owner@ossp.org Wed Aug 8 11:23:41 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f789NdN60718; Wed, 8 Aug 2001 11:23:39 +0200 (CEST) Date: Wed, 8 Aug 2001 11:23:39 +0200 (CEST) Message-Id: <200108080923.f789NdN60718@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds xml-decode-octetstream.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 08-Aug-2001 11:23:39 Branch: HEAD Handle: 2001080810233900 Modified files: ossp-pkg/srpc/libxds xml-decode-octetstream.c Log: base64_decode() did not honor the srclen parameter properly but depended on the src buffer to be terminated by a null byte. This is fixed now. Summary: Revision Changes Path 1.2 +12 -14 ossp-pkg/srpc/libxds/xml-decode-octetstream.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/xml-decode-octetstream.c ============================================================ $ cvs diff -u -r1.1 -r1.2 xml-decode-octetstream.c --- ossp-pkg/srpc/libxds/xml-decode-octetstream.c 2001/08/02 17:24:50 1.1 +++ ossp-pkg/srpc/libxds/xml-decode-octetstream.c 2001/08/08 09:23:39 1.2 @@ -105,7 +105,6 @@ if (ch == xds_pad64) { /* We got a pad char. */ - ch = *src++; /* Skip it, get next. */ switch (state) { case 0: /* Invalid = in first position */ @@ -113,22 +112,29 @@ return -1; case 2: /* Valid, means one byte of info */ /* Skip any number of spaces. */ - for (; ch != '\0'; ch = *src++) + while(srclen > 0) + { + ch = *src++; + --srclen; if (!(isascii(ch) && isspace(ch))) break; + } /* Make sure there is another trailing = sign. */ if (ch != xds_pad64) return -1; - ch = *src++; /* Skip the = */ /* FALLTHROUGH */ case 3: /* Valid, means two bytes of info */ /* * We know this char is an =. Is there anything but * whitespace after it? */ - for (; ch != '\0'; ch = *src++) + while(srclen > 0) + { + ch = *src++; + --srclen; if (!(isascii(ch) && isspace(ch))) return -1; + } /* * Now make sure for cases 2 and 3 that the "extra" * bits that slopped past the last full byte were @@ -192,23 +198,16 @@ p = (char*)buffer + 13; } - /* Now find out how long the decoded data is going to be and - allocate a buffer for it. */ + /* Now find out how long the decoded data is going to be, allocate + a buffer for it, and decode away. */ - p[p_len] = '\0'; *data_len = base64_decode(NULL, 0, p, p_len); - p[p_len] = '<'; if (*data_len == (size_t)-1) return XDS_ERR_UNKNOWN; *data = malloc(*data_len); if (*data == NULL) return XDS_ERR_NO_MEM; - - /* Decode the data. */ - - p[p_len] = '\0'; base64_decode(*data, *data_len, p, p_len); - p[p_len] = '<'; /* Check that we have a closing tag. */ @@ -223,4 +222,3 @@ *used_buffer_size = 13 + p_len + 14; return XDS_OK; } - From ossp-cvs-owner@ossp.org Wed Aug 8 11:50:29 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f789oS164862; Wed, 8 Aug 2001 11:50:28 +0200 (CEST) Date: Wed, 8 Aug 2001 11:50:28 +0200 (CEST) Message-Id: <200108080950.f789oS164862@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds xml-decode-octetstream.c xml-encode-o... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 08-Aug-2001 11:50:28 Branch: HEAD Handle: 2001080810502700 Modified files: ossp-pkg/srpc/libxds xml-decode-octetstream.c xml-encode-octetstream.c Log: Fixed base64_(en|de)code()'s problem with buffer's of input size zero. Summary: Revision Changes Path 1.3 +1 -1 ossp-pkg/srpc/libxds/xml-decode-octetstream.c 1.2 +1 -1 ossp-pkg/srpc/libxds/xml-encode-octetstream.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/xml-decode-octetstream.c ============================================================ $ cvs diff -u -r1.2 -r1.3 xml-decode-octetstream.c --- ossp-pkg/srpc/libxds/xml-decode-octetstream.c 2001/08/08 09:23:39 1.2 +++ ossp-pkg/srpc/libxds/xml-decode-octetstream.c 2001/08/08 09:50:27 1.3 @@ -36,7 +36,7 @@ char *pos; if (srclen == 0) - srclen = strlen(src); + return 0; state = 0; dstidx = 0; res = 0; Index: ossp-pkg/srpc/libxds/xml-encode-octetstream.c ============================================================ $ cvs diff -u -r1.1 -r1.2 xml-encode-octetstream.c --- ossp-pkg/srpc/libxds/xml-encode-octetstream.c 2001/08/02 17:24:50 1.1 +++ ossp-pkg/srpc/libxds/xml-encode-octetstream.c 2001/08/08 09:50:27 1.2 @@ -41,7 +41,7 @@ size_t i; if (srclen == 0) - return -1; + return 0; if (dst == NULL) { /* just calculate required length of dst */ From ossp-cvs-owner@ossp.org Wed Aug 8 13:21:29 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f78BLSZ76237; Wed, 8 Aug 2001 13:21:28 +0200 (CEST) Date: Wed, 8 Aug 2001 13:21:28 +0200 (CEST) Message-Id: <200108081121.f78BLSZ76237@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds Makefile.in ossp-pkg/srpc/libxds/regr... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 08-Aug-2001 13:21:28 Branch: HEAD Handle: 2001080812212701 Added files: ossp-pkg/srpc/libxds xml-decode-string.c xml-encode-string.c ossp-pkg/srpc/libxds/regression-tests xml-string-empty.c xml-string.c Modified files: ossp-pkg/srpc/libxds Makefile.in ossp-pkg/srpc/libxds/regression-tests Makefile.in Log: Implemented xml engines for encoding or decoding strings plus the apropriate test cases. Summary: Revision Changes Path 1.22 +1 -0 ossp-pkg/srpc/libxds/Makefile.in 1.14 +2 -1 ossp-pkg/srpc/libxds/regression-tests/Makefile.in 1.1 +112 -0 ossp-pkg/srpc/libxds/regression-tests/xml-string-empty.c 1.1 +112 -0 ossp-pkg/srpc/libxds/regression-tests/xml-string.c 1.1 +114 -0 ossp-pkg/srpc/libxds/xml-decode-string.c 1.1 +126 -0 ossp-pkg/srpc/libxds/xml-encode-string.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/Makefile.in ============================================================ $ cvs diff -u -r1.21 -r1.22 Makefile.in --- ossp-pkg/srpc/libxds/Makefile.in 2001/08/07 14:46:38 1.21 +++ ossp-pkg/srpc/libxds/Makefile.in 2001/08/08 11:21:27 1.22 @@ -15,6 +15,7 @@ xml-encode-begin.o xml-decode-begin.o \ xml-encode-end.o xml-decode-end.o \ xml-encode-octetstream.o xml-decode-octetstream.o \ + xml-encode-string.o xml-decode-string.o \ $(XML64_OBJS) XDR64_OBJS = @xdr_64_bit_objects@ Index: ossp-pkg/srpc/libxds/regression-tests/Makefile.in ============================================================ $ cvs diff -u -r1.13 -r1.14 Makefile.in --- ossp-pkg/srpc/libxds/regression-tests/Makefile.in 2001/08/02 17:24:50 1.13 +++ ossp-pkg/srpc/libxds/regression-tests/Makefile.in 2001/08/08 11:21:27 1.14 @@ -13,7 +13,8 @@ xds-getbuffer.exe xds-decode.exe xds-setbuffer.exe xds-engine-restart.exe \ xdr-uint32.exe xdr-int32.exe xdr-octetstream.exe xdr-octetstream-empty.exe \ xdr-string.exe xdr-string-empty.exe xml-uint32.exe xml-int32.exe \ - xml-double.exe xml-octetstream.exe xml-octetstream-empty.exe $(TESTS64) + xml-double.exe xml-octetstream.exe xml-octetstream-empty.exe \ + xml-string.exe xml-string-empty.exe $(TESTS64) .SUFFIXES: .SUFFIXES: .c .exe Index: ossp-pkg/srpc/libxds/regression-tests/xml-string-empty.c ============================================================ $ cvs update -p -r1.1 xml-string-empty.c /* XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) This file is part of OSSP XDS, an extensible data serialization library which can be found at http://www.ossp.com/pkg/xds/. 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. */ #include #include #include #include "../internal.h" int main() { xds_t* xds; char* buffer; size_t buffer_size; char msg[] = ""; char* new_msg; /* Encode the string, then erase the buffer and decode the string back, verifying that it hasn't changed. */ xds = xds_init(XDS_ENCODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); return 1; } if (xds_register(xds, "string", &xml_encode_string, NULL) != XDS_OK || xds_register(xds, "begin", &xml_encode_begin, NULL) != XDS_OK || xds_register(xds, "end", &xml_encode_end, NULL) != XDS_OK) { printf("Failed to register my encoding engines.\n"); return 1; } if (xds_encode(xds, "begin string end", msg, sizeof(msg)-1) != XDS_OK) { printf("xds_encode() failed.\n"); return 1; } if (xds_getbuffer(xds, XDS_GIFT, (void**)&buffer, &buffer_size) != XDS_OK) { printf("xds_getbuffer() failed.\n"); return 1; } xds_destroy(xds); write(1, buffer, buffer_size); printf("\n"); xds = xds_init(XDS_DECODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); return 1; } if (xds_register(xds, "string", &xml_decode_string, NULL) != XDS_OK || xds_register(xds, "begin", &xml_decode_begin, NULL) != XDS_OK || xds_register(xds, "end", &xml_decode_end, NULL) != XDS_OK) { printf("Failed to register my decoding engines.\n"); return 1; } if (xds_setbuffer(xds, XDS_GIFT, buffer, buffer_size) != XDS_OK) { printf("xds_setbuffer() failed.\n"); return 1; } if (xds_decode(xds, "begin string end", &new_msg) != XDS_OK) { printf("xds_decode() failed.\n"); return 1; } if (strlen(new_msg) != sizeof(msg)-1) { printf("The size of the decoded message is wrong.\n"); return 1; } if (memcmp(msg, new_msg, sizeof(msg)-1) != 0) { printf("The decoded string is not correct.\n"); return 1; } xds_destroy(xds); free(new_msg); /* Everything went fine. */ return 0; } Index: ossp-pkg/srpc/libxds/regression-tests/xml-string.c ============================================================ $ cvs update -p -r1.1 xml-string.c /* XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) This file is part of OSSP XDS, an extensible data serialization library which can be found at http://www.ossp.com/pkg/xds/. 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. */ #include #include #include #include "../internal.h" int main() { xds_t* xds; char* buffer; size_t buffer_size; char msg[] = " ]]>&<&>World"; char* new_msg; /* Encode the string, then erase the buffer and decode the string back, verifying that it hasn't changed. */ xds = xds_init(XDS_ENCODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); return 1; } if (xds_register(xds, "string", &xml_encode_string, NULL) != XDS_OK || xds_register(xds, "begin", &xml_encode_begin, NULL) != XDS_OK || xds_register(xds, "end", &xml_encode_end, NULL) != XDS_OK) { printf("Failed to register my encoding engines.\n"); return 1; } if (xds_encode(xds, "begin string end", msg, sizeof(msg)-1) != XDS_OK) { printf("xds_encode() failed.\n"); return 1; } if (xds_getbuffer(xds, XDS_GIFT, (void**)&buffer, &buffer_size) != XDS_OK) { printf("xds_getbuffer() failed.\n"); return 1; } xds_destroy(xds); write(1, buffer, buffer_size); printf("\n"); xds = xds_init(XDS_DECODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); return 1; } if (xds_register(xds, "string", &xml_decode_string, NULL) != XDS_OK || xds_register(xds, "begin", &xml_decode_begin, NULL) != XDS_OK || xds_register(xds, "end", &xml_decode_end, NULL) != XDS_OK) { printf("Failed to register my decoding engines.\n"); return 1; } if (xds_setbuffer(xds, XDS_GIFT, buffer, buffer_size) != XDS_OK) { printf("xds_setbuffer() failed.\n"); return 1; } if (xds_decode(xds, "begin string end", &new_msg) != XDS_OK) { printf("xds_decode() failed.\n"); return 1; } if (strlen(new_msg) != sizeof(msg)-1) { printf("The size of the decoded message is wrong.\n"); return 1; } if (memcmp(msg, new_msg, sizeof(msg)-1) != 0) { printf("The decoded string is not correct.\n"); return 1; } xds_destroy(xds); free(new_msg); /* Everything went fine. */ return 0; } Index: ossp-pkg/srpc/libxds/xml-decode-string.c ============================================================ $ cvs update -p -r1.1 xml-decode-string.c /* XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) This file is part of OSSP XDS, an extensible data serialization library which can be found at http://www.ossp.com/pkg/xds/. 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. */ #include #include "xds.h" static const char TAG_OPEN[] = ""; static const char TAG_CLOSE[] = ""; static const size_t TAG_OPEN_LEN = sizeof(TAG_OPEN)-1; static const size_t TAG_CLOSE_LEN = sizeof(TAG_CLOSE)-1; int xml_decode_string(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, size_t* used_buffer_size, va_list* args) { char** target_buffer; char* src; size_t src_len; char* dst; /* Setup the engine. We need at least space for our tags; how long the actual content is going to be will be seen soon. */ xds_init_encoding_engine(TAG_OPEN_LEN + TAG_CLOSE_LEN); /* Is the opening tag there? */ if (strncasecmp(buffer, TAG_OPEN, TAG_OPEN_LEN) != 0) return XDS_ERR_TYPE_MISMATCH; /* Determine the length of the encoded data. */ src = (char*)buffer + TAG_OPEN_LEN; for (src_len = 0; src[src_len] != '<'; ++src_len) if (src[src_len] == '\0') return XDS_ERR_TYPE_MISMATCH; /* Check the closing tag. */ if (strncasecmp(src + src_len, TAG_CLOSE, TAG_CLOSE_LEN) != 0) return XDS_ERR_TYPE_MISMATCH; *used_buffer_size = TAG_OPEN_LEN + src_len + TAG_CLOSE_LEN; /* Allocate target buffer. */ target_buffer = va_arg(*args, char**); xds_check_parameter(target_buffer != NULL); *target_buffer = dst = malloc(src_len + 1); if (dst == NULL) return XDS_ERR_NO_MEM; /* Decode the data into the target buffer. */ while(src_len > 0) { if (*src == '&') { if (src_len >= 4 && strncmp(src, "<", 4) == 0) { *dst++ = '<'; src += 4; src_len -= 4; } else if (src_len >= 4 && strncmp(src, ">", 4) == 0) { *dst++ = '>'; src += 4; src_len -= 4; } else if (src_len >= 5 && strncmp(src, "&", 5) == 0) { *dst++ = '&'; src += 5; src_len -= 5; } else { free(dst); return XDS_ERR_TYPE_MISMATCH; } } else { *dst++ = *src++; --src_len; } } *dst = '\0'; /* Done. */ return XDS_OK; } Index: ossp-pkg/srpc/libxds/xml-encode-string.c ============================================================ $ cvs update -p -r1.1 xml-encode-string.c /* XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) This file is part of OSSP XDS, an extensible data serialization library which can be found at http://www.ossp.com/pkg/xds/. 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. */ #include #include "xds.h" static const char TAG_OPEN[] = ""; static const char TAG_CLOSE[] = ""; static const size_t TAG_OPEN_LEN = sizeof(TAG_OPEN)-1; static const size_t TAG_CLOSE_LEN = sizeof(TAG_CLOSE)-1; int xml_encode_string(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, size_t* used_buffer_size, va_list* args) { char* src; size_t src_len; char* dst; size_t dst_size; /* Setup the engine. We need at least space for our tags; how long the actual content is going to be will be seen soon. */ xds_init_encoding_engine(TAG_OPEN_LEN + TAG_CLOSE_LEN); /* Get the data from the stack. */ src = va_arg(*args, char*); xds_check_parameter(src != NULL); src_len = strlen(src); /* Set up the target buffer. */ dst = buffer; dst_size = buffer_size; /* Write the opening tag. */ memmove(dst, TAG_OPEN, TAG_OPEN_LEN); dst += TAG_OPEN_LEN; dst_size -= TAG_OPEN_LEN; /* Format the data into the buffer. */ while(src_len > 0 && dst_size > 0) { switch(*src) { case '<': /* Turn into "<". */ if (dst_size >= 4) { *dst++ = '&'; --dst_size; *dst++ = 'l'; --dst_size; *dst++ = 't'; --dst_size; *dst++ = ';'; --dst_size; ++src; --src_len; } break; case '&': /* Turn into "&". */ if (dst_size >= 5) { *dst++ = '&'; --dst_size; *dst++ = 'a'; --dst_size; *dst++ = 'm'; --dst_size; *dst++ = 'p'; --dst_size; *dst++ = ';'; --dst_size; ++src; --src_len; } break; case '>': /* Turn into ">". */ if (dst_size >= 4) { *dst++ = '&'; --dst_size; *dst++ = 'g'; --dst_size; *dst++ = 't'; --dst_size; *dst++ = ';'; --dst_size; ++src; --src_len; } break; default: /* Just copy it. */ *dst++ = *src++; --src_len; --dst_size; } } if (src_len > 0) { /* Target buffer was too small. */ *used_buffer_size = dst - (char*)buffer + 1; return XDS_ERR_OVERFLOW; } /* Write the closing tag. */ memmove(dst, TAG_CLOSE, TAG_CLOSE_LEN); dst += TAG_CLOSE_LEN; dst_size -= TAG_CLOSE_LEN; /* Done. */ *used_buffer_size = dst - (char*)buffer; return XDS_OK; } From ossp-cvs-owner@ossp.org Wed Aug 8 13:49:08 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f78Bn8480231; Wed, 8 Aug 2001 13:49:08 +0200 (CEST) Date: Wed, 8 Aug 2001 13:49:08 +0200 (CEST) Message-Id: <200108081149.f78Bn8480231@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds configure.ac Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 08-Aug-2001 13:49:08 Branch: HEAD Handle: 2001080812490700 Modified files: ossp-pkg/srpc/libxds configure.ac Log: Don't compile with -ansi or gcc won't find the 64-bit data types on some platforms. Summary: Revision Changes Path 1.15 +2 -2 ossp-pkg/srpc/libxds/configure.ac ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/configure.ac ============================================================ $ cvs diff -u -r1.14 -r1.15 configure.ac --- ossp-pkg/srpc/libxds/configure.ac 2001/08/07 11:16:19 1.14 +++ ossp-pkg/srpc/libxds/configure.ac 2001/08/08 11:49:07 1.15 @@ -2,7 +2,7 @@ AC_INIT(libxds) AC_PREREQ(2.52) -AC_REVISION($Revision: 1.14 $) +AC_REVISION($Revision: 1.15 $) dnl Get rid of the lousy -g and -O defaults in CFLAGS. dnl @@ -18,7 +18,7 @@ dnl Set special flags for gcc. dnl if test "$GCC" = yes; then - CFLAGS="$CFLAGS -Wall -ansi -pedantic -Wshadow -Wpointer-arith -Wcast-align -Winline -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wno-long-long" + CFLAGS="$CFLAGS -Wall -pedantic -Wshadow -Wpointer-arith -Wcast-align -Winline -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wno-long-long" fi dnl Check for exact data types. From ossp-cvs-owner@ossp.org Wed Aug 8 13:50:18 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f78BoHm80396; Wed, 8 Aug 2001 13:50:17 +0200 (CEST) Date: Wed, 8 Aug 2001 13:50:17 +0200 (CEST) Message-Id: <200108081150.f78BoHm80396@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds register.c unregister.c vdecode.c ven... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 08-Aug-2001 13:50:17 Branch: HEAD Handle: 2001080812501600 Modified files: ossp-pkg/srpc/libxds register.c unregister.c vdecode.c vencode.c xml-decode-int32.c xml-decode-int64.c xml-decode-uint32.c xml-decode-uint64.c Log: Fixed warnings that complained about feeding a "char" into the isxxx() routines, which expect an "int". Summary: Revision Changes Path 1.9 +1 -1 ossp-pkg/srpc/libxds/register.c 1.7 +1 -1 ossp-pkg/srpc/libxds/unregister.c 1.6 +1 -1 ossp-pkg/srpc/libxds/vdecode.c 1.14 +1 -1 ossp-pkg/srpc/libxds/vencode.c 1.5 +1 -1 ossp-pkg/srpc/libxds/xml-decode-int32.c 1.6 +1 -1 ossp-pkg/srpc/libxds/xml-decode-int64.c 1.5 +1 -1 ossp-pkg/srpc/libxds/xml-decode-uint32.c 1.6 +1 -1 ossp-pkg/srpc/libxds/xml-decode-uint64.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/register.c ============================================================ $ cvs diff -u -r1.8 -r1.9 register.c --- ossp-pkg/srpc/libxds/register.c 2001/08/02 10:51:57 1.8 +++ ossp-pkg/srpc/libxds/register.c 2001/08/08 11:50:16 1.9 @@ -40,7 +40,7 @@ xds_check_parameter(engine != NULL); for(pos = 0; name[pos] != '\0'; ++pos) { - if (!isalnum(name[pos]) && name[pos] != '-' && name[pos] != '_') + if (!isalnum((int)name[pos]) && name[pos] != '-' && name[pos] != '_') return XDS_ERR_INVALID_ARG; } Index: ossp-pkg/srpc/libxds/unregister.c ============================================================ $ cvs diff -u -r1.6 -r1.7 unregister.c --- ossp-pkg/srpc/libxds/unregister.c 2001/08/02 10:51:57 1.6 +++ ossp-pkg/srpc/libxds/unregister.c 2001/08/08 11:50:16 1.7 @@ -40,7 +40,7 @@ xds_check_parameter(name != NULL); for(pos = 0; name[pos] != '\0'; ++pos) { - if (!isalnum(name[pos]) && name[pos] != '-' && name[pos] != '_') + if (!isalnum((int)name[pos]) && name[pos] != '-' && name[pos] != '_') return XDS_ERR_INVALID_ARG; } Index: ossp-pkg/srpc/libxds/vdecode.c ============================================================ $ cvs diff -u -r1.5 -r1.6 vdecode.c --- ossp-pkg/srpc/libxds/vdecode.c 2001/08/01 15:25:47 1.5 +++ ossp-pkg/srpc/libxds/vdecode.c 2001/08/08 11:50:16 1.6 @@ -59,7 +59,7 @@ buffer_len_backup = xds->buffer_len; for(name = p; *p != '\0'; name = p) { - while(isalnum(*p) || *p == '-' || *p == '_') + while(isalnum((int)*p) || *p == '-' || *p == '_') ++p; if (*p) *p++ = '\0'; Index: ossp-pkg/srpc/libxds/vencode.c ============================================================ $ cvs diff -u -r1.13 -r1.14 vencode.c --- ossp-pkg/srpc/libxds/vencode.c 2001/08/01 15:25:47 1.13 +++ ossp-pkg/srpc/libxds/vencode.c 2001/08/08 11:50:16 1.14 @@ -71,7 +71,7 @@ buffer_len_backup = xds->buffer_len; for(name = p; *p != '\0'; name = p) { - while(isalnum(*p) || *p == '-' || *p == '_') + while(isalnum((int)*p) || *p == '-' || *p == '_') ++p; if (*p) *p++ = '\0'; Index: ossp-pkg/srpc/libxds/xml-decode-int32.c ============================================================ $ cvs diff -u -r1.4 -r1.5 xml-decode-int32.c --- ossp-pkg/srpc/libxds/xml-decode-int32.c 2001/08/02 08:10:13 1.4 +++ ossp-pkg/srpc/libxds/xml-decode-int32.c 2001/08/08 11:50:16 1.5 @@ -56,7 +56,7 @@ } else negative = XDS_FALSE; - while(isdigit(*p)) + while(isdigit((int)*p)) { if (p >= (char*)buffer + buffer_size) return XDS_ERR_UNDERFLOW; Index: ossp-pkg/srpc/libxds/xml-decode-int64.c ============================================================ $ cvs diff -u -r1.5 -r1.6 xml-decode-int64.c --- ossp-pkg/srpc/libxds/xml-decode-int64.c 2001/08/02 08:10:13 1.5 +++ ossp-pkg/srpc/libxds/xml-decode-int64.c 2001/08/08 11:50:16 1.6 @@ -56,7 +56,7 @@ } else negative = XDS_FALSE; - while(isdigit(*p)) + while(isdigit((int)*p)) { if (p >= (char*)buffer + buffer_size) return XDS_ERR_UNDERFLOW; Index: ossp-pkg/srpc/libxds/xml-decode-uint32.c ============================================================ $ cvs diff -u -r1.4 -r1.5 xml-decode-uint32.c --- ossp-pkg/srpc/libxds/xml-decode-uint32.c 2001/08/02 08:10:13 1.4 +++ ossp-pkg/srpc/libxds/xml-decode-uint32.c 2001/08/08 11:50:16 1.5 @@ -48,7 +48,7 @@ value = va_arg(*args, xds_uint32_t*); *value = 0; p = (char*)buffer + 8; - while(isdigit(*p)) + while(isdigit((int)*p)) { if (p >= (char*)buffer + buffer_size) return XDS_ERR_UNDERFLOW; Index: ossp-pkg/srpc/libxds/xml-decode-uint64.c ============================================================ $ cvs diff -u -r1.5 -r1.6 xml-decode-uint64.c --- ossp-pkg/srpc/libxds/xml-decode-uint64.c 2001/08/02 08:10:13 1.5 +++ ossp-pkg/srpc/libxds/xml-decode-uint64.c 2001/08/08 11:50:16 1.6 @@ -48,7 +48,7 @@ value = va_arg(*args, xds_uint64_t*); *value = 0; p = (char*)buffer + 8; - while(isdigit(*p)) + while(isdigit((int)*p)) { if (p >= (char*)buffer + buffer_size) return XDS_ERR_UNDERFLOW; From ossp-cvs-owner@ossp.org Wed Aug 8 15:12:30 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f78DCTP90259; Wed, 8 Aug 2001 15:12:29 +0200 (CEST) Date: Wed, 8 Aug 2001 15:12:29 +0200 (CEST) Message-Id: <200108081312.f78DCTP90259@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds/docs libxds.tex Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 08-Aug-2001 15:12:29 Branch: HEAD Handle: 2001080814122800 Modified files: ossp-pkg/srpc/libxds/docs libxds.tex Log: Added the missing chapter about extending the library. Summary: Revision Changes Path 1.4 +197 -10 ossp-pkg/srpc/libxds/docs/libxds.tex ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/docs/libxds.tex ============================================================ $ cvs diff -u -r1.3 -r1.4 libxds.tex --- ossp-pkg/srpc/libxds/docs/libxds.tex 2001/08/07 14:41:06 1.3 +++ ossp-pkg/srpc/libxds/docs/libxds.tex 2001/08/08 13:12:28 1.4 @@ -1,6 +1,6 @@ % -*- mode: LaTeX; fill-column: 75; -*- % -% $Id: libxds.tex,v 1.3 2001/08/07 14:41:06 simons Exp $ +% $Id: libxds.tex,v 1.4 2001/08/08 13:12:28 simons Exp $ % \documentclass[a4paper,10pt,pointlessnumbers,bibtotoc]{scrartcl} \usepackage[dvips,xdvi]{graphicx} @@ -548,6 +548,176 @@ \section{Extending the XDS library} \label{meta engines} +Now that we know how primitive data types can be encoded and decoded, let's +write a ``meta engine'' that will handle complex data structures. For the +example, we'll use the structure ``mystruct'', which is defined as follows: + +\begin{quote} +\begin{verbatim} +struct mystruct + { + xds_int32_t small; + xds_int64_t big; + xds_uint32_t positive; + char text[16]; + }; +\end{verbatim} +\end{quote} + +In order to encode an instance of this structure, we first write an +encoding engine: + +\begin{quote} +\begin{verbatim} +static int encode_mystruct(xds_t* xds, void* engine_context, + void* buffer, size_t buffer_size, + size_t* used_buffer_size, + va_list* args) + { + struct mystruct* ms; + ms = va_arg(*args, struct mystruct*); + return xds_encode(xds, "int32 int64 uint32 octetstream", + ms->small, ms->big, ms->positive, + ms->text, sizeof(ms->text)); + } +\end{verbatim} +\end{quote} + +This engine does nothing but take the address of the ``mystruct'' instance +from the stack and then use xds\_encode() to handle all elements of +``mystruct'' separately --- which is fine, because these data types are +supperted by libxds already. It is worth noting, though, that we refer to +the other engines by name, meaning that these engines must be registered in +``xds'' by that name! + +What is very nice, though, is the fact that this encoding engine does not +even need to know which formatting engines are used to encode the actual +values! If the user registeres the XDR engines under the apropriate names, +``mystruct'' will be encoded in XDR. If the user registeres the XML engines +under the apropriate names, ``mystruct'' will be encoded in XML. Because of +that property we call such an engine a ``meta engine''. + +Of coures you need not necessarily implement an engine like that: Rather +than going through xds\_encode(), it would be possible to execute the +apropriate encoding engines directly. This had the advantage of not +depending on those engines being registered at all, but it would make the +meta engine depend on the elementary engines unnecessarily. + +One more word about the engine syntax and semantics: As has been mentioned +earlier, any function that adheres to the shown above is potentially a +formatting engine. These parameters have the following meaning: + +\begin{itemize} + +\item xds --- This is the XDS context that was originally provided to the +xds\_encode() call, which in turn executed the engine. It may be used, for +example, for executing xds\_en\-code() again like we did in the example +engine shown before. + +\item engine\_context --- The engine context can be used by the engine to +store any type of internal information. The value the engine will receive +must have been provided when the engine was registered by xds\_register(). +Engines may obviously neglect this parameter if they don't need a context +of their own --- all engines included in this distribution do so. + +\item buffer --- This parameter points to the buffer in which the encoded +data should be written. In decoding mode, ``buffer'' points to the encoded +data, which should be decoded; the location where the results should be +stored at can be found on the stack then. + +\item buffer\_size --- The number of bytes that are available in +``buffer''. In encoding mode, this means ``free space'', in decoding mode, +``buffer\_size'' determines how many bytes of encoded data are available in +``buffer'' for consumation. + +\item used\_buffer\_size --- This parameter points to a variable, which the +callback must set before returning in order to let the framework know how +many bytes it actually used in ``buffer''. A callback encoding, say, an +int32 number into a 8 byte text representation would set the +used\_buffer\_size to 8, for instance: +\begin{quote} +\begin{verbatim} +*used_buffer_size = 8; +\end{verbatim} +\end{quote} +In encoding mode, this variable determines how many bytes the engine has +written into ``buffer''; in decoding mode the variable determines how many +bytes the engines has read from ``buffer''. + +\item args --- This pointer points to an initialized varadic argument. Use +the standard C macro va\_arg() to fetch the actual data. + +\end{itemize} + +A callback may return any of the following return codes as defined in +\textsf{xds.h}: + +\begin{itemize} +\item XDS\_OK --- No error. + +\item XDS\_ERR\_NO\_MEM --- Failed to allocate required memory. + +\item XDS\_ERR\_OVERFLOW --- The buffer is too small to hold all encoded +data. The callback may set ``*used\_buffer\_size'' to the number of bytes +it needs in ``buffer'', thereby giving the framework a hint by how many +bytes it should enlarge the buffer before trying the engine again, but just +leaving ``*used\_buffer\_size'' alone will work fine, too, it may just be a +bit less efficient in some cases. Obviously this return code does not make +much sense in decoding mode. + +\item XDS\_ERR\_INVALID\_ARG --- Unexpected parameters. + +\item XDS\_ERR\_TYPE\_MISMATCH --- This return code should be returned in +decoding mode in case the decoding engine realizes that the data it is +decoding does not fit what it's expecting. Not all encoding formats will +allow to detect this at all. XDR, for example, does not. + +\item XDS\_ERR\_UNDERFLOW --- In decode mode, this error should be returned +when an engine needs, say, 4 byte of data in order to decode a value but +``buffer''/''buffer\_size'' provides less. + +\item XDS\_ERR\_UNKNOWN --- Any other reason to fail than those listed +before. + +\end{itemize} + +Let's take a look at the corresponding decoding engine now: + +\begin{quote} +\begin{verbatim} +static int decode_mystruct(xds_t* xds, void* engine_context, + void* buffer, size_t buffer_size, + size_t* used_buffer_size, + va_list* args) + { + struct mystruct* ms; + size_t i; + char* tmp; + int rc; + ms = va_arg(*args, struct mystruct*); + rc = xds_decode(xds, "int32 int64 uint32 octetstream", + &(ms->small), &(ms->big), &(ms->positive), + &tmp, &i); + if (rc == XDS_OK) + { + assert(i == sizeof(ms->text)); + memmove(ms->text, tmp, i); + free(tmp); + } + return rc; + } +\end{verbatim} +\end{quote} + +The engine simply calls xds\_decode() to handle the separate data types. +The only complication is that the octet stream decoding engines return a +pointer to \textsf{malloc()}ed buffer --- what is not what we need. Thus we +have to manually copy the contents of that buffer into the right place in +the structure and free the (now unused) buffer again. + +A complete example program encoding and decoding ``mystruct'' can be found +at \textsf{docs/\-extended.c} in the distribution. + \section{The XDS Framework} \label{xds} @@ -602,12 +772,12 @@ engine name component. xds\_register() may return the following return codes: \textsf{XDS\_OK} - (everything went fine; the engine is registered now), + (everything went fine; the engine is registered now), \textsf{XDS\_ERR\_INVALID\_ARG} (either ``xds'', ``name'', or ``engine'' - are \textsf{NULL} or ``name'' contains illegal characters for an engine - name), or + are \textsf{NULL} or ``name'' contains illegal characters for an engine + name), or \textsf{XDS\_ERR\_NO\_MEM} (failed to allocate internally required - buffers). + buffers). \subsection{int xds\_unregister(xds\_t*~\underline{xds}, const~char*~\underline{name});} @@ -775,7 +945,7 @@ \label{xdr} \begin{tabular}{|c|c|c|c|} \hline -\bf Function Name & \bf Expected ``args'' Data Type & \bf Input Size & \bf Output Size \\ \hline +\bf Function Name & \bf Expected ``args'' Datatype & \bf Input & \bf Output \\ \hline xdr\_encode\_uint32() & xds\_uint32\_t & 4 byte & 4 byte \\ xdr\_decode\_uint32() & xds\_uint32\_t* & 4 byte & 4 byte \\[1ex] xdr\_encode\_int32() & xds\_int32\_t & 4 byte & 4 byte \\ @@ -791,14 +961,22 @@ xdr\_encode\_string() & char* & variable & variable \\ xdr\_decode\_string() & char** & variable & variable \\ \hline \end{tabular} +\medskip + +Please note that the routines xdr\_decode\_octetstream() and +xdr\_decode\_string() return a pointer to a buffer holding the decoded +data. This buffer has been allocated with \textsf{malloc()} and must be +\textsf{free()}ed by the application when it is not required anymore. All +other callbacks write the decoded value into the location found on the +stack, but these behave differently because the length of the decoded data +is not known in advance and the application cannot provide a buffer that's +guaranteed to suffice. \section{The XML Engines} \label{xml} -\subsection{Encoding engines} - \begin{tabular}{|c|c|c|c|} \hline -\bf Function Name & \bf Expected ``args'' Data Type & \bf Input Size & \bf Output Size \\ \hline +\bf Function Name & \bf Expected ``args'' Datatype & \bf Input & \bf Output \\ \hline xml\_encode\_uint32() & xds\_uint32\_t & ?? byte & ?? byte \\ xml\_decode\_uint32() & xds\_uint32\_t* & ?? byte & ?? byte \\[1ex] xml\_encode\_int32() & xds\_int32\_t & ?? byte & ?? byte \\ @@ -814,8 +992,17 @@ xml\_encode\_string() & char* & variable & variable \\ xml\_decode\_string() & char** & variable & variable \\ \hline \end{tabular} +\medskip + +Please note that the routines xml\_decode\_octetstream() and +xml\_decode\_string() return a pointer to a buffer holding the decoded +data. This buffer has been allocated with \textsf{malloc()} and must be +\textsf{free()}ed by the application when it is not required anymore. All +other callbacks write the decoded value into the location found on the +stack, but these behave differently because the length of the decoded data +is not known in advance and the application cannot provide a buffer that's +guaranteed to suffice. -\newpage \begin{thebibliography}{xxx} \bibitem{xdr} RFC 1832: ``XDR: External Data Representation Standard'', From ossp-cvs-owner@ossp.org Wed Aug 8 15:13:12 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f78DDBD90346; Wed, 8 Aug 2001 15:13:11 +0200 (CEST) Date: Wed, 8 Aug 2001 15:13:11 +0200 (CEST) Message-Id: <200108081313.f78DDBD90346@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds/docs extended.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 08-Aug-2001 15:13:11 Branch: HEAD Handle: 2001080814131100 Added files: ossp-pkg/srpc/libxds/docs extended.c Log: Example program demonstrating how to write custom engines. Summary: Revision Changes Path 1.1 +124 -0 ossp-pkg/srpc/libxds/docs/extended.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/docs/extended.c ============================================================ $ cvs update -p -r1.1 extended.c #include #include #include struct mystruct { xds_int32_t small; xds_int64_t big; xds_uint32_t positive; char text[16]; }; static int encode_mystruct(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, size_t* used_buffer_size, va_list* args) { struct mystruct* ms; ms = va_arg(*args, struct mystruct*); return xds_encode(xds, "int32 int64 uint32 octetstream", ms->small, ms->big, ms->positive, ms->text, sizeof(ms->text)); } static int decode_mystruct(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, size_t* used_buffer_size, va_list* args) { struct mystruct* ms; size_t i; char* tmp; int rc; ms = va_arg(*args, struct mystruct*); rc = xds_decode(xds, "int32 int64 uint32 octetstream", &(ms->small), &(ms->big), &(ms->positive), &tmp, &i); if (rc == XDS_OK) { assert(i == sizeof(ms->text)); memmove(ms->text, tmp, i); free(tmp); } return rc; } static void error_exit(int rc, const char* msg, ...) { va_list args; va_start(args, msg); vfprintf(stderr, msg, args); va_end(args); exit(rc); } int main() { xds_t* xds; char* buffer; size_t buffer_size; struct mystruct ms, new_ms; ms.small = -0x1234567; ms.big = -0x1234567890abcdeLL; ms.positive = 42; strcpy(ms.text, "Hallo World"); /* Encode our copy of mystruct using our encoding callback. */ xds = xds_init(XDS_ENCODE); if (xds == NULL) error_exit(1, "Failed to initialize XDS context.\n"); if (xds_register(xds, "mystruct", &encode_mystruct, NULL) != XDS_OK || xds_register(xds, "int32", &xdr_encode_int32, NULL) != XDS_OK || xds_register(xds, "int64", &xdr_encode_int64, NULL) != XDS_OK || xds_register(xds, "octetstream", &xdr_encode_octetstream, NULL) != XDS_OK || xds_register(xds, "uint32", &xdr_encode_uint32, NULL) != XDS_OK) { error_exit(1, "Failed to register my encoding engines.\n"); } if (xds_encode(xds, "mystruct", &ms) != XDS_OK) error_exit(1, "xds_encode() failed!\n"); if (xds_getbuffer(xds, XDS_GIFT, (void**)&buffer, &buffer_size) != XDS_OK) error_exit(1, "xds_getbuffer() failed!\n"); xds_destroy(xds); /* Now create a decoding context and decode the whole thing again. */ xds = xds_init(XDS_DECODE); if (xds == NULL) error_exit(1, "Failed to initialize XDS context.\n"); if (xds_register(xds, "mystruct", &decode_mystruct, NULL) != XDS_OK || xds_register(xds, "int32", &xdr_decode_int32, NULL) != XDS_OK || xds_register(xds, "int64", &xdr_decode_int64, NULL) != XDS_OK || xds_register(xds, "uint32", &xdr_decode_uint32, NULL) != XDS_OK || xds_register(xds, "octetstream", &xdr_decode_octetstream, NULL) != XDS_OK) { error_exit(1, "Failed to register my decoding engines.\n"); } if (xds_setbuffer(xds, XDS_GIFT, buffer, buffer_size) != XDS_OK) error_exit(1, "xds_setbuffer() failed!\n"); if (xds_decode(xds, "mystruct", &new_ms) != XDS_OK) error_exit(1, "xds_decode() failed!\n"); xds_destroy(xds); /* Both structures must be identical. */ if (ms.small != new_ms.small || ms.big != new_ms.big || ms.positive != new_ms.positive || memcmp(&ms.text, &new_ms.text, sizeof(ms.text)) != 0) { error_exit(1, "Decoded data does not match the original!\n"); } /* Everything went fine. */ return 0; } From ossp-cvs-owner@ossp.org Wed Aug 8 15:14:51 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f78DEoB90500; Wed, 8 Aug 2001 15:14:50 +0200 (CEST) Date: Wed, 8 Aug 2001 15:14:50 +0200 (CEST) Message-Id: <200108081314.f78DEoB90500@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc TODO Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 08-Aug-2001 15:14:50 Branch: HEAD Handle: 2001080814145000 Modified files: ossp-pkg/srpc TODO Log: Bumped milestone (1) to 100% fulfilled: As far as I can see, the EVAL file is complete. Summary: Revision Changes Path 1.13 +1 -1 ossp-pkg/srpc/TODO ____________________________________________________________________________ Index: ossp-pkg/srpc/TODO ============================================================ $ cvs diff -u -r1.12 -r1.13 TODO --- ossp-pkg/srpc/TODO 2001/07/31 16:03:01 1.12 +++ ossp-pkg/srpc/TODO 2001/08/08 13:14:50 1.13 @@ -3,7 +3,7 @@ o M1 (peti) [11-Jun-2001] - evaluation checklist for XDS and AMP - done: 50% [-> EVAL] + done: 100% [-> EVAL] o M2 (peti+rse) [25-Jun-2001] - design/architecture paper (authentication+encryption framework) From ossp-cvs-owner@ossp.org Wed Aug 8 15:17:12 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f78DHAi91192; Wed, 8 Aug 2001 15:17:10 +0200 (CEST) Date: Wed, 8 Aug 2001 15:17:10 +0200 (CEST) Message-Id: <200108081317.f78DHAi91192@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc TODO Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 08-Aug-2001 15:17:10 Branch: HEAD Handle: 2001080814171000 Modified files: ossp-pkg/srpc TODO Log: Documented state of affairs for the implementation of the XDR and XML engines. Summary: Revision Changes Path 1.14 +5 -25 ossp-pkg/srpc/TODO ____________________________________________________________________________ Index: ossp-pkg/srpc/TODO ============================================================ $ cvs diff -u -r1.13 -r1.14 TODO --- ossp-pkg/srpc/TODO 2001/08/08 13:14:50 1.13 +++ ossp-pkg/srpc/TODO 2001/08/08 13:17:10 1.14 @@ -17,31 +17,11 @@ o M4 (peti) [4 weeks until 30-Jul-2001] - implementation of libxds library framework done: 100% [-> libxds/*.c] - - implementation of libxds SunRPC/XDR and XML-RPC backends - for basic data types: - o integer: - - short - - unsigned short - - int - - unsigned int - - long - - unsigned long - o floating point: - - float - - double - o pointer: - - void * - - void(*)() - o string - - char * (end is NUL) - - unsigned char * (end is NUL) - o octet-stream - - void * (end is after given length) - Function prototype is xds_engine_t. - Function name scheme is: - {xdr,xml}_{en,de}code_{[u]short,[u]int,[u]long, - float,double,voidptr,funcptr, - [u]string,octets} + - implementation XDR engines for basic data types. + done: 99% [-> everything is implemented except "double" support] + - implementation XML engines for basic data types. + done: 99% [-> everything is implemented except "double" support] + - regression tests for libxds (make check) - 16bit Integers mean trouble when passing them through "...": From ossp-cvs-owner@ossp.org Wed Aug 8 15:17:51 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f78DHoA91271; Wed, 8 Aug 2001 15:17:50 +0200 (CEST) Date: Wed, 8 Aug 2001 15:17:50 +0200 (CEST) Message-Id: <200108081317.f78DHoA91271@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc TODO Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 08-Aug-2001 15:17:50 Branch: HEAD Handle: 2001080814175000 Modified files: ossp-pkg/srpc TODO Log: Regression tests are complete. Summary: Revision Changes Path 1.15 +1 -0 ossp-pkg/srpc/TODO ____________________________________________________________________________ Index: ossp-pkg/srpc/TODO ============================================================ $ cvs diff -u -r1.14 -r1.15 TODO --- ossp-pkg/srpc/TODO 2001/08/08 13:17:10 1.14 +++ ossp-pkg/srpc/TODO 2001/08/08 13:17:50 1.15 @@ -23,6 +23,7 @@ done: 99% [-> everything is implemented except "double" support] - regression tests for libxds (make check) + done: 100% [-> regression-tests/*.c] - 16bit Integers mean trouble when passing them through "...": From ossp-cvs-owner@ossp.org Wed Aug 8 15:18:48 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f78DIl391369; Wed, 8 Aug 2001 15:18:47 +0200 (CEST) Date: Wed, 8 Aug 2001 15:18:47 +0200 (CEST) Message-Id: <200108081318.f78DIl391369@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc TODO Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 08-Aug-2001 15:18:46 Branch: HEAD Handle: 2001080814184600 Modified files: ossp-pkg/srpc TODO Log: Cosmetic change: Corrected indention. Summary: Revision Changes Path 1.16 +17 -15 ossp-pkg/srpc/TODO ____________________________________________________________________________ Index: ossp-pkg/srpc/TODO ============================================================ $ cvs diff -u -r1.15 -r1.16 TODO --- ossp-pkg/srpc/TODO 2001/08/08 13:17:50 1.15 +++ ossp-pkg/srpc/TODO 2001/08/08 13:18:46 1.16 @@ -2,28 +2,30 @@ ======================== o M1 (peti) [11-Jun-2001] - - evaluation checklist for XDS and AMP - done: 100% [-> EVAL] + - evaluation checklist for XDS and AMP + done: 100% [-> EVAL] o M2 (peti+rse) [25-Jun-2001] - - design/architecture paper (authentication+encryption framework) - (< 10KB Text + 1x Figure) - done: 30% [-> architecture.fig] + - design/architecture paper (authentication+encryption framework) + (< 10KB Text + 1x Figure) + done: 30% [-> architecture.fig] o M3 (peti+rse) [2-Jul-2001] - - design libxds API - done: 100% [-> libxds/xds.h + libxds/xds.pod] + - design libxds API + done: 100% [-> libxds/xds.h + libxds/xds.pod] o M4 (peti) [4 weeks until 30-Jul-2001] - - implementation of libxds library framework - done: 100% [-> libxds/*.c] - - implementation XDR engines for basic data types. - done: 99% [-> everything is implemented except "double" support] - - implementation XML engines for basic data types. - done: 99% [-> everything is implemented except "double" support] + - implementation of libxds library framework + done: 100% [-> libxds/*.c] - - regression tests for libxds (make check) - done: 100% [-> regression-tests/*.c] + - implementation XDR engines for basic data types. + done: 99% [-> everything is implemented except "double" support] + + - implementation XML engines for basic data types. + done: 99% [-> everything is implemented except "double" support] + + - regression tests for libxds (make check) + done: 100% [-> regression-tests/*.c] - 16bit Integers mean trouble when passing them through "...": From ossp-cvs-owner@ossp.org Wed Aug 8 15:19:08 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f78DJ7n91425; Wed, 8 Aug 2001 15:19:07 +0200 (CEST) Date: Wed, 8 Aug 2001 15:19:07 +0200 (CEST) Message-Id: <200108081319.f78DJ7n91425@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc TODO Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 08-Aug-2001 15:19:07 Branch: HEAD Handle: 2001080814190700 Modified files: ossp-pkg/srpc TODO Log: The problem with 16-bit integers is solved. Summary: Revision Changes Path 1.17 +0 -13 ossp-pkg/srpc/TODO ____________________________________________________________________________ Index: ossp-pkg/srpc/TODO ============================================================ $ cvs diff -u -r1.16 -r1.17 TODO --- ossp-pkg/srpc/TODO 2001/08/08 13:18:46 1.16 +++ ossp-pkg/srpc/TODO 2001/08/08 13:19:07 1.17 @@ -27,19 +27,6 @@ - regression tests for libxds (make check) done: 100% [-> regression-tests/*.c] - - 16bit Integers mean trouble when passing them through "...": - - | xdr-encode-uint16.c:46: `xds_uint16_t' is promoted to `int' when passed through `...' - | xdr-encode-uint16.c:46: (so you should pass `int' not `xds_uint16_t' to `va_arg') - - Maybe we should skip int16 support at all? Currently I work around - this problem by implicitely assuming that the short is promoted to - an int. - - To make matters even worse: The RFC doesn't even define how XDR - deals with 16-bit integers! The mere existance of such a datatype - is not positively confirmed. - - XML: 1234 uint32, int64, uint64, From ossp-cvs-owner@ossp.org Wed Aug 8 15:19:46 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f78DJjR91503; Wed, 8 Aug 2001 15:19:45 +0200 (CEST) Date: Wed, 8 Aug 2001 15:19:45 +0200 (CEST) Message-Id: <200108081319.f78DJjR91503@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc TODO Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 08-Aug-2001 15:19:45 Branch: HEAD Handle: 2001080814194500 Modified files: ossp-pkg/srpc TODO Log: Removed closed points concerning the XML engines. Summary: Revision Changes Path 1.18 +0 -14 ossp-pkg/srpc/TODO ____________________________________________________________________________ Index: ossp-pkg/srpc/TODO ============================================================ $ cvs diff -u -r1.17 -r1.18 TODO --- ossp-pkg/srpc/TODO 2001/08/08 13:19:07 1.17 +++ ossp-pkg/srpc/TODO 2001/08/08 13:19:45 1.18 @@ -27,21 +27,7 @@ - regression tests for libxds (make check) done: 100% [-> regression-tests/*.c] - - XML: 1234 - uint32, int64, uint64, - - - xml_encode_begin(): - - - - - - xml_encode_end(): - - UFT-8 RFC: rfc2279.txt - - Escape: < <--> < - & <--> & - ]]> <--> ]]> - strcpy() copies one byte more than the length of the text itself because the trailing \0 is written to. Currently, this behavior is From ossp-cvs-owner@ossp.org Wed Aug 8 15:20:39 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f78DKcH91605; Wed, 8 Aug 2001 15:20:38 +0200 (CEST) Date: Wed, 8 Aug 2001 15:20:38 +0200 (CEST) Message-Id: <200108081320.f78DKcH91605@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc TODO Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 08-Aug-2001 15:20:38 Branch: HEAD Handle: 2001080814203800 Modified files: ossp-pkg/srpc TODO Log: Removed the "avoid strcpy()" item: This has been fixed. Summary: Revision Changes Path 1.19 +0 -5 ossp-pkg/srpc/TODO ____________________________________________________________________________ Index: ossp-pkg/srpc/TODO ============================================================ $ cvs diff -u -r1.18 -r1.19 TODO --- ossp-pkg/srpc/TODO 2001/08/08 13:19:45 1.18 +++ ossp-pkg/srpc/TODO 2001/08/08 13:20:38 1.19 @@ -29,11 +29,6 @@ - UFT-8 RFC: rfc2279.txt - - strcpy() copies one byte more than the length of the text itself - because the trailing \0 is written to. Currently, this behavior is - not taken into account when calculating the correct buffer size in - the xml-encode-*-.c modules. This has to be fixed! - - libm may be used. We don't depend on sprintf() but convert out numbers ourselves for portability. From ossp-cvs-owner@ossp.org Wed Aug 8 15:21:32 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f78DLVf91701; Wed, 8 Aug 2001 15:21:31 +0200 (CEST) Date: Wed, 8 Aug 2001 15:21:31 +0200 (CEST) Message-Id: <200108081321.f78DLVf91701@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc TODO Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 08-Aug-2001 15:21:31 Branch: HEAD Handle: 2001080814213100 Modified files: ossp-pkg/srpc TODO Log: Removed the "don't use snprintf()" item: This has been implemented. Summary: Revision Changes Path 1.20 +10 -14 ossp-pkg/srpc/TODO ____________________________________________________________________________ Index: ossp-pkg/srpc/TODO ============================================================ $ cvs diff -u -r1.19 -r1.20 TODO --- ossp-pkg/srpc/TODO 2001/08/08 13:20:38 1.19 +++ ossp-pkg/srpc/TODO 2001/08/08 13:21:31 1.20 @@ -29,12 +29,9 @@ - UFT-8 RFC: rfc2279.txt - - libm may be used. We don't depend on sprintf() but convert out - numbers ourselves for portability. + - IEEE values ranges for floating point numbers will be used for + accurarcy in XML presentation. - - IEEE values ranges for floating point numbers will be used for - accurarcy in XML presentation. - - autoconf should find the types for int32 etc. even if they're not defined in sys/types.h. @@ -42,18 +39,17 @@ compiler supports. o M5 (peti+rse) [1 week until 06-Aug-2001] - - [peti] documentation for libxds (xds.pod) - - [rse] OSSP adjustments for libxds + - [peti] documentation for libxds (xds.pod) + - [rse] OSSP adjustments for libxds o M6 (peti+rse) [1 week until 13-Aug-2001] - - design API for libamp + - design API for libamp o M7 (peti) [4 weeks until 10-Sep-2001] - - implementation of libamp library framework - - implementation of libamp backends SHM, TCP and UDP - - regression tests for libamp + - implementation of libamp library framework + - implementation of libamp backends SHM, TCP and UDP + - regression tests for libamp o M8 (peti+rse) [1 week until 17-Sep-2001] - - [peti] documentation for libamp - - [rse] OSSP adjustments for libamp - + - [peti] documentation for libamp + - [rse] OSSP adjustments for libamp From ossp-cvs-owner@ossp.org Wed Aug 8 15:23:06 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f78DN6q91841; Wed, 8 Aug 2001 15:23:06 +0200 (CEST) Date: Wed, 8 Aug 2001 15:23:06 +0200 (CEST) Message-Id: <200108081323.f78DN6q91841@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc TODO Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 08-Aug-2001 15:23:06 Branch: HEAD Handle: 2001080814230500 Modified files: ossp-pkg/srpc TODO Log: Documented state of affairs for UTF-8 encoding in XML. Summary: Revision Changes Path 1.21 +1 -0 ossp-pkg/srpc/TODO ____________________________________________________________________________ Index: ossp-pkg/srpc/TODO ============================================================ $ cvs diff -u -r1.20 -r1.21 TODO --- ossp-pkg/srpc/TODO 2001/08/08 13:21:31 1.20 +++ ossp-pkg/srpc/TODO 2001/08/08 13:23:05 1.21 @@ -28,6 +28,7 @@ done: 100% [-> regression-tests/*.c] - UFT-8 RFC: rfc2279.txt + done: 0% - IEEE values ranges for floating point numbers will be used for accurarcy in XML presentation. From ossp-cvs-owner@ossp.org Wed Aug 8 16:40:32 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f78EeVl02016; Wed, 8 Aug 2001 16:40:31 +0200 (CEST) Date: Wed, 8 Aug 2001 16:40:31 +0200 (CEST) Message-Id: <200108081440.f78EeVl02016@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds/regression-tests xml-string.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 08-Aug-2001 16:40:31 Branch: HEAD Handle: 2001080815403000 Modified files: ossp-pkg/srpc/libxds/regression-tests xml-string.c Log: Added some weird characters in the xml-string example in order to test UTF-8 encoding. Summary: Revision Changes Path 1.2 +1 -1 ossp-pkg/srpc/libxds/regression-tests/xml-string.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/regression-tests/xml-string.c ============================================================ $ cvs diff -u -r1.1 -r1.2 xml-string.c --- ossp-pkg/srpc/libxds/regression-tests/xml-string.c 2001/08/08 11:21:28 1.1 +++ ossp-pkg/srpc/libxds/regression-tests/xml-string.c 2001/08/08 14:40:30 1.2 @@ -37,7 +37,7 @@ char* buffer; size_t buffer_size; - char msg[] = " ]]>&<&>World"; + char msg[] = " ]]>&<&>World: äöüß"; char* new_msg; /* Encode the string, then erase the buffer and decode the string From ossp-cvs-owner@ossp.org Wed Aug 8 17:10:04 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f78FA2q06543; Wed, 8 Aug 2001 17:10:02 +0200 (CEST) Date: Wed, 8 Aug 2001 17:10:02 +0200 (CEST) Message-Id: <200108081510.f78FA2q06543@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds xml-decode-string.c xml-encode-string... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 08-Aug-2001 17:10:02 Branch: HEAD Handle: 2001080816100200 Modified files: ossp-pkg/srpc/libxds xml-decode-string.c xml-encode-string.c Log: - Implemented UTF-8 encoding of strings. - Fixed a buffer-overrun problem in xml_encode_string(). Summary: Revision Changes Path 1.2 +74 -0 ossp-pkg/srpc/libxds/xml-decode-string.c 1.2 +120 -38 ossp-pkg/srpc/libxds/xml-encode-string.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/xml-decode-string.c ============================================================ $ cvs diff -u -r1.1 -r1.2 xml-decode-string.c --- ossp-pkg/srpc/libxds/xml-decode-string.c 2001/08/08 11:21:27 1.1 +++ ossp-pkg/srpc/libxds/xml-decode-string.c 2001/08/08 15:10:02 1.2 @@ -25,9 +25,71 @@ SUCH DAMAGE. */ +#include #include #include "xds.h" +#define INVALID 0x80000000 + +#define get(c) c = *strptr++; \ + if (chars) (*chars)++; \ + if ((c) == 0) return (unsigned int)EOF + +static unsigned int sgetu8(unsigned char *strptr, int *chars) + { + unsigned int c; + int i, iterations; + unsigned char ch; + + if (chars) + *chars = 0; + + if (strptr == NULL) + return (unsigned int)EOF; + + get(c); + + if ((c & 0xFE) == 0xFC) + { + c &= 0x01; + iterations = 5; + } + else if ((c & 0xFC) == 0xF8) + { + c &= 0x03; + iterations = 4; + } + else if ((c & 0xF8) == 0xF0) + { + c &= 0x07; + iterations = 3; + } + else if ((c & 0xF0) == 0xE0) + { + c &= 0x0F; + iterations = 2; + } + else if ((c & 0xE0) == 0xC0) + { + c &= 0x1F; + iterations = 1; + } + else if ((c & 0x80) == 0x80) + return INVALID; + else return c; + + for (i = 0; i < iterations; i++) + { + get(ch); + if ((ch & 0xC0) != 0x80) + return INVALID; + c <<= 6; + c |= ch & 0x3F; + } + + return c; + } + static const char TAG_OPEN[] = ""; static const char TAG_CLOSE[] = ""; static const size_t TAG_OPEN_LEN = sizeof(TAG_OPEN)-1; @@ -41,6 +103,8 @@ char* src; size_t src_len; char* dst; + int utf8_len; + unsigned int rc; /* Setup the engine. We need at least space for our tags; how long the actual content is going to be will be seen soon. */ @@ -99,6 +163,16 @@ free(dst); return XDS_ERR_TYPE_MISMATCH; } + } + else if (*((xds_uint8_t*)src) >= 0x80) + { + rc = sgetu8((xds_uint8_t*)src, &utf8_len); + if (rc == (unsigned int)EOF) + return XDS_ERR_UNDERFLOW; + else if (rc == INVALID || rc > 255) + return XDS_ERR_TYPE_MISMATCH; + *dst++ = (xds_uint8_t)rc; + src += utf8_len; src_len -= utf8_len; } else { Index: ossp-pkg/srpc/libxds/xml-encode-string.c ============================================================ $ cvs diff -u -r1.1 -r1.2 xml-encode-string.c --- ossp-pkg/srpc/libxds/xml-encode-string.c 2001/08/08 11:21:27 1.1 +++ ossp-pkg/srpc/libxds/xml-encode-string.c 2001/08/08 15:10:02 1.2 @@ -25,9 +25,71 @@ SUCH DAMAGE. */ +#include #include #include "xds.h" +#define bits(c) (0x80 | ((c) & 0x3F)) +#define put(c) *strptr++ = (c); +#define putbits(c) put(bits(c)) +#define finish() *strptr = '\0' + +static char* sputu8(xds_uint32_t c, char* strptr) + { + if (strptr == NULL) + return NULL; + + if (c < 0x80) + { + put(c); + finish(); + } + else if (c < 0x800) + { + put(0xC0 | (c >> 6)); + putbits(c); + finish(); + } + else if (c < 0x10000) + { + put(0xE0 | (c >> 12)); + putbits(c >> 6); + putbits(c); + finish(); + } + else if (c < 0x200000) + { + put(0xF0 | (c >> 18)); + putbits(c >> 12); + putbits(c >> 6); + putbits(c); + finish(); + } + else if (c < 0x400000) + { + put(0xF8 | (c >> 24)); + putbits(c >> 18); + putbits(c >> 12); + putbits(c >> 6); + putbits(c); + finish(); + } + else if (c < 0x80000000) + { + put(0xFC | (c >> 30)); + putbits(c >> 24); + putbits(c >> 18); + putbits(c >> 12); + putbits(c >> 6); + putbits(c); + finish(); + } + else + finish(); /* Not a valid Unicode "character" */ + + return strptr; + } + static const char TAG_OPEN[] = ""; static const char TAG_CLOSE[] = ""; static const size_t TAG_OPEN_LEN = sizeof(TAG_OPEN)-1; @@ -41,6 +103,7 @@ size_t src_len; char* dst; size_t dst_size; + char* tmp; /* Setup the engine. We need at least space for our tags; how long the actual content is going to be will be seen soon. */ @@ -68,48 +131,67 @@ while(src_len > 0 && dst_size > 0) { - switch(*src) - { - case '<': /* Turn into "<". */ - if (dst_size >= 4) - { - *dst++ = '&'; --dst_size; - *dst++ = 'l'; --dst_size; - *dst++ = 't'; --dst_size; - *dst++ = ';'; --dst_size; - ++src; --src_len; - } - break; - case '&': /* Turn into "&". */ - if (dst_size >= 5) - { - *dst++ = '&'; --dst_size; - *dst++ = 'a'; --dst_size; - *dst++ = 'm'; --dst_size; - *dst++ = 'p'; --dst_size; - *dst++ = ';'; --dst_size; - ++src; --src_len; - } - break; - case '>': /* Turn into ">". */ - if (dst_size >= 4) - { - *dst++ = '&'; --dst_size; - *dst++ = 'g'; --dst_size; - *dst++ = 't'; --dst_size; - *dst++ = ';'; --dst_size; - ++src; --src_len; - } - break; - default: /* Just copy it. */ - *dst++ = *src++; - --src_len; - --dst_size; + if (*((xds_uint8_t*)src) >= 0x80) + { /* UTF-8ify it. */ + if (dst_size >= 7) + { + tmp = sputu8((xds_uint32_t)*((xds_uint8_t*)src), dst); + ++src; --src_len; + dst_size -= tmp - dst; + dst = tmp; + } + else + dst_size = 0; + } + else if (*src == '<') + { /* Turn into "<". */ + if (dst_size >= 4) + { + *dst++ = '&'; --dst_size; + *dst++ = 'l'; --dst_size; + *dst++ = 't'; --dst_size; + *dst++ = ';'; --dst_size; + ++src; --src_len; + } + else + dst_size = 0; + } + else if (*src == '&') + { /* Turn into "&". */ + if (dst_size >= 5) + { + *dst++ = '&'; --dst_size; + *dst++ = 'a'; --dst_size; + *dst++ = 'm'; --dst_size; + *dst++ = 'p'; --dst_size; + *dst++ = ';'; --dst_size; + ++src; --src_len; + } + else + dst_size = 0; + } + else if (*src == '>') + { /* Turn into ">". */ + if (dst_size >= 4) + { + *dst++ = '&'; --dst_size; + *dst++ = 'g'; --dst_size; + *dst++ = 't'; --dst_size; + *dst++ = ';'; --dst_size; + ++src; --src_len; + } + else + dst_size = 0; + } + else + { /* No special character; just copy it. */ + *dst++ = *src++; + --src_len; --dst_size; } } if (src_len > 0) { /* Target buffer was too small. */ - *used_buffer_size = dst - (char*)buffer + 1; + *used_buffer_size = buffer_size + 1; return XDS_ERR_OVERFLOW; } From ossp-cvs-owner@ossp.org Wed Aug 8 21:15:31 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f78JFTR41653; Wed, 8 Aug 2001 21:15:29 +0200 (CEST) Date: Wed, 8 Aug 2001 21:15:29 +0200 (CEST) Message-Id: <200108081915.f78JFTR41653@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds .cvsignore Makefile.in configure.ac d... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 08-Aug-2001 21:15:29 Branch: HEAD Handle: 19700101010000997294526 Added files: ossp-pkg/srpc/libxds xds.c xds.pod xds_engine_xdr.c xds_engine_xml.c xds_p.h xds_test.sh xds_test_lib.c xds_test_xdr.c xds_test_xml.c Modified files: ossp-pkg/srpc/libxds .cvsignore Makefile.in configure.ac ossp-pkg/srpc/libxds/docs Makefile.in Removed files: ossp-pkg/srpc/libxds decode.c destroy.c encode.c find-engine.c getbuffer.c init.c internal.h register.c set-capacity.c setbuffer.c unregister.c vdecode.c vencode.c xdr-decode-double.c xdr-decode-int32.c xdr-decode-int64.c xdr-decode-octetstream.c xdr-decode-string.c xdr-decode-uint32.c xdr-decode-uint64.c xdr-encode-double.c xdr-encode-int32.c xdr-encode-int64.c xdr-encode-octetstream.c xdr-encode-string.c xdr-encode-uint32.c xdr-encode-uint64.c xml-decode-begin.c xml-decode-double.c xml-decode-end.c xml-decode-int32.c xml-decode-int64.c xml-decode-octetstream.c xml-decode-string.c xml-decode-uint32.c xml-decode-uint64.c xml-encode-begin.c xml-encode-double.c xml-encode-end.c xml-encode-int32.c xml-encode-int64.c xml-encode-octetstream.c xml-encode-string.c xml-encode-uint32.c xml-encode-uint64.c ossp-pkg/srpc/libxds/docs xds.pod ossp-pkg/srpc/libxds/regression-tests .cvsignore .run-tests Makefile.in xdr-int32.c xdr-int64.c xdr-octetstream-empty.c xdr-octetstream.c xdr-string-empty.c xdr-string.c xdr-uint32.c xdr-uint64.c xds-core.c xds-decode.c xds-encode.c xds-engine-restart.c xds-find-engine.c xds-getbuffer.c xds-mystruct.c xds-register.c xds-setbuffer.c xml-double.c xml-int32.c xml-int64.c xml-octetstream-empty.c xml-octetstream.c xml-string-empty.c xml-string.c xml-uint32.c xml-uint64.c Log: First cut of the ruthless style adjustments to OSSP XDS: o adjust source tree to follow OSSP source tree style by heavily combining sources into smaller sets (needs more work when still missing parts are added later) o automatic re-indentation of sources with GNU indent (still needs manual review and adjustments; will follow) These two heavy steps were mostly done automatically with the help of two helper scripts written in Perl. So expect more manual adjustments to follow... Summary: Revision Changes Path 1.5 +2 -0 ossp-pkg/srpc/libxds/.cvsignore 1.23 +41 -45 ossp-pkg/srpc/libxds/Makefile.in 1.16 +9 -18 ossp-pkg/srpc/libxds/configure.ac NONE +0 -38 ossp-pkg/srpc/libxds/decode.c NONE +0 -57 ossp-pkg/srpc/libxds/destroy.c 1.4 +2 -7 ossp-pkg/srpc/libxds/docs/Makefile.in NONE +0 -134 ossp-pkg/srpc/libxds/docs/xds.pod NONE +0 -38 ossp-pkg/srpc/libxds/encode.c NONE +0 -66 ossp-pkg/srpc/libxds/find-engine.c NONE +0 -52 ossp-pkg/srpc/libxds/getbuffer.c NONE +0 -70 ossp-pkg/srpc/libxds/init.c NONE +0 -63 ossp-pkg/srpc/libxds/internal.h NONE +0 -82 ossp-pkg/srpc/libxds/register.c NONE +0 -2 ossp-pkg/srpc/libxds/regression-tests/.cvsignore NONE +0 -42 ossp-pkg/srpc/libxds/regression-tests/.run-tests NONE +0 -43 ossp-pkg/srpc/libxds/regression-tests/Makefile.in NONE +0 -144 ossp-pkg/srpc/libxds/regression-tests/xdr-int32.c NONE +0 -144 ossp-pkg/srpc/libxds/regression-tests/xdr-int64.c NONE +0 -110 ossp-pkg/srpc/libxds/regression-tests/xdr-octetstream-empty.c NONE +0 -110 ossp-pkg/srpc/libxds/regression-tests/xdr-octetstream.c NONE +0 -104 ossp-pkg/srpc/libxds/regression-tests/xdr-string-empty.c NONE +0 -109 ossp-pkg/srpc/libxds/regression-tests/xdr-string.c NONE +0 -150 ossp-pkg/srpc/libxds/regression-tests/xdr-uint32.c NONE +0 -150 ossp-pkg/srpc/libxds/regression-tests/xdr-uint64.c NONE +0 -74 ossp-pkg/srpc/libxds/regression-tests/xds-core.c NONE +0 -124 ossp-pkg/srpc/libxds/regression-tests/xds-decode.c NONE +0 -117 ossp-pkg/srpc/libxds/regression-tests/xds-encode.c NONE +0 -122 ossp-pkg/srpc/libxds/regression-tests/xds-engine-restart.c NONE +0 -163 ossp-pkg/srpc/libxds/regression-tests/xds-find-engine.c NONE +0 -151 ossp-pkg/srpc/libxds/regression-tests/xds-getbuffer.c NONE +0 -168 ossp-pkg/srpc/libxds/regression-tests/xds-mystruct.c NONE +0 -144 ossp-pkg/srpc/libxds/regression-tests/xds-register.c NONE +0 -134 ossp-pkg/srpc/libxds/regression-tests/xds-setbuffer.c NONE +0 -114 ossp-pkg/srpc/libxds/regression-tests/xml-double.c NONE +0 -140 ossp-pkg/srpc/libxds/regression-tests/xml-int32.c NONE +0 -116 ossp-pkg/srpc/libxds/regression-tests/xml-int64.c NONE +0 -113 ossp-pkg/srpc/libxds/regression-tests/xml-octetstream-empty.c NONE +0 -113 ossp-pkg/srpc/libxds/regression-tests/xml-octetstream.c NONE +0 -112 ossp-pkg/srpc/libxds/regression-tests/xml-string-empty.c NONE +0 -112 ossp-pkg/srpc/libxds/regression-tests/xml-string.c NONE +0 -115 ossp-pkg/srpc/libxds/regression-tests/xml-uint32.c NONE +0 -115 ossp-pkg/srpc/libxds/regression-tests/xml-uint64.c NONE +0 -61 ossp-pkg/srpc/libxds/set-capacity.c NONE +0 -61 ossp-pkg/srpc/libxds/setbuffer.c NONE +0 -72 ossp-pkg/srpc/libxds/unregister.c NONE +0 -102 ossp-pkg/srpc/libxds/vdecode.c NONE +0 -165 ossp-pkg/srpc/libxds/vencode.c NONE +0 -35 ossp-pkg/srpc/libxds/xdr-decode-double.c NONE +0 -64 ossp-pkg/srpc/libxds/xdr-decode-int32.c NONE +0 -72 ossp-pkg/srpc/libxds/xdr-decode-int64.c NONE +0 -76 ossp-pkg/srpc/libxds/xdr-decode-octetstream.c NONE +0 -75 ossp-pkg/srpc/libxds/xdr-decode-string.c NONE +0 -51 ossp-pkg/srpc/libxds/xdr-decode-uint32.c NONE +0 -55 ossp-pkg/srpc/libxds/xdr-decode-uint64.c NONE +0 -35 ossp-pkg/srpc/libxds/xdr-encode-double.c NONE +0 -57 ossp-pkg/srpc/libxds/xdr-encode-int32.c NONE +0 -61 ossp-pkg/srpc/libxds/xdr-encode-int64.c NONE +0 -69 ossp-pkg/srpc/libxds/xdr-encode-octetstream.c NONE +0 -69 ossp-pkg/srpc/libxds/xdr-encode-string.c NONE +0 -49 ossp-pkg/srpc/libxds/xdr-encode-uint32.c NONE +0 -53 ossp-pkg/srpc/libxds/xdr-encode-uint64.c 1.1 +500 -0 ossp-pkg/srpc/libxds/xds.c 1.7 +134 -0 ossp-pkg/srpc/libxds/xds.pod 1.1 +483 -0 ossp-pkg/srpc/libxds/xds_engine_xdr.c 1.1 +1049 -0 ossp-pkg/srpc/libxds/xds_engine_xml.c 1.1 +60 -0 ossp-pkg/srpc/libxds/xds_p.h 1.1 +42 -0 ossp-pkg/srpc/libxds/xds_test.sh 1.1 +914 -0 ossp-pkg/srpc/libxds/xds_test_lib.c 1.1 +759 -0 ossp-pkg/srpc/libxds/xds_test_xdr.c 1.1 +741 -0 ossp-pkg/srpc/libxds/xds_test_xml.c NONE +0 -39 ossp-pkg/srpc/libxds/xml-decode-begin.c NONE +0 -35 ossp-pkg/srpc/libxds/xml-decode-double.c NONE +0 -39 ossp-pkg/srpc/libxds/xml-decode-end.c NONE +0 -78 ossp-pkg/srpc/libxds/xml-decode-int32.c NONE +0 -78 ossp-pkg/srpc/libxds/xml-decode-int64.c NONE +0 -224 ossp-pkg/srpc/libxds/xml-decode-octetstream.c NONE +0 -188 ossp-pkg/srpc/libxds/xml-decode-string.c NONE +0 -68 ossp-pkg/srpc/libxds/xml-decode-uint32.c NONE +0 -68 ossp-pkg/srpc/libxds/xml-decode-uint64.c NONE +0 -43 ossp-pkg/srpc/libxds/xml-encode-begin.c NONE +0 -35 ossp-pkg/srpc/libxds/xml-encode-double.c NONE +0 -40 ossp-pkg/srpc/libxds/xml-encode-end.c NONE +0 -79 ossp-pkg/srpc/libxds/xml-encode-int32.c NONE +0 -80 ossp-pkg/srpc/libxds/xml-encode-int64.c NONE +0 -142 ossp-pkg/srpc/libxds/xml-encode-octetstream.c NONE +0 -208 ossp-pkg/srpc/libxds/xml-encode-string.c NONE +0 -70 ossp-pkg/srpc/libxds/xml-encode-uint32.c NONE +0 -70 ossp-pkg/srpc/libxds/xml-encode-uint64.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/.cvsignore ============================================================ $ cvs diff -u -r1.4 -r1.5 .cvsignore --- ossp-pkg/srpc/libxds/.cvsignore 2001/07/20 10:42:34 1.4 +++ ossp-pkg/srpc/libxds/.cvsignore 2001/08/08 19:15:23 1.5 @@ -1,2 +1,4 @@ +.*.t +.*.l xds.3 xds.h Makefile configure Index: ossp-pkg/srpc/libxds/Makefile.in ============================================================ $ cvs diff -u -r1.22 -r1.23 Makefile.in --- ossp-pkg/srpc/libxds/Makefile.in 2001/08/08 11:21:27 1.22 +++ ossp-pkg/srpc/libxds/Makefile.in 2001/08/08 19:15:23 1.23 @@ -1,70 +1,66 @@ # Build libxds. -CC = @CC@ -AR = ar -RANLIB = @RANLIB@ - -CPPFLAGS = @CPPFLAGS@ @DEFS@ -D_GNU_SOURCE -CFLAGS = @CFLAGS@ -LDFLAGS = @LDFLAGS@ - -XML64_OBJS = @xml_64_bit_objects@ -XML_OBJS = xml-encode-int32.o xml-decode-int32.o \ - xml-encode-uint32.o xml-decode-uint32.o \ - xml-encode-double.o xml-decode-double.o \ - xml-encode-begin.o xml-decode-begin.o \ - xml-encode-end.o xml-decode-end.o \ - xml-encode-octetstream.o xml-decode-octetstream.o \ - xml-encode-string.o xml-decode-string.o \ - $(XML64_OBJS) - -XDR64_OBJS = @xdr_64_bit_objects@ -XDR_OBJS = xdr-encode-int32.o xdr-decode-int32.o \ - xdr-encode-uint32.o xdr-decode-uint32.o \ - xdr-encode-double.o xdr-decode-double.o \ - xdr-encode-octetstream.o xdr-decode-octetstream.o \ - xdr-encode-string.o xdr-decode-string.o \ - $(XDR64_OBJS) - -XDS_OBJS = decode.o destroy.o encode.o getbuffer.o init.o register.o \ - setbuffer.o unregister.o vdecode.o vencode.o find-engine.o \ - set-capacity.o +CC = @CC@ +AR = ar +RANLIB = @RANLIB@ +CPPFLAGS = @CPPFLAGS@ @DEFS@ -D_GNU_SOURCE +CFLAGS = @CFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +POD2MAN = @POD2MAN@ + +LIB_NAME = libxds.a +LIB_OBJS = xds.o xds_engine_xdr.o xds_engine_xml.o +TST_SRCS = xds_test_lib.c xds_test_xdr.c xds_test_xml.c -OBJS = $(XDS_OBJS) $(XDR_OBJS) $(XML_OBJS) +.SUFFIXES: +.SUFFIXES: .c .o .pod .3 +.PHONY: clean distclean realclean check docs + .c.o: $(CC) $(CPPFLAGS) $(WARNFLAGS) $(OPTFLAGS) $(CFLAGS) -c $< +.pod.3: + $(POD2MAN) --section=3 --center="XDS Library Programmer API" $< >$@ -.PHONY: clean distclean realclean check docs +all: $(LIB_NAME) xds.3 -all: libxds.a - -libxds.a: $(OBJS) +$(LIB_NAME): $(LIB_OBJS) @rm -f $@ - $(AR) cr $@ $(OBJS) + $(AR) cr $@ $(LIB_OBJS) $(RANLIB) $@ clean:: - @(cd regression-tests && $(MAKE) $@) @(cd docs && $(MAKE) $@) - rm -f $(OBJS) - rm -f libxds.a + -rm -f $(LIB_OBJS) + -rm -f ./.*.t ./.*.l + -rm -f $(LIB_NAME) + -rm -f xds.3 distclean:: clean - @(cd regression-tests && $(MAKE) $@) @(cd docs && $(MAKE) $@) - rm -f config.log config.status Makefile + -rm -f config.log config.status Makefile realclean:: distclean - rm -f configure + -rm -f configure -check: libxds.a - (cd regression-tests && $(MAKE) check) +check: $(LIB_NAME) $(TST_SRCS) + -@for filename in $(TST_SRCS); do \ + for testname in `grep "#ifdef XDS_TEST_" $$filename | sed -e 's;^#ifdef ;;'`; do \ + filebase=`echo $$filename | sed -e 's;\.c;;'`; \ + testbase=`echo $$testname | sed -e 's;^XDS_TEST_;;'`; \ + if [ ! -f ".$$testbase.t" ]; then \ + echo "$(CC) $(CPPFLAGS) $(WARNFLAGS) $(OPTFLAGS) $(CFLAGS) $(LDFLAGS) -D$$testname -o .$$testbase.t $$filebase.c $(LIB_NAME)"; \ + $(CC) $(CPPFLAGS) $(WARNFLAGS) $(OPTFLAGS) $(CFLAGS) $(LDFLAGS) -D$$testname -o .$$testbase.t $$filebase.c $(LIB_NAME); \ + fi; \ + done; \ + done; \ + sh ./xds_test.sh ./.*.t docs: @(cd docs && $(MAKE)) # Dependencies + +$(LIB_OBJS): xds_p.h xds.h -$(XDS_OBJS): internal.h xds.h -$(XDR_OBJS) $(XML_OBJS): xds.h Index: ossp-pkg/srpc/libxds/configure.ac ============================================================ $ cvs diff -u -r1.15 -r1.16 configure.ac --- ossp-pkg/srpc/libxds/configure.ac 2001/08/08 11:49:07 1.15 +++ ossp-pkg/srpc/libxds/configure.ac 2001/08/08 19:15:23 1.16 @@ -1,8 +1,8 @@ dnl configure.in -- Process this file with autoconf to produce a configure script. -AC_INIT(libxds) +AC_INIT(xds) AC_PREREQ(2.52) -AC_REVISION($Revision: 1.15 $) +AC_REVISION($Revision: 1.16 $) dnl Get rid of the lousy -g and -O defaults in CFLAGS. dnl @@ -50,17 +50,6 @@ [AC_MSG_WARN([no signed 64 bit data type found]) xds_int64_t=undefined]) dnl -if test "$xds_int64_t" = "undefined" -o "$xds_uint64_t" = "undefined"; then - have_64_bit_support="#undef XDS_HAVE_64_BIT_SUPPORT" -else - have_64_bit_support="#define XDS_HAVE_64_BIT_SUPPORT" - xdr_64_bit_objects="xdr-encode-int64.o xdr-decode-int64.o" - xdr_64_bit_objects="$xdr_64_bit_objects xdr-encode-uint64.o xdr-decode-uint64.o" - xml_64_bit_objects="xml-encode-int64.o xml-decode-int64.o" - xml_64_bit_objects="$xml_64_bit_objects xml-encode-uint64.o xml-decode-uint64.o" - tests_64_bit="xdr-int64.exe xdr-uint64.exe xml-int64.exe xml-uint64.exe" - tests_64_bit="$tests_64_bit xds-mystruct.exe" -fi AC_SUBST([xds_uint8_t]) AC_SUBST([xds_uint16_t]) AC_SUBST([xds_uint32_t]) @@ -69,10 +58,12 @@ AC_SUBST([xds_int16_t]) AC_SUBST([xds_int32_t]) AC_SUBST([xds_int64_t]) +if test "$xds_int64_t" = "undefined" -o "$xds_uint64_t" = "undefined"; then + have_64_bit_support="#undef XDS_HAVE_64_BIT_SUPPORT" +else + have_64_bit_support="#define XDS_HAVE_64_BIT_SUPPORT" +fi AC_SUBST([have_64_bit_support]) -AC_SUBST([xdr_64_bit_objects]) -AC_SUBST([xml_64_bit_objects]) -AC_SUBST([tests_64_bit]) dnl Find the library containing the xdr_xxx() functions. dnl @@ -81,6 +72,6 @@ dnl Write results. dnl -AC_CONFIG_FILES(xds.h Makefile regression-tests/Makefile docs/Makefile) -AC_CONFIG_COMMANDS([default], [chmod -w xds.h Makefile regression-tests/Makefile docs/Makefile]) +AC_CONFIG_FILES(xds.h Makefile docs/Makefile) +AC_CONFIG_COMMANDS([default], [chmod -w xds.h Makefile docs/Makefile]) AC_OUTPUT Index: ossp-pkg/srpc/libxds/docs/Makefile.in ============================================================ $ cvs diff -u -r1.3 -r1.4 Makefile.in --- ossp-pkg/srpc/libxds/docs/Makefile.in 2001/08/07 14:07:00 1.3 +++ ossp-pkg/srpc/libxds/docs/Makefile.in 2001/08/08 19:15:26 1.4 @@ -1,10 +1,9 @@ # Build libxds documentation. LATEX = @LATEX@ -POD2MAN = @POD2MAN@ .SUFFIXES: -.SUFFIXES: .tex .dvi .ps .pod .3 +.SUFFIXES: .tex .dvi .ps .tex.dvi: latex \\nonstopmode\\input $<; \ @@ -15,14 +14,10 @@ .dvi.ps: dvips $< -o $@ -.pod.3: - $(POD2MAN) --section=3 --center="XDS Library Programmer API " $< >$@ +all: libxds.ps -all: libxds.ps xds.3 - clean: rm -f libxds.aux libxds.dvi libxds.log libxds.ps libxds.toc - rm -f xds.3 distclean realclean: rm -f Makefile Index: ossp-pkg/srpc/libxds/xds.c ============================================================ $ cvs update -p -r1.1 xds.c /* * XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The * OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless * Deutschland (http://www.cw.com/de/) * * This file is part of OSSP XDS, an extensible data serialization library * which can be found at http://www.ossp.com/pkg/xds/. * * 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. */ #include #include #include #include "xds_p.h" xds_t *xds_init(xds_mode_t mode) { xds_t *ctx; /* Sanity check parameter. */ assert(mode == XDS_ENCODE || mode == XDS_DECODE); if (mode != XDS_ENCODE && mode != XDS_DECODE) { errno = EINVAL; return NULL; } /* Allocate context structure. */ ctx = malloc(sizeof (struct xds_context)); if (ctx == NULL) return NULL; /* errno is set by calloc() */ /* Set mode of operation in context. */ ctx->mode = mode; /* Initialize buffer handling. */ ctx->buffer = NULL; ctx->buffer_len = 0; ctx->buffer_capacity = 0; ctx->we_own_buffer = XDS_FALSE; /* Initialize engines map. */ ctx->engines = NULL; ctx->engines_len = 0; ctx->engines_capacity = 0; return ctx; } void xds_destroy(xds_t *xds) { /* Sanity checks. */ assert(xds != NULL); if (xds == NULL) return; /* Free allocated memory. */ assert(xds->buffer != NULL || (xds->buffer_capacity == 0 && xds->buffer_len == 0)); if (xds->buffer != NULL && xds->we_own_buffer) free(xds->buffer); assert(xds->engines != NULL || xds->engines_capacity == 0); if (xds->engines != NULL) { size_t i; for (i = 0; i < xds->engines_len; ++i) { assert(xds->engines[i].name != NULL); free(xds->engines[i].name); } free(xds->engines); } free(xds); return; } int xds_setbuffer(xds_t *xds, xds_scope_t flag, void *buffer, size_t buffer_len) { /* Sanity checks. */ xds_check_parameter(xds != NULL); xds_check_parameter(flag == XDS_GIFT || flag == XDS_LOAN); xds_check_parameter((buffer != NULL && buffer_len != 0) || flag == XDS_GIFT); /* Free the old buffer if there is one. */ if (xds->buffer != NULL && xds->we_own_buffer) free(xds->buffer); xds->buffer_len = 0; if (flag == XDS_GIFT) { xds->buffer = buffer; if (buffer == NULL) xds->buffer_capacity = 0; else xds->buffer_capacity = buffer_len; xds->we_own_buffer = XDS_TRUE; } else { xds->buffer = buffer; xds->buffer_capacity = buffer_len; xds->we_own_buffer = XDS_FALSE; } return XDS_OK; } int xds_getbuffer(xds_t *xds, xds_scope_t flag, void **buffer, size_t *buffer_len) { /* Sanity checks. */ xds_check_parameter(xds != NULL); xds_check_parameter(flag == XDS_GIFT || flag == XDS_LOAN); xds_check_parameter(buffer != NULL); xds_check_parameter(buffer_len != NULL); /* Return the buffer to the caller. */ *buffer = xds->buffer; *buffer_len = xds->buffer_len; if (flag == XDS_GIFT) { xds->buffer = NULL; xds->buffer_capacity = xds->buffer_len = 0; } else xds->buffer_len = 0; return XDS_OK; } int xds_set_capacity(void **array, size_t *array_capacity, size_t new_capacity, size_t elem_size, size_t initial_capacity) { void *buf; size_t size; /* Sanity checks. */ xds_check_parameter(array != NULL); xds_check_parameter(array_capacity != NULL); xds_check_parameter(elem_size != 0); xds_check_parameter(initial_capacity != 0); /* Do we need to re-allocate? */ if (*array_capacity > new_capacity) return XDS_OK; /* Find the correct capacity. */ size = (*array_capacity != 0) ? *array_capacity * 2 : initial_capacity; while (size < new_capacity) size *= 2; /* Allocate the array and store the new values. */ buf = realloc(*array, size * elem_size); if (buf == NULL) return XDS_ERR_NO_MEM; *array = buf; *array_capacity = size; return XDS_OK; } int xds_find_engine(const engine_map_t *engines, size_t last, const char *name, size_t *pos) { size_t first; /* Sanity checks. */ xds_check_parameter(engines != NULL || last == 0); xds_check_parameter(name != NULL); xds_check_parameter(pos != NULL); /* Use binary search to find "name" in "engines". */ for (first = 0; (last - first) > 0;) { size_t half = first + ((last - first) / 2); int rc = strcmp(engines[half].name, name); if (rc < 0) first = half + 1; else if (rc == 0) { /* found it */ *pos = half; return XDS_TRUE; } else last = half; assert(first <= last); } *pos = first; return XDS_FALSE; } int xds_register(xds_t *xds, const char *name, xds_engine_t engine, void *engine_context) { size_t pos; /* Sanity checks. */ xds_check_parameter(xds != NULL); xds_check_parameter(name != NULL); xds_check_parameter(engine != NULL); for (pos = 0; name[pos] != '\0'; ++pos) { if (!isalnum((int)name[pos]) && name[pos] != '-' && name[pos] != '_') return XDS_ERR_INVALID_ARG; } /* Copy the name argument into our own memory. */ name = strdup(name); if (name == NULL) return XDS_ERR_NO_MEM; /* Search engines for the entry. */ if (xds_find_engine(xds->engines, xds->engines_len, name, &pos)) { /* overwrite existing entry */ free(xds->engines[pos].name); } else { /* insert new entry */ int rc = xds_set_capacity((void **)&xds->engines, &xds->engines_capacity, xds->engines_len + 1, sizeof (engine_map_t), XDS_INITIAL_ENGINES_CAPACITY); assert(rc == XDS_OK || rc == XDS_ERR_NO_MEM); if (rc != XDS_OK) return rc; memmove(&xds->engines[pos + 1], &xds->engines[pos], (xds->engines_len - pos) * sizeof (engine_map_t)); ++xds->engines_len; } /* Insert entry. */ xds->engines[pos].name = (char *)name; xds->engines[pos].engine = engine; xds->engines[pos].context = engine_context; /* Everything is fine. */ return XDS_OK; } int xds_unregister(xds_t *xds, const char *name) { size_t pos; int rc; /* Sanity checks. */ xds_check_parameter(xds != NULL); xds_check_parameter(name != NULL); for (pos = 0; name[pos] != '\0'; ++pos) { if (!isalnum((int)name[pos]) && name[pos] != '-' && name[pos] != '_') return XDS_ERR_INVALID_ARG; } /* Find the entry we're supposed to delete. */ if (!xds_find_engine(xds->engines, xds->engines_len, name, &pos)) return XDS_ERR_UNKNOWN_ENGINE; /* Free the memory allocated for this entry and move the entries behind it back if necessary. */ assert(xds->engines[pos].name != NULL); free(xds->engines[pos].name); memmove(&xds->engines[pos], &xds->engines[pos + 1], (xds->engines_len - (pos + 1)) * sizeof (engine_map_t)); --xds->engines_len; /* Lower capacity if necessary. */ rc = xds_set_capacity((void **)&xds->engines, &xds->engines_capacity, xds->engines_len, sizeof (engine_map_t), XDS_INITIAL_ENGINES_CAPACITY); assert(rc == XDS_OK || rc == XDS_ERR_NO_MEM); if (rc != XDS_OK) return rc; return XDS_OK; } int xds_encode(xds_t *xds, const char *fmt, ...) { int rc; va_list args; va_start(args, fmt); rc = xds_vencode(xds, fmt, args); va_end(args); return rc; } int xds_vencode(xds_t *xds, const char *fmt_arg, va_list args) { va_list args_backup; size_t buffer_len_backup; char *name; char *p; char *fmt; int rc; /* Sanity checks. */ xds_check_parameter(xds != NULL); xds_check_parameter(fmt_arg != NULL); assert(xds->mode == XDS_ENCODE); if (xds->mode != XDS_ENCODE) return XDS_ERR_INVALID_MODE; /* Ensure we have a buffer allocated ready for use. */ if (xds->buffer == NULL) { /* allocate a new buffer */ rc = xds_set_capacity((void **)&xds->buffer, &xds->buffer_capacity, XDS_INITIAL_BUFFER_CAPACITY, sizeof (char), XDS_INITIAL_BUFFER_CAPACITY); assert(rc == XDS_OK || rc == XDS_ERR_NO_MEM); if (rc != XDS_OK) return rc; xds->buffer_len = 0; xds->we_own_buffer = XDS_TRUE; } /* Iterate through the items in the format string and execute the apropriate engines. */ fmt = p = strdup(fmt_arg); if (fmt == NULL) return XDS_ERR_NO_MEM; buffer_len_backup = xds->buffer_len; for (name = p; *p != '\0'; name = p) { while (isalnum((int)*p) || *p == '-' || *p == '_') ++p; if (*p) *p++ = '\0'; else *p = '\0'; if (strlen(name) > 0) { int restart_engine; size_t used_buffer_size; size_t pos; if (xds_find_engine(xds->engines, xds->engines_len, name, &pos) == XDS_FALSE) { rc = XDS_ERR_UNKNOWN_ENGINE; goto leave; } do { /* Ensure the buffer has free space. */ assert(xds->buffer_len <= xds->buffer_capacity); if (xds->buffer_len == xds->buffer_capacity) { if (xds->we_own_buffer) { rc = xds_set_capacity((void **)&xds->buffer, &xds->buffer_capacity, xds->buffer_len + 1, sizeof (char), XDS_INITIAL_BUFFER_CAPACITY); assert(rc == XDS_OK || rc == XDS_ERR_NO_MEM); if (rc != XDS_OK) goto leave; } else { rc = XDS_ERR_OVERFLOW; goto leave; } } /* Execute the engine. */ used_buffer_size = 0; args_backup = args; rc = (*xds->engines[pos].engine)(xds, xds->engines[pos].context, xds->buffer + xds->buffer_len, xds->buffer_capacity - xds->buffer_len, &used_buffer_size, &args); assert(rc <= 0); if (rc == XDS_OK) { restart_engine = XDS_FALSE; xds->buffer_len += used_buffer_size; } else if (rc == XDS_ERR_OVERFLOW) { /* enlarge buffer */ if (!xds->we_own_buffer) goto leave; restart_engine = XDS_TRUE; args = args_backup; rc = xds_set_capacity((void **)&xds->buffer, &xds->buffer_capacity, xds->buffer_capacity + ((used_buffer_size == 0) ? 1 : used_buffer_size), sizeof (char), XDS_INITIAL_BUFFER_CAPACITY); assert(rc == XDS_OK || rc == XDS_ERR_NO_MEM); if (rc != XDS_OK) goto leave; } else goto leave; } while (restart_engine); } } rc = XDS_OK; /* Clean up and leave. */ leave: free(fmt); if (rc != XDS_OK) xds->buffer_len = buffer_len_backup; return rc; } int xds_decode(xds_t *xds, const char *fmt, ...) { int rc; va_list args; va_start(args, fmt); rc = xds_vdecode(xds, fmt, args); va_end(args); return rc; } int xds_vdecode(xds_t *xds, const char *fmt_arg, va_list args) { size_t buffer_len_backup; char *name; char *p; char *fmt; int rc; /* Sanity checks. */ xds_check_parameter(xds != NULL); xds_check_parameter(fmt_arg != NULL); assert(xds->mode == XDS_DECODE); if (xds->mode != XDS_DECODE) return XDS_ERR_INVALID_MODE; /* Ensure we have a buffer to decode. */ if (xds->buffer == NULL || xds->buffer_capacity == 0) return XDS_ERR_UNDERFLOW; /* Iterate through the items in the format string and execute the apropriate engines. */ fmt = p = strdup(fmt_arg); if (fmt == NULL) return XDS_ERR_NO_MEM; buffer_len_backup = xds->buffer_len; for (name = p; *p != '\0'; name = p) { while (isalnum((int)*p) || *p == '-' || *p == '_') ++p; if (*p) *p++ = '\0'; else *p = '\0'; if (strlen(name) > 0) { size_t pos; size_t used_buffer_size = 0; if (xds_find_engine(xds->engines, xds->engines_len, name, &pos)) { rc = (*xds->engines[pos].engine)(xds, xds->engines[pos].context, xds->buffer + xds->buffer_len, xds->buffer_capacity - xds->buffer_len, &used_buffer_size, &args); assert(rc <= 0); if (rc == XDS_OK) xds->buffer_len += used_buffer_size; else goto leave; } else { rc = XDS_ERR_UNKNOWN_ENGINE; goto leave; } } } rc = XDS_OK; /* Clean up and leave. */ leave: free(fmt); if (rc != XDS_OK) xds->buffer_len = buffer_len_backup; return rc; } Index: ossp-pkg/srpc/libxds/xds.pod ============================================================ $ cvs update -p -r1.7 xds.pod =pod =head1 NAME xds - eXtensible Data Serialization =head1 SYNOPSIS =head1 DESCRIPTION =over 4 =item xds_t* B(xds_mode_t I); Valid settings for I are B and B. If successful, a valid handle is returned -- B otherwise. If the routine fails, the system variable B is set apropriately. =item void B(xds_t* I); Free all internally allocated resources associated with this context. I must be a handle obtained by calling B. =item int B(xds_t* I, const char* I, xds_engine_t I, void* I); Register the function I as formatting engine in context I under the name I. The function must have the following prototype: int my_engine(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list args); It must gather its values from I and encode/decode them into I. The encoded/decoded representation must not take up more than I byte of memory, because that's the maximum I can hold. If the buffer is too small, I must return B. In case of no error, I must return the number of bytes it has written to the buffer. (Note that all xds error defines are smaller than >0.) The variable I is passed through to the function every time it is called; it is not touched in any way by the xds library. A valid name I for a callback function consists of an arbitrary number of characters from the class [a-zA-Z0-9_-]. =item int B(xds_t* I, const char* I); Remove encoding/decoding engine I from context I. The function will return B if successful and B if I is not a registered engine. =item int B(xds_t* I, xds_scope_t I, void* I, size_t I); Encoding mode: Set internal buffer used in context I to I. The buffer has a capacity of I byte. I may be set to B or B. A "loaned" buffer is one that is owned by the application; xds will use it, but it will not B the buffer nor will it try to B it if it's too small. A buffer given to xds as a "gift" is henceforth owned by xds and may be Bd or Bed as the library sees fit. If I is B, I must be a pointer obtained from calling the B API. Calling B with a I of B will cause the xds library to allocate a buffer of its own. I is ignored in this case. Decoding mode: I contains the encoded representation of the data to be used for following B calls. The encoded data is I byte long. Unlike in encoding mode, such a buffer is not modified, hence there is no need to extend the buffer. If I is set to B, the library will B I when the context is destroyed. B returns one of the following codes signifying success or failure: B (everything alright), B (failed to allocate new internal buffers), and B (arguments don't make sense). =item int B(xds_t* I, xds_scope_t flag, void** buffer, size_t* buffer_size); This routine will write the address and size of the internal buffer in context I to I and I. The I parameter determines who owns the buffer after that; setting I to B means that the buffer is owned by the xds library and that the user may not rely on its contents still being there after another xds library function call. Furthermore, calling B will flush the registered buffer, meaning that coming B calls will start at the beginning and potentially overwrite the buffer contents. Setting I to B means that the returned buffer is owned by the application programmer from now on, it is no longer modified or used in any way by the library. The application must B the buffer when it's not needed anymore. =item int B(xds_t* I, const char* I, ...); The B function call will encode an arbitrary number of values into the chosen representation. The syntax is very similar to B: As parameters, it requires the I handle obtained from B, a format string I describing the following value parameters, and an arbitrary number of actual values. The format string lists the names of the callback functions to be used in order to format the values; it has the format "name name ...". The names are delimited by any number of characters any of which is not part of the character set allowed for function names here. Hence, you can delimit the names by blanks, tabs, dollar signs or pretty much anyting your want. B will return either B (everything OK), B (failed allocating memory for intenal buffering), B (can't expand internal buffer because it's owned by the application), B (parameters don't make sense), B (specified callback can't handle this data type), and B (unknown call back name used in I). =item int B(xds_t* I, const char* I, ...); Like B, only the other way round. =item int B(xds_t* I, const char* I, va_list I); See B. =item int B(xds_t* I, const char* I, va_list I); See B. =back =cut Index: ossp-pkg/srpc/libxds/xds_engine_xdr.c ============================================================ $ cvs update -p -r1.1 xds_engine_xdr.c /* * XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The * OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless * Deutschland (http://www.cw.com/de/) * * This file is part of OSSP XDS, an extensible data serialization library * which can be found at http://www.ossp.com/pkg/xds/. * * 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. */ #include #include "xds.h" int xdr_encode_int32(xds_t * xds, void *engine_context, void *buffer, size_t buffer_size, size_t * used_buffer_size, va_list * args) { xds_uint32_t tmp; xds_int32_t value; xds_init_encoding_engine(4); /* Get value and format it into the buffer. */ value = va_arg(*args, xds_uint32_t); if (value < 0) { value = 0 - value; tmp = 0 - (xds_uint32_t) value; } else tmp = (xds_uint32_t) value; ((xds_uint8_t *) buffer)[0] = (tmp >> 24) & 0x000000ff; ((xds_uint8_t *) buffer)[1] = (tmp >> 16) & 0x000000ff; ((xds_uint8_t *) buffer)[2] = (tmp >> 8) & 0x000000ff; ((xds_uint8_t *) buffer)[3] = (tmp >> 0) & 0x000000ff; /* Done. */ return XDS_OK; } int xdr_decode_int32(xds_t * xds, void *engine_context, void *buffer, size_t buffer_size, size_t * used_buffer_size, va_list * args) { xds_int32_t *value; xds_uint32_t tmp; xds_init_decoding_engine(4); /* Get value and format it into the buffer. */ value = va_arg(*args, xds_int32_t *); xds_check_parameter(value != NULL); if (((xds_uint8_t *) buffer)[0] & 0x80) { /* negative number */ tmp = ((xds_uint8_t *) buffer)[0]; tmp = tmp << 8; tmp += ((xds_uint8_t *) buffer)[1]; tmp = tmp << 8; tmp += ((xds_uint8_t *) buffer)[2]; tmp = tmp << 8; tmp += ((xds_uint8_t *) buffer)[3]; tmp = 0 - tmp; *value = 0 - (int32_t) tmp; } else { /* positive number */ *value = ((xds_uint8_t *) buffer)[0]; *value = *value << 8; *value += ((xds_uint8_t *) buffer)[1]; *value = *value << 8; *value += ((xds_uint8_t *) buffer)[2]; *value = *value << 8; *value += ((xds_uint8_t *) buffer)[3]; } /* Done. */ return XDS_OK; } int xdr_encode_uint32(xds_t * xds, void *engine_context, void *buffer, size_t buffer_size, size_t * used_buffer_size, va_list * args) { xds_uint32_t value; xds_init_encoding_engine(4); /* Get value and format it into the buffer. */ value = va_arg(*args, xds_uint32_t); ((xds_uint8_t *) buffer)[0] = (value >> 24) & 0x000000ff; ((xds_uint8_t *) buffer)[1] = (value >> 16) & 0x000000ff; ((xds_uint8_t *) buffer)[2] = (value >> 8) & 0x000000ff; ((xds_uint8_t *) buffer)[3] = (value >> 0) & 0x000000ff; /* Done. */ return XDS_OK; } int xdr_decode_uint32(xds_t * xds, void *engine_context, void *buffer, size_t buffer_size, size_t * used_buffer_size, va_list * args) { xds_uint32_t *value; xds_init_decoding_engine(4); /* Get value and format it into the buffer. */ value = va_arg(*args, xds_uint32_t *); xds_check_parameter(value != NULL); *value = ((xds_uint8_t *) buffer)[0]; *value = *value << 8; *value += ((xds_uint8_t *) buffer)[1]; *value = *value << 8; *value += ((xds_uint8_t *) buffer)[2]; *value = *value << 8; *value += ((xds_uint8_t *) buffer)[3]; /* Done. */ return XDS_OK; } #ifdef XDS_HAVE_64_BIT_SUPPORT int xdr_encode_int64(xds_t * xds, void *engine_context, void *buffer, size_t buffer_size, size_t * used_buffer_size, va_list * args) { xds_uint64_t tmp; xds_int64_t value; xds_init_encoding_engine(8); /* Get value and format it into the buffer. */ value = va_arg(*args, xds_uint64_t); if (value < 0) { value = 0 - value; tmp = 0 - (xds_uint64_t) value; } else tmp = (xds_uint64_t) value; ((xds_uint8_t *) buffer)[0] = (tmp >> 56) & 0x000000ff; ((xds_uint8_t *) buffer)[1] = (tmp >> 48) & 0x000000ff; ((xds_uint8_t *) buffer)[2] = (tmp >> 40) & 0x000000ff; ((xds_uint8_t *) buffer)[3] = (tmp >> 32) & 0x000000ff; ((xds_uint8_t *) buffer)[4] = (tmp >> 24) & 0x000000ff; ((xds_uint8_t *) buffer)[5] = (tmp >> 16) & 0x000000ff; ((xds_uint8_t *) buffer)[6] = (tmp >> 8) & 0x000000ff; ((xds_uint8_t *) buffer)[7] = (tmp >> 0) & 0x000000ff; /* Done. */ return XDS_OK; } int xdr_decode_int64(xds_t * xds, void *engine_context, void *buffer, size_t buffer_size, size_t * used_buffer_size, va_list * args) { xds_int64_t *value; xds_uint64_t tmp; xds_init_decoding_engine(8); /* Get value and format it into the buffer. */ value = va_arg(*args, xds_int64_t *); xds_check_parameter(value != NULL); if (((xds_uint8_t *) buffer)[0] & 0x80) { /* negative number */ tmp = ((xds_uint8_t *) buffer)[0]; tmp = tmp << 8; tmp += ((xds_uint8_t *) buffer)[1]; tmp = tmp << 8; tmp += ((xds_uint8_t *) buffer)[2]; tmp = tmp << 8; tmp += ((xds_uint8_t *) buffer)[3]; tmp = tmp << 8; tmp += ((xds_uint8_t *) buffer)[4]; tmp = tmp << 8; tmp += ((xds_uint8_t *) buffer)[5]; tmp = tmp << 8; tmp += ((xds_uint8_t *) buffer)[6]; tmp = tmp << 8; tmp += ((xds_uint8_t *) buffer)[7]; tmp = 0 - tmp; *value = 0 - (xds_int64_t) tmp; } else { /* positive number */ *value = ((xds_uint8_t *) buffer)[0]; *value = *value << 8; *value += ((xds_uint8_t *) buffer)[1]; *value = *value << 8; *value += ((xds_uint8_t *) buffer)[2]; *value = *value << 8; *value += ((xds_uint8_t *) buffer)[3]; *value = *value << 8; *value += ((xds_uint8_t *) buffer)[4]; *value = *value << 8; *value += ((xds_uint8_t *) buffer)[5]; *value = *value << 8; *value += ((xds_uint8_t *) buffer)[6]; *value = *value << 8; *value += ((xds_uint8_t *) buffer)[7]; } /* Done. */ return XDS_OK; } int xdr_encode_uint64(xds_t * xds, void *engine_context, void *buffer, size_t buffer_size, size_t * used_buffer_size, va_list * args) { xds_uint64_t value; xds_init_encoding_engine(8); /* Get value and format it into the buffer. */ value = va_arg(*args, xds_uint64_t); ((xds_uint8_t *) buffer)[0] = (value >> 56) & 0x000000ff; ((xds_uint8_t *) buffer)[1] = (value >> 48) & 0x000000ff; ((xds_uint8_t *) buffer)[2] = (value >> 40) & 0x000000ff; ((xds_uint8_t *) buffer)[3] = (value >> 32) & 0x000000ff; ((xds_uint8_t *) buffer)[4] = (value >> 24) & 0x000000ff; ((xds_uint8_t *) buffer)[5] = (value >> 16) & 0x000000ff; ((xds_uint8_t *) buffer)[6] = (value >> 8) & 0x000000ff; ((xds_uint8_t *) buffer)[7] = (value >> 0) & 0x000000ff; /* Done. */ return XDS_OK; } int xdr_decode_uint64(xds_t * xds, void *engine_context, void *buffer, size_t buffer_size, size_t * used_buffer_size, va_list * args) { xds_uint64_t *value; xds_init_decoding_engine(8); /* Get value and format it into the buffer. */ value = va_arg(*args, xds_uint64_t *); xds_check_parameter(value != NULL); *value = ((xds_uint8_t *) buffer)[0]; *value = *value << 8; *value += ((xds_uint8_t *) buffer)[1]; *value = *value << 8; *value += ((xds_uint8_t *) buffer)[2]; *value = *value << 8; *value += ((xds_uint8_t *) buffer)[3]; *value = *value << 8; *value += ((xds_uint8_t *) buffer)[4]; *value = *value << 8; *value += ((xds_uint8_t *) buffer)[5]; *value = *value << 8; *value += ((xds_uint8_t *) buffer)[6]; *value = *value << 8; *value += ((xds_uint8_t *) buffer)[7]; /* Done. */ return XDS_OK; } #endif /* XDS_HAVE_64_BIT_SUPPORT */ int xdr_encode_double(xds_t * xds, void *engine_context, void *buffer, size_t buffer_size, size_t * used_buffer_size, va_list * args) { return -1; } int xdr_decode_double(xds_t * xds, void *engine_context, void *buffer, size_t buffer_size, size_t * used_buffer_size, va_list * args) { return -1; } int xdr_encode_string(xds_t * xds, void *engine_context, void *buffer, size_t buffer_size, size_t * used_buffer_size, va_list * args) { char *p; size_t p_len; size_t padding; xds_init_encoding_engine(4); /* Get value from stack and calculate the correct amount of padding. */ p = va_arg(*args, char *); xds_check_parameter(p != NULL); p_len = strlen(p); padding = (4 - (p_len & 0x03)) & 0x03; assert((p_len + padding) % 4 == 0); /* We need (4 + p_len + padding) bytes in the buffer to format our * parameter. If we don't have them, return an underflow error. */ *used_buffer_size = 4 + p_len + padding; if (buffer_size < *used_buffer_size) return XDS_ERR_OVERFLOW; /* Format the values into the buffer. */ ((xds_uint8_t *) buffer)[0] = (p_len >> 24) & 0x000000ff; ((xds_uint8_t *) buffer)[1] = (p_len >> 16) & 0x000000ff; ((xds_uint8_t *) buffer)[2] = (p_len >> 8) & 0x000000ff; ((xds_uint8_t *) buffer)[3] = (p_len >> 0) & 0x000000ff; memmove((xds_uint8_t *) buffer + 4, p, p_len); memset((xds_uint8_t *) buffer + 4 + p_len, 0, padding); /* Done. */ return XDS_OK; } int xdr_decode_string(xds_t * xds, void *engine_context, void *buffer, size_t buffer_size, size_t * used_buffer_size, va_list * args) { char **p; size_t p_len; size_t padding; xds_init_decoding_engine(4); p = va_arg(*args, char **); xds_check_parameter(p != NULL); /* Read the size of the message. */ p_len = ((xds_uint8_t *) buffer)[0]; p_len = p_len << 8; p_len += ((xds_uint8_t *) buffer)[1]; p_len = p_len << 8; p_len += ((xds_uint8_t *) buffer)[2]; p_len = p_len << 8; p_len += ((xds_uint8_t *) buffer)[3]; /* Calculate padding. */ padding = (4 - (p_len & 0x03)) & 0x03; /* Do we have enough data?. */ *used_buffer_size = 4 + p_len + padding; if (buffer_size < *used_buffer_size) return XDS_ERR_UNDERFLOW; /* Allocate buffer for the data. */ *p = (char *)malloc(p_len + 1); if (*p == NULL) return XDS_ERR_NO_MEM; /* Copy data into the buffer. */ memmove(*p, (xds_uint8_t *) buffer + 4, p_len); ((xds_uint8_t *) buffer)[4 + p_len] = '\0'; /* Done. */ return XDS_OK; } int xdr_encode_octetstream(xds_t * xds, void *engine_context, void *buffer, size_t buffer_size, size_t * used_buffer_size, va_list * args) { xds_uint8_t *p; size_t p_len; size_t padding; xds_init_encoding_engine(4); /* Get value from stack and calculate the correct amount of padding. */ p = (xds_uint8_t *) va_arg(*args, void *); xds_check_parameter(p != NULL); p_len = va_arg(*args, size_t); padding = (4 - (p_len & 0x03)) & 0x03; assert((p_len + padding) % 4 == 0); /* We need (4 + p_len + padding) bytes in the buffer to format our * parameter. If we don't have them, return an underflow error. */ *used_buffer_size = 4 + p_len + padding; if (buffer_size < *used_buffer_size) return XDS_ERR_OVERFLOW; /* Format the values into the buffer. */ ((xds_uint8_t *) buffer)[0] = (p_len >> 24) & 0x000000ff; ((xds_uint8_t *) buffer)[1] = (p_len >> 16) & 0x000000ff; ((xds_uint8_t *) buffer)[2] = (p_len >> 8) & 0x000000ff; ((xds_uint8_t *) buffer)[3] = (p_len >> 0) & 0x000000ff; memmove((xds_uint8_t *) buffer + 4, p, p_len); memset((xds_uint8_t *) buffer + 4 + p_len, 0, padding); /* Done. */ return XDS_OK; } int xdr_decode_octetstream(xds_t * xds, void *engine_context, void *buffer, size_t buffer_size, size_t * used_buffer_size, va_list * args) { void **p; size_t *p_len; size_t padding; xds_init_decoding_engine(4); p = va_arg(*args, void **); p_len = va_arg(*args, size_t *); xds_check_parameter(p != NULL); xds_check_parameter(p_len != NULL); /* Read the size of the message. */ *p_len = ((xds_uint8_t *) buffer)[0]; *p_len = *p_len << 8; *p_len += ((xds_uint8_t *) buffer)[1]; *p_len = *p_len << 8; *p_len += ((xds_uint8_t *) buffer)[2]; *p_len = *p_len << 8; *p_len += ((xds_uint8_t *) buffer)[3]; /* Calculate padding. */ padding = (4 - (*p_len & 0x03)) & 0x03; /* Do we have enough data?. */ *used_buffer_size = 4 + *p_len + padding; if (buffer_size < *used_buffer_size) return XDS_ERR_UNDERFLOW; /* Allocate buffer for the data. */ *p = malloc(*p_len); if (*p == NULL) return XDS_ERR_NO_MEM; /* Copy data into the buffer. */ memmove(*p, (xds_uint8_t *) buffer + 4, *p_len); /* Done. */ return XDS_OK; } Index: ossp-pkg/srpc/libxds/xds_engine_xml.c ============================================================ $ cvs update -p -r1.1 xds_engine_xml.c /* * XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The * OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless * Deutschland (http://www.cw.com/de/) * * This file is part of OSSP XDS, an extensible data serialization library * which can be found at http://www.ossp.com/pkg/xds/. * * 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. */ #include #include #include #include "xds.h" const char xds_xml_begin_text[] = "\n" "\n" "\n"; int xml_encode_begin(xds_t * xds, void *engine_context, void *buffer, size_t buffer_size, size_t * used_buffer_size, va_list * args) { xds_init_encoding_engine(strlen(xds_xml_begin_text)); memmove(buffer, xds_xml_begin_text, strlen(xds_xml_begin_text)); return XDS_OK; } int xml_decode_begin(xds_t * xds, void *engine_context, void *buffer, size_t buffer_size, size_t * used_buffer_size, va_list * args) { xds_init_encoding_engine(strlen(xds_xml_begin_text)); if (strncasecmp(buffer, xds_xml_begin_text, strlen(xds_xml_begin_text)) != 0) return XDS_ERR_TYPE_MISMATCH; return XDS_OK; } const char xds_xml_end_text[] = "\n"; int xml_encode_end(xds_t * xds, void *engine_context, void *buffer, size_t buffer_size, size_t * used_buffer_size, va_list * args) { xds_init_encoding_engine(strlen(xds_xml_end_text)); memmove(buffer, xds_xml_end_text, strlen(xds_xml_end_text)); return XDS_OK; } int xml_decode_end(xds_t * xds, void *engine_context, void *buffer, size_t buffer_size, size_t * used_buffer_size, va_list * args) { xds_init_decoding_engine(strlen(xds_xml_end_text)); if (strncasecmp(buffer, xds_xml_end_text, strlen(xds_xml_end_text)) != 0) return XDS_ERR_TYPE_MISMATCH; return XDS_OK; } int xml_encode_int32(xds_t * xds, void *engine_context, void *buffer, size_t buffer_size, size_t * used_buffer_size, va_list * args) { xds_int32_t value; char buf[32]; size_t i, j; char *p; int negative; xds_init_encoding_engine(7 + 8 + 11); /* Get the value and format it into our buffer. Keep track of the length * of the formatted result. */ value = va_arg(*args, xds_int32_t); if (value < 0) { negative = XDS_TRUE; value = 0 - value; } else negative = XDS_FALSE; i = 0; do { unsigned char remainder = value % 10; value = value / 10; buf[i++] = '0' + remainder; } while (value != 0); if (negative) buf[i++] = '-'; /* Now that we know the correct size of our data's representation, write * it into the buffer. */ *used_buffer_size = 7 + 8 + i; p = buffer; memmove(p, "", 7); p += 7; for (j = i; j > 0;) { *p++ = buf[--j]; } memmove(p, "", 8); return XDS_OK; } int xml_decode_int32(xds_t * xds, void *engine_context, void *buffer, size_t buffer_size, size_t * used_buffer_size, va_list * args) { xds_int32_t *value; char *p; int negative; xds_init_decoding_engine(7 + 8 + 1); /* Does the opening XML tag match? */ if (strncasecmp(buffer, "", 7) != 0) return XDS_ERR_TYPE_MISMATCH; /* Decode the representation of the value. */ value = va_arg(*args, xds_int32_t *); *value = 0; p = (char *)buffer + 7; if (*p == '-') { negative = XDS_TRUE; ++p; } else negative = XDS_FALSE; while (isdigit((int)*p)) { if (p >= (char *)buffer + buffer_size) return XDS_ERR_UNDERFLOW; *value *= 10; *value += *p++ - '0'; } if (negative) *value = 0 - *value; /* Does the closing XML tag match? */ if (p + 8 > (char *)buffer + buffer_size) return XDS_ERR_UNDERFLOW; else if (strncasecmp(p, "", 8) != 0) return XDS_ERR_TYPE_MISMATCH; *used_buffer_size = p + 8 - (char *)buffer; return XDS_OK; } int xml_encode_uint32(xds_t * xds, void *engine_context, void *buffer, size_t buffer_size, size_t * used_buffer_size, va_list * args) { xds_uint32_t value; char buf[32]; size_t i, j; char *p; xds_init_encoding_engine(8 + 9 + 10); /* Format value into our buffer. */ value = va_arg(*args, xds_uint32_t); i = 0; do { unsigned char remainder = value % 10; value = value / 10; buf[i++] = '0' + remainder; } while (value != 0); /* Store the correct buffer size. */ *used_buffer_size = 8 + 9 + i; /* Write result into the buffer. */ p = buffer; memmove(p, "", 8); p += 8; for (j = i; j > 0;) { *p++ = buf[--j]; } memmove(p, "", 9); return XDS_OK; } int xml_decode_uint32(xds_t * xds, void *engine_context, void *buffer, size_t buffer_size, size_t * used_buffer_size, va_list * args) { xds_uint32_t *value; char *p; xds_init_decoding_engine(8 + 9 + 1); /* Does the opening XML tag match? */ if (strncasecmp(buffer, "", 8) != 0) return XDS_ERR_TYPE_MISMATCH; /* Decode the representation of the value. */ value = va_arg(*args, xds_uint32_t *); *value = 0; p = (char *)buffer + 8; while (isdigit((int)*p)) { if (p >= (char *)buffer + buffer_size) return XDS_ERR_UNDERFLOW; *value *= 10; *value += *p++ - '0'; } /* Does the closing XML tag match? */ if (p + 9 > (char *)buffer + buffer_size) return XDS_ERR_UNDERFLOW; else if (strncasecmp(p, "", 9) != 0) return XDS_ERR_TYPE_MISMATCH; *used_buffer_size = p + 9 - (char *)buffer; return XDS_OK; } #ifdef XDS_HAVE_64_BIT_SUPPORT int xml_encode_int64(xds_t * xds, void *engine_context, void *buffer, size_t buffer_size, size_t * used_buffer_size, va_list * args) { xds_int64_t value; char buf[64]; size_t i, j; char *p; int negative; xds_init_encoding_engine(7 + 8 + 21); /* Format value into our buffer. */ value = va_arg(*args, xds_int64_t); if (value < 0) { negative = XDS_TRUE; value = 0 - value; } else negative = XDS_FALSE; i = 0; do { unsigned char remainder = value % 10; value = value / 10; buf[i++] = '0' + remainder; } while (value != 0); if (negative) buf[i++] = '-'; /* Store the correct buffer size. */ *used_buffer_size = 7 + 8 + i; /* Write result into the buffer. */ p = buffer; memmove(p, "", 7); p += 7; for (j = i; j > 0;) { *p++ = buf[--j]; } memmove(p, "", 8); return XDS_OK; } int xml_decode_int64(xds_t * xds, void *engine_context, void *buffer, size_t buffer_size, size_t * used_buffer_size, va_list * args) { xds_int64_t *value; char *p; int negative; xds_init_decoding_engine(7 + 8 + 1); /* Does the opening XML tag match? */ if (strncasecmp(buffer, "", 7) != 0) return XDS_ERR_TYPE_MISMATCH; /* Decode the representation of the value. */ value = va_arg(*args, xds_int64_t *); *value = 0; p = (char *)buffer + 7; if (*p == '-') { negative = XDS_TRUE; ++p; } else negative = XDS_FALSE; while (isdigit((int)*p)) { if (p >= (char *)buffer + buffer_size) return XDS_ERR_UNDERFLOW; *value *= 10; *value += *p++ - '0'; } if (negative) *value = 0 - *value; /* Does the closing XML tag match? */ if (p + 8 > (char *)buffer + buffer_size) return XDS_ERR_UNDERFLOW; else if (strncasecmp(p, "", 8) != 0) return XDS_ERR_TYPE_MISMATCH; *used_buffer_size = p + 8 - (char *)buffer; return XDS_OK; } int xml_encode_uint64(xds_t * xds, void *engine_context, void *buffer, size_t buffer_size, size_t * used_buffer_size, va_list * args) { xds_uint64_t value; char buf[64]; size_t i, j; char *p; xds_init_encoding_engine(8 + 9 + 20); /* Format value into our buffer. */ value = va_arg(*args, xds_uint64_t); i = 0; do { unsigned char remainder = value % 10; value = value / 10; buf[i++] = '0' + remainder; } while (value != 0); /* Store the correct buffer size. */ *used_buffer_size = 8 + 9 + i; /* Write result into the buffer. */ p = buffer; memmove(p, "", 8); p += 8; for (j = i; j > 0;) { *p++ = buf[--j]; } memmove(p, "", 9); return XDS_OK; } int xml_decode_uint64(xds_t * xds, void *engine_context, void *buffer, size_t buffer_size, size_t * used_buffer_size, va_list * args) { xds_uint64_t *value; char *p; xds_init_decoding_engine(8 + 9 + 1); /* Does the opening XML tag match? */ if (strncasecmp(buffer, "", 8) != 0) return XDS_ERR_TYPE_MISMATCH; /* Decode the representation of the value. */ value = va_arg(*args, xds_uint64_t *); *value = 0; p = (char *)buffer + 8; while (isdigit((int)*p)) { if (p >= (char *)buffer + buffer_size) return XDS_ERR_UNDERFLOW; *value *= 10; *value += *p++ - '0'; } /* Does the closing XML tag match? */ if (p + 9 > (char *)buffer + buffer_size) return XDS_ERR_UNDERFLOW; else if (strncasecmp(p, "", 9) != 0) return XDS_ERR_TYPE_MISMATCH; *used_buffer_size = p + 9 - (char *)buffer; return XDS_OK; } #endif /* XDS_HAVE_64_BIT_SUPPORT */ int xml_encode_double(xds_t * xds, void *engine_context, void *buffer, size_t buffer_size, size_t * used_buffer_size, va_list * args) { return -1; } int xml_decode_double(xds_t * xds, void *engine_context, void *buffer, size_t buffer_size, size_t * used_buffer_size, va_list * args) { return -1; } #define bits(c) (0x80 | ((c) & 0x3F)) #define put(c) *strptr++ = (c); #define putbits(c) put(bits(c)) #define finish() *strptr = '\0' static char *sputu8(xds_uint32_t c, char *strptr) { if (strptr == NULL) return NULL; if (c < 0x80) { put(c); finish(); } else if (c < 0x800) { put(0xC0 | (c >> 6)); putbits(c); finish(); } else if (c < 0x10000) { put(0xE0 | (c >> 12)); putbits(c >> 6); putbits(c); finish(); } else if (c < 0x200000) { put(0xF0 | (c >> 18)); putbits(c >> 12); putbits(c >> 6); putbits(c); finish(); } else if (c < 0x400000) { put(0xF8 | (c >> 24)); putbits(c >> 18); putbits(c >> 12); putbits(c >> 6); putbits(c); finish(); } else if (c < 0x80000000) { put(0xFC | (c >> 30)); putbits(c >> 24); putbits(c >> 18); putbits(c >> 12); putbits(c >> 6); putbits(c); finish(); } else finish(); /* Not a valid Unicode "character" */ return strptr; } static const char TAG_OPEN[] = ""; static const char TAG_CLOSE[] = ""; static const size_t TAG_OPEN_LEN = sizeof (TAG_OPEN) - 1; static const size_t TAG_CLOSE_LEN = sizeof (TAG_CLOSE) - 1; int xml_encode_string(xds_t * xds, void *engine_context, void *buffer, size_t buffer_size, size_t * used_buffer_size, va_list * args) { char *src; size_t src_len; char *dst; size_t dst_size; char *tmp; /* Setup the engine. We need at least space for our tags; how long the * actual content is going to be will be seen soon. */ xds_init_encoding_engine(TAG_OPEN_LEN + TAG_CLOSE_LEN); /* Get the data from the stack. */ src = va_arg(*args, char *); xds_check_parameter(src != NULL); src_len = strlen(src); /* Set up the target buffer. */ dst = buffer; dst_size = buffer_size; /* Write the opening tag. */ memmove(dst, TAG_OPEN, TAG_OPEN_LEN); dst += TAG_OPEN_LEN; dst_size -= TAG_OPEN_LEN; /* Format the data into the buffer. */ while (src_len > 0 && dst_size > 0) { if (*((xds_uint8_t *) src) >= 0x80) { /* UTF-8ify it. */ if (dst_size >= 7) { tmp = sputu8((xds_uint32_t) * ((xds_uint8_t *) src), dst); ++src; --src_len; dst_size -= tmp - dst; dst = tmp; } else dst_size = 0; } else if (*src == '<') { /* Turn into "<". */ if (dst_size >= 4) { *dst++ = '&'; --dst_size; *dst++ = 'l'; --dst_size; *dst++ = 't'; --dst_size; *dst++ = ';'; --dst_size; ++src; --src_len; } else dst_size = 0; } else if (*src == '&') { /* Turn into "&". */ if (dst_size >= 5) { *dst++ = '&'; --dst_size; *dst++ = 'a'; --dst_size; *dst++ = 'm'; --dst_size; *dst++ = 'p'; --dst_size; *dst++ = ';'; --dst_size; ++src; --src_len; } else dst_size = 0; } else if (*src == '>') { /* Turn into ">". */ if (dst_size >= 4) { *dst++ = '&'; --dst_size; *dst++ = 'g'; --dst_size; *dst++ = 't'; --dst_size; *dst++ = ';'; --dst_size; ++src; --src_len; } else dst_size = 0; } else { /* No special character; just copy it. */ *dst++ = *src++; --src_len; --dst_size; } } if (src_len > 0) { /* Target buffer was too small. */ *used_buffer_size = buffer_size + 1; return XDS_ERR_OVERFLOW; } /* Write the closing tag. */ memmove(dst, TAG_CLOSE, TAG_CLOSE_LEN); dst += TAG_CLOSE_LEN; dst_size -= TAG_CLOSE_LEN; /* Done. */ *used_buffer_size = dst - (char *)buffer; return XDS_OK; } #define INVALID 0x80000000 #define get(c) c = *strptr++; \ if (chars) (*chars)++; \ if ((c) == 0) return (unsigned int)EOF static unsigned int sgetu8(unsigned char *strptr, int *chars) { unsigned int c; int i, iterations; unsigned char ch; if (chars) *chars = 0; if (strptr == NULL) return (unsigned int)EOF; get(c); if ((c & 0xFE) == 0xFC) { c &= 0x01; iterations = 5; } else if ((c & 0xFC) == 0xF8) { c &= 0x03; iterations = 4; } else if ((c & 0xF8) == 0xF0) { c &= 0x07; iterations = 3; } else if ((c & 0xF0) == 0xE0) { c &= 0x0F; iterations = 2; } else if ((c & 0xE0) == 0xC0) { c &= 0x1F; iterations = 1; } else if ((c & 0x80) == 0x80) return INVALID; else return c; for (i = 0; i < iterations; i++) { get(ch); if ((ch & 0xC0) != 0x80) return INVALID; c <<= 6; c |= ch & 0x3F; } return c; } int xml_decode_string(xds_t * xds, void *engine_context, void *buffer, size_t buffer_size, size_t * used_buffer_size, va_list * args) { char **target_buffer; char *src; size_t src_len; char *dst; int utf8_len; unsigned int rc; /* Setup the engine. We need at least space for our tags; how long the * actual content is going to be will be seen soon. */ xds_init_encoding_engine(TAG_OPEN_LEN + TAG_CLOSE_LEN); /* Is the opening tag there? */ if (strncasecmp(buffer, TAG_OPEN, TAG_OPEN_LEN) != 0) return XDS_ERR_TYPE_MISMATCH; /* Determine the length of the encoded data. */ src = (char *)buffer + TAG_OPEN_LEN; for (src_len = 0; src[src_len] != '<'; ++src_len) if (src[src_len] == '\0') return XDS_ERR_TYPE_MISMATCH; /* Check the closing tag. */ if (strncasecmp(src + src_len, TAG_CLOSE, TAG_CLOSE_LEN) != 0) return XDS_ERR_TYPE_MISMATCH; *used_buffer_size = TAG_OPEN_LEN + src_len + TAG_CLOSE_LEN; /* Allocate target buffer. */ target_buffer = va_arg(*args, char **); xds_check_parameter(target_buffer != NULL); *target_buffer = dst = malloc(src_len + 1); if (dst == NULL) return XDS_ERR_NO_MEM; /* Decode the data into the target buffer. */ while (src_len > 0) { if (*src == '&') { if (src_len >= 4 && strncmp(src, "<", 4) == 0) { *dst++ = '<'; src += 4; src_len -= 4; } else if (src_len >= 4 && strncmp(src, ">", 4) == 0) { *dst++ = '>'; src += 4; src_len -= 4; } else if (src_len >= 5 && strncmp(src, "&", 5) == 0) { *dst++ = '&'; src += 5; src_len -= 5; } else { free(dst); return XDS_ERR_TYPE_MISMATCH; } } else if (*((xds_uint8_t *) src) >= 0x80) { rc = sgetu8((xds_uint8_t *) src, &utf8_len); if (rc == (unsigned int)EOF) return XDS_ERR_UNDERFLOW; else if (rc == INVALID || rc > 255) return XDS_ERR_TYPE_MISMATCH; *dst++ = (xds_uint8_t) rc; src += utf8_len; src_len -= utf8_len; } else { *dst++ = *src++; --src_len; } } *dst = '\0'; /* Done. */ return XDS_OK; } const char xds_base64[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; const char xds_pad64 = '='; static int base64_encode(char *dst, size_t dstlen, unsigned char const *src, size_t srclen) { size_t dstpos; unsigned char input[3]; unsigned char output[4]; int ocnt; size_t i; if (srclen == 0) return 0; if (dst == NULL) { /* just calculate required length of dst */ dstlen = (((srclen + 2) / 3) * 4); return dstlen; } /* bulk encoding */ dstpos = 0; ocnt = 0; while (srclen >= 3) { input[0] = *src++; input[1] = *src++; input[2] = *src++; srclen -= 3; output[0] = (input[0] >> 2); output[1] = ((input[0] & 0x03) << 4) + (input[1] >> 4); output[2] = ((input[1] & 0x0f) << 2) + (input[2] >> 6); output[3] = (input[2] & 0x3f); if (dstpos + 4 > dstlen) return -1; dst[dstpos++] = xds_base64[output[0]]; dst[dstpos++] = xds_base64[output[1]]; dst[dstpos++] = xds_base64[output[2]]; dst[dstpos++] = xds_base64[output[3]]; } /* now worry about padding with remaining 1 or 2 bytes */ if (srclen != 0) { input[0] = input[1] = input[2] = '\0'; for (i = 0; i < srclen; i++) input[i] = *src++; output[0] = (input[0] >> 2); output[1] = ((input[0] & 0x03) << 4) + (input[1] >> 4); output[2] = ((input[1] & 0x0f) << 2) + (input[2] >> 6); if (dstpos + 4 > dstlen) return -1; dst[dstpos++] = xds_base64[output[0]]; dst[dstpos++] = xds_base64[output[1]]; if (srclen == 1) dst[dstpos++] = xds_pad64; else dst[dstpos++] = xds_base64[output[2]]; dst[dstpos++] = xds_pad64; } if (dstpos >= dstlen) return -1; dst[dstpos] = '\0'; return dstpos; } int xml_encode_octetstream(xds_t * xds, void *engine_context, void *buffer, size_t buffer_size, size_t * used_buffer_size, va_list * args) { xds_uint8_t *src; size_t src_len; /* We need at least 27 byte for the starting and ending tag. */ xds_init_encoding_engine(13 + 14); /* Get parameters from stack. */ src = (xds_uint8_t *) va_arg(*args, void *); xds_check_parameter(src != NULL); src_len = va_arg(*args, size_t); /* Calculate how many bytes we'll need in buffer and make sure we have * them. */ *used_buffer_size = base64_encode(NULL, 0, src, src_len); if (*used_buffer_size == (size_t) - 1) return XDS_ERR_UNKNOWN; else *used_buffer_size += 13 + 14; if (buffer_size < *used_buffer_size) return XDS_ERR_OVERFLOW; /* Format the data into the buffer. */ memmove(buffer, "", 13); if (base64_encode((char *)buffer + 13, buffer_size - 13, src, src_len) < 0) return XDS_ERR_UNKNOWN; memmove((char *)buffer + *used_buffer_size - 14, "", 14); /* Done. */ return XDS_OK; } static int base64_decode(unsigned char *dst, size_t dstlen, char const *src, size_t srclen) { int dstidx, state, ch = 0; unsigned char res; char *pos; if (srclen == 0) return 0; state = 0; dstidx = 0; res = 0; while (srclen-- > 0) { ch = *src++; if (isascii(ch) && isspace(ch)) /* Skip whitespace anywhere */ continue; if (ch == xds_pad64) break; pos = strchr(xds_base64, ch); if (pos == 0) /* A non-base64 character */ return -1; switch (state) { case 0: if (dst != NULL) { if ((size_t) dstidx >= dstlen) return -1; dst[dstidx] = ((pos - xds_base64) << 2); } state = 1; break; case 1: if (dst != NULL) { if ((size_t) dstidx >= dstlen) return -1; dst[dstidx] |= ((pos - xds_base64) >> 4); res = (((pos - xds_base64) & 0x0f) << 4); } dstidx++; state = 2; break; case 2: if (dst != NULL) { if ((size_t) dstidx >= dstlen) return -1; dst[dstidx] = res | ((pos - xds_base64) >> 2); res = ((pos - xds_base64) & 0x03) << 6; } dstidx++; state = 3; break; case 3: if (dst != NULL) { if ((size_t) dstidx >= dstlen) return -1; dst[dstidx] = res | (pos - xds_base64); } dstidx++; state = 0; break; default: break; } } /* * We are done decoding Base-64 chars. Let's see if we ended * on a byte boundary, and/or with erroneous trailing characters. */ if (ch == xds_pad64) { /* We got a pad char. */ switch (state) { case 0: /* Invalid = in first position */ case 1: /* Invalid = in second position */ return -1; case 2: /* Valid, means one byte of info */ /* Skip any number of spaces. */ while (srclen > 0) { ch = *src++; --srclen; if (!(isascii(ch) && isspace(ch))) break; } /* Make sure there is another trailing = sign. */ if (ch != xds_pad64) return -1; /* FALLTHROUGH */ case 3: /* Valid, means two bytes of info */ /* * We know this char is an =. Is there anything but * whitespace after it? */ while (srclen > 0) { ch = *src++; --srclen; if (!(isascii(ch) && isspace(ch))) return -1; } /* * Now make sure for cases 2 and 3 that the "extra" * bits that slopped past the last full byte were * zeros. If we don't check them, they become a * subliminal channel. */ if (dst != NULL && res != 0) return -1; default: break; } } else { /* * We ended by seeing the end of the string. Make sure we * have no partial bytes lying around. */ if (state != 0) return -1; } return dstidx; } int xml_decode_octetstream(xds_t * xds, void *engine_context, void *buffer, size_t buffer_size, size_t * used_buffer_size, va_list * args) { char *p; size_t p_len; xds_uint8_t **data; size_t *data_len; /* We need at least 27 byte for the starting and ending tag. */ xds_init_encoding_engine(13 + 14); /* Get parameters from stack. */ data = va_arg(*args, xds_uint8_t **); xds_check_parameter(data != NULL); data_len = va_arg(*args, size_t *); /* Check for the opening tag. */ if (memcmp("", buffer, 13) != 0) return XDS_ERR_TYPE_MISMATCH; /* Find the end of the data and calculate the length of the * base64-encoded stuff. */ p = (char *)buffer + 13; while (p < ((char *)buffer + buffer_size) && *p != '<') ++p; if (p == ((char *)buffer + buffer_size)) return XDS_ERR_TYPE_MISMATCH; else { p_len = p - ((char *)buffer + 13); p = (char *)buffer + 13; } /* Now find out how long the decoded data is going to be, allocate a * buffer for it, and decode away. */ *data_len = base64_decode(NULL, 0, p, p_len); if (*data_len == (size_t) - 1) return XDS_ERR_UNKNOWN; *data = malloc(*data_len); if (*data == NULL) return XDS_ERR_NO_MEM; base64_decode(*data, *data_len, p, p_len); /* Check that we have a closing tag. */ if (memcmp(p + p_len, "", 14) != 0) { free(*data); return XDS_ERR_TYPE_MISMATCH; } /* Done. */ *used_buffer_size = 13 + p_len + 14; return XDS_OK; } Index: ossp-pkg/srpc/libxds/xds_p.h ============================================================ $ cvs update -p -r1.1 xds_p.h /* * XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The * OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless * Deutschland (http://www.cw.com/de/) * * This file is part of OSSP XDS, an extensible data serialization library * which can be found at http://www.ossp.com/pkg/xds/. * * 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. * * internal.h: internal C API */ #ifndef __INTERNAL_H__ #define __INTERNAL_H__ #include "xds.h" #define XDS_INITIAL_BUFFER_CAPACITY 512 #define XDS_INITIAL_ENGINES_CAPACITY 32 typedef struct { char *name; xds_engine_t engine; void *context; } engine_map_t; struct xds_context { xds_mode_t mode; char *buffer; size_t buffer_len; size_t buffer_capacity; int we_own_buffer; engine_map_t *engines; size_t engines_len; size_t engines_capacity; }; int xds_find_engine(const engine_map_t * engines, size_t last, const char *name, size_t * pos); int xds_set_capacity(void **array, size_t * array_capacity, size_t new_capacity, size_t elem_size, size_t initial_capacity); #endif /* !defined(__INTERNAL_H__) */ Index: ossp-pkg/srpc/libxds/xds_test.sh ============================================================ $ cvs update -p -r1.1 xds_test.sh #!/bin/sh if [ $# -lt 1 ]; then echo "Usage: $0 test1.t [...]" exit 1 fi RESCOLUMN=30 numTests=0 numFails=0 echo "Running test suite:" pad='' n=$RESCOLUMN while [ $n -gt 0 ]; do pad="$pad." n=`expr $n - 1` done for suite in "$@"; do name=`expr "${suite}" : '\./\.\(.*\)\.t$'` echo "$name$pad" | awk '{ printf("%s ", substr($0, 0, n)); }' n=$RESCOLUMN numTests=`expr $numTests + 1` eval ./$suite >.${name}.l 2>&1 if [ $? -eq 0 ]; then echo "OK" else numFails=`expr $numFails + 1` echo "FAILED" fi done echo if [ $numFails -eq 0 ]; then echo "Summary: All tests succeeded." exit 0 else percent=`expr $numFails \* 100` percent=`expr $percent / $numTests` echo "Summary: $numFails of $numTests tests failed ($percent%)." exit 1 fi Index: ossp-pkg/srpc/libxds/xds_test_lib.c ============================================================ $ cvs update -p -r1.1 xds_test_lib.c /* * XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The * OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless * Deutschland (http://www.cw.com/de/) * * This file is part of OSSP XDS, an extensible data serialization library * which can be found at http://www.ossp.com/pkg/xds/. * * 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. */ #include #include #include #include "xds_p.h" #ifdef XDS_TEST_XDS_CORE int main() { xds_t *ctx[50]; size_t i; /* Open a bunch of contextes and close them again. */ for (i = 0; i < sizeof (ctx) / sizeof (xds_t *); ++i) { if (i % 2 == 0) ctx[i] = xds_init(XDS_ENCODE); else ctx[i] = xds_init(XDS_DECODE); if (ctx[i] == 0) { printf("Failed to initialize xds context: i = %d\n", i); return 1; } } for (i = 0; i < sizeof (ctx) / sizeof (xds_t *); ++i) xds_destroy(ctx[i]); #ifdef NDEBUG /* Check how the library deals with errorneous arguments. */ if (xds_init((xds_mode_t) 42) != NULL || errno != EINVAL) { printf ("Called xds_init() with invalid mode but didn't get EINVAL.\n"); return 1; } /* Call xds_destroy() with an invalid context and see whether we survive * that. */ xds_destroy(NULL); #endif /* Everything went fine. */ return 0; } #endif /* XDS_TEST_XDS_CORE */ #ifdef XDS_TEST_XDS_FIND_ENGINE int main() { const engine_map_t engines[] = { {"alan", NULL, 0}, {"berta", NULL, 0}, {"caesar", NULL, 0}, {"doris", NULL, 0}, {"egon", NULL, 0}, {"franziska", NULL, 0}, {"gudrun", NULL, 0}, {"heinz", NULL, 0}, {"igor", NULL, 0}, {"jamila", NULL, 0}, {"karin", NULL, 0}, {"louis", NULL, 0}, }; size_t engines_len = sizeof (engines) / sizeof (engine_map_t); size_t pos; size_t i; /* Does xds_find_engine handle an empty array? */ if (xds_find_engine(engines, 0, "whatever", &pos)) { printf ("xds_find_engine() said 'whatever' would be in the array, but that's wrong.\n"); exit(1); } if (pos != 0) { printf ("xds_find_engine() would insert 'whatever' at position %d, but 0 is correct.\n", pos); exit(1); } /* Search for every single entry in the array and check the results. */ for (i = 0; i < engines_len; ++i) { if (!xds_find_engine(engines, engines_len, engines[i].name, &pos)) { printf ("xds_find_engine() said '%s' wouldn't be in the array, but that's wrong.\n", engines[i].name); exit(1); } if (pos != i) { printf ("xds_find_engine() would insert '%s' at position %d, but %d is correct.\n", engines[i].name, pos, i); exit(1); } } /* Search for non-existing name that would be inserted at the first * position. */ if (xds_find_engine(engines, engines_len, "aaron", &pos)) { printf ("xds_find_engine() said 'aaron' would be in the array, but that's wrong.\n"); exit(1); } if (pos != 0) { printf ("xds_find_engine() would insert 'aaron' at position %d, but 0 is correct.\n", pos); exit(1); } /* Search for non-existing name that would be inserted at last position. */ if (xds_find_engine(engines, engines_len, "zerberos", &pos)) { printf ("xds_find_engine() said 'zerberos' would be in the array, but that's wrong.\n"); exit(1); } if (pos != engines_len) { printf ("xds_find_engine() would insert 'zerberos' at position %d, but %d is correct.\n", pos, engines_len); exit(1); } /* Search for non-existing names that would be inserted at random * positions. */ if (xds_find_engine(engines, engines_len, "balthasar", &pos)) { printf ("xds_find_engine() said 'balthasar' would be in the array, but that's wrong.\n"); exit(1); } if (pos != 1) { printf ("xds_find_engine() would insert 'balthasar' at position %d, but 1 is correct.\n", pos); exit(1); } if (xds_find_engine(engines, engines_len, "bulli", &pos)) { printf ("xds_find_engine() said 'bulli' would be in the array, but that's wrong.\n"); exit(1); } if (pos != 2) { printf ("xds_find_engine() would insert 'bulli' at position %d, but 2 is correct.\n", pos); exit(1); } if (xds_find_engine(engines, engines_len, "hildegard", &pos)) { printf ("xds_find_engine() said 'hildegard' would be in the array, but that's wrong.\n"); exit(1); } if (pos != 8) { printf ("xds_find_engine() would insert 'hildegard' at position %d, but 8 is correct.\n", pos); exit(1); } if (xds_find_engine(engines, engines_len, "harald", &pos)) { printf ("xds_find_engine() said 'harald' would be in the array, but that's wrong.\n"); exit(1); } if (pos != 7) { printf ("xds_find_engine() would insert 'harald' at position %d, but 7 is correct.\n", pos); exit(1); } /* Everything went fine. */ return 0; } #endif /* XDS_TEST_XDS_FIND_ENGINE */ #ifdef XDS_TEST_XDS_REGISTER static int dummy_engine(xds_t * xds, void *engine_context, void *buffer, size_t buffer_size, size_t * used_buffer_size, va_list * args) { return 0; } int main() { const char *test_names[] = { "foo", "bar", "zarah", "caesar", "claus", "heinz", }; size_t test_names_len = sizeof (test_names) / sizeof (char *); xds_t *xds; size_t i; /* Create context. */ xds = xds_init(XDS_ENCODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); return 1; } /* Register the dummy callback under an invalid name to see whether the * routine fails correctly. */ if (xds_register(xds, "abcdefh1230#", &dummy_engine, NULL) != XDS_ERR_INVALID_ARG) { printf ("xds_register() illegally accepted an invalid name for the engine.\n"); return 1; } /* Register the dummy callback under multiple names. */ for (i = 0; i < test_names_len; ++i) { if (xds_register(xds, test_names[i], &dummy_engine, NULL) != XDS_OK) { printf("Failed to register engine for '%s'.\n", test_names[i]); return 1; } } /* Register the callback again, overwriting an existing entry. */ if (xds_register(xds, "claus", &dummy_engine, NULL) != XDS_OK) { printf("Failed to re-register engine for 'claus'.\n"); return 1; } /* Ensure that everything is in alphabetical order. */ for (i = 1; i < xds->engines_len; ++i) { assert(xds->engines[i - 1].name != NULL); assert(xds->engines[i].name != NULL); if (strcmp(xds->engines[i - 1].name, xds->engines[i].name) >= 0) { printf("xds->engines is not in alphabetical order!\n"); exit(1); } } /* Try to remove an unknown entry. */ if (xds_unregister(xds, "abacadabra") != XDS_ERR_UNKNOWN_ENGINE) { printf ("xds_unregister() succeeded at removing 'abacadabra' even though it is not there.\n"); exit(1); } /* Remove an entry from the middle. */ if (xds_unregister(xds, test_names[test_names_len / 2]) != XDS_OK) { printf("xds_unregister() failed to remove '%s'.\n", test_names[test_names_len / 2]); exit(1); } /* Remove the last entry. */ assert(test_names_len > 0); if (xds_unregister(xds, test_names[test_names_len - 1]) != XDS_OK) { printf("xds_unregister() failed to remove '%s'.\n", test_names[test_names_len - 1]); exit(1); } /* Remove the first entry. */ if (xds_unregister(xds, test_names[0]) != XDS_OK) { printf("xds_unregister() failed to remove '%s'.\n", test_names[0]); exit(1); } /* Clean up. */ xds_destroy(xds); /* Everything went fine. */ return 0; } #endif /* XDS_TEST_XDS_REGISTER */ #ifdef XDS_TEST_XDS_SETBUFFER static int dummy_engine(xds_t * xds, void *engine_context, void *buffer, size_t buffer_size, size_t * used_buffer_size, va_list * args) { assert(xds != NULL); assert(buffer != NULL); assert(buffer_size != 0); assert(used_buffer_size != NULL); assert(args != NULL); if (buffer_size < 64) return XDS_ERR_OVERFLOW; else *used_buffer_size = 64; memset(buffer, 'a', 64); return XDS_OK; } int main() { xds_t *xds; char *buffer; size_t buffer_size; /* Create XDS context. */ xds = xds_init(XDS_ENCODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); return 1; } /* Register the callback. */ if (xds_register(xds, "dummy", &dummy_engine, NULL) != XDS_OK) { printf("Failed to register my encoding engine.\n"); return 1; } /* Give the library a buffer of 32 byte, call the engine once, get the * buffer back and see whether it has been enlarged or not. */ buffer_size = 32; buffer = malloc(buffer_size); if (buffer == NULL) { printf("Failed to allocate my memory.\n"); return 1; } if (xds_setbuffer(xds, XDS_GIFT, buffer, buffer_size) != XDS_OK) { printf("xds_setbuffer() failed!\n"); return 1; } if (xds_encode(xds, "dummy") != XDS_OK) { printf("xds_encode() failed!\n"); return 1; } if (xds_getbuffer(xds, XDS_GIFT, (void **)&buffer, &buffer_size) != XDS_OK) { printf("xds_getbuffer() failed!\n"); return 1; } if (buffer_size < 64) { printf ("xds_encode() did not enlarge the buffer after processing the callback\n"); printf("even though all capacity was used up!\n"); return 1; } /* Loan the library a buffer we own, call the engine once to exceed the * buffer's capacity and check, whether the library returns the correct * error code. */ buffer = malloc(32); if (buffer == NULL) { printf("Failed to allocate my memory.\n"); return 1; } buffer_size = 32; if (xds_setbuffer(xds, XDS_LOAN, buffer, buffer_size) != XDS_OK) { printf("xds_setbuffer() failed!\n"); return 1; } if (xds_encode(xds, "dummy") != XDS_ERR_OVERFLOW) { printf("xds_encode() was supposed to fail with XDS_ERR_OVERFLOW!\n"); return 1; } free(buffer); /* Clean up. */ xds_destroy(xds); /* Everything went fine. */ return 0; } #endif /* XDS_TEST_XDS_SETBUFFER */ #ifdef XDS_TEST_XDS_GETBUFFER static int dummy_engine(xds_t * xds, void *engine_context, void *buffer, size_t buffer_size, size_t * used_buffer_size, va_list * args) { if (buffer_size < 6) return XDS_ERR_OVERFLOW; else *used_buffer_size = 6; memmove(buffer, "Hallo!", 6); return XDS_OK; } int main() { xds_t *xds; char *old; size_t old_len; char *new; size_t new_len; /* Create XDS context. */ xds = xds_init(XDS_ENCODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); return 1; } /* Register the dummy callback under multiple names. */ if (xds_register(xds, "text", &dummy_engine, (void *)42) != XDS_OK) { printf("Failed to register my encoding engine.\n"); return 1; } /* Encode something, then flush the buffer by calling xds_getbuffer(), * then encode something new and verify that the old buffer hasn't ben * overwritten and that the new one contains the correct string. */ if (xds_encode(xds, "text text") != XDS_OK) { printf("xds_encode() failed!\n"); return 1; } if (xds_getbuffer(xds, XDS_GIFT, (void **)&old, &old_len) != XDS_OK) { printf("xds_getbuffer() failed for the first buffer!\n"); return 1; } if (xds_encode(xds, "text") != XDS_OK) { printf("xds_encode() failed!\n"); return 1; } if (xds_getbuffer(xds, XDS_GIFT, (void **)&new, &new_len) != XDS_OK) { printf("xds_getbuffer() failed for the second buffer!\n"); return 1; } if ((memcmp(old, "Hallo!Hallo!", 12) != 0 || old_len != 12) && (memcmp(new, "Hallo!", 6) != 0 || new_len != 6)) { printf("xds_encode() did not yield the expected result.\n"); return 1; } free(old); free(new); /* Encode somthing, then get the buffer via XDS_LOAN and verify the * contents. Encode something new and compare the new content with what * we expect. */ if (xds_encode(xds, "text text") != XDS_OK) { printf("xds_encode() failed!\n"); return 1; } if (xds_getbuffer(xds, XDS_LOAN, (void **)&old, &old_len) != XDS_OK) { printf("xds_getbuffer() failed for the first buffer!\n"); return 1; } if (memcmp(old, "Hallo!Hallo!", 12) != 0 || old_len != 12) { printf("xds_encode() did not yield the expected result.\n"); return 1; } if (xds_encode(xds, "text") != XDS_OK) { printf("xds_encode() failed!\n"); return 1; } if (xds_getbuffer(xds, XDS_LOAN, (void **)&new, &new_len) != XDS_OK) { printf("xds_getbuffer() failed for the second buffer!\n"); return 1; } if (old != new) { printf ("xds_encode() allocated a new buffer even though we used XDS_LOAN.\n"); return 1; } if (memcmp(new, "Hallo!", 6) != 0 || new_len != 6) { printf("xds_encode() did not yield the expected result.\n"); return 1; } /* Clean up. */ xds_destroy(xds); /* Everything went fine. */ return 0; } #endif /* XDS_TEST_XDS_GETBUFFER */ #ifdef XDS_TEST_XDS_ENCODE static int dummy_engine(xds_t * xds, void *engine_context, void *buffer, size_t buffer_size, size_t * used_buffer_size, va_list * args) { if (xds == NULL) { printf("XDS context isn't passed through to registered engine.\n"); exit(1); } if (engine_context != (void *)42) { printf("Engine context isn't passed through to registered engine.\n"); exit(1); } if (buffer == NULL) { printf("Buffer passed to engine is NULL.\n"); exit(1); } if (buffer_size == 0) { printf("buffer_size passed to engine is zero!\n"); exit(1); } if (used_buffer_size == NULL) { printf("used_buffer_size pointer passed to engine is NULL!\n"); exit(1); } if (args == NULL) { printf("args pointer passed to engine is NULL!\n"); exit(1); } *used_buffer_size = 6; if (buffer_size < 6) return XDS_ERR_OVERFLOW; memmove(buffer, "Hallo ", 6); return XDS_OK; } int main() { xds_t *xds; /* Create XDS context. */ xds = xds_init(XDS_ENCODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); return 1; } /* Register the dummy callback under multiple names. */ if (xds_register(xds, "int", &dummy_engine, (void *)42) != XDS_OK || xds_register(xds, "float", &dummy_engine, (void *)42) != XDS_OK || xds_register(xds, "double", &dummy_engine, (void *)42) != XDS_OK || xds_register(xds, "text", &dummy_engine, (void *)42) != XDS_OK) { printf("Failed to register my encoding engines.\n"); return 1; } /* Let's go and encode something. */ if (xds_encode(xds, "int:text double double float") != XDS_OK) { printf("xds_encode() failed!\n"); return 1; } if (memcmp(xds->buffer, "Hallo Hallo Hallo Hallo Hallo ", 30) != 0) { printf("xds_encode() did not yield the expected result.\n"); return 1; } /* Clean up. */ xds_destroy(xds); /* Everything went fine. */ return 0; } #endif /* XDS_TEST_XDS_ENCODE */ #ifdef XDS_TEST_XDS_DECODE static int dummy_engine(xds_t * xds, void *engine_context, void *buffer, size_t buffer_size, size_t * used_buffer_size, va_list * args) { if (xds == NULL) { printf("XDS context isn't passed through to registered engine.\n"); exit(1); } if (engine_context != (void *)42) { printf("Engine context isn't passed through to registered engine.\n"); exit(1); } if (buffer == NULL) { printf("Buffer passed to engine is NULL.\n"); exit(1); } if (buffer_size == 0) { printf("Buffer size passed to engine is zero!\n"); exit(1); } if (used_buffer_size == NULL) { printf("used_buffer_size passed to engine is zero!\n"); exit(1); } if (args == NULL) { printf("args pointer passed to engine is NULL!\n"); exit(1); } if (buffer_size < 6) { printf("The buffer is too small; can't verify my encoded string.\n"); exit(1); } if (memcmp(buffer, "Hallo!", 6) != 0) { printf ("The contents of the decode buffer are not what we expected.\n"); exit(1); } *used_buffer_size = 6; return XDS_OK; } int main() { xds_t *xds; char buffer[] = "Hallo!Hallo!Hallo!"; /* Create XDS context. */ xds = xds_init(XDS_DECODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); return 1; } /* Register the dummy callback under multiple names. */ if (xds_register(xds, "text", &dummy_engine, (void *)42) != XDS_OK) { printf("Failed to register my decoding engines.\n"); return 1; } /* Decode the buffer and have the callback report when something is * wrong. */ if (xds_setbuffer(xds, XDS_LOAN, buffer, sizeof (buffer) - 1) != XDS_OK) { printf("xds_decode() failed!"); return 1; } if (xds_decode(xds, "text::text text") != XDS_OK) { printf("xds_decode() failed!"); return 1; } /* Clean up. */ xds_destroy(xds); /* Everything went fine. */ return 0; } #endif /* XDS_TEST_XDS_DECODE */ #ifdef XDS_TEST_XDS_ENGINE_RESTART static int dummy_engine(xds_t * xds, void *engine_context, void *buffer, size_t buffer_size, size_t * used_buffer_size, va_list * args) { if (xds == NULL) { printf("XDS context isn't passed through to registered engine.\n"); exit(1); } if (engine_context != (void *)42) { printf("Engine context isn't passed through to registered engine.\n"); exit(1); } if (buffer == NULL) { printf("Buffer passed to engine is NULL.\n"); exit(1); } if (buffer_size == 0) { printf("Buffer size passed to engine is zero!\n"); exit(1); } if (used_buffer_size == NULL) { printf("used_buffer_size pointer passed to engine is NULL!\n"); exit(1); } if (args == NULL) { printf("args pointer passed to engine is NULL!\n"); exit(1); } if (va_arg(*args, int) != 42) { printf("The varadic argument is not what the engine expected!\n"); exit(1); } if (buffer_size < 64) return XDS_ERR_OVERFLOW; else *used_buffer_size = 64; return XDS_OK; } int main() { xds_t *xds; char *buffer; size_t buffer_size; /* Create an XDS context and set a buffer that's too small for the first * encode() call. Then call encode() with two parameters: the one the * engine is expecting and a different one after that. The engine will * complain if it sees the second value -- what would mean that the args * parameter was not resetted to the original value before the engine is * restarted after buffer enlargement. */ xds = xds_init(XDS_ENCODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); return 1; } if (xds_register(xds, "int", &dummy_engine, (void *)42) != XDS_OK) { printf("Failed to register my encoding engines.\n"); return 1; } buffer = malloc(32); if (buffer == NULL) { printf("malloc() failed!\n"); return 1; } buffer_size = 32; if (xds_setbuffer(xds, XDS_GIFT, buffer, buffer_size) != XDS_OK) { printf("xds_setbuffer() failed!\n"); return 1; } if (xds_encode(xds, "int", 42, 13) != XDS_OK) { printf("xds_encode() failed!"); return 1; } xds_destroy(xds); return 0; } #endif /* XDS_TEST_XDS_ENGINE_RESTART */ #ifdef XDS_TEST_XDS_MYSTRUCT struct mystruct { xds_int32_t small; xds_uint32_t positive; }; static int encode_mystruct_engine(xds_t * xds, void *engine_context, void *buffer, size_t buffer_size, size_t * used_buffer_size, va_list * args) { struct mystruct *ms; assert(xds != NULL); assert(buffer != NULL); assert(buffer_size != 0); assert(used_buffer_size != NULL); assert(args != NULL); ms = va_arg(*args, struct mystruct *); return xds_encode(xds, "int32 uint32", ms->small, ms->positive); } static int decode_mystruct_engine(xds_t * xds, void *engine_context, void *buffer, size_t buffer_size, size_t * used_buffer_size, va_list * args) { struct mystruct *ms; assert(xds != NULL); assert(buffer != NULL); assert(buffer_size != 0); assert(used_buffer_size != NULL); assert(args != NULL); ms = va_arg(*args, struct mystruct *); return xds_decode(xds, "int32 uint32", &(ms->small), &(ms->positive)); } int main() { xds_t *xds; char *buffer; size_t buffer_size; struct mystruct ms, new_ms; ms.small = -0x1234567; ms.positive = 42; /* Encode our copy of mystruct using our encoding callback. Then get a * the buffer and destroy the context again. */ xds = xds_init(XDS_ENCODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); return 1; } if (xds_register(xds, "mystruct", &encode_mystruct_engine, NULL) != XDS_OK || xds_register(xds, "int32", &xdr_encode_int32, NULL) != XDS_OK || xds_register(xds, "uint32", &xdr_encode_uint32, NULL) != XDS_OK) { printf("Failed to register my encoding engines.\n"); return 1; } buffer_size = 4; buffer = malloc(buffer_size); if (buffer == NULL) { printf("Failed to allocate memory for buffer.\n"); return 1; } if (xds_setbuffer(xds, XDS_GIFT, buffer, buffer_size) != XDS_OK) { printf("xds_setbuffer() failed!\n"); return 1; } if (xds_encode(xds, "mystruct", &ms) != XDS_OK) { printf("xds_encode() failed!\n"); return 1; } if (xds->buffer_capacity <= buffer_size) { printf("Buffer should have been enlarged after xds_encode()!\n"); return 1; } if (xds_getbuffer(xds, XDS_GIFT, (void **)&buffer, &buffer_size) != XDS_OK) { printf("xds_getbuffer() failed!\n"); return 1; } xds_destroy(xds); printf("The encoded representation is %u bytes long.\n", buffer_size); /* Now create a decoding context and decode the whole thing again. */ xds = xds_init(XDS_DECODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); return 1; } if (xds_register(xds, "mystruct", &decode_mystruct_engine, NULL) != XDS_OK || xds_register(xds, "int32", &xdr_decode_int32, NULL) != XDS_OK || xds_register(xds, "uint32", &xdr_decode_uint32, NULL) != XDS_OK) { printf("Failed to register my decoding engines.\n"); return 1; } if (xds_setbuffer(xds, XDS_GIFT, buffer, buffer_size) != XDS_OK) { printf("xds_setbuffer() failed!\n"); return 1; } if (xds_decode(xds, "mystruct", &new_ms) != XDS_OK) { printf("xds_decode() failed!\n"); return 1; } xds_destroy(xds); /* Both structures must be identical. */ if (ms.small != new_ms.small || ms.positive != new_ms.positive) { printf("Decoded data does not match the original!\n"); return 1; } /* Everything went fine. */ return 0; } #endif /* XDS_TEST_XDS_MYSTRUCT */ Index: ossp-pkg/srpc/libxds/xds_test_xdr.c ============================================================ $ cvs update -p -r1.1 xds_test_xdr.c /* * XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The * OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless * Deutschland (http://www.cw.com/de/) * * This file is part of OSSP XDS, an extensible data serialization library * which can be found at http://www.ossp.com/pkg/xds/. * * 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. */ #include #include #include #include #include #include "xds.h" #ifdef XDS_TEST_XDR_INT32 int main() { XDR xdrs; char xdr_buf[1024]; size_t xdr_buf_size; xds_t *xds; char *xds_buf; size_t xds_buf_size; xds_int32_t values[] = { 0x00000000, 0x12345678, -0x12345678, 0x7bcdef01, -0x7bcdef01, 0x7fffffff }; size_t i; /* Encode the values array using the RPC-XDR implementation. */ xdrmem_create(&xdrs, xdr_buf, sizeof (xdr_buf), XDR_ENCODE); for (i = 0; i < sizeof (values) / sizeof (xds_int32_t); ++i) xdr_int32_t(&xdrs, &values[i]); xdr_buf_size = xdr_getpos(&xdrs); xdr_destroy(&xdrs); /* Encode the values array using the XDS implementation. */ xds = xds_init(XDS_ENCODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); return 1; } if (xds_register(xds, "int", &xdr_encode_int32, NULL) != XDS_OK) { printf("Failed to register my encoding engines.\n"); return 1; } for (i = 0; i < sizeof (values) / sizeof (xds_int32_t); ++i) { if (xds_encode(xds, "int", values[i]) != XDS_OK) { printf("xds_encode(values[%d]) failed!\n", i); return 1; } } if (xds_getbuffer(xds, XDS_GIFT, (void **)&xds_buf, &xds_buf_size) != XDS_OK) { printf("getbuffer() failed.\n"); return 1; } xds_destroy(xds); /* Both buffers must be equal now. */ if (xdr_buf_size != xds_buf_size) { printf("The buffer sizes don't match: %d != %d.\n", xdr_buf_size, xds_buf_size); return 1; } if (memcmp(xds_buf, xdr_buf, xds_buf_size) != 0) { printf("The buffers' contents is not identical!\n"); return 1; } /* Now we decode the values again using the XDS implementation and * compare them to our original values. Obviously, they should not * differ. */ xds = xds_init(XDS_DECODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); return 1; } if (xds_register(xds, "int", &xdr_decode_int32, NULL) != XDS_OK) { printf("Failed to register my decoding engines.\n"); return 1; } if (xds_setbuffer(xds, XDS_GIFT, xds_buf, xds_buf_size) != XDS_OK) { printf("setbuffer() failed.\n"); return 1; } for (i = 0; i < sizeof (values) / sizeof (xds_int32_t); ++i) { xds_int32_t tmp; if (xds_decode(xds, "int", &tmp) != XDS_OK) { printf("xds_encode() failed for the %d value!\n", i); return 1; } if (values[i] != tmp) { printf("The %dth value has not been decoded correctly!\n", i); return 1; } } xds_destroy(xds); /* Everything went fine. */ return 0; } #endif /* XDS_TEST_XDR_INT32 */ #ifdef XDS_TEST_XDR_UINT32 #ifdef __FreeBSD__ static int xdr_uint32_t(XDR * xdrs, uint32_t * val) { return xdr_u_int32_t(xdrs, val); } #endif int main() { XDR xdrs; char xdr_buf[1024]; size_t xdr_buf_size; xds_t *xds; char *xds_buf; size_t xds_buf_size; xds_uint32_t values[] = { 0x00000000, 0x12345678, 0xabcdef01, 0xc500b3ef, 0xffffffff }; size_t i; /* Encode the values array using the RPC-XDR implementation. */ xdrmem_create(&xdrs, xdr_buf, sizeof (xdr_buf), XDR_ENCODE); for (i = 0; i < sizeof (values) / sizeof (xds_uint32_t); ++i) xdr_uint32_t(&xdrs, &values[i]); xdr_buf_size = xdr_getpos(&xdrs); xdr_destroy(&xdrs); /* Encode the values array using the XDS implementation. */ xds = xds_init(XDS_ENCODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); return 1; } if (xds_register(xds, "uint", &xdr_encode_uint32, NULL) != XDS_OK) { printf("Failed to register my encoding engines.\n"); return 1; } for (i = 0; i < sizeof (values) / sizeof (uint32_t); ++i) { if (xds_encode(xds, "uint", values[i]) != XDS_OK) { printf("xds_encode(values[%d]) failed!\n", i); return 1; } } if (xds_getbuffer(xds, XDS_GIFT, (void **)&xds_buf, &xds_buf_size) != XDS_OK) { printf("getbuffer() failed.\n"); return 1; } xds_destroy(xds); /* Both buffers must be equal now. */ if (xdr_buf_size != xds_buf_size) { printf("The buffer sizes don't match: %d != %d.\n", xdr_buf_size, xds_buf_size); return 1; } if (memcmp(xds_buf, xdr_buf, xds_buf_size) != 0) { printf("The buffers' contents is not identical!\n"); return 1; } /* Now we decode the values again using the XDS implementation and * compare them to our original values. Obviously, they should not * differ. */ xds = xds_init(XDS_DECODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); return 1; } if (xds_register(xds, "uint", &xdr_decode_uint32, NULL) != XDS_OK) { printf("Failed to register my decoding engines.\n"); return 1; } if (xds_setbuffer(xds, XDS_GIFT, xds_buf, xds_buf_size) != XDS_OK) { printf("setbuffer() failed.\n"); return 1; } for (i = 0; i < sizeof (values) / sizeof (xds_uint32_t); ++i) { xds_uint32_t tmp; if (xds_decode(xds, "uint", &tmp) != XDS_OK) { printf("xds_encode() failed for the %d value!\n", i); return 1; } if (values[i] != tmp) { printf("The %dth value has not been decoded correctly!\n", i); return 1; } } xds_destroy(xds); /* Everything went fine. */ return 0; } #endif /* XDS_TEST_XDR_UINT32 */ #ifdef XDS_TEST_XDR_INT64 #ifdef XDS_HAVE_64_BIT_SUPPORT int main() { XDR xdrs; char xdr_buf[1024]; size_t xdr_buf_size; xds_t *xds; char *xds_buf; size_t xds_buf_size; xds_int64_t values[] = { 0x0000000000000000LL, 0x123456789abcdef0LL, -0x123456789abcdef0LL, 0x7bcdef01cc45bb9aLL, -0x7bcdef01cc45bb9aLL, 0x7fffffffffffffffLL }; size_t i; /* Encode the values array using the RPC-XDR implementation. */ xdrmem_create(&xdrs, xdr_buf, sizeof (xdr_buf), XDR_ENCODE); for (i = 0; i < sizeof (values) / sizeof (xds_int64_t); ++i) xdr_int64_t(&xdrs, &values[i]); xdr_buf_size = xdr_getpos(&xdrs); xdr_destroy(&xdrs); /* Encode the values array using the XDS implementation. */ xds = xds_init(XDS_ENCODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); return 1; } if (xds_register(xds, "int", &xdr_encode_int64, NULL) != XDS_OK) { printf("Failed to register my encoding engines.\n"); return 1; } for (i = 0; i < sizeof (values) / sizeof (xds_int64_t); ++i) { if (xds_encode(xds, "int", values[i]) != XDS_OK) { printf("xds_encode(values[%d]) failed!\n", i); return 1; } } if (xds_getbuffer(xds, XDS_GIFT, (void **)&xds_buf, &xds_buf_size) != XDS_OK) { printf("getbuffer() failed.\n"); return 1; } xds_destroy(xds); /* Both buffers must be equal now. */ if (xdr_buf_size != xds_buf_size) { printf("The buffer sizes don't match: %d != %d.\n", xdr_buf_size, xds_buf_size); return 1; } if (memcmp(xds_buf, xdr_buf, xds_buf_size) != 0) { printf("The buffers' contents is not identical!\n"); return 1; } /* Now we decode the values again using the XDS implementation and * compare them to our original values. Obviously, they should not * differ. */ xds = xds_init(XDS_DECODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); return 1; } if (xds_register(xds, "int", &xdr_decode_int64, NULL) != XDS_OK) { printf("Failed to register my decoding engines.\n"); return 1; } if (xds_setbuffer(xds, XDS_GIFT, xds_buf, xds_buf_size) != XDS_OK) { printf("setbuffer() failed.\n"); return 1; } for (i = 0; i < sizeof (values) / sizeof (xds_int64_t); ++i) { xds_int64_t tmp; if (xds_decode(xds, "int", &tmp) != XDS_OK) { printf("xds_encode() failed for the %d value!\n", i); return 1; } if (values[i] != tmp) { printf("The %dth value has not been decoded correctly!\n", i); return 1; } } xds_destroy(xds); /* Everything went fine. */ return 0; } #endif /* XDS_HAVE_64_BIT_SUPPORT */ #endif /* XDS_TEST_XDR_INT64 */ #ifdef XDS_TEST_XDR_UINT64 #ifdef XDS_HAVE_64_BIT_SUPPORT #ifdef __FreeBSD__ static int xdr_uint64_t(XDR * xdrs, uint64_t * val) { return xdr_u_int64_t(xdrs, val); } #endif int main() { XDR xdrs; char xdr_buf[1024]; size_t xdr_buf_size; xds_t *xds; char *xds_buf; size_t xds_buf_size; xds_uint64_t values[] = { 0x0000000000000000ULL, 0x123456789abcdef0ULL, 0xabcdef01cc45bb9aULL, 0xc500b3efdd34ca9eULL, 0xffffffffffffffffULL }; size_t i; /* Encode the values array using the RPC-XDR implementation. */ xdrmem_create(&xdrs, xdr_buf, sizeof (xdr_buf), XDR_ENCODE); for (i = 0; i < sizeof (values) / sizeof (xds_uint64_t); ++i) xdr_uint64_t(&xdrs, &values[i]); xdr_buf_size = xdr_getpos(&xdrs); xdr_destroy(&xdrs); /* Encode the values array using the XDS implementation. */ xds = xds_init(XDS_ENCODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); return 1; } if (xds_register(xds, "uint", &xdr_encode_uint64, NULL) != XDS_OK) { printf("Failed to register my encoding engines.\n"); return 1; } for (i = 0; i < sizeof (values) / sizeof (uint64_t); ++i) { if (xds_encode(xds, "uint", values[i]) != XDS_OK) { printf("xds_encode(values[%d]) failed!\n", i); return 1; } } if (xds_getbuffer(xds, XDS_GIFT, (void **)&xds_buf, &xds_buf_size) != XDS_OK) { printf("getbuffer() failed.\n"); return 1; } xds_destroy(xds); /* Both buffers must be equal now. */ if (xdr_buf_size != xds_buf_size) { printf("The buffer sizes don't match: %d != %d.\n", xdr_buf_size, xds_buf_size); return 1; } if (memcmp(xds_buf, xdr_buf, xds_buf_size) != 0) { printf("The buffers' contents is not identical!\n"); return 1; } /* Now we decode the values again using the XDS implementation and * compare them to our original values. Obviously, they should not * differ. */ xds = xds_init(XDS_DECODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); return 1; } if (xds_register(xds, "uint", &xdr_decode_uint64, NULL) != XDS_OK) { printf("Failed to register my decoding engines.\n"); return 1; } if (xds_setbuffer(xds, XDS_GIFT, xds_buf, xds_buf_size) != XDS_OK) { printf("setbuffer() failed.\n"); return 1; } for (i = 0; i < sizeof (values) / sizeof (xds_uint64_t); ++i) { xds_uint64_t tmp; if (xds_decode(xds, "uint", &tmp) != XDS_OK) { printf("xds_encode() failed for the %d value!\n", i); return 1; } if (values[i] != tmp) { printf("The %dth value has not been decoded correctly!\n", i); return 1; } } xds_destroy(xds); /* Everything went fine. */ return 0; } #endif /* XDS_HAVE_64_BIT_SUPPORT */ #endif /* XDS_TEST_XDR_UINT64 */ #ifdef XDS_TEST_XDR_STRING int main() { xds_t *xds; char *buffer; size_t buffer_size; char msg[] = "Hello World"; char *new_msg; /* Encode the string as octet stream. Then erase the buffer and decode * the string back, verifying that it hasn't changed. */ xds = xds_init(XDS_ENCODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); return 1; } if (xds_register(xds, "string", &xdr_encode_string, NULL) != XDS_OK) { printf("Failed to register my encoding engines.\n"); return 1; } if (xds_encode(xds, "string", msg) != XDS_OK) { printf("xds_encode() failed.\n"); return 1; } if (xds_getbuffer(xds, XDS_GIFT, (void **)&buffer, &buffer_size) != XDS_OK) { printf("xds_getbuffer() failed.\n"); return 1; } xds_destroy(xds); if (buffer_size % 4 != 0) { printf("The encoded strings' buffer size is not a multiple of 4.\n"); return 1; } xds = xds_init(XDS_DECODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); return 1; } if (xds_register(xds, "string", &xdr_decode_string, NULL) != XDS_OK) { printf("Failed to register my decoding engines.\n"); return 1; } if (xds_setbuffer(xds, XDS_GIFT, buffer, buffer_size) != XDS_OK) { printf("xds_setbuffer() failed.\n"); return 1; } if (xds_decode(xds, "string", &new_msg) != XDS_OK) { printf("xds_decode() failed.\n"); return 1; } if (strlen(new_msg) != sizeof (msg) - 1) { printf("The size of the decoded message is wrong.\n"); return 1; } if (memcmp(msg, new_msg, sizeof (msg) - 1) != 0) { printf("The decoded string is not correct.\n"); return 1; } xds_destroy(xds); free(new_msg); /* Everything went fine. */ return 0; } #endif /* XDS_TEST_XDR_STRING */ #ifdef XDS_TEST_XDR_STRING_EMPTY int main() { xds_t *xds; char *buffer; size_t buffer_size; char msg[] = ""; char *new_msg; /* Encode the string as octet stream. Then erase the buffer and decode * the string back, verifying that it hasn't changed. */ xds = xds_init(XDS_ENCODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); return 1; } if (xds_register(xds, "string", &xdr_encode_string, NULL) != XDS_OK) { printf("Failed to register my encoding engines.\n"); return 1; } if (xds_encode(xds, "string", msg, 0) != XDS_OK) { printf("xds_encode() failed.\n"); return 1; } if (xds_getbuffer(xds, XDS_GIFT, (void **)&buffer, &buffer_size) != XDS_OK) { printf("xds_getbuffer() failed.\n"); return 1; } xds_destroy(xds); if (buffer_size % 4 != 0) { printf("The encoded strings' buffer size is not a multiple of 4.\n"); return 1; } xds = xds_init(XDS_DECODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); return 1; } if (xds_register(xds, "string", &xdr_decode_string, NULL) != XDS_OK) { printf("Failed to register my decoding engines.\n"); return 1; } if (xds_setbuffer(xds, XDS_GIFT, buffer, buffer_size) != XDS_OK) { printf("xds_setbuffer() failed.\n"); return 1; } if (xds_decode(xds, "string", &new_msg) != XDS_OK) { printf("xds_decode() failed.\n"); return 1; } if (strlen(new_msg) != 0) { printf("The size of the decoded message is wrong.\n"); return 1; } xds_destroy(xds); free(new_msg); /* Everything went fine. */ return 0; } #endif /* XDS_TEST_XDR_STRING_EMPTY */ #ifdef XDS_TEST_XDR_OCTETSTREAM int main() { xds_t *xds; char *buffer; size_t buffer_size; char msg[] = "Hello\000World"; char *new_msg; size_t new_msg_size; /* Encode the string as octet stream. Then erase the buffer and decode * the string back, verifying that it hasn't changed. */ xds = xds_init(XDS_ENCODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); return 1; } if (xds_register(xds, "os", &xdr_encode_octetstream, NULL) != XDS_OK) { printf("Failed to register my encoding engines.\n"); return 1; } if (xds_encode(xds, "os", msg, sizeof (msg) - 1) != XDS_OK) { printf("xds_encode() failed.\n"); return 1; } if (xds_getbuffer(xds, XDS_GIFT, (void **)&buffer, &buffer_size) != XDS_OK) { printf("xds_getbuffer() failed.\n"); return 1; } xds_destroy(xds); if (buffer_size % 4 != 0) { printf ("The encoded octet stream's buffer size is not a multiple of 4.\n"); return 1; } xds = xds_init(XDS_DECODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); return 1; } if (xds_register(xds, "os", &xdr_decode_octetstream, NULL) != XDS_OK) { printf("Failed to register my decoding engines.\n"); return 1; } if (xds_setbuffer(xds, XDS_GIFT, buffer, buffer_size) != XDS_OK) { printf("xds_setbuffer() failed.\n"); return 1; } if (xds_decode(xds, "os", &new_msg, &new_msg_size) != XDS_OK) { printf("xds_decode() failed.\n"); return 1; } if (new_msg_size != sizeof (msg) - 1) { printf("The size of the decoded message is wrong.\n"); return 1; } if (memcmp(msg, new_msg, new_msg_size) != 0) { printf("The decoded octet stream is not correct.\n"); return 1; } xds_destroy(xds); free(new_msg); /* Everything went fine. */ return 0; } #endif /* XDS_TEST_XDR_OCTETSTREAM */ #ifdef XDS_TEST_XDR_OCTETSTREAM_EMPTY int main() { xds_t *xds; char *buffer; size_t buffer_size; char msg[] = ""; char *new_msg; size_t new_msg_size; /* Encode the string as octet stream. Then erase the buffer and decode * the string back, verifying that it hasn't changed. */ xds = xds_init(XDS_ENCODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); return 1; } if (xds_register(xds, "os", &xdr_encode_octetstream, NULL) != XDS_OK) { printf("Failed to register my encoding engines.\n"); return 1; } if (xds_encode(xds, "os", msg, 0) != XDS_OK) { printf("xds_encode() failed.\n"); return 1; } if (xds_getbuffer(xds, XDS_GIFT, (void **)&buffer, &buffer_size) != XDS_OK) { printf("xds_getbuffer() failed.\n"); return 1; } xds_destroy(xds); if (buffer_size % 4 != 0) { printf ("The encoded octet stream's buffer size is not a multiple of 4.\n"); return 1; } xds = xds_init(XDS_DECODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); return 1; } if (xds_register(xds, "os", &xdr_decode_octetstream, NULL) != XDS_OK) { printf("Failed to register my decoding engines.\n"); return 1; } if (xds_setbuffer(xds, XDS_GIFT, buffer, buffer_size) != XDS_OK) { printf("xds_setbuffer() failed.\n"); return 1; } if (xds_decode(xds, "os", &new_msg, &new_msg_size) != XDS_OK) { printf("xds_decode() failed.\n"); return 1; } if (new_msg_size != 0) { printf("The size of the decoded message is wrong.\n"); return 1; } if (memcmp(msg, new_msg, new_msg_size) != 0) { printf("The decoded octet stream is not correct.\n"); return 1; } xds_destroy(xds); free(new_msg); /* Everything went fine. */ return 0; } #endif /* XDS_TEST_XDR_OCTETSTREAM_EMPTY */ Index: ossp-pkg/srpc/libxds/xds_test_xml.c ============================================================ $ cvs update -p -r1.1 xds_test_xml.c /* * XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The * OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless * Deutschland (http://www.cw.com/de/) * * This file is part of OSSP XDS, an extensible data serialization library * which can be found at http://www.ossp.com/pkg/xds/. * * 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. */ #include #include #include #include "xds_p.h" #ifdef XDS_TEST_XML_INT32 int main() { xds_t *xds; char *buffer; size_t buffer_size; xds_int32_t values[] = { 0x00000000, 0x12345678, -0x12345678, 0x7bcdef01, -0x7bcdef01, 0x7fffffff }; size_t i; /* Encode the values array, then decode it back and compare the numbers. */ xds = xds_init(XDS_ENCODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); return 1; } if (xds_register(xds, "begin", &xml_encode_begin, NULL) != XDS_OK || xds_register(xds, "end", &xml_encode_end, NULL) != XDS_OK || xds_register(xds, "int", &xml_encode_int32, NULL) != XDS_OK) { printf("Failed to register my encoding engines.\n"); return 1; } if (xds_encode(xds, "begin") != XDS_OK) { printf("xds_encode_begin() failed!\n"); return 1; } for (i = 0; i < sizeof (values) / sizeof (xds_int32_t); ++i) { if (xds_encode(xds, "int", values[i]) != XDS_OK) { printf("xds_encode(values[%d]) failed!\n", i); return 1; } } if (xds_encode(xds, "end") != XDS_OK) { printf("xds_encode_end() failed!\n"); return 1; } if (xds_getbuffer(xds, XDS_GIFT, (void **)&buffer, &buffer_size) != XDS_OK) { printf("getbuffer() failed.\n"); return 1; } xds_destroy(xds); xds = xds_init(XDS_DECODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); return 1; } if (xds_register(xds, "begin", &xml_decode_begin, NULL) != XDS_OK || xds_register(xds, "end", &xml_decode_end, NULL) != XDS_OK || xds_register(xds, "int", &xml_decode_int32, NULL) != XDS_OK) { printf("Failed to register my decoding engines.\n"); return 1; } if (xds_setbuffer(xds, XDS_GIFT, buffer, buffer_size) != XDS_OK) { printf("setbuffer() failed.\n"); return 1; } if (xds_decode(xds, "begin") != XDS_OK) { printf("xds_decode_begin() failed!\n"); return 1; } for (i = 0; i < sizeof (values) / sizeof (xds_int32_t); ++i) { xds_int32_t val; if (xds_decode(xds, "int", &val) != XDS_OK) { printf("xds_decode(values[%d]) failed!\n", i); return 1; } if (val != values[i]) { printf ("Decoded value (%d) does not match the original value (%d)!\n", val, values[i]); return 1; } } if (xds_decode(xds, "end") != XDS_OK) { printf("xds_decode_end() failed!\n"); return 1; } xds_destroy(xds); /* Everything went fine. */ return 0; } #endif /* XDS_TEST_XML_INT32 */ #ifdef XDS_TEST_XML_UINT32 int main() { xds_t *xds; char *buffer; size_t buffer_size; xds_uint32_t values[] = { 0x00000000, 0x12345678, 0xabcdef01, 0xc500b3ef, 0xffffffff }; size_t i; /* Encode the values array, then decode it back and compare the numbers. */ xds = xds_init(XDS_ENCODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); return 1; } if (xds_register(xds, "int", &xml_encode_uint32, NULL) != XDS_OK) { printf("Failed to register my encoding engines.\n"); return 1; } for (i = 0; i < sizeof (values) / sizeof (xds_uint32_t); ++i) { if (xds_encode(xds, "int", values[i]) != XDS_OK) { printf("xds_encode(values[%d]) failed!\n", i); return 1; } } if (xds_getbuffer(xds, XDS_GIFT, (void **)&buffer, &buffer_size) != XDS_OK) { printf("getbuffer() failed.\n"); return 1; } xds_destroy(xds); xds = xds_init(XDS_DECODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); return 1; } if (xds_register(xds, "int", &xml_decode_uint32, NULL) != XDS_OK) { printf("Failed to register my decoding engines.\n"); return 1; } if (xds_setbuffer(xds, XDS_GIFT, buffer, buffer_size) != XDS_OK) { printf("setbuffer() failed.\n"); return 1; } for (i = 0; i < sizeof (values) / sizeof (xds_uint32_t); ++i) { xds_uint32_t val; if (xds_decode(xds, "int", &val) != XDS_OK) { printf("xds_decode(values[%d]) failed!\n", i); return 1; } if (val != values[i]) { printf ("Decoded value (%d) does not match the original value (%d)!\n", val, values[i]); return 1; } } xds_destroy(xds); /* Everything went fine. */ return 0; } #endif /* XDS_TEST_XML_UINT32 */ #ifdef XDS_TEST_XML_INT64 #ifdef XDS_HAVE_64_BIT_SUPPORT int main() { xds_t *xds; char *buffer; size_t buffer_size; xds_int64_t values[] = { 0x0000000000000000LL, 0x123456789abcdef0LL, -0x123456789abcdef0LL, 0x7bcdef01cc45bb9aLL, -0x7bcdef01cc45bb9aLL, 0x7fffffffffffffffLL }; size_t i; /* Encode the values array, then decode it back and compare the numbers. */ xds = xds_init(XDS_ENCODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); return 1; } if (xds_register(xds, "int", &xml_encode_int64, NULL) != XDS_OK) { printf("Failed to register my encoding engines.\n"); return 1; } for (i = 0; i < sizeof (values) / sizeof (xds_int64_t); ++i) { if (xds_encode(xds, "int", values[i]) != XDS_OK) { printf("xds_encode(values[%d]) failed!\n", i); return 1; } } if (xds_getbuffer(xds, XDS_GIFT, (void **)&buffer, &buffer_size) != XDS_OK) { printf("getbuffer() failed.\n"); return 1; } xds_destroy(xds); xds = xds_init(XDS_DECODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); return 1; } if (xds_register(xds, "int", &xml_decode_int64, NULL) != XDS_OK) { printf("Failed to register my decoding engines.\n"); return 1; } if (xds_setbuffer(xds, XDS_GIFT, buffer, buffer_size) != XDS_OK) { printf("setbuffer() failed.\n"); return 1; } for (i = 0; i < sizeof (values) / sizeof (xds_int64_t); ++i) { xds_int64_t val; if (xds_decode(xds, "int", &val) != XDS_OK) { printf("xds_decode(values[%d]) failed!\n", i); return 1; } if (val != values[i]) { printf("Decoded value does not match the original!\n"); return 1; } } xds_destroy(xds); /* Everything went fine. */ return 0; } #endif /* XDS_HAVE_64_BIT_SUPPORT */ #endif /* XDS_TEST_XML_INT64 */ #ifdef XDS_TEST_XML_UINT64 #ifdef XDS_HAVE_64_BIT_SUPPORT int main() { xds_t *xds; char *buffer; size_t buffer_size; xds_uint64_t values[] = { 0x0000000000000000ULL, 0x123456789abcdef0ULL, 0xabcdef01cc45bb9aULL, 0xc500b3efdd34ca9eULL, 0xffffffffffffffffULL }; size_t i; /* Encode the values array, then decode it back and compare the numbers. */ xds = xds_init(XDS_ENCODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); return 1; } if (xds_register(xds, "int", &xml_encode_uint64, NULL) != XDS_OK) { printf("Failed to register my encoding engines.\n"); return 1; } for (i = 0; i < sizeof (values) / sizeof (xds_uint64_t); ++i) { if (xds_encode(xds, "int", values[i]) != XDS_OK) { printf("xds_encode(values[%d]) failed!\n", i); return 1; } } if (xds_getbuffer(xds, XDS_GIFT, (void **)&buffer, &buffer_size) != XDS_OK) { printf("getbuffer() failed.\n"); return 1; } xds_destroy(xds); xds = xds_init(XDS_DECODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); return 1; } if (xds_register(xds, "int", &xml_decode_uint64, NULL) != XDS_OK) { printf("Failed to register my decoding engines.\n"); return 1; } if (xds_setbuffer(xds, XDS_GIFT, buffer, buffer_size) != XDS_OK) { printf("setbuffer() failed.\n"); return 1; } for (i = 0; i < sizeof (values) / sizeof (xds_uint64_t); ++i) { xds_uint64_t val; if (xds_decode(xds, "int", &val) != XDS_OK) { printf("xds_decode(values[%d]) failed!\n", i); return 1; } if (val != values[i]) { printf("Decoded value does not match the original!\n"); return 1; } } xds_destroy(xds); /* Everything went fine. */ return 0; } #endif /* XDS_HAVE_64_BIT_SUPPORT */ #endif /* XDS_TEST_XML_UINT64 */ #ifdef XDS_TEST_XML_DOUBLE int main() { #if 0 xds_t *xds; char *buffer; size_t buffer_size; xds_double_t values[] = { 3.14159265358979323844 }; size_t i; /* Encode the values array, then decode it back and compare the numbers. */ xds = xds_init(XDS_ENCODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); return 1; } if (xds_register(xds, "int", &xml_encode_double, NULL) != XDS_OK) { printf("Failed to register my encoding engines.\n"); return 1; } for (i = 0; i < sizeof (values) / sizeof (xds_double_t); ++i) { if (xds_encode(xds, "int", values[i]) != XDS_OK) { printf("xds_encode(values[%d]) failed!\n", i); return 1; } } if (xds_getbuffer(xds, XDS_GIFT, (void **)&buffer, &buffer_size) != XDS_OK) { printf("getbuffer() failed.\n"); return 1; } xds_destroy(xds); printf("%s\n", buffer); xds = xds_init(XDS_DECODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); return 1; } if (xds_register(xds, "int", &xml_decode_double, NULL) != XDS_OK) { printf("Failed to register my decoding engines.\n"); return 1; } if (xds_setbuffer(xds, XDS_GIFT, buffer, buffer_size) != XDS_OK) { printf("setbuffer() failed.\n"); return 1; } for (i = 0; i < sizeof (values) / sizeof (xds_double_t); ++i) { xds_double_t val; if (xds_decode(xds, "int", &val) != XDS_OK) { printf("xds_decode(values[%d]) failed!\n", i); return 1; } if (val != values[i]) { printf ("Decoded value (%E) does not match the original value (%E)!\n", val, values[i]); return 1; } } xds_destroy(xds); /* Everything went fine. */ #endif return 0; } #endif /* XDS_TEST_XML_DOUBLE */ #ifdef XDS_TEST_XML_STRING int main() { xds_t *xds; char *buffer; size_t buffer_size; char msg[] = " ]]>&<&>World: äöüß"; char *new_msg; /* Encode the string, then erase the buffer and decode the string back, * verifying that it hasn't changed. */ xds = xds_init(XDS_ENCODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); return 1; } if (xds_register(xds, "string", &xml_encode_string, NULL) != XDS_OK || xds_register(xds, "begin", &xml_encode_begin, NULL) != XDS_OK || xds_register(xds, "end", &xml_encode_end, NULL) != XDS_OK) { printf("Failed to register my encoding engines.\n"); return 1; } if (xds_encode(xds, "begin string end", msg, sizeof (msg) - 1) != XDS_OK) { printf("xds_encode() failed.\n"); return 1; } if (xds_getbuffer(xds, XDS_GIFT, (void **)&buffer, &buffer_size) != XDS_OK) { printf("xds_getbuffer() failed.\n"); return 1; } xds_destroy(xds); write(1, buffer, buffer_size); printf("\n"); xds = xds_init(XDS_DECODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); return 1; } if (xds_register(xds, "string", &xml_decode_string, NULL) != XDS_OK || xds_register(xds, "begin", &xml_decode_begin, NULL) != XDS_OK || xds_register(xds, "end", &xml_decode_end, NULL) != XDS_OK) { printf("Failed to register my decoding engines.\n"); return 1; } if (xds_setbuffer(xds, XDS_GIFT, buffer, buffer_size) != XDS_OK) { printf("xds_setbuffer() failed.\n"); return 1; } if (xds_decode(xds, "begin string end", &new_msg) != XDS_OK) { printf("xds_decode() failed.\n"); return 1; } if (strlen(new_msg) != sizeof (msg) - 1) { printf("The size of the decoded message is wrong.\n"); return 1; } if (memcmp(msg, new_msg, sizeof (msg) - 1) != 0) { printf("The decoded string is not correct.\n"); return 1; } xds_destroy(xds); free(new_msg); /* Everything went fine. */ return 0; } #endif /* XDS_TEST_XML_STRING */ #ifdef XDS_TEST_XML_STRING_EMPTY int main() { xds_t *xds; char *buffer; size_t buffer_size; char msg[] = ""; char *new_msg; /* Encode the string, then erase the buffer and decode the string back, * verifying that it hasn't changed. */ xds = xds_init(XDS_ENCODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); return 1; } if (xds_register(xds, "string", &xml_encode_string, NULL) != XDS_OK || xds_register(xds, "begin", &xml_encode_begin, NULL) != XDS_OK || xds_register(xds, "end", &xml_encode_end, NULL) != XDS_OK) { printf("Failed to register my encoding engines.\n"); return 1; } if (xds_encode(xds, "begin string end", msg, sizeof (msg) - 1) != XDS_OK) { printf("xds_encode() failed.\n"); return 1; } if (xds_getbuffer(xds, XDS_GIFT, (void **)&buffer, &buffer_size) != XDS_OK) { printf("xds_getbuffer() failed.\n"); return 1; } xds_destroy(xds); write(1, buffer, buffer_size); printf("\n"); xds = xds_init(XDS_DECODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); return 1; } if (xds_register(xds, "string", &xml_decode_string, NULL) != XDS_OK || xds_register(xds, "begin", &xml_decode_begin, NULL) != XDS_OK || xds_register(xds, "end", &xml_decode_end, NULL) != XDS_OK) { printf("Failed to register my decoding engines.\n"); return 1; } if (xds_setbuffer(xds, XDS_GIFT, buffer, buffer_size) != XDS_OK) { printf("xds_setbuffer() failed.\n"); return 1; } if (xds_decode(xds, "begin string end", &new_msg) != XDS_OK) { printf("xds_decode() failed.\n"); return 1; } if (strlen(new_msg) != sizeof (msg) - 1) { printf("The size of the decoded message is wrong.\n"); return 1; } if (memcmp(msg, new_msg, sizeof (msg) - 1) != 0) { printf("The decoded string is not correct.\n"); return 1; } xds_destroy(xds); free(new_msg); /* Everything went fine. */ return 0; } #endif /* XDS_TEST_XML_STRING_EMPTY */ #ifdef XDS_TEST_XML_OCTETSTREAM int main() { xds_t *xds; char *buffer; size_t buffer_size; char msg[] = "Hallo\000Worl"; char *new_msg; size_t new_msg_size; /* Encode the string as octet stream. Then erase the buffer and decode * the string back, verifying that it hasn't changed. */ xds = xds_init(XDS_ENCODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); return 1; } if (xds_register(xds, "os", &xml_encode_octetstream, NULL) != XDS_OK || xds_register(xds, "begin", &xml_encode_begin, NULL) != XDS_OK || xds_register(xds, "end", &xml_encode_end, NULL) != XDS_OK) { printf("Failed to register my encoding engines.\n"); return 1; } if (xds_encode(xds, "begin os end", msg, sizeof (msg) - 1) != XDS_OK) { printf("xds_encode() failed.\n"); return 1; } if (xds_getbuffer(xds, XDS_GIFT, (void **)&buffer, &buffer_size) != XDS_OK) { printf("xds_getbuffer() failed.\n"); return 1; } xds_destroy(xds); write(1, buffer, buffer_size); printf("\n"); xds = xds_init(XDS_DECODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); return 1; } if (xds_register(xds, "os", &xml_decode_octetstream, NULL) != XDS_OK || xds_register(xds, "begin", &xml_decode_begin, NULL) != XDS_OK || xds_register(xds, "end", &xml_decode_end, NULL) != XDS_OK) { printf("Failed to register my decoding engines.\n"); return 1; } if (xds_setbuffer(xds, XDS_GIFT, buffer, buffer_size) != XDS_OK) { printf("xds_setbuffer() failed.\n"); return 1; } if (xds_decode(xds, "begin os end", &new_msg, &new_msg_size) != XDS_OK) { printf("xds_decode() failed.\n"); return 1; } if (new_msg_size != sizeof (msg) - 1) { printf("The size of the decoded message is wrong.\n"); return 1; } if (memcmp(msg, new_msg, new_msg_size) != 0) { printf("The decoded octet stream is not correct.\n"); return 1; } xds_destroy(xds); free(new_msg); /* Everything went fine. */ return 0; } #endif /* XDS_TEST_XML_OCTETSTREAM */ #ifdef XDS_TEST_XML_OCTETSTREAM_EMPTY int main() { xds_t *xds; char *buffer; size_t buffer_size; char msg[] = ""; char *new_msg; size_t new_msg_size; /* Encode the string as octet stream. Then erase the buffer and decode * the string back, verifying that it hasn't changed. */ xds = xds_init(XDS_ENCODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); return 1; } if (xds_register(xds, "os", &xml_encode_octetstream, NULL) != XDS_OK || xds_register(xds, "begin", &xml_encode_begin, NULL) != XDS_OK || xds_register(xds, "end", &xml_encode_end, NULL) != XDS_OK) { printf("Failed to register my encoding engines.\n"); return 1; } if (xds_encode(xds, "begin os end", msg, sizeof (msg) - 1) != XDS_OK) { printf("xds_encode() failed.\n"); return 1; } if (xds_getbuffer(xds, XDS_GIFT, (void **)&buffer, &buffer_size) != XDS_OK) { printf("xds_getbuffer() failed.\n"); return 1; } xds_destroy(xds); write(1, buffer, buffer_size); printf("\n"); xds = xds_init(XDS_DECODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); return 1; } if (xds_register(xds, "os", &xml_decode_octetstream, NULL) != XDS_OK || xds_register(xds, "begin", &xml_decode_begin, NULL) != XDS_OK || xds_register(xds, "end", &xml_decode_end, NULL) != XDS_OK) { printf("Failed to register my decoding engines.\n"); return 1; } if (xds_setbuffer(xds, XDS_GIFT, buffer, buffer_size) != XDS_OK) { printf("xds_setbuffer() failed.\n"); return 1; } if (xds_decode(xds, "begin os end", &new_msg, &new_msg_size) != XDS_OK) { printf("xds_decode() failed.\n"); return 1; } if (new_msg_size != sizeof (msg) - 1) { printf("The size of the decoded message is wrong.\n"); return 1; } if (memcmp(msg, new_msg, new_msg_size) != 0) { printf("The decoded octet stream is not correct.\n"); return 1; } xds_destroy(xds); free(new_msg); /* Everything went fine. */ return 0; } #endif /* XDS_TEST_XML_OCTETSTREAM_EMPTY */ From ossp-cvs-owner@ossp.org Wed Aug 8 21:29:28 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f78JTRv43112; Wed, 8 Aug 2001 21:29:27 +0200 (CEST) Date: Wed, 8 Aug 2001 21:29:27 +0200 (CEST) Message-Id: <200108081929.f78JTRv43112@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds xds.h.in xds_p.h Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 08-Aug-2001 21:29:27 Branch: HEAD Handle: 2001080820292600 Modified files: ossp-pkg/srpc/libxds xds.h.in xds_p.h Log: Mmanual style cleanups to header files. Summary: Revision Changes Path 1.11 +83 -89 ossp-pkg/srpc/libxds/xds.h.in 1.2 +36 -34 ossp-pkg/srpc/libxds/xds_p.h ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/xds.h.in ============================================================ $ cvs diff -u -r1.10 -r1.11 xds.h.in --- ossp-pkg/srpc/libxds/xds.h.in 2001/08/02 17:24:49 1.10 +++ ossp-pkg/srpc/libxds/xds.h.in 2001/08/08 19:29:26 1.11 @@ -1,59 +1,58 @@ /* - XDS - OSSP Extensible Data Serialization Library - Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) - Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) - - This file is part of OSSP XDS, an extensible data serialization - library which can be found at http://www.ossp.com/pkg/xds/. - - 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. - - xds.h: C API +** XDS - OSSP Extensible Data Serialization Library +** Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) +** Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) +** +** This file is part of OSSP XDS, an extensible data serialization +** library which can be found at http://www.ossp.com/pkg/xds/. +** +** 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. +** +** xds.h: C API */ -#ifndef __LIBXDS_H__ -#define __LIBXDS_H__ +#ifndef __XDS_H__ +#define __XDS_H__ #include #include #include #include -#define XDS_TRUE (1==1) +#define XDS_TRUE (1==1) #define XDS_FALSE (1!=1) @have_64_bit_support@ -typedef @xds_uint8_t@ xds_uint8_t; -typedef @xds_int8_t@ xds_int8_t; +typedef @xds_uint8_t@ xds_uint8_t; +typedef @xds_int8_t@ xds_int8_t; typedef @xds_uint16_t@ xds_uint16_t; -typedef @xds_int16_t@ xds_int16_t; +typedef @xds_int16_t@ xds_int16_t; typedef @xds_uint32_t@ xds_uint32_t; -typedef @xds_int32_t@ xds_int32_t; +typedef @xds_int32_t@ xds_int32_t; #ifdef XDS_HAVE_64_BIT_SUPPORT typedef @xds_uint64_t@ xds_uint64_t; -typedef @xds_int64_t@ xds_int64_t; +typedef @xds_int64_t@ xds_int64_t; #endif -typedef double xds_double_t; +typedef double xds_double_t; -enum - { +enum { XDS_OK = 0, XDS_ERR_NO_MEM = -1, XDS_ERR_OVERFLOW = -2, @@ -63,69 +62,62 @@ XDS_ERR_INVALID_MODE = -6, XDS_ERR_UNDERFLOW = -7, XDS_ERR_UNKNOWN = -8 - }; +}; + typedef enum { XDS_ENCODE, XDS_DECODE } xds_mode_t; typedef enum { XDS_LOAN, XDS_GIFT } xds_scope_t; struct xds_context; typedef struct xds_context xds_t; -typedef int (*xds_engine_t)(xds_t* xds, void* engine_context, - void* buffer, size_t buffer_size, size_t* used_buffer_size, - va_list* args); - -xds_t* xds_init(xds_mode_t); -void xds_destroy(xds_t* xds); - -int xds_register(xds_t* xds, const char* name, xds_engine_t engine, void* engine_context); -int xds_unregister(xds_t* xds, const char* name); - -int xds_setbuffer(xds_t* xds, xds_scope_t flag, void* buffer, size_t buffer_len); -int xds_getbuffer(xds_t* xds, xds_scope_t flag, void** buffer, size_t* buffer_len); - -int xds_encode(xds_t* xds, const char* fmt, ...); -int xds_decode(xds_t* xds, const char* fmt, ...); -int xds_vencode(xds_t* xds, const char* fmt, va_list args); -int xds_vdecode(xds_t* xds, const char* fmt, va_list args); - -#define xds_check_parameter(condition) \ - do \ - { \ - assert(condition); \ - if (!(condition)) \ - return XDS_ERR_INVALID_ARG; \ +typedef int (*xds_engine_t)(xds_t *xds, void *engine_context, + void *buffer, size_t buffer_size, size_t *used_buffer_size, + va_list *args); + +xds_t *xds_init (xds_mode_t); +void xds_destroy (xds_t *xds); +int xds_register (xds_t *xds, const char *name, xds_engine_t engine, void *engine_context); +int xds_unregister(xds_t *xds, const char *name); +int xds_setbuffer (xds_t *xds, xds_scope_t flag, void *buffer, size_t buffer_len); +int xds_getbuffer (xds_t *xds, xds_scope_t flag, void **buffer, size_t *buffer_len); +int xds_encode (xds_t *xds, const char *fmt, ...); +int xds_decode (xds_t *xds, const char *fmt, ...); +int xds_vencode (xds_t *xds, const char *fmt, va_list args); +int xds_vdecode (xds_t *xds, const char *fmt, va_list args); + +#define xds_check_parameter(condition) \ + do { \ + assert(condition); \ + if (!(condition)) \ + return XDS_ERR_INVALID_ARG; \ } while(XDS_FALSE) -#define xds_init_encoding_engine(size) \ - do \ - { \ - xds_check_parameter(xds != NULL); \ - xds_check_parameter(buffer != NULL); \ - xds_check_parameter(buffer_size != 0); \ - xds_check_parameter(used_buffer_size != NULL && *used_buffer_size == 0); \ - xds_check_parameter(args != NULL); \ - *used_buffer_size = size; \ - if (buffer_size < size) \ - return XDS_ERR_OVERFLOW; \ +#define xds_init_encoding_engine(size) \ + do { \ + xds_check_parameter(xds != NULL); \ + xds_check_parameter(buffer != NULL); \ + xds_check_parameter(buffer_size != 0); \ + xds_check_parameter(used_buffer_size != NULL && *used_buffer_size == 0); \ + xds_check_parameter(args != NULL); \ + *used_buffer_size = size; \ + if (buffer_size < size) \ + return XDS_ERR_OVERFLOW; \ } while(XDS_FALSE) -#define xds_init_decoding_engine(size) \ - do \ - { \ - xds_check_parameter(xds != NULL); \ - xds_check_parameter(buffer != NULL); \ - xds_check_parameter(buffer_size != 0); \ - xds_check_parameter(used_buffer_size != NULL && *used_buffer_size == 0); \ - xds_check_parameter(args != NULL); \ - *used_buffer_size = size; \ - if (buffer_size < size) \ - return XDS_ERR_UNDERFLOW; \ +#define xds_init_decoding_engine(size) \ + do { \ + xds_check_parameter(xds != NULL); \ + xds_check_parameter(buffer != NULL); \ + xds_check_parameter(buffer_size != 0); \ + xds_check_parameter(used_buffer_size != NULL && *used_buffer_size == 0); \ + xds_check_parameter(args != NULL); \ + *used_buffer_size = size; \ + if (buffer_size < size) \ + return XDS_ERR_UNDERFLOW; \ } while(XDS_FALSE) -#define xds_declare_formatting_engine(x) \ - int x(xds_t* xds, void* engine_context, \ - void* buffer, size_t buffer_size, size_t* used_buffer_size, \ - va_list* args) +#define xds_declare_formatting_engine(func) \ + int func(xds_t *, void *, void *, size_t, size_t *, va_list *) xds_declare_formatting_engine(xdr_encode_uint32); xds_declare_formatting_engine(xdr_decode_uint32); @@ -164,9 +156,11 @@ xds_declare_formatting_engine(xml_decode_octetstream); xds_declare_formatting_engine(xml_encode_string); xds_declare_formatting_engine(xml_decode_string); + extern const char xds_xml_begin_text[]; extern const char xds_xml_end_text[]; extern const char xds_base64[]; extern const char xds_pad64; + +#endif /* __XDS_H__ */ -#endif /* !defined(__LIBXDS_H__) */ Index: ossp-pkg/srpc/libxds/xds_p.h ============================================================ $ cvs diff -u -r1.1 -r1.2 xds_p.h --- ossp-pkg/srpc/libxds/xds_p.h 2001/08/08 19:15:23 1.1 +++ ossp-pkg/srpc/libxds/xds_p.h 2001/08/08 19:29:26 1.2 @@ -1,35 +1,38 @@ -/* - * XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The - * OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless - * Deutschland (http://www.cw.com/de/) - * - * This file is part of OSSP XDS, an extensible data serialization library - * which can be found at http://www.ossp.com/pkg/xds/. - * - * 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. - * - * internal.h: internal C API */ +/* +** XDS - OSSP Extensible Data Serialization Library +** Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) +** Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) +** +** This file is part of OSSP XDS, an extensible data serialization +** library which can be found at http://www.ossp.com/pkg/xds/. +** +** 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. +** +** xds_p.h: internal C API +*/ -#ifndef __INTERNAL_H__ -#define __INTERNAL_H__ +#ifndef __XDS_P_H__ +#define __XDS_P_H__ #include "xds.h" -#define XDS_INITIAL_BUFFER_CAPACITY 512 +#define XDS_INITIAL_BUFFER_CAPACITY 512 #define XDS_INITIAL_ENGINES_CAPACITY 32 typedef struct { @@ -40,21 +43,20 @@ struct xds_context { xds_mode_t mode; - char *buffer; size_t buffer_len; size_t buffer_capacity; int we_own_buffer; - engine_map_t *engines; size_t engines_len; size_t engines_capacity; }; -int xds_find_engine(const engine_map_t * engines, size_t last, - const char *name, size_t * pos); -int xds_set_capacity(void **array, size_t * array_capacity, +int xds_find_engine(const engine_map_t *engines, size_t last, + const char *name, size_t *pos); +int xds_set_capacity(void **array, size_t *array_capacity, size_t new_capacity, size_t elem_size, size_t initial_capacity); + +#endif /* __XDS_P_H__ */ -#endif /* !defined(__INTERNAL_H__) */ From ossp-cvs-owner@ossp.org Wed Aug 8 21:32:04 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f78JW2743532; Wed, 8 Aug 2001 21:32:02 +0200 (CEST) Date: Wed, 8 Aug 2001 21:32:02 +0200 (CEST) Message-Id: <200108081932.f78JW2743532@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds xds.h.in xds_engine_xml.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 08-Aug-2001 21:32:02 Branch: HEAD Handle: 2001080820320200 Modified files: ossp-pkg/srpc/libxds xds.h.in xds_engine_xml.c Log: Do not export internal things. Summary: Revision Changes Path 1.12 +0 -5 ossp-pkg/srpc/libxds/xds.h.in 1.2 +6 -5 ossp-pkg/srpc/libxds/xds_engine_xml.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/xds.h.in ============================================================ $ cvs diff -u -r1.11 -r1.12 xds.h.in --- ossp-pkg/srpc/libxds/xds.h.in 2001/08/08 19:29:26 1.11 +++ ossp-pkg/srpc/libxds/xds.h.in 2001/08/08 19:32:02 1.12 @@ -157,10 +157,5 @@ xds_declare_formatting_engine(xml_encode_string); xds_declare_formatting_engine(xml_decode_string); -extern const char xds_xml_begin_text[]; -extern const char xds_xml_end_text[]; -extern const char xds_base64[]; -extern const char xds_pad64; - #endif /* __XDS_H__ */ Index: ossp-pkg/srpc/libxds/xds_engine_xml.c ============================================================ $ cvs diff -u -r1.1 -r1.2 xds_engine_xml.c --- ossp-pkg/srpc/libxds/xds_engine_xml.c 2001/08/08 19:15:23 1.1 +++ ossp-pkg/srpc/libxds/xds_engine_xml.c 2001/08/08 19:32:02 1.2 @@ -27,11 +27,14 @@ #include #include "xds.h" -const char xds_xml_begin_text[] = +static const char xds_xml_begin_text[] = "\n" "\n" "\n"; +static const char xds_xml_end_text[] = + "\n"; + int xml_encode_begin(xds_t * xds, void *engine_context, void *buffer, size_t buffer_size, size_t * used_buffer_size, va_list * args) @@ -52,8 +55,6 @@ return XDS_OK; } -const char xds_xml_end_text[] = "\n"; - int xml_encode_end(xds_t * xds, void *engine_context, void *buffer, size_t buffer_size, size_t * used_buffer_size, va_list * args) @@ -754,9 +755,9 @@ return XDS_OK; } -const char xds_base64[] = +static const char xds_base64[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; -const char xds_pad64 = '='; +static const char xds_pad64 = '='; static int base64_encode(char *dst, size_t dstlen, unsigned char const *src, size_t srclen) From ossp-cvs-owner@ossp.org Wed Aug 8 21:33:57 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f78JXtw43683; Wed, 8 Aug 2001 21:33:55 +0200 (CEST) Date: Wed, 8 Aug 2001 21:33:55 +0200 (CEST) Message-Id: <200108081933.f78JXtw43683@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds xds.c xds_p.h Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 08-Aug-2001 21:33:55 Branch: HEAD Handle: 2001080820335500 Modified files: ossp-pkg/srpc/libxds xds.c xds_p.h Log: Do not export internal functions, too. Summary: Revision Changes Path 1.2 +2 -2 ossp-pkg/srpc/libxds/xds.c 1.3 +0 -6 ossp-pkg/srpc/libxds/xds_p.h ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/xds.c ============================================================ $ cvs diff -u -r1.1 -r1.2 xds.c --- ossp-pkg/srpc/libxds/xds.c 2001/08/08 19:15:23 1.1 +++ ossp-pkg/srpc/libxds/xds.c 2001/08/08 19:33:55 1.2 @@ -142,7 +142,7 @@ return XDS_OK; } -int xds_set_capacity(void **array, size_t *array_capacity, +static int xds_set_capacity(void **array, size_t *array_capacity, size_t new_capacity, size_t elem_size, size_t initial_capacity) { @@ -174,7 +174,7 @@ return XDS_OK; } -int xds_find_engine(const engine_map_t *engines, size_t last, +static int xds_find_engine(const engine_map_t *engines, size_t last, const char *name, size_t *pos) { size_t first; Index: ossp-pkg/srpc/libxds/xds_p.h ============================================================ $ cvs diff -u -r1.2 -r1.3 xds_p.h --- ossp-pkg/srpc/libxds/xds_p.h 2001/08/08 19:29:26 1.2 +++ ossp-pkg/srpc/libxds/xds_p.h 2001/08/08 19:33:55 1.3 @@ -52,11 +52,5 @@ size_t engines_capacity; }; -int xds_find_engine(const engine_map_t *engines, size_t last, - const char *name, size_t *pos); -int xds_set_capacity(void **array, size_t *array_capacity, - size_t new_capacity, size_t elem_size, - size_t initial_capacity); - #endif /* __XDS_P_H__ */ From ossp-cvs-owner@ossp.org Thu Aug 9 13:58:24 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f79BwNX70514; Thu, 9 Aug 2001 13:58:23 +0200 (CEST) Date: Thu, 9 Aug 2001 13:58:23 +0200 (CEST) Message-Id: <200108091158.f79BwNX70514@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds configure.ac Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 09-Aug-2001 13:58:23 Branch: HEAD Handle: 2001080912582200 Modified files: ossp-pkg/srpc/libxds configure.ac Log: AC_INIT expects as parameter the name of an unique source file in the repository. I gave it xds.h.in. Summary: Revision Changes Path 1.17 +2 -2 ossp-pkg/srpc/libxds/configure.ac ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/configure.ac ============================================================ $ cvs diff -u -r1.16 -r1.17 configure.ac --- ossp-pkg/srpc/libxds/configure.ac 2001/08/08 19:15:23 1.16 +++ ossp-pkg/srpc/libxds/configure.ac 2001/08/09 11:58:22 1.17 @@ -1,8 +1,8 @@ dnl configure.in -- Process this file with autoconf to produce a configure script. -AC_INIT(xds) +AC_INIT(xds.h.in) AC_PREREQ(2.52) -AC_REVISION($Revision: 1.16 $) +AC_REVISION($Revision: 1.17 $) dnl Get rid of the lousy -g and -O defaults in CFLAGS. dnl From ossp-cvs-owner@ossp.org Thu Aug 9 14:09:08 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f79C96w72065; Thu, 9 Aug 2001 14:09:06 +0200 (CEST) Date: Thu, 9 Aug 2001 14:09:06 +0200 (CEST) Message-Id: <200108091209.f79C96w72065@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc EVAL Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 09-Aug-2001 14:09:06 Branch: HEAD Handle: 2001080913090600 Modified files: ossp-pkg/srpc EVAL Log: Added entry for PVM. Needs to be investigated. Summary: Revision Changes Path 1.15 +1 -0 ossp-pkg/srpc/EVAL ____________________________________________________________________________ Index: ossp-pkg/srpc/EVAL ============================================================ $ cvs diff -u -r1.14 -r1.15 EVAL --- ossp-pkg/srpc/EVAL 2001/06/27 21:10:01 1.14 +++ ossp-pkg/srpc/EVAL 2001/08/09 12:09:06 1.15 @@ -126,6 +126,7 @@ be necessary before the package can even be compiled -- let alone be tested. +o PVM, http://www.epm.ornl.gov/pvm/ o Foreign Function Call Library http://clisp.cons.org/~haible/packages-ffcall.html From ossp-cvs-owner@ossp.org Thu Aug 9 14:57:53 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f79Cvpx78971; Thu, 9 Aug 2001 14:57:51 +0200 (CEST) Date: Thu, 9 Aug 2001 14:57:51 +0200 (CEST) Message-Id: <200108091257.f79Cvpx78971@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds/docs data-exchange.dia data-exchange.... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 09-Aug-2001 14:57:51 Branch: HEAD Handle: 2001080913575100 Modified files: ossp-pkg/srpc/libxds/docs data-exchange.dia data-exchange.eps Log: Replaced name "libxds" with "XDS" in the diagram. Summary: Revision Changes Path 1.2 +4 -4 ossp-pkg/srpc/libxds/docs/data-exchange.dia 1.2 +29 -29 ossp-pkg/srpc/libxds/docs/data-exchange.eps ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/docs/data-exchange.dia ============================================================ $ cvs diff -u -r1.1 -r1.2 data-exchange.dia --- ossp-pkg/srpc/libxds/docs/data-exchange.dia 2001/08/02 12:19:33 1.1 +++ ossp-pkg/srpc/libxds/docs/data-exchange.dia 2001/08/09 12:57:51 1.2 @@ -1,12 +1,12 @@ -#A4##Network##$1234##libxds##libxds##$1234##The value in +#A4##Network##$1234##XDS##XDS##$1234##The value in Host A's -representation##Transfer encoded +representation##Transfer encoded value over the -network.##Encode value +network.##Encode value from host format to -standard format.##The value in +standard format.##The value in Host B's representation##Decode value from standard Index: ossp-pkg/srpc/libxds/docs/data-exchange.eps ============================================================ $ cvs diff -u -r1.1 -r1.2 data-exchange.eps --- ossp-pkg/srpc/libxds/docs/data-exchange.eps 2001/08/02 12:19:33 1.1 +++ ossp-pkg/srpc/libxds/docs/data-exchange.eps 2001/08/09 12:57:51 1.2 @@ -1,11 +1,11 @@ %!PS-Adobe-2.0 EPSF-2.0 -%%Title: /home/simons/projects/srpc/libxds/docs/data-exchange.dia +%%Title: data-exchange.dia %%Creator: Dia v0.88.1 -%%CreationDate: Tue Jul 31 15:42:54 2001 +%%CreationDate: Thu Aug 9 14:35:09 2001 %%For: simons %%Magnification: 1.0000 %%Orientation: Portrait -%%BoundingBox: 0 0 1244 483 +%%BoundingBox: 0 0 1245 483 %%Pages: 1 %%BeginSetup %%EndSetup @@ -342,7 +342,7 @@ putinterval } bind def 28.346000 -28.346000 scale --9.066950 -17.005000 translate +-9.016950 -17.005000 translate %%EndProlog @@ -355,11 +355,11 @@ 0 slj [] 0 sd 1.000000 1.000000 1.000000 srgb -n 28.578343 13.328139 m 28.029049 13.317177 26.963752 13.547390 27.113560 14.040704 c 27.263366 14.534017 27.979113 14.643638 28.278728 14.501130 c 28.578343 14.358617 27.812660 15.191765 29.277445 15.411015 c 30.742216 15.630266 31.491254 15.279465 31.274865 15.027327 c 31.058477 14.775189 32.556552 15.619304 33.255654 15.136952 c 33.954756 14.654601 32.539907 14.194179 32.839522 14.259954 c 33.139137 14.325729 34.054627 14.238029 33.755012 13.415840 c 33.455397 12.593650 30.758861 13.229477 31.058477 13.108889 c 31.358092 12.988301 30.609054 12.385361 29.676932 12.505949 c 28.744796 12.626537 28.678681 12.845360 28.578809 13.327712 c 28.578343 13.328139 l f +n 28.578389 13.328181 m 28.029094 13.317219 26.963798 13.547432 27.113606 14.040745 c 27.263412 14.534059 27.979159 14.643680 28.278774 14.501171 c 28.578389 14.358659 27.812706 15.191806 29.277490 15.411056 c 30.742261 15.630307 31.491299 15.279506 31.274910 15.027368 c 31.058522 14.775230 32.556597 15.619344 33.255698 15.136993 c 33.954800 14.654642 32.539951 14.194221 32.839566 14.259996 c 33.139181 14.325771 34.054672 14.238071 33.755057 13.415881 c 33.455442 12.593692 30.758907 13.229519 31.058522 13.108931 c 31.358137 12.988343 30.609099 12.385403 29.676977 12.505991 c 28.744841 12.626580 28.678726 12.845403 28.578855 13.327754 c 28.578389 13.328181 l f 0.000000 0.000000 0.000000 srgb -n 28.578343 13.328139 m 28.029049 13.317177 26.963752 13.547390 27.113560 14.040704 c 27.263366 14.534017 27.979113 14.643638 28.278728 14.501130 c 28.578343 14.358617 27.812660 15.191765 29.277445 15.411015 c 30.742216 15.630266 31.491254 15.279465 31.274865 15.027327 c 31.058477 14.775189 32.556552 15.619304 33.255654 15.136952 c 33.954756 14.654601 32.539907 14.194179 32.839522 14.259954 c 33.139137 14.325729 34.054627 14.238029 33.755012 13.415840 c 33.455397 12.593650 30.758861 13.229477 31.058477 13.108889 c 31.358092 12.988301 30.609054 12.385361 29.676932 12.505949 c 28.744796 12.626537 28.678681 12.845360 28.578809 13.327712 c 28.578343 13.328139 l s +n 28.578389 13.328181 m 28.029094 13.317219 26.963798 13.547432 27.113606 14.040745 c 27.263412 14.534059 27.979159 14.643680 28.278774 14.501171 c 28.578389 14.358659 27.812706 15.191806 29.277490 15.411056 c 30.742261 15.630307 31.491299 15.279506 31.274910 15.027368 c 31.058522 14.775230 32.556597 15.619344 33.255698 15.136993 c 33.954800 14.654642 32.539951 14.194221 32.839566 14.259996 c 33.139181 14.325771 34.054672 14.238071 33.755057 13.415881 c 33.455442 12.593692 30.758907 13.229519 31.058522 13.108931 c 31.358137 12.988343 30.609099 12.385403 29.676977 12.505991 c 28.744841 12.626580 28.678726 12.845403 28.578855 13.327754 c 28.578389 13.328181 l s /Helvetica-latin1 ff 0.800000 scf sf -(Network) dup sw 2 div 30.699271 ex sub 14.305014 m gs 1 -1 sc sh gr +(Network) dup sw 2 div 30.699317 ex sub 14.305056 m gs 1 -1 sc sh gr 1.000000 1.000000 1.000000 srgb n 11.000000 8.000000 m 11.000000 10.000000 l 14.724000 10.000000 l 14.724000 8.000000 l f 0.100000 slw @@ -373,35 +373,35 @@ 0.100000 slw [] 0 sd 1.000000 1.000000 1.000000 srgb -n 18.250000 12.222453 m 18.250000 15.722453 l 22.237680 15.722453 l 22.237680 12.222453 l f +n 18.250000 12.222500 m 18.250000 15.722500 l 21.898320 15.722500 l 21.898320 12.222500 l f 0.000000 0.000000 0.000000 srgb -n 18.250000 12.222453 m 18.250000 15.722453 l 22.237680 15.722453 l 22.237680 12.222453 l cp s +n 18.250000 12.222500 m 18.250000 15.722500 l 21.898320 15.722500 l 21.898320 12.222500 l cp s 1.000000 1.000000 1.000000 srgb -n 17.250000 12.922453 m 17.250000 13.622453 l 19.250000 13.622453 l 19.250000 12.922453 l f +n 17.250000 12.922500 m 17.250000 13.622500 l 19.250000 13.622500 l 19.250000 12.922500 l f 0.000000 0.000000 0.000000 srgb -n 17.250000 12.922453 m 17.250000 13.622453 l 19.250000 13.622453 l 19.250000 12.922453 l cp s +n 17.250000 12.922500 m 17.250000 13.622500 l 19.250000 13.622500 l 19.250000 12.922500 l cp s 1.000000 1.000000 1.000000 srgb -n 17.250000 14.322453 m 17.250000 15.022453 l 19.250000 15.022453 l 19.250000 14.322453 l f +n 17.250000 14.322500 m 17.250000 15.022500 l 19.250000 15.022500 l 19.250000 14.322500 l f 0.000000 0.000000 0.000000 srgb -n 17.250000 14.322453 m 17.250000 15.022453 l 19.250000 15.022453 l 19.250000 14.322453 l cp s +n 17.250000 14.322500 m 17.250000 15.022500 l 19.250000 15.022500 l 19.250000 14.322500 l cp s /Helvetica-latin1 ff 0.800000 scf sf -(libxds) 19.650000 13.562453 m gs 1 -1 sc sh gr +(XDS) 19.650000 13.562500 m gs 1 -1 sc sh gr 0.100000 slw [] 0 sd 1.000000 1.000000 1.000000 srgb -n 40.000000 12.222453 m 40.000000 15.722453 l 43.987680 15.722453 l 43.987680 12.222453 l f +n 40.000000 12.222500 m 40.000000 15.722500 l 43.648320 15.722500 l 43.648320 12.222500 l f 0.000000 0.000000 0.000000 srgb -n 40.000000 12.222453 m 40.000000 15.722453 l 43.987680 15.722453 l 43.987680 12.222453 l cp s +n 40.000000 12.222500 m 40.000000 15.722500 l 43.648320 15.722500 l 43.648320 12.222500 l cp s 1.000000 1.000000 1.000000 srgb -n 39.000000 12.922453 m 39.000000 13.622453 l 41.000000 13.622453 l 41.000000 12.922453 l f +n 39.000000 12.922500 m 39.000000 13.622500 l 41.000000 13.622500 l 41.000000 12.922500 l f 0.000000 0.000000 0.000000 srgb -n 39.000000 12.922453 m 39.000000 13.622453 l 41.000000 13.622453 l 41.000000 12.922453 l cp s +n 39.000000 12.922500 m 39.000000 13.622500 l 41.000000 13.622500 l 41.000000 12.922500 l cp s 1.000000 1.000000 1.000000 srgb -n 39.000000 14.322453 m 39.000000 15.022453 l 41.000000 15.022453 l 41.000000 14.322453 l f +n 39.000000 14.322500 m 39.000000 15.022500 l 41.000000 15.022500 l 41.000000 14.322500 l f 0.000000 0.000000 0.000000 srgb -n 39.000000 14.322453 m 39.000000 15.022453 l 41.000000 15.022453 l 41.000000 14.322453 l cp s +n 39.000000 14.322500 m 39.000000 15.022500 l 41.000000 15.022500 l 41.000000 14.322500 l cp s /Helvetica-latin1 ff 0.800000 scf sf -(libxds) 41.400000 13.562453 m gs 1 -1 sc sh gr +(XDS) 41.400000 13.562500 m gs 1 -1 sc sh gr 1.000000 1.000000 1.000000 srgb n 47.000000 8.000000 m 47.000000 10.000000 l 50.724000 10.000000 l 50.724000 8.000000 l f 0.100000 slw @@ -416,30 +416,30 @@ [] 0 sd [] 0 sd 0 slc -n 17.544095 9.237859 4.743719 4.743719 93.554427 170.754606 ellipse s +n 17.544142 9.237863 4.743765 4.743765 93.554963 170.754749 ellipse s 0 slj -n 16.426740 14.322086 m 17.250000 13.972453 l 16.476338 13.523625 l f +n 16.426737 14.322126 m 17.250000 13.972500 l 16.476342 13.523665 l f 0.100000 slw [] 0 sd [] 0 sd 0 slc -n 43.739542 8.691284 5.286995 5.286995 14.331690 87.309911 ellipse s +n 43.428782 8.276789 5.699940 5.699940 17.597050 87.792656 ellipse s 0 slj -n 49.051524 10.874117 m 48.862000 10.000000 l 48.276420 10.676089 l f +n 49.001426 10.883493 m 48.862000 10.000000 l 48.238861 10.641637 l f 0.100000 slw [] 0 sd [] 0 sd 0 slc -n 22.237680 13.972453 m 27.096130 13.959822 l s +n 21.898320 13.972500 m 27.096100 13.959800 l s 0 slj -n 26.297172 14.361901 m 27.096130 13.959822 l 26.295092 13.561903 l f +n 26.297080 14.361753 m 27.096100 13.959800 l 26.295125 13.561756 l f 0.100000 slw [] 0 sd [] 0 sd 0 slc -n 33.781947 13.996742 m 38.931947 13.984242 l s +n 33.781900 13.996700 m 38.931900 13.984200 l s 0 slj -n 38.132920 14.386182 m 38.931947 13.984242 l 38.130978 13.586185 l f +n 38.132873 14.386141 m 38.931900 13.984200 l 38.130931 13.586143 l f /Times-Roman-latin1 ff 1.000000 scf sf (The value in) dup sw 2 div 12.000000 ex sub 1.000000 m gs 1 -1 sc sh gr (Host A's) dup sw 2 div 12.000000 ex sub 2.000000 m gs 1 -1 sc sh gr From ossp-cvs-owner@ossp.org Thu Aug 9 14:58:10 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f79Cw8I79027; Thu, 9 Aug 2001 14:58:08 +0200 (CEST) Date: Thu, 9 Aug 2001 14:58:08 +0200 (CEST) Message-Id: <200108091258.f79Cw8I79027@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds/docs libxds.tex Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 09-Aug-2001 14:58:08 Branch: HEAD Handle: 2001080913580800 Modified files: ossp-pkg/srpc/libxds/docs libxds.tex Log: Worked Ralf's comments in. Summary: Revision Changes Path 1.5 +197 -199 ossp-pkg/srpc/libxds/docs/libxds.tex ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/docs/libxds.tex ============================================================ $ cvs diff -u -r1.4 -r1.5 libxds.tex --- ossp-pkg/srpc/libxds/docs/libxds.tex 2001/08/08 13:12:28 1.4 +++ ossp-pkg/srpc/libxds/docs/libxds.tex 2001/08/09 12:58:08 1.5 @@ -1,6 +1,6 @@ % -*- mode: LaTeX; fill-column: 75; -*- % -% $Id: libxds.tex,v 1.4 2001/08/08 13:12:28 simons Exp $ +% $Id: libxds.tex,v 1.5 2001/08/09 12:58:08 simons Exp $ % \documentclass[a4paper,10pt,pointlessnumbers,bibtotoc]{scrartcl} \usepackage[dvips,xdvi]{graphicx} @@ -10,8 +10,8 @@ \begin{document} -\subject{Cable \& Wireless Application Development} -\title{XDS -- eXtensible Data Serialization} +\titlehead{Cable \& Wireless Deutschland GmbH\\Application Services\\Development Team} +\title{OSSP XDS ---\\eXtensible Data Serialization} \author{Peter Simons $<$simons@computer.org$>$} \date{2001-08-01} \maketitle @@ -33,24 +33,24 @@ get even more complicated when you start exchanging floating point numbers, for which about a dozen different encodings exist! -Solving these problems is the domain of libxds; its purpose is to encode -data in a way that allows this data to be exchanged between computer -systems of different types. Assume you'd want to reliably transfer the -value \$1234 from host A to host B. Then you would encode the value using -libxds, transfer the encoded data via the network, and decode the value -again at the other end. Every application that follows this process will -read the correct value no matter what native representation its hosting -platform uses internally. - \begin{figure}[tbh] \begin{center} \includegraphics[width=\textwidth]{data-exchange.eps} - \caption{Data exchange using libxds} + \caption{Data exchange using XDS} \label{data exchange} \end{center} \end{figure} + +Solving these problems is the domain of XDS; its purpose is to encode data +in a way that allows this data to be exchanged between computer systems of +different types. Assume you'd want to reliably transfer the value \$1234 +from host A to host B. Then you would encode the value using XDS, transfer +the encoded data over the network, and decode the value again at the other +end. Every application that follows this process will read the correct +value no matter what native representation its hosting platform uses +internally. -There is a rich variety of applications for such a functionality: libxds +There is a rich variety of applications for such a functionality: XDS may be used to encode data before it is written to disk or read from the disk, it may be used to encode data to be exchanged between processes over the network, etc. Because of this variety, special attention has been paid @@ -58,113 +58,112 @@ \paragraph{The library has been designed to be extensible.} The functionality is split into a generic encoding and decoding framework -and a set of formatting engines. These engines can be plugged into the -framework at run-time to actually encode and decode data. Because of this -architecture, libxds can be customized to deploy any data format the -developer sees fit. Included in the distribution are formatting engines for -the XDR format specified in \cite{xdr} and for the XML format specified in -\cite{xml}. +and a set of encoding and decoding engines. These engines can be plugged +into the framework at run-time to actually do the encoding and decoding of +data. Because of this architecture, XDS can be customized to deploy any +data format the developer sees fit. Included in the distribution are +engines for the XDR format specified in \cite{xdr} and for the XML format +specified in \cite{xml}. \paragraph{The library is convenient to use.} An arbitrary number of variables can be encoded or decoded with one single -function call. All memory management is done by libxds, the developer +function call. All memory management is done by XDS, the developer doesn't need bother to allocate or to manage buffers for the encoded or decoded data. Automatic buffer management can be switched off at run-time, though, for maximum performance. \paragraph{Performance.} -Since all transferred data has to wander through libxds, the library has -been written to encode and decode with maximim performance. The generic -encoding framework adds almost no run-time overhead to the encoding -process. If non-automatic buffer management has been selected, hardly -anything but the actual formatting engines is executed. +Since all transferred data has to wander through XDS, the library has been +written to encode and decode with maximum performance. The generic encoding +framework adds almost no run-time overhead to the encoding process. If +non-automatic buffer management has been selected, hardly anything but the +actual encoding/decoding engines is executed. \paragraph{Robustness.} In order to verify that the library is working correctly, a set of -regression tests is included in the distribution. The test suits will --- +regression tests is included in the distribution. The test suites will --- among other things --- encode known values and compare the result with the -expected (correct) values. This ensures that libxds works correctly on any +expected (correct) values. This ensures that XDS works correctly on any platform. \paragraph{Use standard formats.} -The supported formats XDR and XML and widely known and accepted formats, -which are most likely interoperable with other marshaling implementations. -For XDR for example, it would be possible to encode data with libxds and to -decode it with an entirely different XDR implementation or vice versa. +The supported XDR and XML formats are widely known and accepted, meaning +that they are interoperable with other marshaling implementations. For XDR +for instance, it would be possible to encode data with XDS and to decode it +with an entirely different XDR implementation or vice versa. \paragraph{Portability.} -libxds has been written with portability in mind. Development took place on -FreeBSD, Linux and Solaris; other platforms has been used to test the -results. It is expected that libxds will compile and function on virtually -any POSIX.1-compilant system with a moderately modern ISO-C compiler. Gnu's -CC (gcc) is known to compile the library just fine. For maximum -portability, GNU autoconf has been used to determine the target system's +XDS has been written with portability in mind. Development took place on +FreeBSD, Linux and Solaris; other platforms were used to test the results. +It is expected that XDS will compile and function on virtually any +POSIX.1-compliant system with a moderately modern ISO-C compiler. GNU's +C~Compiler~(gcc) is known to compile the library just fine. For maximum +portability, GNU Autoconf has been used to determine the target system's properties. -\section{Architecture of libxds} +\section{Architecture of XDS} \begin{figure}[htb] \begin{center} \includegraphics[width=\textwidth]{architecture.eps} - \caption{Components of libxds} - \label{libxds components} + \caption{Components of XDS} + \label{XDS components} \end{center} \end{figure} -The architecture of libxds is illustrated in figure~\ref{libxds -components}. libxds consists of three components: The generic encoding and -decoding framework, a set of formatting engines to encode and decode values -in a certain forman, and a run-time context, which is used to manage -buffers, registered engines, etc. +The architecture of XDS is illustrated in figure~\ref{XDS components}. XDS +consists of three components: The generic encoding and decoding framework, +a set of engines to encode and decode values in a certain format, and a +run-time context, which is used to manage buffers, registered engines, etc. In order to use the library, the first thing the developer has to do is to -create a valid XDS context by calling {\sf xds\_init()}. The routine +create a valid XDS context by calling \textsf{xds\_init()}. The routine requires one parameter that determines whether to operate in encoding- or decoding mode. A context can be used for encoding or decoding only; it is not possible to use the same context for both operations. Once a valid XDS -context has been obtained, the routine {\sf xds\_register()} can be used to -register an arbitrary number of formatting engines within the context. - -A set of formatting engines has been included in the library. These -routines will handle any elementary datatype included in the ISO-C language -such as 32-bit integers, 64-bit integers, unsigned integers (of both 32- -and 64-bit), floating point numbers, strings and octet streams. - -Once all required formatting engines are registered, the routines {\sf -xds\_encode()} or {\sf xds\_\-decode()} may be used to actually perform the -encoding or decoding process. Any data type for which a formatting engine +context has been obtained, the routine \textsf{xds\_register()} can be used to +register an arbitrary number of encoding or decoding engines within the +context. + +A set of engines has been included in the library. These routines will +handle any elementary datatype included in the ISO-C language such as +32-bit integers, 64-bit integers, unsigned integers (of both 32- and +64-bit), floating point numbers, strings and octet streams. + +Once all required encoding/decoding engines are registered, the routines +\textsf{xds\_encode()} or \textsf{xds\_\-decode()} may be used to actually +perform the encoding or decoding process. Any data type for which an engine has been registered can be handled by the library. -This means, that it is possible for the developer to write custom -formatting engines for any data type he desires to use and to register them -in the context as long as these engines adhere to the {\sf xds\_engine\_t} -interface defined in {\sf xds.h}. - -In particular it is possible to register meta formatting engines. That is a -formatting engine designed to encode or decode structures --- data types -which consist of several elementary data types. The formatting engine for -such a structure will simply re-use the existing engines in order to encode -or decode the whole structure. The clou here is that the meta engine -doesn't even need to know \emph{which} low-level formatting engines are -registered in order to use them. Hence, a meta engine may format the whole -structure in XDR, XML, or any other format without needing to know anything -about the details. +This means, that it is possible for the developer to write custom engines +for any data type he desires to use and to register them in the context as +long as these engines adhere to the \textsf{xds\_engine\_t} interface defined +in \textsf{xds.h}. + +In particular it is possible to register meta engines. That is an engine +designed to encode or decode structures --- data types which consist of +several elementary data types. The engine for such a structure will simply +re-use the existing engines in order to encode or decode the whole +structure. The clou here is that the meta engine doesn't even need to know +\emph{which} low-level engines are registered in order to use them. Hence, +a meta engine may format the whole structure in XDR, XML, or any other +format without needing to know anything about the details. This topic is addressed in great detail in section~\ref{meta engines} of this document, but before we come to that rather advanced topic, let us start by studying two simple examples of how data is encoded and decoded -using libxds. +using XDS. \section{Using the XDS library} \subsection{Encoding} The following example program will encode three variables using the XDR -formatting engines. The result of the process will then be written to the -standard output stream, which can be redirected to a file or piped into the -decoding program described in the next section. Just take a look at the -source code for a moment, we will then go on to discuss all relevant -sections line by line. +engines. The result of the process will then be written to the standard +output stream, which can be redirected to a file or piped into the decoding +program described in the next section. Just take a look at the source code +for a moment, we will then go on to discuss all relevant sections line by +line. \begin{Verbatim}[numbers=left,fontsize=\small,frame=lines] #include @@ -225,62 +224,64 @@ \paragraph{Lines 1--5.} The program starts by including several system headers, which define the prototypes for some routines we use. The most interesting header in our -case is of course {\sf xds.h} --- the header of libxds. Please note that -all declarations required to use libxds are included in that file. +case is of course \textsf{xds.h} --- the header of XDS. Please note that +all declarations required to use XDS are included in that file. \paragraph{Lines 7--13.} -The {\sf error\_exit()} routine is not relevant for the example; we just +The \textsf{error\_exit()} routine is not relevant for the example; we just define it to make the rest of the source code shorter and easier to read. \paragraph{Lines 16--53.} -This is the interesting part: The {\sf main()} routine. This function will +This is the interesting part: The \textsf{main()} routine. This function will create the variables to be encoded on the stack, assign values to them, initialize the XDS library, use it to encode the values, and write the result of the encoding process to the standard output stream. Read on for further details. \paragraph{Lines 26--28.} -First of all we have to obtain a XDS context for all further operation. -This is done by calling {\sf xds\_init()}. Since we intend to \emph{encode} +First of all we have to obtain an XDS context for all further operation. +This is done by calling \textsf{xds\_init()}. Since we intend to \emph{encode} data, we initialize the context in encoding mode. The only other mode of operation would be decoding mode, but this is demonstrated in the next section. -All routines in libxds return a code from a small list of return codes -defined in {\sf xds.h}, but {\sf xds\_init()} is different: It will return -a pointer to an {\sf xds\_t} in case of success and {\sf NULL} in case of -failure. One reason why {\sf xds\_init()} would fail is because it can't -allocate the memory required to initialize the context. In this case, the -system variable {\sf errno} is set to {\sf ENOMEM}. Another reason why {\sf -xds\_init()} would fail is because the mode parameter is invalid, in which -case {\sf errno} woulde be set to {\sf EINVAL}. If libxds has been compiled -with assertions enabled, such an error would result in an assertion error, -terminating the program with a diagnostic message immediately. +All routines in XDS return a code from a small list of return codes defined +in \textsf{xds.h}, but \textsf{xds\_init()} is different: It will return a +pointer to an \textsf{xds\_t} in case of success and \textsf{NULL} in case +of failure. One reason why \textsf{xds\_init()} would fail is because it +can't allocate the memory required to initialize the context. In this case, +the system variable \textsf{errno} is set to \textsf{ENOMEM}. Another +reason why \textsf{xds\_init()} would fail is because the mode parameter is +invalid, in which case \textsf{errno} woulde be set to \textsf{EINVAL}. If +XDS has been compiled with assertions enabled, such an error would result +in an assertion error, terminating the program with a diagnostic message +immediately. \paragraph{Lines 30--33.} -Once we have obtained a valid XDS context, we register the formatting -engines we need. In this example, we'll encode a signed 32-bit integer, an -unsigned 32-bit integer, and a string. We'll be using XDR encoding in this -case, so the engines to register are {\sf xdr\_encode\_int32()}, {\sf -xdr\_encode\_uint32()}, and {\sf xdr\_encode\_string()}. (A complete list -of available formatting engines can be found in {\sf xds.h} or in -section~\ref{xdr}~and~\ref{xml}. Please note that we could switch the -deployed encoding format simply be using the corresponding {\sf -xml\_encode\_XXX()} engines here. We could even mix XDR and XML encoding as -we see fit but it's hard to think of a case where this would make sense. +Once we have obtained a valid XDS context, we register the engines we need. +In this example, we'll encode a signed 32-bit integer, an unsigned 32-bit +integer, and a string. We'll be using XDR encoding in this case, so the +engines to register are \textsf{xdr\_encode\_int32()}, +\textsf{xdr\_encode\_uint32()}, and \textsf{xdr\_encode\_string()}. (A +complete list of available engines can be found in \textsf{xds.h}, in +section~\ref{xdr}~and~\ref{xml}, or in the manual pages for the library. +Please note that we could switch the deployed encoding format simply be +using the corresponding \textsf{xml\_encode\_XXX()} engines here. We could +even mix XDR and XML encoding as we see fit but it's hard to think of a +case where this would make sense. As you can see in the code, the developer is free to choose a name he'd like to register the engine under. These names may only contain -alphanumerical characters plus the hyphon (``\verb#-#'') and the underscore +alphanumerical characters plus the hyphen (``\verb#-#'') and the underscore (``\verb#_#''). You can choose any name you want, but it is recommended to -follow the naming scheme of the corresponding formatting engine. Why this -is recommended will be seen in section~\ref{meta engines}. +follow the naming scheme of the corresponding engine. Why this is +recommended will be seen in section~\ref{meta engines}. \paragraph{Lines 35--36.} This is the place where the actual encoding takes place. As parameters, -{\sf xds\_encode()} requires a valid encoding context plus a format string +\textsf{xds\_encode()} requires a valid encoding context plus a format string that describes how the following parameters are to be interpreted. While -the concept is obviously identical to {\sf sprintf()}, the syntax is +the concept is obviously identical to \textsf{sprintf()}, the syntax is different. The format string may contain an arbitrary number of names, which are delimited by an arbitrary number of any character that is not a legal character for engine names. Thus you can delimit the names by colons, @@ -288,70 +289,69 @@ For each valid engine name in the format string, a corresponding parameter must follow. What these parameters mean depends on the engine you're using. -The engines provided with the libxds library will expect the value to -encode, but theoretically developers are free to write formatting engines -that expect virtually any kind of information here. More about this will -explained in section~\ref{meta engines}. +The engines provided with the XDS library will expect the value to encode, +but theoretically developers are free to write encoding and decoding +engines that expect virtually any kind of information here. More about this +will explained in section~\ref{meta engines}. \paragraph{Lines 38--39.} We have encoded all values we wanted to encode, now we can get the result -from the library. This happens by calling {\sf xds\_getbuffer()}. The +from the library. This happens by calling \textsf{xds\_getbuffer()}. The routine will store the buffer's address and length at the locations we provided as parameters. Please note that we can choose whether we want the -buffer as a ``gift'' ({\sf XDS\_GIFT}) or as a ``loan'' ({\sf XDS\_LOAN}). +buffer as a ``gift'' (\textsf{XDS\_GIFT}) or as a ``loan'' (\textsf{XDS\_LOAN}). The buffer being a ``loan'' means that the buffer is still owned by the -library -- we're only allowed to peak at it. But any call to an libxds +library --- we're only allowed to peak at it. But any call to an XDS routine may potentially modify the buffer or even change the buffers -location. Hence the result of a {\sf xds\_getbuffer()} call with loaning -semantics is only valid until the next libxds routine is called. After +location. Hence the result of a \textsf{xds\_getbuffer()} call with loaning +semantics is only valid until the next XDS routine is called. After that, it is invalid. If we choose the gift semantics, the buffer we receive will be owned by us; the library will not touch the buffer again. This means of course, that -we're responsible for {\sf free()}ing the buffer when we don't need it +we're responsible for \textsf{free()}ing the buffer when we don't need it anymore. \paragraph{Line 41.} Destroy the XDS context and all data associated with it. This is possible because we requested the buffer as ``gift''; the buffer is not associated -with libxds anymore. +with XDS anymore. \paragraph{Line 43.} Write the buffer with the encoded data to the standard output stream. \paragraph{Line 45.} Now that we don't need the buffer anymore, we have to return the memory it -uses to the system. libxds won't do that for us. +uses to the system. XDS won't do that for us. \paragraph{Lines 47--50.} Write a short report of what we have done to the standard error channel. \bigskip Finally, let us compile and execute the example program shown above. For -convenience, it is included in the distribution under the name {\sf -docs/encode.c}. You can compile and execute the program as follows: +convenience, it is included in the distribution under the name +\textsf{docs/encode.c}. You can compile and execute the program as follows: \begin{quote} \begin{verbatim} -simons@dev13:~/libxds$ cd docs -simons@dev13:~/libxds/docs$ gcc -I.. encode.c -o encode -L.. -lxds -simons@dev13:~/libxds/docs$ ./encode >output +$ gcc -I.. encode.c -o encode -L.. -lxds +$ ./encode >output Encoded data: int32 = -42 uint32 = 0x12345678 string = "This is a test." -simons@dev13:~/libxds/docs$ ls -l output +$ ls -l output -rw-r--r-- 1 simons simons 28 Aug 2 15:21 output \end{verbatim} \end{quote} -The result of executing the programm --- the file {\sf output} --- can be -displayed with {\sf hexdump(1)} or {\sf od(1)} and should look like this: +The result of executing the programm --- the file \textsf{output} --- can be +displayed with \textsf{hexdump(1)} or \textsf{od(1)} and should look like this: \begin{quote} \begin{Verbatim}[fontsize=\small] -simons@dev13:~/libxds/docs$ hexdump -C output +$ hexdump -C output 00000000 ff ff ff d6 12 34 56 78 00 00 00 0f 54 68 69 73 |.....4Vx....This| 00000010 20 69 73 20 61 20 74 65 73 74 2e 00 | is a test..| 0000001c @@ -442,15 +442,15 @@ \end{Verbatim} \paragraph{Lines 1--25.} -Include the required header files, define the {\sf error\_exit()} helper +Include the required header files, define the \textsf{error\_exit()} helper function, and create the required variables on the stack. \paragraph{Lines 27--39.} These instructions will read an unspecified number of bytes from the standard input stream --- as long as the input does not exceed the size of -the {\sf buffer} variable. In order to provide the program with the -apropriate input, redirect the standard input stream to the file {\sf -output} created in the previous section or connect the encoding and +the \textsf{buffer} variable. In order to provide the program with the +appropriate input, redirect the standard input stream to the file +\textsf{output} created in the previous section or connect the encoding and decoding programs directly by a pipe. \paragraph{Lines 41-43.} @@ -468,34 +468,34 @@ Here we do not get a buffer from the library, we \emph{set} the buffer we've read earlier in the context for decoding. Please note that we use loan semantics in this case, not gift semantics. This is necessary because -{\sf buffer} has not been allocated by {\sf malloc()} --- the variable -lives on the stack. This means that we cannot give it to libxds because -libxds expects to be able to {\sf free()} the buffer when the context is +\textsf{buffer} has not been allocated by \textsf{malloc()} --- the variable +lives on the stack. This means that we cannot give it to XDS because +XDS expects to be able to \textsf{free()} the buffer when the context is destroyed. Loan semantics are fine, though, all we have to do is to take care that we -don't erase or modify the contents of {\sf buffer} while libxds operates on +don't erase or modify the contents of \textsf{buffer} while XDS operates on it. The library itself will never touch the buffer in decode mode, no matter whether loan or gift semantics have been chosen. \paragraph{Lines 53--54.} Here come the actual decoding of the buffer's contents using {\sf -xds\_decode()}. The syntax is identical to {\sf xds\_encode()}'s, the only +xds\_decode()}. The syntax is identical to \textsf{xds\_encode()}'s, the only difference is that the decoding engines do not expect the values --- like the encoding engines did --- but the location where to store the value. -Thus we pass the addresses of the apropriate variables here. If the routine -returns with {\sf XDS\_OK}, the decoded values will have been stored in +Thus we pass the addresses of the appropriate variables here. If the routine +returns with \textsf{XDS\_OK}, the decoded values will have been stored in those locations. It should be noted that the decoded string cannot trivially be returned -this way. Instead, {\sf xds\_decode()} will use {\sf malloc()} to allocate +this way. Instead, \textsf{xds\_decode()} will use \textsf{malloc()} to allocate a buffer barely large enough to hold the string. The address of that buffer -is then stored in the pointer {\sf string}. Of course this means that the -application has to {\sf free()} the string once it's not required anymore. +is then stored in the pointer \textsf{string}. Of course this means that the +application has to \textsf{free()} the string once it's not required anymore. \paragraph{Line 56.} We don't need the context anymore, so we destroy it and free all used -resources. This does not affect {\sf buffer} in any way because we used +resources. This does not affect \textsf{buffer} in any way because we used loan semantics. \paragraph{Lines 58-61.} @@ -503,19 +503,18 @@ a look at them. \paragraph{Line 63.} -Now that we don't need the contents of {\sf string} anymore, we must return -the buffer allocated in {\sf xds\_decode()} to the system. +Now that we don't need the contents of \textsf{string} anymore, we must return +the buffer allocated in \textsf{xds\_decode()} to the system. \bigskip Like the encoding program described earlier, the source code to this -program is included in the library distribution as {\sf docs/decode.c}. You -can compile and execute the program like this: +program is included in the library distribution as \textsf{docs/decode.c}. +You can compile and execute the program like this: \begin{quote} \begin{verbatim} -simons@dev13:~/libxds$ cd docs -simons@dev13:~/libxds/docs$ gcc -I.. decode.c -o decode -L.. -lxds -simons@dev13:~/libxds/docs$ ./decode From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds/docs libxds.tex Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 09-Aug-2001 15:38:01 Branch: HEAD Handle: 2001080914380000 Modified files: ossp-pkg/srpc/libxds/docs libxds.tex Log: Added section about frequently asked questions. Currently, only the design decision agains encoding and decoding with the same XDS context is documented. Summary: Revision Changes Path 1.6 +57 -1 ossp-pkg/srpc/libxds/docs/libxds.tex ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/docs/libxds.tex ============================================================ $ cvs diff -u -r1.5 -r1.6 libxds.tex --- ossp-pkg/srpc/libxds/docs/libxds.tex 2001/08/09 12:58:08 1.5 +++ ossp-pkg/srpc/libxds/docs/libxds.tex 2001/08/09 13:38:00 1.6 @@ -1,6 +1,6 @@ % -*- mode: LaTeX; fill-column: 75; -*- % -% $Id: libxds.tex,v 1.5 2001/08/09 12:58:08 simons Exp $ +% $Id: libxds.tex,v 1.6 2001/08/09 13:38:00 simons Exp $ % \documentclass[a4paper,10pt,pointlessnumbers,bibtotoc]{scrartcl} \usepackage[dvips,xdvi]{graphicx} @@ -1000,6 +1000,62 @@ stack, but these behave differently because the length of the decoded data is not known in advance and the application cannot provide a buffer that's guaranteed to suffice. + +\section{Frequently Asked Questions} + +\subsection{Why do we have separate encoding and decoding modes?} + +Some users complained about having to maintain separate XDS contexts for +encoding and decoding. They wondered, why it is not possible to encode and +decode with a single XDS context. The reason is that this limitatiton makes +the XDS context structure and the programmer API for XDS much simpler. If +we were able to use a single context for encoding and decoding, we had to +maintain \emph{two} lists of registered engines per XDS context: One set of +encoding engines and one set of decoding engines. Consequently, the +\textsf{xds\_register()} function would need to take an additional +parameter, which determines whether you're registering an encoding or an +decoding engine. All this is not necessary in the current design, because +one list of registered engines suffices. + +Another important topic is buffer management. The buffer handling in +encoding mode is subtly different from that in encoding mode: The XDS +context contains a buffer, the size of that buffer and a kind of ``current +position'' pointer. When an engine stores, say, 8 bytes of encoded data in +the buffer, \textsf{xds\_vencode()} will increase the ``current position'' +by 8 bytes --- the next encoding engine will append its encoded data at the +end of the buffer. If the ``current position'' reaches the end of the +buffer, the buffer is reallocated with an appropriately bigger size. + +In decoding mode, the same variables in the XDS context have a different +meaning: Since the buffer is never going to be resized, the buffer size +does not correspond to the size of the memory chunk that constitutes the +buffer, it says how many bytes of information the buffer contains; it's the +length of the contents. The ``current position'' is initialized at the +beginning of the buffer and every time an engine claims to have decoded, +say, 8 bytes from the buffer, the ``current position'' is increased by 8 +bytes towards the end of the buffer. If the ``current position'' reaches +the end of the buffer's contents, an \textsf{XDS\_UNDERFLOW} error is +returned. + +Buffer handling is different in encoding and decoding mode in so far as +that in encoding mode, the initial buffer is empty and the current position +moves with the end of the content, determining where new data should be +appended. In decoding mode, the initial buffer is filled and the current +position wanders from the beginning to the end of the content. + +Thus, if an XDS context should be used for both encoding and decoding, the +library had to manage two different buffers because the encoding and +decoding buffers have different semantics. Thus, the +\textsf{xds\_setbuffer()} and \textsf{xds\_getbuffer()} routines would need +an additional parameter in order to set the two buffers independently. + +Considering all that, we found that the current design greatly reduces the +complexity of the implementation and of the API while putting the user only +through minimum inconvenience. + +\subsection{What are those xds\_int-something types good for?} + +\subsection{Why do I have to register the engines manually?} \begin{thebibliography}{xxx} From ossp-cvs-owner@ossp.org Thu Aug 9 15:53:48 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f79Drl987166; Thu, 9 Aug 2001 15:53:47 +0200 (CEST) Date: Thu, 9 Aug 2001 15:53:47 +0200 (CEST) Message-Id: <200108091353.f79Drl987166@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds/docs libxds.tex Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 09-Aug-2001 15:53:47 Branch: HEAD Handle: 2001080914534700 Modified files: ossp-pkg/srpc/libxds/docs libxds.tex Log: Added another subsection to the FAQ chapter. Summary: Revision Changes Path 1.7 +49 -2 ossp-pkg/srpc/libxds/docs/libxds.tex ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/docs/libxds.tex ============================================================ $ cvs diff -u -r1.6 -r1.7 libxds.tex --- ossp-pkg/srpc/libxds/docs/libxds.tex 2001/08/09 13:38:00 1.6 +++ ossp-pkg/srpc/libxds/docs/libxds.tex 2001/08/09 13:53:47 1.7 @@ -1,6 +1,6 @@ % -*- mode: LaTeX; fill-column: 75; -*- % -% $Id: libxds.tex,v 1.6 2001/08/09 13:38:00 simons Exp $ +% $Id: libxds.tex,v 1.7 2001/08/09 13:53:47 simons Exp $ % \documentclass[a4paper,10pt,pointlessnumbers,bibtotoc]{scrartcl} \usepackage[dvips,xdvi]{graphicx} @@ -1055,7 +1055,54 @@ \subsection{What are those xds\_int-something types good for?} -\subsection{Why do I have to register the engines manually?} +\subsection{Why do I have to register all the engines manually?} + +One idea that came up during the design of the API was to provide a way to +register all elementary XML or XDR engines with a single function call, +something like this: + % +\begin{quote} +\begin{verbatim} +xds = xds_init(XDS_ENCODE, XDS_XML); /* Use the XML engines. */ +xds = xds_init(XDS_ENCODE, XDS_XDR); /* Use the XDR engines. */ +\end{verbatim} +\end{quote} + % +The advantage of this approach is that the application developer does not +need to bother about registering some obscure functions like +\textsf{xdr\_encode\_octetstream()}. We dismissed the idea nonetheless for +the following reasons: + +\begin{itemize} + +\item Since the library is meant to be extensible, the \textsf{xds\_init()} +has no (good) way of knowing which engines actually exist for an encoding +scheme. Suppose someone writes a whole set of engines that implement the +CORBA format, then he would not be able to register his engines without +re-writing \textsf{xds\_init()}. + +\item On a similar note, the \textsf{xds\_init()} would not know about the +meta engines required by the application developer. The call outlined above +would only register the engines for the elementary data types, for the very +good reason that the meta engines do not even ``exist'' when the XDS +library is compiled. + +\item This approach would make it hard to mix engines from different +formats. If all engines are registered manually, the application programmer +may chose to use the XDR format for encoding all kinds of integers, but to +use the XML format for encoding strings, octet streams, or floating point +numbers. + +\item If one routine would reference all engines of an encoding format, it +meant that all engines of that format were linked into the binary once the +application accesses that routine. It would not be possible to, say, +register the engines dealing with integers without pulling the floating +point engines into the program too --- even though nobody uses them. + +\end{itemize} + + + \begin{thebibliography}{xxx} From ossp-cvs-owner@ossp.org Thu Aug 9 15:55:42 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f79Dtfn87347; Thu, 9 Aug 2001 15:55:41 +0200 (CEST) Date: Thu, 9 Aug 2001 15:55:41 +0200 (CEST) Message-Id: <200108091355.f79Dtfn87347@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds/docs libxds.tex Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 09-Aug-2001 15:55:41 Branch: HEAD Handle: 2001080914554000 Modified files: ossp-pkg/srpc/libxds/docs libxds.tex Log: Changed the link to XML in the references section. Summary: Revision Changes Path 1.8 +2 -5 ossp-pkg/srpc/libxds/docs/libxds.tex ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/docs/libxds.tex ============================================================ $ cvs diff -u -r1.7 -r1.8 libxds.tex --- ossp-pkg/srpc/libxds/docs/libxds.tex 2001/08/09 13:53:47 1.7 +++ ossp-pkg/srpc/libxds/docs/libxds.tex 2001/08/09 13:55:40 1.8 @@ -1,6 +1,6 @@ % -*- mode: LaTeX; fill-column: 75; -*- % -% $Id: libxds.tex,v 1.7 2001/08/09 13:53:47 simons Exp $ +% $Id: libxds.tex,v 1.8 2001/08/09 13:55:40 simons Exp $ % \documentclass[a4paper,10pt,pointlessnumbers,bibtotoc]{scrartcl} \usepackage[dvips,xdvi]{graphicx} @@ -1101,15 +1101,12 @@ \end{itemize} - - - \begin{thebibliography}{xxx} \bibitem{xdr} RFC 1832: ``XDR: External Data Representation Standard'', R.~Srinivasan, August~1995 -\bibitem{xml} \textsf{http://www.ossp.org/pkg/xds/xds-xml.dtd} +\bibitem{xml} XML-RPC Home Page: \textsf{http://www.xmlrpc.org/} \end{thebibliography} From ossp-cvs-owner@ossp.org Thu Aug 9 16:12:01 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f79EC0U91407; Thu, 9 Aug 2001 16:12:00 +0200 (CEST) Date: Thu, 9 Aug 2001 16:12:00 +0200 (CEST) Message-Id: <200108091412.f79EC0U91407@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds/docs libxds.tex Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 09-Aug-2001 16:12:00 Branch: HEAD Handle: 2001080915120000 Modified files: ossp-pkg/srpc/libxds/docs libxds.tex Log: Completed the FAQ section. Summary: Revision Changes Path 1.9 +15 -1 ossp-pkg/srpc/libxds/docs/libxds.tex ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/docs/libxds.tex ============================================================ $ cvs diff -u -r1.8 -r1.9 libxds.tex --- ossp-pkg/srpc/libxds/docs/libxds.tex 2001/08/09 13:55:40 1.8 +++ ossp-pkg/srpc/libxds/docs/libxds.tex 2001/08/09 14:12:00 1.9 @@ -1,6 +1,6 @@ % -*- mode: LaTeX; fill-column: 75; -*- % -% $Id: libxds.tex,v 1.8 2001/08/09 13:55:40 simons Exp $ +% $Id: libxds.tex,v 1.9 2001/08/09 14:12:00 simons Exp $ % \documentclass[a4paper,10pt,pointlessnumbers,bibtotoc]{scrartcl} \usepackage[dvips,xdvi]{graphicx} @@ -1055,6 +1055,16 @@ \subsection{What are those xds\_int-something types good for?} +The XDS library uses the data types \textsf{xds\_int32\_t}, etc. rather +than \textsf{int}. This is necessary because we need to have a definive +size for each data type. In ISO-C, though, the actual size of an +\textsf{int} is undefined. In theory, the system header +\textsf{sys/types.h} defines types with fixed sizes, but unfortunately the +names of these data types vary from vendor to vendor. To solve that, we +defined our own data types. The application programmer might want to take a +look at the top few lines of the \textsf{xds.h} include file to see how the +actual data types are mapped to the \textsf{xds\_xxx\_t} variant. + \subsection{Why do I have to register all the engines manually?} One idea that came up during the design of the API was to provide a way to @@ -1098,6 +1108,10 @@ application accesses that routine. It would not be possible to, say, register the engines dealing with integers without pulling the floating point engines into the program too --- even though nobody uses them. + +The author of this document wishes to remark, though, that this property of +the library was later uh \dots{} removed by the decision of the team leader +to merge all engines into one source module per format. Sorry. \end{itemize} From ossp-cvs-owner@ossp.org Thu Aug 9 16:59:09 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f79Ex8a99250; Thu, 9 Aug 2001 16:59:08 +0200 (CEST) Date: Thu, 9 Aug 2001 16:59:08 +0200 (CEST) Message-Id: <200108091459.f79Ex8a99250@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds/docs libxds.tex Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 09-Aug-2001 16:59:08 Branch: HEAD Handle: 2001080915590700 Modified files: ossp-pkg/srpc/libxds/docs libxds.tex Log: Added paragraph about the need of fixed size data types. Summary: Revision Changes Path 1.10 +13 -2 ossp-pkg/srpc/libxds/docs/libxds.tex ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/docs/libxds.tex ============================================================ $ cvs diff -u -r1.9 -r1.10 libxds.tex --- ossp-pkg/srpc/libxds/docs/libxds.tex 2001/08/09 14:12:00 1.9 +++ ossp-pkg/srpc/libxds/docs/libxds.tex 2001/08/09 14:59:07 1.10 @@ -1,6 +1,6 @@ % -*- mode: LaTeX; fill-column: 75; -*- % -% $Id: libxds.tex,v 1.9 2001/08/09 14:12:00 simons Exp $ +% $Id: libxds.tex,v 1.10 2001/08/09 14:59:07 simons Exp $ % \documentclass[a4paper,10pt,pointlessnumbers,bibtotoc]{scrartcl} \usepackage[dvips,xdvi]{graphicx} @@ -563,7 +563,17 @@ \end{verbatim} \end{quote} -In order to encode an instance of this structure, we first write an +Some readers might wonder why the structure is defined using these weird +data types rather than the familiar ones like \textsf{int}, \textsf{long}, +etc. The reason is that these data types have an undefined size. An +\textsf{int} variable will have, say, 32 bits when compiled on the average +Unix machine, but when the same source is compiled on a 64-bit machine, +like TRUE64 Unix, it will have a size of 64 bit. That is a problem when +those structures have to be exchanged between entirely different systems, +because the structures are binary incompatible --- something even XDS +cannot remedy. + +Anyway, in order to encode an instance of this structure, we write an encoding engine: \begin{quote} @@ -1054,6 +1064,7 @@ through minimum inconvenience. \subsection{What are those xds\_int-something types good for?} +\label{xds int stuff} The XDS library uses the data types \textsf{xds\_int32\_t}, etc. rather than \textsf{int}. This is necessary because we need to have a definive From ossp-cvs-owner@ossp.org Thu Aug 9 17:23:30 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f79FNSD02972; Thu, 9 Aug 2001 17:23:28 +0200 (CEST) Date: Thu, 9 Aug 2001 17:23:28 +0200 (CEST) Message-Id: <200108091523.f79FNSD02972@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds/docs libxds.tex Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 09-Aug-2001 17:23:28 Branch: HEAD Handle: 2001080916232800 Modified files: ossp-pkg/srpc/libxds/docs libxds.tex Log: Fixed length of input and output data for the XML engines. Summary: Revision Changes Path 1.11 +25 -25 ossp-pkg/srpc/libxds/docs/libxds.tex ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/docs/libxds.tex ============================================================ $ cvs diff -u -r1.10 -r1.11 libxds.tex --- ossp-pkg/srpc/libxds/docs/libxds.tex 2001/08/09 14:59:07 1.10 +++ ossp-pkg/srpc/libxds/docs/libxds.tex 2001/08/09 15:23:28 1.11 @@ -1,6 +1,6 @@ % -*- mode: LaTeX; fill-column: 75; -*- % -% $Id: libxds.tex,v 1.10 2001/08/09 14:59:07 simons Exp $ +% $Id: libxds.tex,v 1.11 2001/08/09 15:23:28 simons Exp $ % \documentclass[a4paper,10pt,pointlessnumbers,bibtotoc]{scrartcl} \usepackage[dvips,xdvi]{graphicx} @@ -954,16 +954,16 @@ \begin{tabular}{|c|c|c|c|} \hline \bf Function Name & \bf Expected ``args'' Datatype & \bf Input & \bf Output \\ \hline -xdr\_encode\_uint32() & xds\_uint32\_t & 4 byte & 4 byte \\ -xdr\_decode\_uint32() & xds\_uint32\_t* & 4 byte & 4 byte \\[1ex] -xdr\_encode\_int32() & xds\_int32\_t & 4 byte & 4 byte \\ -xdr\_decode\_int32() & xds\_int32\_t* & 4 byte & 4 byte \\[1ex] -xdr\_encode\_uint64() & xds\_uint64\_t & 4 byte & 4 byte \\ -xdr\_decode\_uint64() & xds\_uint64\_t* & 4 byte & 4 byte \\[1ex] -xdr\_encode\_int64() & xds\_int64\_t & 4 byte & 4 byte \\ -xdr\_decode\_int64() & xds\_int64\_t* & 4 byte & 4 byte \\[1ex] -xdr\_encode\_double() & xds\_double\_t & ?? byte & ?? byte \\ -xdr\_decode\_double() & xds\_double\_t* & ?? byte & ?? byte \\[1ex] +xdr\_encode\_uint32() & xds\_uint32\_t & 4 bytes & 4 bytes \\ +xdr\_decode\_uint32() & xds\_uint32\_t* & 4 bytes & 4 bytes \\[1ex] +xdr\_encode\_int32() & xds\_int32\_t & 4 bytes & 4 bytes \\ +xdr\_decode\_int32() & xds\_int32\_t* & 4 bytes & 4 bytes \\[1ex] +xdr\_encode\_uint64() & xds\_uint64\_t & 4 bytes & 4 bytes \\ +xdr\_decode\_uint64() & xds\_uint64\_t* & 4 bytes & 4 bytes \\[1ex] +xdr\_encode\_int64() & xds\_int64\_t & 4 bytes & 4 bytes \\ +xdr\_decode\_int64() & xds\_int64\_t* & 4 bytes & 4 bytes \\[1ex] +xdr\_encode\_double() & xds\_double\_t & ?? bytes & ?? bytes \\ +xdr\_decode\_double() & xds\_double\_t* & ?? bytes & ?? bytes \\[1ex] xdr\_encode\_octetstream() & void*, size\_t & variable & variable \\ xdr\_decode\_octetstream() & void**, size\_t* & variable & variable \\[1ex] xdr\_encode\_string() & char* & variable & variable \\ @@ -985,20 +985,20 @@ \begin{tabular}{|c|c|c|c|} \hline \bf Function Name & \bf Expected ``args'' Datatype & \bf Input & \bf Output \\ \hline -xml\_encode\_uint32() & xds\_uint32\_t & ?? byte & ?? byte \\ -xml\_decode\_uint32() & xds\_uint32\_t* & ?? byte & ?? byte \\[1ex] -xml\_encode\_int32() & xds\_int32\_t & ?? byte & ?? byte \\ -xml\_decode\_int32() & xds\_int32\_t* & ?? byte & ?? byte \\[1ex] -xml\_encode\_uint64() & xds\_uint64\_t & ?? byte & ?? byte \\ -xml\_decode\_uint64() & xds\_uint64\_t* & ?? byte & ?? byte \\[1ex] -xml\_encode\_int64() & xds\_int64\_t & ?? byte & ?? byte \\ -xml\_decode\_int64() & xds\_int64\_t* & ?? byte & ?? byte \\[1ex] -xml\_encode\_double() & xds\_double\_t & ?? byte & ?? byte \\ -xml\_decode\_double() & xds\_double\_t* & ?? byte & ?? byte \\[1ex] -xml\_encode\_octetstream() & void*, size\_t & variable & variable \\ -xml\_decode\_octetstream() & void**, size\_t* & variable & variable \\[1ex] -xml\_encode\_string() & char* & variable & variable \\ -xml\_decode\_string() & char** & variable & variable \\ \hline +xml\_encode\_uint32() & xds\_uint32\_t & 4 bytes & 18--27 bytes \\ +xml\_decode\_uint32() & xds\_uint32\_t* & 18--27 bytes & 4 bytes \\[1ex] +xml\_encode\_int32() & xds\_int32\_t & 4 bytes & 16--26 bytes \\ +xml\_decode\_int32() & xds\_int32\_t* & 16--26 bytes & 4 bytes \\[1ex] +xml\_encode\_uint64() & xds\_uint64\_t & 8 bytes & 18--37 bytes \\ +xml\_decode\_uint64() & xds\_uint64\_t* & 18--37 bytes & 8 bytes \\[1ex] +xml\_encode\_int64() & xds\_int64\_t & 8 bytes & 16--36 bytes \\ +xml\_decode\_int64() & xds\_int64\_t* & 16--36 bytes & 8 bytes \\[1ex] +xml\_encode\_double() & xds\_double\_t & ?? bytes & ?? bytes \\ +xml\_decode\_double() & xds\_double\_t* & ?? bytes & ?? bytes \\[1ex] +xml\_encode\_octetstream() & void*, size\_t & variable & variable \\ +xml\_decode\_octetstream() & void**, size\_t* & variable & variable \\[1ex] +xml\_encode\_string() & char* & variable & variable \\ +xml\_decode\_string() & char** & variable & variable \\ \hline \end{tabular} \medskip From ossp-cvs-owner@ossp.org Thu Aug 9 17:25:58 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f79FPve03242; Thu, 9 Aug 2001 17:25:57 +0200 (CEST) Date: Thu, 9 Aug 2001 17:25:57 +0200 (CEST) Message-Id: <200108091525.f79FPve03242@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds/docs extended.c libxds.tex Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 09-Aug-2001 17:25:57 Branch: HEAD Handle: 2001080916255700 Modified files: ossp-pkg/srpc/libxds/docs extended.c libxds.tex Log: The assert() in extended.c is wrong because it is not invariable but depends on "user input". Use "if" instead. Summary: Revision Changes Path 1.2 +5 -1 ossp-pkg/srpc/libxds/docs/extended.c 1.12 +6 -2 ossp-pkg/srpc/libxds/docs/libxds.tex ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/docs/extended.c ============================================================ $ cvs diff -u -r1.1 -r1.2 extended.c --- ossp-pkg/srpc/libxds/docs/extended.c 2001/08/08 13:13:11 1.1 +++ ossp-pkg/srpc/libxds/docs/extended.c 2001/08/09 15:25:57 1.2 @@ -35,7 +35,11 @@ &tmp, &i); if (rc == XDS_OK) { - assert(i == sizeof(ms->text)); + if (i != sizeof(ms->text)) + { + free(tmp); + return XDS_ERR_TYPE_MISMATCH; + } memmove(ms->text, tmp, i); free(tmp); } Index: ossp-pkg/srpc/libxds/docs/libxds.tex ============================================================ $ cvs diff -u -r1.11 -r1.12 libxds.tex --- ossp-pkg/srpc/libxds/docs/libxds.tex 2001/08/09 15:23:28 1.11 +++ ossp-pkg/srpc/libxds/docs/libxds.tex 2001/08/09 15:25:57 1.12 @@ -1,6 +1,6 @@ % -*- mode: LaTeX; fill-column: 75; -*- % -% $Id: libxds.tex,v 1.11 2001/08/09 15:23:28 simons Exp $ +% $Id: libxds.tex,v 1.12 2001/08/09 15:25:57 simons Exp $ % \documentclass[a4paper,10pt,pointlessnumbers,bibtotoc]{scrartcl} \usepackage[dvips,xdvi]{graphicx} @@ -709,7 +709,11 @@ &tmp, &i); if (rc == XDS_OK) { - assert(i == sizeof(ms->text)); + if (i != sizeof(ms->text)) + { + free(tmp); + return XDS_ERR_TYPE_MISMATCH; + } memmove(ms->text, tmp, i); free(tmp); } From ossp-cvs-owner@ossp.org Thu Aug 9 17:30:00 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f79FTxV03945; Thu, 9 Aug 2001 17:29:59 +0200 (CEST) Date: Thu, 9 Aug 2001 17:29:59 +0200 (CEST) Message-Id: <200108091529.f79FTxV03945@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds/docs extended.c libxds.tex Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 09-Aug-2001 17:29:59 Branch: HEAD Handle: 2001080916295800 Modified files: ossp-pkg/srpc/libxds/docs extended.c libxds.tex Log: Made the code in extended.c more elegant. Summary: Revision Changes Path 1.3 +4 -6 ossp-pkg/srpc/libxds/docs/extended.c 1.13 +5 -7 ossp-pkg/srpc/libxds/docs/libxds.tex ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/docs/extended.c ============================================================ $ cvs diff -u -r1.2 -r1.3 extended.c --- ossp-pkg/srpc/libxds/docs/extended.c 2001/08/09 15:25:57 1.2 +++ ossp-pkg/srpc/libxds/docs/extended.c 2001/08/09 15:29:58 1.3 @@ -35,12 +35,10 @@ &tmp, &i); if (rc == XDS_OK) { - if (i != sizeof(ms->text)) - { - free(tmp); - return XDS_ERR_TYPE_MISMATCH; - } - memmove(ms->text, tmp, i); + if (i == sizeof(ms->text)) + memmove(ms->text, tmp, i); + else + rc = XDS_ERR_TYPE_MISMATCH; free(tmp); } return rc; Index: ossp-pkg/srpc/libxds/docs/libxds.tex ============================================================ $ cvs diff -u -r1.12 -r1.13 libxds.tex --- ossp-pkg/srpc/libxds/docs/libxds.tex 2001/08/09 15:25:57 1.12 +++ ossp-pkg/srpc/libxds/docs/libxds.tex 2001/08/09 15:29:58 1.13 @@ -1,6 +1,6 @@ % -*- mode: LaTeX; fill-column: 75; -*- % -% $Id: libxds.tex,v 1.12 2001/08/09 15:25:57 simons Exp $ +% $Id: libxds.tex,v 1.13 2001/08/09 15:29:58 simons Exp $ % \documentclass[a4paper,10pt,pointlessnumbers,bibtotoc]{scrartcl} \usepackage[dvips,xdvi]{graphicx} @@ -709,12 +709,10 @@ &tmp, &i); if (rc == XDS_OK) { - if (i != sizeof(ms->text)) - { - free(tmp); - return XDS_ERR_TYPE_MISMATCH; - } - memmove(ms->text, tmp, i); + if (i == sizeof(ms->text)) + memmove(ms->text, tmp, i); + else + rc = XDS_ERR_TYPE_MISMATCH; free(tmp); } return rc; From ossp-cvs-owner@ossp.org Thu Aug 9 17:35:24 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f79FZOv05006; Thu, 9 Aug 2001 17:35:24 +0200 (CEST) Date: Thu, 9 Aug 2001 17:35:24 +0200 (CEST) Message-Id: <200108091535.f79FZOv05006@ossp.org> From: "Peter Simons" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds/docs libxds.tex Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Peter Simons Root: /e/ossp/cvs Email: simons@computer.org Module: ossp-pkg Date: 09-Aug-2001 17:35:24 Branch: HEAD Handle: 2001080916352300 Modified files: ossp-pkg/srpc/libxds/docs libxds.tex Log: Made the "xds_int-something" section more clear. Summary: Revision Changes Path 1.14 +3 -2 ossp-pkg/srpc/libxds/docs/libxds.tex ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/docs/libxds.tex ============================================================ $ cvs diff -u -r1.13 -r1.14 libxds.tex --- ossp-pkg/srpc/libxds/docs/libxds.tex 2001/08/09 15:29:58 1.13 +++ ossp-pkg/srpc/libxds/docs/libxds.tex 2001/08/09 15:35:23 1.14 @@ -1,6 +1,6 @@ % -*- mode: LaTeX; fill-column: 75; -*- % -% $Id: libxds.tex,v 1.13 2001/08/09 15:29:58 simons Exp $ +% $Id: libxds.tex,v 1.14 2001/08/09 15:35:23 simons Exp $ % \documentclass[a4paper,10pt,pointlessnumbers,bibtotoc]{scrartcl} \usepackage[dvips,xdvi]{graphicx} @@ -1076,7 +1076,8 @@ names of these data types vary from vendor to vendor. To solve that, we defined our own data types. The application programmer might want to take a look at the top few lines of the \textsf{xds.h} include file to see how the -actual data types are mapped to the \textsf{xds\_xxx\_t} variant. +actual data types are mapped to the \textsf{xds\_xxx\_t} variant on your +system. \subsection{Why do I have to register all the engines manually?} From ossp-cvs-owner@ossp.org Thu Aug 9 21:58:38 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f79JwaO41475; Thu, 9 Aug 2001 21:58:36 +0200 (CEST) Date: Thu, 9 Aug 2001 21:58:36 +0200 (CEST) Message-Id: <200108091958.f79JwaO41475@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds Makefile.in configure.ac xds.c xds.h.... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 09-Aug-2001 21:58:36 Branch: HEAD Handle: 2001080920583500 Modified files: ossp-pkg/srpc/libxds Makefile.in configure.ac xds.c xds.h.in xds.pod xds_engine_xdr.c xds_engine_xml.c xds_p.h xds_test.sh xds_test_lib.c xds_test_xdr.c xds_test_xml.c Log: Use the license consistently. Summary: Revision Changes Path 1.24 +28 -1 ossp-pkg/srpc/libxds/Makefile.in 1.18 +29 -2 ossp-pkg/srpc/libxds/configure.ac 1.3 +28 -23 ossp-pkg/srpc/libxds/xds.c 1.13 +1 -1 ossp-pkg/srpc/libxds/xds.h.in 1.8 +30 -2 ossp-pkg/srpc/libxds/xds.pod 1.2 +29 -23 ossp-pkg/srpc/libxds/xds_engine_xdr.c 1.3 +29 -23 ossp-pkg/srpc/libxds/xds_engine_xml.c 1.4 +1 -1 ossp-pkg/srpc/libxds/xds_p.h 1.2 +28 -0 ossp-pkg/srpc/libxds/xds_test.sh 1.2 +28 -23 ossp-pkg/srpc/libxds/xds_test_lib.c 1.2 +28 -23 ossp-pkg/srpc/libxds/xds_test_xdr.c 1.2 +28 -23 ossp-pkg/srpc/libxds/xds_test_xml.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/Makefile.in ============================================================ $ cvs diff -u -r1.23 -r1.24 Makefile.in --- ossp-pkg/srpc/libxds/Makefile.in 2001/08/08 19:15:23 1.23 +++ ossp-pkg/srpc/libxds/Makefile.in 2001/08/09 19:58:35 1.24 @@ -1,4 +1,31 @@ -# Build libxds. +## +## XDS - OSSP Extensible Data Serialization Library +## Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) +## Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) +## +## This file is part of OSSP XDS, an extensible data serialization +## library which can be found at http://www.ossp.com/pkg/xds/. +## +## 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 +## CC = @CC@ AR = ar Index: ossp-pkg/srpc/libxds/configure.ac ============================================================ $ cvs diff -u -r1.17 -r1.18 configure.ac --- ossp-pkg/srpc/libxds/configure.ac 2001/08/09 11:58:22 1.17 +++ ossp-pkg/srpc/libxds/configure.ac 2001/08/09 19:58:35 1.18 @@ -1,8 +1,35 @@ -dnl configure.in -- Process this file with autoconf to produce a configure script. +dnl ## +dnl ## XDS - OSSP Extensible Data Serialization Library +dnl ## Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) +dnl ## Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) +dnl ## +dnl ## This file is part of OSSP XDS, an extensible data serialization +dnl ## library which can be found at http://www.ossp.com/pkg/xds/. +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: autoconf script source +dnl ## AC_INIT(xds.h.in) AC_PREREQ(2.52) -AC_REVISION($Revision: 1.17 $) +AC_REVISION($Revision: 1.18 $) dnl Get rid of the lousy -g and -O defaults in CFLAGS. dnl Index: ossp-pkg/srpc/libxds/xds.c ============================================================ $ cvs diff -u -r1.2 -r1.3 xds.c --- ossp-pkg/srpc/libxds/xds.c 2001/08/08 19:33:55 1.2 +++ ossp-pkg/srpc/libxds/xds.c 2001/08/09 19:58:35 1.3 @@ -1,26 +1,31 @@ -/* - * XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The - * OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless - * Deutschland (http://www.cw.com/de/) - * - * This file is part of OSSP XDS, an extensible data serialization library - * which can be found at http://www.ossp.com/pkg/xds/. - * - * 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. */ +/* +** XDS - OSSP Extensible Data Serialization Library +** Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) +** Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) +** +** This file is part of OSSP XDS, an extensible data serialization +** library which can be found at http://www.ossp.com/pkg/xds/. +** +** 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. +** +** xds.c: XDS library framework +*/ #include #include Index: ossp-pkg/srpc/libxds/xds.h.in ============================================================ $ cvs diff -u -r1.12 -r1.13 xds.h.in --- ossp-pkg/srpc/libxds/xds.h.in 2001/08/08 19:32:02 1.12 +++ ossp-pkg/srpc/libxds/xds.h.in 2001/08/09 19:58:35 1.13 @@ -24,7 +24,7 @@ ** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF ** SUCH DAMAGE. ** -** xds.h: C API +** xds.h: XDS library API */ #ifndef __XDS_H__ Index: ossp-pkg/srpc/libxds/xds.pod ============================================================ $ cvs diff -u -r1.7 -r1.8 xds.pod --- ossp-pkg/srpc/libxds/xds.pod 2001/08/08 19:15:23 1.7 +++ ossp-pkg/srpc/libxds/xds.pod 2001/08/09 19:58:35 1.8 @@ -1,11 +1,39 @@ +## +## XDS - OSSP Extensible Data Serialization Library +## Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) +## Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) +## +## This file is part of OSSP XDS, an extensible data serialization +## library which can be found at http://www.ossp.com/pkg/xds/. +## +## 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. +## +## xds.pod: Unix manual page source +## + =pod =head1 NAME -xds - eXtensible Data Serialization +xds - OSSP eXtensible Data Serialization =head1 SYNOPSIS - =head1 DESCRIPTION Index: ossp-pkg/srpc/libxds/xds_engine_xdr.c ============================================================ $ cvs diff -u -r1.1 -r1.2 xds_engine_xdr.c --- ossp-pkg/srpc/libxds/xds_engine_xdr.c 2001/08/08 19:15:23 1.1 +++ ossp-pkg/srpc/libxds/xds_engine_xdr.c 2001/08/09 19:58:35 1.2 @@ -1,28 +1,34 @@ -/* - * XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The - * OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless - * Deutschland (http://www.cw.com/de/) - * - * This file is part of OSSP XDS, an extensible data serialization library - * which can be found at http://www.ossp.com/pkg/xds/. - * - * 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. */ +/* +** XDS - OSSP Extensible Data Serialization Library +** Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) +** Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) +** +** This file is part of OSSP XDS, an extensible data serialization +** library which can be found at http://www.ossp.com/pkg/xds/. +** +** 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. +** +** xds_engine_xdr.c: XDR encoding/decoding engine +*/ #include + #include "xds.h" int xdr_encode_int32(xds_t * xds, void *engine_context, Index: ossp-pkg/srpc/libxds/xds_engine_xml.c ============================================================ $ cvs diff -u -r1.2 -r1.3 xds_engine_xml.c --- ossp-pkg/srpc/libxds/xds_engine_xml.c 2001/08/08 19:32:02 1.2 +++ ossp-pkg/srpc/libxds/xds_engine_xml.c 2001/08/09 19:58:35 1.3 @@ -1,30 +1,36 @@ -/* - * XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The - * OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless - * Deutschland (http://www.cw.com/de/) - * - * This file is part of OSSP XDS, an extensible data serialization library - * which can be found at http://www.ossp.com/pkg/xds/. - * - * 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. */ +/* +** XDS - OSSP Extensible Data Serialization Library +** Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) +** Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) +** +** This file is part of OSSP XDS, an extensible data serialization +** library which can be found at http://www.ossp.com/pkg/xds/. +** +** 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. +** +** xds_engine_xml.c: XML encoding/decoding engine +*/ #include #include #include + #include "xds.h" static const char xds_xml_begin_text[] = Index: ossp-pkg/srpc/libxds/xds_p.h ============================================================ $ cvs diff -u -r1.3 -r1.4 xds_p.h --- ossp-pkg/srpc/libxds/xds_p.h 2001/08/08 19:33:55 1.3 +++ ossp-pkg/srpc/libxds/xds_p.h 2001/08/09 19:58:35 1.4 @@ -24,7 +24,7 @@ ** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF ** SUCH DAMAGE. ** -** xds_p.h: internal C API +** xds_p.h: internal library API */ #ifndef __XDS_P_H__ Index: ossp-pkg/srpc/libxds/xds_test.sh ============================================================ $ cvs diff -u -r1.1 -r1.2 xds_test.sh --- ossp-pkg/srpc/libxds/xds_test.sh 2001/08/08 19:15:23 1.1 +++ ossp-pkg/srpc/libxds/xds_test.sh 2001/08/09 19:58:35 1.2 @@ -1,4 +1,32 @@ #!/bin/sh +## +## XDS - OSSP Extensible Data Serialization Library +## Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) +## Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) +## +## This file is part of OSSP XDS, an extensible data serialization +## library which can be found at http://www.ossp.com/pkg/xds/. +## +## 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. +## +## xds_test.sh: test suite driver script +## if [ $# -lt 1 ]; then echo "Usage: $0 test1.t [...]" Index: ossp-pkg/srpc/libxds/xds_test_lib.c ============================================================ $ cvs diff -u -r1.1 -r1.2 xds_test_lib.c --- ossp-pkg/srpc/libxds/xds_test_lib.c 2001/08/08 19:15:23 1.1 +++ ossp-pkg/srpc/libxds/xds_test_lib.c 2001/08/09 19:58:35 1.2 @@ -1,26 +1,31 @@ -/* - * XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The - * OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless - * Deutschland (http://www.cw.com/de/) - * - * This file is part of OSSP XDS, an extensible data serialization library - * which can be found at http://www.ossp.com/pkg/xds/. - * - * 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. */ +/* +** XDS - OSSP Extensible Data Serialization Library +** Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) +** Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) +** +** This file is part of OSSP XDS, an extensible data serialization +** library which can be found at http://www.ossp.com/pkg/xds/. +** +** 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. +** +** xds_test_lib.c: test suite for library framework +*/ #include #include Index: ossp-pkg/srpc/libxds/xds_test_xdr.c ============================================================ $ cvs diff -u -r1.1 -r1.2 xds_test_xdr.c --- ossp-pkg/srpc/libxds/xds_test_xdr.c 2001/08/08 19:15:23 1.1 +++ ossp-pkg/srpc/libxds/xds_test_xdr.c 2001/08/09 19:58:35 1.2 @@ -1,26 +1,31 @@ -/* - * XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The - * OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless - * Deutschland (http://www.cw.com/de/) - * - * This file is part of OSSP XDS, an extensible data serialization library - * which can be found at http://www.ossp.com/pkg/xds/. - * - * 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. */ +/* +** XDS - OSSP Extensible Data Serialization Library +** Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) +** Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) +** +** This file is part of OSSP XDS, an extensible data serialization +** library which can be found at http://www.ossp.com/pkg/xds/. +** +** 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. +** +** xds_test_xdr.c: test suite for XDR encodig/decoding engine +*/ #include #include Index: ossp-pkg/srpc/libxds/xds_test_xml.c ============================================================ $ cvs diff -u -r1.1 -r1.2 xds_test_xml.c --- ossp-pkg/srpc/libxds/xds_test_xml.c 2001/08/08 19:15:23 1.1 +++ ossp-pkg/srpc/libxds/xds_test_xml.c 2001/08/09 19:58:35 1.2 @@ -1,26 +1,31 @@ -/* - * XDS - OSSP Extensible Data Serialization Library Copyright (c) 2001 The - * OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless - * Deutschland (http://www.cw.com/de/) - * - * This file is part of OSSP XDS, an extensible data serialization library - * which can be found at http://www.ossp.com/pkg/xds/. - * - * 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. */ +/* +** XDS - OSSP Extensible Data Serialization Library +** Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) +** Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) +** +** This file is part of OSSP XDS, an extensible data serialization +** library which can be found at http://www.ossp.com/pkg/xds/. +** +** 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. +** +** xds_test_xml.c: test suite for XML encodig/decoding engine +*/ #include #include From ossp-cvs-owner@ossp.org Thu Aug 9 22:59:07 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f79Kx6549418; Thu, 9 Aug 2001 22:59:06 +0200 (CEST) Date: Thu, 9 Aug 2001 22:59:06 +0200 (CEST) Message-Id: <200108092059.f79Kx6549418@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds xds.c xds_engine_xdr.c xds_engine_xml... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 09-Aug-2001 22:59:06 Branch: HEAD Handle: 2001080921590500 Modified files: ossp-pkg/srpc/libxds xds.c xds_engine_xdr.c xds_engine_xml.c xds_test_lib.c xds_test_xdr.c xds_test_xml.c Log: Final adjustments to coding style in order to make OSSP XDS look equal in style to all other OSSP parts. This should remove most of the strangeness GNU indent usually introduces. Summary: Revision Changes Path 1.4 +55 -64 ossp-pkg/srpc/libxds/xds.c 1.3 +128 -168 ossp-pkg/srpc/libxds/xds_engine_xdr.c 1.4 +122 -172 ossp-pkg/srpc/libxds/xds_engine_xml.c 1.3 +65 -147 ossp-pkg/srpc/libxds/xds_test_lib.c 1.3 +24 -52 ossp-pkg/srpc/libxds/xds_test_xdr.c 1.3 +14 -29 ossp-pkg/srpc/libxds/xds_test_xml.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/xds.c ============================================================ $ cvs diff -u -r1.3 -r1.4 xds.c --- ossp-pkg/srpc/libxds/xds.c 2001/08/09 19:58:35 1.3 +++ ossp-pkg/srpc/libxds/xds.c 2001/08/09 20:59:05 1.4 @@ -45,9 +45,8 @@ } /* Allocate context structure. */ - ctx = malloc(sizeof (struct xds_context)); - if (ctx == NULL) - return NULL; /* errno is set by calloc() */ + if ((ctx = malloc(sizeof (struct xds_context))) == NULL) + return NULL; /* errno set by malloc(3) */ /* Set mode of operation in context. */ ctx->mode = mode; @@ -68,7 +67,9 @@ void xds_destroy(xds_t *xds) { - /* Sanity checks. */ + size_t i; + + /* Sanity check parameter. */ assert(xds != NULL); if (xds == NULL) return; @@ -78,25 +79,23 @@ || (xds->buffer_capacity == 0 && xds->buffer_len == 0)); if (xds->buffer != NULL && xds->we_own_buffer) free(xds->buffer); - assert(xds->engines != NULL || xds->engines_capacity == 0); if (xds->engines != NULL) { - size_t i; - for (i = 0; i < xds->engines_len; ++i) { + for (i = 0; i < xds->engines_len; i++) { assert(xds->engines[i].name != NULL); free(xds->engines[i].name); } free(xds->engines); } - free(xds); + return; } int xds_setbuffer(xds_t *xds, xds_scope_t flag, void *buffer, size_t buffer_len) { - /* Sanity checks. */ + /* Sanity check parameters. */ xds_check_parameter(xds != NULL); xds_check_parameter(flag == XDS_GIFT || flag == XDS_LOAN); xds_check_parameter((buffer != NULL && buffer_len != 0) @@ -127,8 +126,7 @@ int xds_getbuffer(xds_t *xds, xds_scope_t flag, void **buffer, size_t *buffer_len) { - /* Sanity checks. */ - + /* Sanity check parameters. */ xds_check_parameter(xds != NULL); xds_check_parameter(flag == XDS_GIFT || flag == XDS_LOAN); xds_check_parameter(buffer != NULL); @@ -139,7 +137,8 @@ *buffer_len = xds->buffer_len; if (flag == XDS_GIFT) { xds->buffer = NULL; - xds->buffer_capacity = xds->buffer_len = 0; + xds->buffer_capacity = 0; + xds->buffer_len = 0; } else xds->buffer_len = 0; @@ -148,8 +147,8 @@ } static int xds_set_capacity(void **array, size_t *array_capacity, - size_t new_capacity, size_t elem_size, - size_t initial_capacity) + size_t new_capacity, size_t elem_size, + size_t initial_capacity) { void *buf; size_t size; @@ -165,13 +164,12 @@ return XDS_OK; /* Find the correct capacity. */ - size = (*array_capacity != 0) ? *array_capacity * 2 : initial_capacity; + size = (*array_capacity != 0) ? (*array_capacity * 2) : initial_capacity; while (size < new_capacity) size *= 2; /* Allocate the array and store the new values. */ - buf = realloc(*array, size * elem_size); - if (buf == NULL) + if ((buf = realloc(*array, size * elem_size)) == NULL) return XDS_ERR_NO_MEM; *array = buf; *array_capacity = size; @@ -190,7 +188,7 @@ xds_check_parameter(pos != NULL); /* Use binary search to find "name" in "engines". */ - for (first = 0; (last - first) > 0;) { + for (first = 0; (last - first) > 0; ) { size_t half = first + ((last - first) / 2); int rc = strcmp(engines[half].name, name); if (rc < 0) @@ -203,8 +201,8 @@ last = half; assert(first <= last); } - *pos = first; + return XDS_FALSE; } @@ -244,12 +242,12 @@ return rc; memmove(&xds->engines[pos + 1], &xds->engines[pos], (xds->engines_len - pos) * sizeof (engine_map_t)); - ++xds->engines_len; + xds->engines_len++; } /* Insert entry. */ - xds->engines[pos].name = (char *)name; - xds->engines[pos].engine = engine; + xds->engines[pos].name = (char *)name; + xds->engines[pos].engine = engine; xds->engines[pos].context = engine_context; /* Everything is fine. */ @@ -264,7 +262,7 @@ /* Sanity checks. */ xds_check_parameter(xds != NULL); xds_check_parameter(name != NULL); - for (pos = 0; name[pos] != '\0'; ++pos) { + for (pos = 0; name[pos] != '\0'; pos++) { if (!isalnum((int)name[pos]) && name[pos] != '-' && name[pos] != '_') return XDS_ERR_INVALID_ARG; } @@ -279,13 +277,11 @@ free(xds->engines[pos].name); memmove(&xds->engines[pos], &xds->engines[pos + 1], (xds->engines_len - (pos + 1)) * sizeof (engine_map_t)); - --xds->engines_len; + xds->engines_len--; /* Lower capacity if necessary. */ - rc = xds_set_capacity((void **)&xds->engines, - &xds->engines_capacity, - xds->engines_len, - sizeof (engine_map_t), + rc = xds_set_capacity((void **)&xds->engines, &xds->engines_capacity, + xds->engines_len, sizeof (engine_map_t), XDS_INITIAL_ENGINES_CAPACITY); assert(rc == XDS_OK || rc == XDS_ERR_NO_MEM); if (rc != XDS_OK) @@ -298,6 +294,7 @@ { int rc; va_list args; + va_start(args, fmt); rc = xds_vencode(xds, fmt, args); va_end(args); @@ -321,11 +318,11 @@ return XDS_ERR_INVALID_MODE; /* Ensure we have a buffer allocated ready for use. */ - if (xds->buffer == NULL) { /* allocate a new buffer */ - rc = xds_set_capacity((void **)&xds->buffer, - &xds->buffer_capacity, - XDS_INITIAL_BUFFER_CAPACITY, - sizeof (char), XDS_INITIAL_BUFFER_CAPACITY); + if (xds->buffer == NULL) { + /* allocate a new buffer */ + rc = xds_set_capacity((void **)&xds->buffer, &xds->buffer_capacity, + XDS_INITIAL_BUFFER_CAPACITY, sizeof (char), + XDS_INITIAL_BUFFER_CAPACITY); assert(rc == XDS_OK || rc == XDS_ERR_NO_MEM); if (rc != XDS_OK) return rc; @@ -333,16 +330,15 @@ xds->we_own_buffer = XDS_TRUE; } - /* Iterate through the items in the format string and execute the - apropriate engines. */ + /* Iterate through items in format string and execute apropriate engines. */ fmt = p = strdup(fmt_arg); if (fmt == NULL) return XDS_ERR_NO_MEM; buffer_len_backup = xds->buffer_len; for (name = p; *p != '\0'; name = p) { while (isalnum((int)*p) || *p == '-' || *p == '_') - ++p; - if (*p) + p++; + if (*p != '\0') *p++ = '\0'; else *p = '\0'; @@ -352,8 +348,8 @@ size_t used_buffer_size; size_t pos; - if (xds_find_engine(xds->engines, xds->engines_len, name, &pos) == - XDS_FALSE) { + if (xds_find_engine(xds->engines, xds->engines_len, name, &pos) + == XDS_FALSE) { rc = XDS_ERR_UNKNOWN_ENGINE; goto leave; } @@ -365,8 +361,7 @@ if (xds->we_own_buffer) { rc = xds_set_capacity((void **)&xds->buffer, &xds->buffer_capacity, - xds->buffer_len + 1, - sizeof (char), + xds->buffer_len + 1, sizeof (char), XDS_INITIAL_BUFFER_CAPACITY); assert(rc == XDS_OK || rc == XDS_ERR_NO_MEM); if (rc != XDS_OK) @@ -381,13 +376,11 @@ /* Execute the engine. */ used_buffer_size = 0; args_backup = args; - rc = (*xds->engines[pos].engine)(xds, - xds->engines[pos].context, - xds->buffer + - xds->buffer_len, - xds->buffer_capacity - - xds->buffer_len, - &used_buffer_size, &args); + rc = (*xds->engines[pos].engine)( + xds, xds->engines[pos].context, + xds->buffer + xds->buffer_len, + xds->buffer_capacity - xds->buffer_len, + &used_buffer_size, &args); assert(rc <= 0); if (rc == XDS_OK) { restart_engine = XDS_FALSE; @@ -400,13 +393,11 @@ restart_engine = XDS_TRUE; args = args_backup; - rc = xds_set_capacity((void **)&xds->buffer, - &xds->buffer_capacity, - xds->buffer_capacity + - ((used_buffer_size == - 0) ? 1 : used_buffer_size), - sizeof (char), - XDS_INITIAL_BUFFER_CAPACITY); + rc = xds_set_capacity( + (void **)&xds->buffer, &xds->buffer_capacity, + xds->buffer_capacity + + ((used_buffer_size == 0) ? 1 : used_buffer_size), + sizeof (char), XDS_INITIAL_BUFFER_CAPACITY); assert(rc == XDS_OK || rc == XDS_ERR_NO_MEM); if (rc != XDS_OK) goto leave; @@ -431,6 +422,7 @@ { int rc; va_list args; + va_start(args, fmt); rc = xds_vdecode(xds, fmt, args); va_end(args); @@ -464,8 +456,8 @@ buffer_len_backup = xds->buffer_len; for (name = p; *p != '\0'; name = p) { while (isalnum((int)*p) || *p == '-' || *p == '_') - ++p; - if (*p) + p++; + if (*p != '\0') *p++ = '\0'; else *p = '\0'; @@ -473,14 +465,13 @@ if (strlen(name) > 0) { size_t pos; size_t used_buffer_size = 0; + if (xds_find_engine(xds->engines, xds->engines_len, name, &pos)) { - rc = (*xds->engines[pos].engine)(xds, - xds->engines[pos].context, - xds->buffer + - xds->buffer_len, - xds->buffer_capacity - - xds->buffer_len, - &used_buffer_size, &args); + rc = (*xds->engines[pos].engine)( + xds, xds->engines[pos].context, + xds->buffer + xds->buffer_len, + xds->buffer_capacity - xds->buffer_len, + &used_buffer_size, &args); assert(rc <= 0); if (rc == XDS_OK) xds->buffer_len += used_buffer_size; Index: ossp-pkg/srpc/libxds/xds_engine_xdr.c ============================================================ $ cvs diff -u -r1.2 -r1.3 xds_engine_xdr.c --- ossp-pkg/srpc/libxds/xds_engine_xdr.c 2001/08/09 19:58:35 1.2 +++ ossp-pkg/srpc/libxds/xds_engine_xdr.c 2001/08/09 20:59:05 1.3 @@ -31,9 +31,9 @@ #include "xds.h" -int xdr_encode_int32(xds_t * xds, void *engine_context, +int xdr_encode_int32(xds_t *xds, void *engine_context, void *buffer, size_t buffer_size, - size_t * used_buffer_size, va_list * args) + size_t *used_buffer_size, va_list *args) { xds_uint32_t tmp; xds_int32_t value; @@ -41,7 +41,6 @@ xds_init_encoding_engine(4); /* Get value and format it into the buffer. */ - value = va_arg(*args, xds_uint32_t); if (value < 0) { value = 0 - value; @@ -49,19 +48,17 @@ } else tmp = (xds_uint32_t) value; - ((xds_uint8_t *) buffer)[0] = (tmp >> 24) & 0x000000ff; - ((xds_uint8_t *) buffer)[1] = (tmp >> 16) & 0x000000ff; - ((xds_uint8_t *) buffer)[2] = (tmp >> 8) & 0x000000ff; - ((xds_uint8_t *) buffer)[3] = (tmp >> 0) & 0x000000ff; - - /* Done. */ + ((xds_uint8_t *)buffer)[0] = (tmp >> 24) & 0x000000ff; + ((xds_uint8_t *)buffer)[1] = (tmp >> 16) & 0x000000ff; + ((xds_uint8_t *)buffer)[2] = (tmp >> 8) & 0x000000ff; + ((xds_uint8_t *)buffer)[3] = (tmp >> 0) & 0x000000ff; return XDS_OK; } -int xdr_decode_int32(xds_t * xds, void *engine_context, +int xdr_decode_int32(xds_t *xds, void *engine_context, void *buffer, size_t buffer_size, - size_t * used_buffer_size, va_list * args) + size_t *used_buffer_size, va_list *args) { xds_int32_t *value; xds_uint32_t tmp; @@ -69,88 +66,81 @@ xds_init_decoding_engine(4); /* Get value and format it into the buffer. */ - value = va_arg(*args, xds_int32_t *); xds_check_parameter(value != NULL); - if (((xds_uint8_t *) buffer)[0] & 0x80) { /* negative number */ - tmp = ((xds_uint8_t *) buffer)[0]; + if (((xds_uint8_t *) buffer)[0] & 0x80) { + /* negative number */ + tmp = ((xds_uint8_t *)buffer)[0]; tmp = tmp << 8; - tmp += ((xds_uint8_t *) buffer)[1]; + tmp += ((xds_uint8_t *)buffer)[1]; tmp = tmp << 8; - tmp += ((xds_uint8_t *) buffer)[2]; + tmp += ((xds_uint8_t *)buffer)[2]; tmp = tmp << 8; - tmp += ((xds_uint8_t *) buffer)[3]; + tmp += ((xds_uint8_t *)buffer)[3]; tmp = 0 - tmp; - *value = 0 - (int32_t) tmp; + *value = 0 - (int32_t)tmp; } - else { /* positive number */ - *value = ((xds_uint8_t *) buffer)[0]; + else { + /* positive number */ + *value = ((xds_uint8_t *)buffer)[0]; *value = *value << 8; - *value += ((xds_uint8_t *) buffer)[1]; + *value += ((xds_uint8_t *)buffer)[1]; *value = *value << 8; - *value += ((xds_uint8_t *) buffer)[2]; + *value += ((xds_uint8_t *)buffer)[2]; *value = *value << 8; - *value += ((xds_uint8_t *) buffer)[3]; + *value += ((xds_uint8_t *)buffer)[3]; } - /* Done. */ - return XDS_OK; } -int xdr_encode_uint32(xds_t * xds, void *engine_context, +int xdr_encode_uint32(xds_t *xds, void *engine_context, void *buffer, size_t buffer_size, - size_t * used_buffer_size, va_list * args) + size_t *used_buffer_size, va_list *args) { xds_uint32_t value; xds_init_encoding_engine(4); /* Get value and format it into the buffer. */ - value = va_arg(*args, xds_uint32_t); - ((xds_uint8_t *) buffer)[0] = (value >> 24) & 0x000000ff; - ((xds_uint8_t *) buffer)[1] = (value >> 16) & 0x000000ff; - ((xds_uint8_t *) buffer)[2] = (value >> 8) & 0x000000ff; - ((xds_uint8_t *) buffer)[3] = (value >> 0) & 0x000000ff; + ((xds_uint8_t *)buffer)[0] = (value >> 24) & 0x000000ff; + ((xds_uint8_t *)buffer)[1] = (value >> 16) & 0x000000ff; + ((xds_uint8_t *)buffer)[2] = (value >> 8) & 0x000000ff; + ((xds_uint8_t *)buffer)[3] = (value >> 0) & 0x000000ff; - /* Done. */ - return XDS_OK; } -int xdr_decode_uint32(xds_t * xds, void *engine_context, +int xdr_decode_uint32(xds_t *xds, void *engine_context, void *buffer, size_t buffer_size, - size_t * used_buffer_size, va_list * args) + size_t *used_buffer_size, va_list *args) { xds_uint32_t *value; xds_init_decoding_engine(4); /* Get value and format it into the buffer. */ - value = va_arg(*args, xds_uint32_t *); xds_check_parameter(value != NULL); - *value = ((xds_uint8_t *) buffer)[0]; + *value = ((xds_uint8_t *)buffer)[0]; *value = *value << 8; - *value += ((xds_uint8_t *) buffer)[1]; + *value += ((xds_uint8_t *)buffer)[1]; *value = *value << 8; - *value += ((xds_uint8_t *) buffer)[2]; + *value += ((xds_uint8_t *)buffer)[2]; *value = *value << 8; - *value += ((xds_uint8_t *) buffer)[3]; - - /* Done. */ + *value += ((xds_uint8_t *)buffer)[3]; return XDS_OK; } #ifdef XDS_HAVE_64_BIT_SUPPORT -int xdr_encode_int64(xds_t * xds, void *engine_context, +int xdr_encode_int64(xds_t *xds, void *engine_context, void *buffer, size_t buffer_size, - size_t * used_buffer_size, va_list * args) + size_t *used_buffer_size, va_list *args) { xds_uint64_t tmp; xds_int64_t value; @@ -158,31 +148,28 @@ xds_init_encoding_engine(8); /* Get value and format it into the buffer. */ - value = va_arg(*args, xds_uint64_t); if (value < 0) { value = 0 - value; - tmp = 0 - (xds_uint64_t) value; + tmp = 0 - (xds_uint64_t)value; } else - tmp = (xds_uint64_t) value; - ((xds_uint8_t *) buffer)[0] = (tmp >> 56) & 0x000000ff; - ((xds_uint8_t *) buffer)[1] = (tmp >> 48) & 0x000000ff; - ((xds_uint8_t *) buffer)[2] = (tmp >> 40) & 0x000000ff; - ((xds_uint8_t *) buffer)[3] = (tmp >> 32) & 0x000000ff; - ((xds_uint8_t *) buffer)[4] = (tmp >> 24) & 0x000000ff; - ((xds_uint8_t *) buffer)[5] = (tmp >> 16) & 0x000000ff; - ((xds_uint8_t *) buffer)[6] = (tmp >> 8) & 0x000000ff; - ((xds_uint8_t *) buffer)[7] = (tmp >> 0) & 0x000000ff; - - /* Done. */ + tmp = (xds_uint64_t)value; + ((xds_uint8_t *)buffer)[0] = (tmp >> 56) & 0x000000ff; + ((xds_uint8_t *)buffer)[1] = (tmp >> 48) & 0x000000ff; + ((xds_uint8_t *)buffer)[2] = (tmp >> 40) & 0x000000ff; + ((xds_uint8_t *)buffer)[3] = (tmp >> 32) & 0x000000ff; + ((xds_uint8_t *)buffer)[4] = (tmp >> 24) & 0x000000ff; + ((xds_uint8_t *)buffer)[5] = (tmp >> 16) & 0x000000ff; + ((xds_uint8_t *)buffer)[6] = (tmp >> 8) & 0x000000ff; + ((xds_uint8_t *)buffer)[7] = (tmp >> 0) & 0x000000ff; return XDS_OK; } -int xdr_decode_int64(xds_t * xds, void *engine_context, +int xdr_decode_int64(xds_t *xds, void *engine_context, void *buffer, size_t buffer_size, - size_t * used_buffer_size, va_list * args) + size_t *used_buffer_size, va_list *args) { xds_int64_t *value; xds_uint64_t tmp; @@ -190,130 +177,125 @@ xds_init_decoding_engine(8); /* Get value and format it into the buffer. */ - value = va_arg(*args, xds_int64_t *); xds_check_parameter(value != NULL); - if (((xds_uint8_t *) buffer)[0] & 0x80) { /* negative number */ - tmp = ((xds_uint8_t *) buffer)[0]; + if (((xds_uint8_t *)buffer)[0] & 0x80) { + /* negative number */ + tmp = ((xds_uint8_t *)buffer)[0]; tmp = tmp << 8; - tmp += ((xds_uint8_t *) buffer)[1]; + tmp += ((xds_uint8_t *)buffer)[1]; tmp = tmp << 8; - tmp += ((xds_uint8_t *) buffer)[2]; + tmp += ((xds_uint8_t *)buffer)[2]; tmp = tmp << 8; - tmp += ((xds_uint8_t *) buffer)[3]; + tmp += ((xds_uint8_t *)buffer)[3]; tmp = tmp << 8; - tmp += ((xds_uint8_t *) buffer)[4]; + tmp += ((xds_uint8_t *)buffer)[4]; tmp = tmp << 8; - tmp += ((xds_uint8_t *) buffer)[5]; + tmp += ((xds_uint8_t *)buffer)[5]; tmp = tmp << 8; - tmp += ((xds_uint8_t *) buffer)[6]; + tmp += ((xds_uint8_t *)buffer)[6]; tmp = tmp << 8; - tmp += ((xds_uint8_t *) buffer)[7]; + tmp += ((xds_uint8_t *)buffer)[7]; tmp = 0 - tmp; - *value = 0 - (xds_int64_t) tmp; + *value = 0 - (xds_int64_t)tmp; } - else { /* positive number */ - *value = ((xds_uint8_t *) buffer)[0]; + else { + /* positive number */ + *value = ((xds_uint8_t *)buffer)[0]; *value = *value << 8; - *value += ((xds_uint8_t *) buffer)[1]; + *value += ((xds_uint8_t *)buffer)[1]; *value = *value << 8; - *value += ((xds_uint8_t *) buffer)[2]; + *value += ((xds_uint8_t *)buffer)[2]; *value = *value << 8; - *value += ((xds_uint8_t *) buffer)[3]; + *value += ((xds_uint8_t *)buffer)[3]; *value = *value << 8; - *value += ((xds_uint8_t *) buffer)[4]; + *value += ((xds_uint8_t *)buffer)[4]; *value = *value << 8; - *value += ((xds_uint8_t *) buffer)[5]; + *value += ((xds_uint8_t *)buffer)[5]; *value = *value << 8; - *value += ((xds_uint8_t *) buffer)[6]; + *value += ((xds_uint8_t *)buffer)[6]; *value = *value << 8; - *value += ((xds_uint8_t *) buffer)[7]; + *value += ((xds_uint8_t *)buffer)[7]; } - /* Done. */ - return XDS_OK; } -int xdr_encode_uint64(xds_t * xds, void *engine_context, +int xdr_encode_uint64(xds_t *xds, void *engine_context, void *buffer, size_t buffer_size, - size_t * used_buffer_size, va_list * args) + size_t *used_buffer_size, va_list *args) { xds_uint64_t value; xds_init_encoding_engine(8); /* Get value and format it into the buffer. */ - value = va_arg(*args, xds_uint64_t); - ((xds_uint8_t *) buffer)[0] = (value >> 56) & 0x000000ff; - ((xds_uint8_t *) buffer)[1] = (value >> 48) & 0x000000ff; - ((xds_uint8_t *) buffer)[2] = (value >> 40) & 0x000000ff; - ((xds_uint8_t *) buffer)[3] = (value >> 32) & 0x000000ff; - ((xds_uint8_t *) buffer)[4] = (value >> 24) & 0x000000ff; - ((xds_uint8_t *) buffer)[5] = (value >> 16) & 0x000000ff; - ((xds_uint8_t *) buffer)[6] = (value >> 8) & 0x000000ff; - ((xds_uint8_t *) buffer)[7] = (value >> 0) & 0x000000ff; + ((xds_uint8_t *)buffer)[0] = (value >> 56) & 0x000000ff; + ((xds_uint8_t *)buffer)[1] = (value >> 48) & 0x000000ff; + ((xds_uint8_t *)buffer)[2] = (value >> 40) & 0x000000ff; + ((xds_uint8_t *)buffer)[3] = (value >> 32) & 0x000000ff; + ((xds_uint8_t *)buffer)[4] = (value >> 24) & 0x000000ff; + ((xds_uint8_t *)buffer)[5] = (value >> 16) & 0x000000ff; + ((xds_uint8_t *)buffer)[6] = (value >> 8) & 0x000000ff; + ((xds_uint8_t *)buffer)[7] = (value >> 0) & 0x000000ff; - /* Done. */ - return XDS_OK; } -int xdr_decode_uint64(xds_t * xds, void *engine_context, +int xdr_decode_uint64(xds_t *xds, void *engine_context, void *buffer, size_t buffer_size, - size_t * used_buffer_size, va_list * args) + size_t *used_buffer_size, va_list *args) { xds_uint64_t *value; xds_init_decoding_engine(8); /* Get value and format it into the buffer. */ - value = va_arg(*args, xds_uint64_t *); xds_check_parameter(value != NULL); - *value = ((xds_uint8_t *) buffer)[0]; + *value = ((xds_uint8_t *)buffer)[0]; *value = *value << 8; - *value += ((xds_uint8_t *) buffer)[1]; + *value += ((xds_uint8_t *)buffer)[1]; *value = *value << 8; - *value += ((xds_uint8_t *) buffer)[2]; + *value += ((xds_uint8_t *)buffer)[2]; *value = *value << 8; - *value += ((xds_uint8_t *) buffer)[3]; + *value += ((xds_uint8_t *)buffer)[3]; *value = *value << 8; - *value += ((xds_uint8_t *) buffer)[4]; + *value += ((xds_uint8_t *)buffer)[4]; *value = *value << 8; - *value += ((xds_uint8_t *) buffer)[5]; + *value += ((xds_uint8_t *)buffer)[5]; *value = *value << 8; - *value += ((xds_uint8_t *) buffer)[6]; + *value += ((xds_uint8_t *)buffer)[6]; *value = *value << 8; - *value += ((xds_uint8_t *) buffer)[7]; + *value += ((xds_uint8_t *)buffer)[7]; - /* Done. */ - return XDS_OK; } #endif /* XDS_HAVE_64_BIT_SUPPORT */ -int xdr_encode_double(xds_t * xds, void *engine_context, +int xdr_encode_double(xds_t *xds, void *engine_context, void *buffer, size_t buffer_size, - size_t * used_buffer_size, va_list * args) + size_t *used_buffer_size, va_list *args) { + /* XXX */ return -1; } -int xdr_decode_double(xds_t * xds, void *engine_context, +int xdr_decode_double(xds_t *xds, void *engine_context, void *buffer, size_t buffer_size, - size_t * used_buffer_size, va_list * args) + size_t *used_buffer_size, va_list *args) { + /* XXX */ return -1; } -int xdr_encode_string(xds_t * xds, void *engine_context, +int xdr_encode_string(xds_t *xds, void *engine_context, void *buffer, size_t buffer_size, - size_t * used_buffer_size, va_list * args) + size_t *used_buffer_size, va_list *args) { char *p; size_t p_len; @@ -322,7 +304,6 @@ xds_init_encoding_engine(4); /* Get value from stack and calculate the correct amount of padding. */ - p = va_arg(*args, char *); xds_check_parameter(p != NULL); p_len = strlen(p); @@ -330,29 +311,25 @@ assert((p_len + padding) % 4 == 0); /* We need (4 + p_len + padding) bytes in the buffer to format our - * parameter. If we don't have them, return an underflow error. */ - + parameter. If we don't have them, return an underflow error. */ *used_buffer_size = 4 + p_len + padding; if (buffer_size < *used_buffer_size) return XDS_ERR_OVERFLOW; /* Format the values into the buffer. */ + ((xds_uint8_t *)buffer)[0] = (p_len >> 24) & 0x000000ff; + ((xds_uint8_t *)buffer)[1] = (p_len >> 16) & 0x000000ff; + ((xds_uint8_t *)buffer)[2] = (p_len >> 8) & 0x000000ff; + ((xds_uint8_t *)buffer)[3] = (p_len >> 0) & 0x000000ff; + memmove((xds_uint8_t *)buffer + 4, p, p_len); + memset((xds_uint8_t *)buffer + 4 + p_len, 0, padding); - ((xds_uint8_t *) buffer)[0] = (p_len >> 24) & 0x000000ff; - ((xds_uint8_t *) buffer)[1] = (p_len >> 16) & 0x000000ff; - ((xds_uint8_t *) buffer)[2] = (p_len >> 8) & 0x000000ff; - ((xds_uint8_t *) buffer)[3] = (p_len >> 0) & 0x000000ff; - memmove((xds_uint8_t *) buffer + 4, p, p_len); - memset((xds_uint8_t *) buffer + 4 + p_len, 0, padding); - - /* Done. */ - return XDS_OK; } -int xdr_decode_string(xds_t * xds, void *engine_context, +int xdr_decode_string(xds_t *xds, void *engine_context, void *buffer, size_t buffer_size, - size_t * used_buffer_size, va_list * args) + size_t *used_buffer_size, va_list *args) { char **p; size_t p_len; @@ -360,48 +337,42 @@ xds_init_decoding_engine(4); + /* Get value. */ p = va_arg(*args, char **); xds_check_parameter(p != NULL); /* Read the size of the message. */ - - p_len = ((xds_uint8_t *) buffer)[0]; + p_len = ((xds_uint8_t *)buffer)[0]; p_len = p_len << 8; - p_len += ((xds_uint8_t *) buffer)[1]; + p_len += ((xds_uint8_t *)buffer)[1]; p_len = p_len << 8; - p_len += ((xds_uint8_t *) buffer)[2]; + p_len += ((xds_uint8_t *)buffer)[2]; p_len = p_len << 8; - p_len += ((xds_uint8_t *) buffer)[3]; + p_len += ((xds_uint8_t *)buffer)[3]; /* Calculate padding. */ - padding = (4 - (p_len & 0x03)) & 0x03; - - /* Do we have enough data?. */ + /* Do we have enough data? */ *used_buffer_size = 4 + p_len + padding; if (buffer_size < *used_buffer_size) return XDS_ERR_UNDERFLOW; /* Allocate buffer for the data. */ - *p = (char *)malloc(p_len + 1); if (*p == NULL) return XDS_ERR_NO_MEM; /* Copy data into the buffer. */ - - memmove(*p, (xds_uint8_t *) buffer + 4, p_len); - ((xds_uint8_t *) buffer)[4 + p_len] = '\0'; - - /* Done. */ + memmove(*p, (xds_uint8_t *)buffer + 4, p_len); + ((xds_uint8_t *)buffer)[4 + p_len] = '\0'; return XDS_OK; } -int xdr_encode_octetstream(xds_t * xds, void *engine_context, +int xdr_encode_octetstream(xds_t *xds, void *engine_context, void *buffer, size_t buffer_size, - size_t * used_buffer_size, va_list * args) + size_t *used_buffer_size, va_list *args) { xds_uint8_t *p; size_t p_len; @@ -410,7 +381,6 @@ xds_init_encoding_engine(4); /* Get value from stack and calculate the correct amount of padding. */ - p = (xds_uint8_t *) va_arg(*args, void *); xds_check_parameter(p != NULL); p_len = va_arg(*args, size_t); @@ -418,29 +388,25 @@ assert((p_len + padding) % 4 == 0); /* We need (4 + p_len + padding) bytes in the buffer to format our - * parameter. If we don't have them, return an underflow error. */ - + parameter. If we don't have them, return an underflow error. */ *used_buffer_size = 4 + p_len + padding; if (buffer_size < *used_buffer_size) return XDS_ERR_OVERFLOW; /* Format the values into the buffer. */ - - ((xds_uint8_t *) buffer)[0] = (p_len >> 24) & 0x000000ff; - ((xds_uint8_t *) buffer)[1] = (p_len >> 16) & 0x000000ff; - ((xds_uint8_t *) buffer)[2] = (p_len >> 8) & 0x000000ff; - ((xds_uint8_t *) buffer)[3] = (p_len >> 0) & 0x000000ff; + ((xds_uint8_t *)buffer)[0] = (p_len >> 24) & 0x000000ff; + ((xds_uint8_t *)buffer)[1] = (p_len >> 16) & 0x000000ff; + ((xds_uint8_t *)buffer)[2] = (p_len >> 8) & 0x000000ff; + ((xds_uint8_t *)buffer)[3] = (p_len >> 0) & 0x000000ff; memmove((xds_uint8_t *) buffer + 4, p, p_len); memset((xds_uint8_t *) buffer + 4 + p_len, 0, padding); - /* Done. */ - return XDS_OK; } -int xdr_decode_octetstream(xds_t * xds, void *engine_context, +int xdr_decode_octetstream(xds_t *xds, void *engine_context, void *buffer, size_t buffer_size, - size_t * used_buffer_size, va_list * args) + size_t *used_buffer_size, va_list *args) { void **p; size_t *p_len; @@ -454,36 +420,30 @@ xds_check_parameter(p_len != NULL); /* Read the size of the message. */ - - *p_len = ((xds_uint8_t *) buffer)[0]; + *p_len = ((xds_uint8_t *)buffer)[0]; *p_len = *p_len << 8; - *p_len += ((xds_uint8_t *) buffer)[1]; + *p_len += ((xds_uint8_t *)buffer)[1]; *p_len = *p_len << 8; - *p_len += ((xds_uint8_t *) buffer)[2]; + *p_len += ((xds_uint8_t *)buffer)[2]; *p_len = *p_len << 8; - *p_len += ((xds_uint8_t *) buffer)[3]; + *p_len += ((xds_uint8_t *)buffer)[3]; /* Calculate padding. */ - padding = (4 - (*p_len & 0x03)) & 0x03; - - /* Do we have enough data?. */ + /* Do we have enough data? */ *used_buffer_size = 4 + *p_len + padding; if (buffer_size < *used_buffer_size) return XDS_ERR_UNDERFLOW; /* Allocate buffer for the data. */ - *p = malloc(*p_len); if (*p == NULL) return XDS_ERR_NO_MEM; /* Copy data into the buffer. */ - memmove(*p, (xds_uint8_t *) buffer + 4, *p_len); - /* Done. */ - return XDS_OK; } + Index: ossp-pkg/srpc/libxds/xds_engine_xml.c ============================================================ $ cvs diff -u -r1.3 -r1.4 xds_engine_xml.c --- ossp-pkg/srpc/libxds/xds_engine_xml.c 2001/08/09 19:58:35 1.3 +++ ossp-pkg/srpc/libxds/xds_engine_xml.c 2001/08/09 20:59:05 1.4 @@ -41,48 +41,49 @@ static const char xds_xml_end_text[] = "\n"; -int xml_encode_begin(xds_t * xds, void *engine_context, +int xml_encode_begin(xds_t *xds, void *engine_context, void *buffer, size_t buffer_size, - size_t * used_buffer_size, va_list * args) + size_t *used_buffer_size, va_list *args) { xds_init_encoding_engine(strlen(xds_xml_begin_text)); memmove(buffer, xds_xml_begin_text, strlen(xds_xml_begin_text)); return XDS_OK; } -int xml_decode_begin(xds_t * xds, void *engine_context, +int xml_decode_begin(xds_t *xds, void *engine_context, void *buffer, size_t buffer_size, - size_t * used_buffer_size, va_list * args) + size_t *used_buffer_size, va_list *args) { xds_init_encoding_engine(strlen(xds_xml_begin_text)); - if (strncasecmp(buffer, xds_xml_begin_text, strlen(xds_xml_begin_text)) != - 0) + if (strncasecmp(buffer, xds_xml_begin_text, + strlen(xds_xml_begin_text)) != 0) return XDS_ERR_TYPE_MISMATCH; return XDS_OK; } -int xml_encode_end(xds_t * xds, void *engine_context, +int xml_encode_end(xds_t *xds, void *engine_context, void *buffer, size_t buffer_size, - size_t * used_buffer_size, va_list * args) + size_t *used_buffer_size, va_list *args) { xds_init_encoding_engine(strlen(xds_xml_end_text)); memmove(buffer, xds_xml_end_text, strlen(xds_xml_end_text)); return XDS_OK; } -int xml_decode_end(xds_t * xds, void *engine_context, +int xml_decode_end(xds_t *xds, void *engine_context, void *buffer, size_t buffer_size, - size_t * used_buffer_size, va_list * args) + size_t *used_buffer_size, va_list *args) { xds_init_decoding_engine(strlen(xds_xml_end_text)); - if (strncasecmp(buffer, xds_xml_end_text, strlen(xds_xml_end_text)) != 0) + if (strncasecmp(buffer, xds_xml_end_text, + strlen(xds_xml_end_text)) != 0) return XDS_ERR_TYPE_MISMATCH; return XDS_OK; } -int xml_encode_int32(xds_t * xds, void *engine_context, +int xml_encode_int32(xds_t *xds, void *engine_context, void *buffer, size_t buffer_size, - size_t * used_buffer_size, va_list * args) + size_t *used_buffer_size, va_list *args) { xds_int32_t value; char buf[32]; @@ -93,8 +94,7 @@ xds_init_encoding_engine(7 + 8 + 11); /* Get the value and format it into our buffer. Keep track of the length - * of the formatted result. */ - + of the formatted result. */ value = va_arg(*args, xds_int32_t); if (value < 0) { negative = XDS_TRUE; @@ -107,29 +107,26 @@ unsigned char remainder = value % 10; value = value / 10; buf[i++] = '0' + remainder; - } - while (value != 0); + } while (value != 0); if (negative) buf[i++] = '-'; /* Now that we know the correct size of our data's representation, write - * it into the buffer. */ - + it into the buffer. */ *used_buffer_size = 7 + 8 + i; p = buffer; memmove(p, "", 7); p += 7; - for (j = i; j > 0;) { + for (j = i; j > 0;) *p++ = buf[--j]; - } memmove(p, "", 8); return XDS_OK; } -int xml_decode_int32(xds_t * xds, void *engine_context, +int xml_decode_int32(xds_t *xds, void *engine_context, void *buffer, size_t buffer_size, - size_t * used_buffer_size, va_list * args) + size_t *used_buffer_size, va_list *args) { xds_int32_t *value; char *p; @@ -138,18 +135,16 @@ xds_init_decoding_engine(7 + 8 + 1); /* Does the opening XML tag match? */ - if (strncasecmp(buffer, "", 7) != 0) return XDS_ERR_TYPE_MISMATCH; /* Decode the representation of the value. */ - value = va_arg(*args, xds_int32_t *); *value = 0; p = (char *)buffer + 7; if (*p == '-') { negative = XDS_TRUE; - ++p; + p++; } else negative = XDS_FALSE; @@ -163,7 +158,6 @@ *value = 0 - *value; /* Does the closing XML tag match? */ - if (p + 8 > (char *)buffer + buffer_size) return XDS_ERR_UNDERFLOW; else if (strncasecmp(p, "", 8) != 0) @@ -173,9 +167,9 @@ return XDS_OK; } -int xml_encode_uint32(xds_t * xds, void *engine_context, +int xml_encode_uint32(xds_t *xds, void *engine_context, void *buffer, size_t buffer_size, - size_t * used_buffer_size, va_list * args) + size_t *used_buffer_size, va_list *args) { xds_uint32_t value; char buf[32]; @@ -185,36 +179,31 @@ xds_init_encoding_engine(8 + 9 + 10); /* Format value into our buffer. */ - value = va_arg(*args, xds_uint32_t); i = 0; do { unsigned char remainder = value % 10; value = value / 10; buf[i++] = '0' + remainder; - } - while (value != 0); + } while (value != 0); /* Store the correct buffer size. */ - *used_buffer_size = 8 + 9 + i; /* Write result into the buffer. */ - p = buffer; memmove(p, "", 8); p += 8; - for (j = i; j > 0;) { + for (j = i; j > 0;) *p++ = buf[--j]; - } memmove(p, "", 9); return XDS_OK; } -int xml_decode_uint32(xds_t * xds, void *engine_context, +int xml_decode_uint32(xds_t *xds, void *engine_context, void *buffer, size_t buffer_size, - size_t * used_buffer_size, va_list * args) + size_t *used_buffer_size, va_list *args) { xds_uint32_t *value; char *p; @@ -222,12 +211,10 @@ xds_init_decoding_engine(8 + 9 + 1); /* Does the opening XML tag match? */ - if (strncasecmp(buffer, "", 8) != 0) return XDS_ERR_TYPE_MISMATCH; /* Decode the representation of the value. */ - value = va_arg(*args, xds_uint32_t *); *value = 0; p = (char *)buffer + 8; @@ -239,7 +226,6 @@ } /* Does the closing XML tag match? */ - if (p + 9 > (char *)buffer + buffer_size) return XDS_ERR_UNDERFLOW; else if (strncasecmp(p, "", 9) != 0) @@ -251,9 +237,9 @@ #ifdef XDS_HAVE_64_BIT_SUPPORT -int xml_encode_int64(xds_t * xds, void *engine_context, +int xml_encode_int64(xds_t *xds, void *engine_context, void *buffer, size_t buffer_size, - size_t * used_buffer_size, va_list * args) + size_t *used_buffer_size, va_list *args) { xds_int64_t value; char buf[64]; @@ -264,7 +250,6 @@ xds_init_encoding_engine(7 + 8 + 21); /* Format value into our buffer. */ - value = va_arg(*args, xds_int64_t); if (value < 0) { negative = XDS_TRUE; @@ -277,31 +262,27 @@ unsigned char remainder = value % 10; value = value / 10; buf[i++] = '0' + remainder; - } - while (value != 0); + } while (value != 0); if (negative) buf[i++] = '-'; /* Store the correct buffer size. */ - *used_buffer_size = 7 + 8 + i; /* Write result into the buffer. */ - p = buffer; memmove(p, "", 7); p += 7; - for (j = i; j > 0;) { + for (j = i; j > 0;) *p++ = buf[--j]; - } memmove(p, "", 8); return XDS_OK; } -int xml_decode_int64(xds_t * xds, void *engine_context, +int xml_decode_int64(xds_t *xds, void *engine_context, void *buffer, size_t buffer_size, - size_t * used_buffer_size, va_list * args) + size_t *used_buffer_size, va_list *args) { xds_int64_t *value; char *p; @@ -310,18 +291,16 @@ xds_init_decoding_engine(7 + 8 + 1); /* Does the opening XML tag match? */ - if (strncasecmp(buffer, "", 7) != 0) return XDS_ERR_TYPE_MISMATCH; /* Decode the representation of the value. */ - value = va_arg(*args, xds_int64_t *); *value = 0; p = (char *)buffer + 7; if (*p == '-') { negative = XDS_TRUE; - ++p; + p++; } else negative = XDS_FALSE; @@ -335,7 +314,6 @@ *value = 0 - *value; /* Does the closing XML tag match? */ - if (p + 8 > (char *)buffer + buffer_size) return XDS_ERR_UNDERFLOW; else if (strncasecmp(p, "", 8) != 0) @@ -345,9 +323,9 @@ return XDS_OK; } -int xml_encode_uint64(xds_t * xds, void *engine_context, +int xml_encode_uint64(xds_t *xds, void *engine_context, void *buffer, size_t buffer_size, - size_t * used_buffer_size, va_list * args) + size_t *used_buffer_size, va_list *args) { xds_uint64_t value; char buf[64]; @@ -357,36 +335,31 @@ xds_init_encoding_engine(8 + 9 + 20); /* Format value into our buffer. */ - value = va_arg(*args, xds_uint64_t); i = 0; do { unsigned char remainder = value % 10; value = value / 10; buf[i++] = '0' + remainder; - } - while (value != 0); + } while (value != 0); /* Store the correct buffer size. */ - *used_buffer_size = 8 + 9 + i; /* Write result into the buffer. */ - p = buffer; memmove(p, "", 8); p += 8; - for (j = i; j > 0;) { + for (j = i; j > 0;) *p++ = buf[--j]; - } memmove(p, "", 9); return XDS_OK; } -int xml_decode_uint64(xds_t * xds, void *engine_context, +int xml_decode_uint64(xds_t *xds, void *engine_context, void *buffer, size_t buffer_size, - size_t * used_buffer_size, va_list * args) + size_t *used_buffer_size, va_list *args) { xds_uint64_t *value; char *p; @@ -394,12 +367,10 @@ xds_init_decoding_engine(8 + 9 + 1); /* Does the opening XML tag match? */ - if (strncasecmp(buffer, "", 8) != 0) return XDS_ERR_TYPE_MISMATCH; /* Decode the representation of the value. */ - value = va_arg(*args, xds_uint64_t *); *value = 0; p = (char *)buffer + 8; @@ -411,7 +382,6 @@ } /* Does the closing XML tag match? */ - if (p + 9 > (char *)buffer + buffer_size) return XDS_ERR_UNDERFLOW; else if (strncasecmp(p, "", 9) != 0) @@ -423,22 +393,24 @@ #endif /* XDS_HAVE_64_BIT_SUPPORT */ -int xml_encode_double(xds_t * xds, void *engine_context, +int xml_encode_double(xds_t *xds, void *engine_context, void *buffer, size_t buffer_size, - size_t * used_buffer_size, va_list * args) + size_t *used_buffer_size, va_list *args) { + /* XXX */ return -1; } -int xml_decode_double(xds_t * xds, void *engine_context, +int xml_decode_double(xds_t *xds, void *engine_context, void *buffer, size_t buffer_size, - size_t * used_buffer_size, va_list * args) + size_t *used_buffer_size, va_list *args) { + /* XXX */ return -1; } -#define bits(c) (0x80 | ((c) & 0x3F)) -#define put(c) *strptr++ = (c); +#define bits(c) (0x80 | ((c) & 0x3F)) +#define put(c) *strptr++ = (c); #define putbits(c) put(bits(c)) #define finish() *strptr = '\0' @@ -487,19 +459,19 @@ finish(); } else - finish(); /* Not a valid Unicode "character" */ + finish(); /* Not a valid Unicode "character" */ return strptr; } -static const char TAG_OPEN[] = ""; -static const char TAG_CLOSE[] = ""; -static const size_t TAG_OPEN_LEN = sizeof (TAG_OPEN) - 1; +static const char TAG_OPEN[] = ""; +static const char TAG_CLOSE[] = ""; +static const size_t TAG_OPEN_LEN = sizeof (TAG_OPEN) - 1; static const size_t TAG_CLOSE_LEN = sizeof (TAG_CLOSE) - 1; -int xml_encode_string(xds_t * xds, void *engine_context, +int xml_encode_string(xds_t *xds, void *engine_context, void *buffer, size_t buffer_size, - size_t * used_buffer_size, va_list * args) + size_t *used_buffer_size, va_list *args) { char *src; size_t src_len; @@ -508,121 +480,121 @@ char *tmp; /* Setup the engine. We need at least space for our tags; how long the - * actual content is going to be will be seen soon. */ - + actual content is going to be will be seen soon. */ xds_init_encoding_engine(TAG_OPEN_LEN + TAG_CLOSE_LEN); /* Get the data from the stack. */ - src = va_arg(*args, char *); xds_check_parameter(src != NULL); src_len = strlen(src); /* Set up the target buffer. */ - dst = buffer; dst_size = buffer_size; /* Write the opening tag. */ - memmove(dst, TAG_OPEN, TAG_OPEN_LEN); dst += TAG_OPEN_LEN; dst_size -= TAG_OPEN_LEN; /* Format the data into the buffer. */ - while (src_len > 0 && dst_size > 0) { - if (*((xds_uint8_t *) src) >= 0x80) { /* UTF-8ify it. */ + if (*((xds_uint8_t *) src) >= 0x80) { + /* UTF-8ify it. */ if (dst_size >= 7) { tmp = sputu8((xds_uint32_t) * ((xds_uint8_t *) src), dst); - ++src; - --src_len; + src++; + src_len--; dst_size -= tmp - dst; dst = tmp; } else dst_size = 0; } - else if (*src == '<') { /* Turn into "<". */ + else if (*src == '<') { + /* Turn into "<". */ if (dst_size >= 4) { *dst++ = '&'; - --dst_size; + dst_size--; *dst++ = 'l'; - --dst_size; + dst_size--; *dst++ = 't'; - --dst_size; + dst_size--; *dst++ = ';'; - --dst_size; - ++src; - --src_len; + dst_size--; + src++; + src_len--; } else dst_size = 0; } - else if (*src == '&') { /* Turn into "&". */ + else if (*src == '&') { + /* Turn into "&". */ if (dst_size >= 5) { *dst++ = '&'; - --dst_size; + dst_size--; *dst++ = 'a'; - --dst_size; + dst_size--; *dst++ = 'm'; - --dst_size; + dst_size--; *dst++ = 'p'; - --dst_size; + dst_size--; *dst++ = ';'; - --dst_size; - ++src; - --src_len; + dst_size--; + src++; + src_len--; } else dst_size = 0; } - else if (*src == '>') { /* Turn into ">". */ + else if (*src == '>') { + /* Turn into ">". */ if (dst_size >= 4) { *dst++ = '&'; - --dst_size; + dst_size--; *dst++ = 'g'; - --dst_size; + dst_size--; *dst++ = 't'; - --dst_size; + dst_size--; *dst++ = ';'; - --dst_size; - ++src; - --src_len; + dst_size--; + src++; + src_len--; } else dst_size = 0; } - else { /* No special character; just copy it. - */ + else { + /* No special character; just copy it. */ *dst++ = *src++; - --src_len; - --dst_size; + src_len--; + dst_size--; } } - if (src_len > 0) { /* Target buffer was too small. */ + if (src_len > 0) { + /* Target buffer was too small. */ *used_buffer_size = buffer_size + 1; return XDS_ERR_OVERFLOW; } /* Write the closing tag. */ - memmove(dst, TAG_CLOSE, TAG_CLOSE_LEN); dst += TAG_CLOSE_LEN; dst_size -= TAG_CLOSE_LEN; - /* Done. */ - *used_buffer_size = dst - (char *)buffer; return XDS_OK; } -#define INVALID 0x80000000 +#define INVALID \ + 0x80000000 +#define get(c) \ + c = *strptr++; \ + if (chars) \ + (*chars)++; \ + if ((c) == 0) \ + return (unsigned int)EOF -#define get(c) c = *strptr++; \ - if (chars) (*chars)++; \ - if ((c) == 0) return (unsigned int)EOF - static unsigned int sgetu8(unsigned char *strptr, int *chars) { unsigned int c; @@ -636,7 +608,6 @@ return (unsigned int)EOF; get(c); - if ((c & 0xFE) == 0xFC) { c &= 0x01; iterations = 5; @@ -673,9 +644,9 @@ return c; } -int xml_decode_string(xds_t * xds, void *engine_context, +int xml_decode_string(xds_t *xds, void *engine_context, void *buffer, size_t buffer_size, - size_t * used_buffer_size, va_list * args) + size_t *used_buffer_size, va_list *args) { char **target_buffer; char *src; @@ -685,30 +656,25 @@ unsigned int rc; /* Setup the engine. We need at least space for our tags; how long the - * actual content is going to be will be seen soon. */ - + actual content is going to be will be seen soon. */ xds_init_encoding_engine(TAG_OPEN_LEN + TAG_CLOSE_LEN); /* Is the opening tag there? */ - if (strncasecmp(buffer, TAG_OPEN, TAG_OPEN_LEN) != 0) return XDS_ERR_TYPE_MISMATCH; /* Determine the length of the encoded data. */ - src = (char *)buffer + TAG_OPEN_LEN; for (src_len = 0; src[src_len] != '<'; ++src_len) if (src[src_len] == '\0') return XDS_ERR_TYPE_MISMATCH; /* Check the closing tag. */ - if (strncasecmp(src + src_len, TAG_CLOSE, TAG_CLOSE_LEN) != 0) return XDS_ERR_TYPE_MISMATCH; *used_buffer_size = TAG_OPEN_LEN + src_len + TAG_CLOSE_LEN; /* Allocate target buffer. */ - target_buffer = va_arg(*args, char **); xds_check_parameter(target_buffer != NULL); *target_buffer = dst = malloc(src_len + 1); @@ -716,7 +682,6 @@ return XDS_ERR_NO_MEM; /* Decode the data into the target buffer. */ - while (src_len > 0) { if (*src == '&') { if (src_len >= 4 && strncmp(src, "<", 4) == 0) { @@ -740,24 +705,22 @@ } } else if (*((xds_uint8_t *) src) >= 0x80) { - rc = sgetu8((xds_uint8_t *) src, &utf8_len); + rc = sgetu8((xds_uint8_t *)src, &utf8_len); if (rc == (unsigned int)EOF) return XDS_ERR_UNDERFLOW; else if (rc == INVALID || rc > 255) return XDS_ERR_TYPE_MISMATCH; - *dst++ = (xds_uint8_t) rc; + *dst++ = (xds_uint8_t)rc; src += utf8_len; src_len -= utf8_len; } else { *dst++ = *src++; - --src_len; + src_len--; } } *dst = '\0'; - /* Done. */ - return XDS_OK; } @@ -765,8 +728,8 @@ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; static const char xds_pad64 = '='; -static int base64_encode(char *dst, size_t dstlen, unsigned char const *src, - size_t srclen) +static int base64_encode(char *dst, size_t dstlen, + unsigned char const *src, size_t srclen) { size_t dstpos; unsigned char input[3]; @@ -791,10 +754,10 @@ input[2] = *src++; srclen -= 3; - output[0] = (input[0] >> 2); + output[0] = ( input[0] >> 2); output[1] = ((input[0] & 0x03) << 4) + (input[1] >> 4); output[2] = ((input[1] & 0x0f) << 2) + (input[2] >> 6); - output[3] = (input[2] & 0x3f); + output[3] = ( input[2] & 0x3f); if (dstpos + 4 > dstlen) return -1; @@ -810,7 +773,7 @@ for (i = 0; i < srclen; i++) input[i] = *src++; - output[0] = (input[0] >> 2); + output[0] = ( input[0] >> 2); output[1] = ((input[0] & 0x03) << 4) + (input[1] >> 4); output[2] = ((input[1] & 0x0f) << 2) + (input[2] >> 6); @@ -832,26 +795,23 @@ return dstpos; } -int xml_encode_octetstream(xds_t * xds, void *engine_context, +int xml_encode_octetstream(xds_t *xds, void *engine_context, void *buffer, size_t buffer_size, - size_t * used_buffer_size, va_list * args) + size_t *used_buffer_size, va_list *args) { xds_uint8_t *src; size_t src_len; /* We need at least 27 byte for the starting and ending tag. */ - xds_init_encoding_engine(13 + 14); /* Get parameters from stack. */ - - src = (xds_uint8_t *) va_arg(*args, void *); + src = (xds_uint8_t *)va_arg(*args, void *); xds_check_parameter(src != NULL); src_len = va_arg(*args, size_t); /* Calculate how many bytes we'll need in buffer and make sure we have - * them. */ - + them. */ *used_buffer_size = base64_encode(NULL, 0, src, src_len); if (*used_buffer_size == (size_t) - 1) return XDS_ERR_UNKNOWN; @@ -861,10 +821,8 @@ return XDS_ERR_OVERFLOW; /* Format the data into the buffer. */ - memmove(buffer, "", 13); - if (base64_encode((char *)buffer + 13, buffer_size - 13, src, src_len) < - 0) + if (base64_encode((char *)buffer + 13, buffer_size - 13, src, src_len) < 0) return XDS_ERR_UNKNOWN; memmove((char *)buffer + *used_buffer_size - 14, "", 14); @@ -873,8 +831,8 @@ return XDS_OK; } -static int base64_decode(unsigned char *dst, size_t dstlen, char const *src, - size_t srclen) +static int base64_decode(unsigned char *dst, size_t dstlen, + char const *src, size_t srclen) { int dstidx, state, ch = 0; unsigned char res; @@ -941,8 +899,7 @@ * We are done decoding Base-64 chars. Let's see if we ended * on a byte boundary, and/or with erroneous trailing characters. */ - - if (ch == xds_pad64) { /* We got a pad char. */ + if (ch == xds_pad64) { /* We got a pad char. */ switch (state) { case 0: /* Invalid = in first position */ case 1: /* Invalid = in second position */ @@ -994,9 +951,9 @@ return dstidx; } -int xml_decode_octetstream(xds_t * xds, void *engine_context, +int xml_decode_octetstream(xds_t *xds, void *engine_context, void *buffer, size_t buffer_size, - size_t * used_buffer_size, va_list * args) + size_t *used_buffer_size, va_list *args) { char *p; size_t p_len; @@ -1004,23 +961,19 @@ size_t *data_len; /* We need at least 27 byte for the starting and ending tag. */ - xds_init_encoding_engine(13 + 14); /* Get parameters from stack. */ - data = va_arg(*args, xds_uint8_t **); xds_check_parameter(data != NULL); data_len = va_arg(*args, size_t *); /* Check for the opening tag. */ - if (memcmp("", buffer, 13) != 0) return XDS_ERR_TYPE_MISMATCH; /* Find the end of the data and calculate the length of the - * base64-encoded stuff. */ - + base64-encoded stuff. */ p = (char *)buffer + 13; while (p < ((char *)buffer + buffer_size) && *p != '<') ++p; @@ -1032,8 +985,7 @@ } /* Now find out how long the decoded data is going to be, allocate a - * buffer for it, and decode away. */ - + buffer for it, and decode away. */ *data_len = base64_decode(NULL, 0, p, p_len); if (*data_len == (size_t) - 1) return XDS_ERR_UNKNOWN; @@ -1043,14 +995,12 @@ base64_decode(*data, *data_len, p, p_len); /* Check that we have a closing tag. */ - if (memcmp(p + p_len, "", 14) != 0) { free(*data); return XDS_ERR_TYPE_MISMATCH; } - /* Done. */ - *used_buffer_size = 13 + p_len + 14; return XDS_OK; } + Index: ossp-pkg/srpc/libxds/xds_test_lib.c ============================================================ $ cvs diff -u -r1.2 -r1.3 xds_test_lib.c --- ossp-pkg/srpc/libxds/xds_test_lib.c 2001/08/09 19:58:35 1.2 +++ ossp-pkg/srpc/libxds/xds_test_lib.c 2001/08/09 20:59:05 1.3 @@ -34,13 +34,12 @@ #ifdef XDS_TEST_XDS_CORE -int main() +int main(int argc, char *argv[]) { xds_t *ctx[50]; size_t i; /* Open a bunch of contextes and close them again. */ - for (i = 0; i < sizeof (ctx) / sizeof (xds_t *); ++i) { if (i % 2 == 0) ctx[i] = xds_init(XDS_ENCODE); @@ -58,7 +57,6 @@ #ifdef NDEBUG /* Check how the library deals with errorneous arguments. */ - if (xds_init((xds_mode_t) 42) != NULL || errno != EINVAL) { printf ("Called xds_init() with invalid mode but didn't get EINVAL.\n"); @@ -66,13 +64,11 @@ } /* Call xds_destroy() with an invalid context and see whether we survive - * that. */ - + that. */ xds_destroy(NULL); #endif /* Everything went fine. */ - return 0; } @@ -80,7 +76,7 @@ #ifdef XDS_TEST_XDS_FIND_ENGINE -int main() +int main(int argc, char *argv[]) { const engine_map_t engines[] = { {"alan", NULL, 0}, @@ -101,118 +97,83 @@ size_t i; /* Does xds_find_engine handle an empty array? */ - if (xds_find_engine(engines, 0, "whatever", &pos)) { - printf - ("xds_find_engine() said 'whatever' would be in the array, but that's wrong.\n"); + printf("xds_find_engine() said 'whatever' would be in the array, but that's wrong.\n"); exit(1); } if (pos != 0) { - printf - ("xds_find_engine() would insert 'whatever' at position %d, but 0 is correct.\n", - pos); + printf("xds_find_engine() would insert 'whatever' at position %d, but 0 is correct.\n", pos); exit(1); } /* Search for every single entry in the array and check the results. */ - for (i = 0; i < engines_len; ++i) { if (!xds_find_engine(engines, engines_len, engines[i].name, &pos)) { - printf - ("xds_find_engine() said '%s' wouldn't be in the array, but that's wrong.\n", - engines[i].name); + printf("xds_find_engine() said '%s' wouldn't be in the array, but that's wrong.\n", engines[i].name); exit(1); } if (pos != i) { - printf - ("xds_find_engine() would insert '%s' at position %d, but %d is correct.\n", - engines[i].name, pos, i); + printf("xds_find_engine() would insert '%s' at position %d, but %d is correct.\n", engines[i].name, pos, i); exit(1); } } /* Search for non-existing name that would be inserted at the first - * position. */ - + position. */ if (xds_find_engine(engines, engines_len, "aaron", &pos)) { - printf - ("xds_find_engine() said 'aaron' would be in the array, but that's wrong.\n"); + printf("xds_find_engine() said 'aaron' would be in the array, but that's wrong.\n"); exit(1); } if (pos != 0) { - printf - ("xds_find_engine() would insert 'aaron' at position %d, but 0 is correct.\n", - pos); + printf("xds_find_engine() would insert 'aaron' at position %d, but 0 is correct.\n", pos); exit(1); } /* Search for non-existing name that would be inserted at last position. */ - if (xds_find_engine(engines, engines_len, "zerberos", &pos)) { - printf - ("xds_find_engine() said 'zerberos' would be in the array, but that's wrong.\n"); + printf("xds_find_engine() said 'zerberos' would be in the array, but that's wrong.\n"); exit(1); } if (pos != engines_len) { - printf - ("xds_find_engine() would insert 'zerberos' at position %d, but %d is correct.\n", - pos, engines_len); + printf("xds_find_engine() would insert 'zerberos' at position %d, but %d is correct.\n", pos, engines_len); exit(1); } - /* Search for non-existing names that would be inserted at random - * positions. */ - + /* Search for non-existing names that would be inserted at random positions. */ if (xds_find_engine(engines, engines_len, "balthasar", &pos)) { - printf - ("xds_find_engine() said 'balthasar' would be in the array, but that's wrong.\n"); + printf("xds_find_engine() said 'balthasar' would be in the array, but that's wrong.\n"); exit(1); } if (pos != 1) { - printf - ("xds_find_engine() would insert 'balthasar' at position %d, but 1 is correct.\n", - pos); + printf("xds_find_engine() would insert 'balthasar' at position %d, but 1 is correct.\n", pos); exit(1); } - if (xds_find_engine(engines, engines_len, "bulli", &pos)) { - printf - ("xds_find_engine() said 'bulli' would be in the array, but that's wrong.\n"); + printf("xds_find_engine() said 'bulli' would be in the array, but that's wrong.\n"); exit(1); } if (pos != 2) { - printf - ("xds_find_engine() would insert 'bulli' at position %d, but 2 is correct.\n", - pos); + printf("xds_find_engine() would insert 'bulli' at position %d, but 2 is correct.\n", pos); exit(1); } - if (xds_find_engine(engines, engines_len, "hildegard", &pos)) { - printf - ("xds_find_engine() said 'hildegard' would be in the array, but that's wrong.\n"); + printf("xds_find_engine() said 'hildegard' would be in the array, but that's wrong.\n"); exit(1); } if (pos != 8) { - printf - ("xds_find_engine() would insert 'hildegard' at position %d, but 8 is correct.\n", - pos); + printf("xds_find_engine() would insert 'hildegard' at position %d, but 8 is correct.\n", pos); exit(1); } - if (xds_find_engine(engines, engines_len, "harald", &pos)) { - printf - ("xds_find_engine() said 'harald' would be in the array, but that's wrong.\n"); + printf("xds_find_engine() said 'harald' would be in the array, but that's wrong.\n"); exit(1); } if (pos != 7) { - printf - ("xds_find_engine() would insert 'harald' at position %d, but 7 is correct.\n", - pos); + printf("xds_find_engine() would insert 'harald' at position %d, but 7 is correct.\n", pos); exit(1); } /* Everything went fine. */ - return 0; } @@ -220,14 +181,14 @@ #ifdef XDS_TEST_XDS_REGISTER -static int dummy_engine(xds_t * xds, void *engine_context, +static int dummy_engine(xds_t *xds, void *engine_context, void *buffer, size_t buffer_size, - size_t * used_buffer_size, va_list * args) + size_t *used_buffer_size, va_list *args) { return 0; } -int main() +int main(int argc, char *argv[]) { const char *test_names[] = { "foo", @@ -242,7 +203,6 @@ size_t i; /* Create context. */ - xds = xds_init(XDS_ENCODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); @@ -250,8 +210,7 @@ } /* Register the dummy callback under an invalid name to see whether the - * routine fails correctly. */ - + routine fails correctly. */ if (xds_register(xds, "abcdefh1230#", &dummy_engine, NULL) != XDS_ERR_INVALID_ARG) { printf @@ -260,7 +219,6 @@ } /* Register the dummy callback under multiple names. */ - for (i = 0; i < test_names_len; ++i) { if (xds_register(xds, test_names[i], &dummy_engine, NULL) != XDS_OK) { printf("Failed to register engine for '%s'.\n", test_names[i]); @@ -269,14 +227,12 @@ } /* Register the callback again, overwriting an existing entry. */ - if (xds_register(xds, "claus", &dummy_engine, NULL) != XDS_OK) { printf("Failed to re-register engine for 'claus'.\n"); return 1; } /* Ensure that everything is in alphabetical order. */ - for (i = 1; i < xds->engines_len; ++i) { assert(xds->engines[i - 1].name != NULL); assert(xds->engines[i].name != NULL); @@ -287,15 +243,12 @@ } /* Try to remove an unknown entry. */ - if (xds_unregister(xds, "abacadabra") != XDS_ERR_UNKNOWN_ENGINE) { - printf - ("xds_unregister() succeeded at removing 'abacadabra' even though it is not there.\n"); + printf("xds_unregister() succeeded at removing 'abacadabra' even though it is not there.\n"); exit(1); } /* Remove an entry from the middle. */ - if (xds_unregister(xds, test_names[test_names_len / 2]) != XDS_OK) { printf("xds_unregister() failed to remove '%s'.\n", test_names[test_names_len / 2]); @@ -303,7 +256,6 @@ } /* Remove the last entry. */ - assert(test_names_len > 0); if (xds_unregister(xds, test_names[test_names_len - 1]) != XDS_OK) { printf("xds_unregister() failed to remove '%s'.\n", @@ -312,18 +264,15 @@ } /* Remove the first entry. */ - if (xds_unregister(xds, test_names[0]) != XDS_OK) { printf("xds_unregister() failed to remove '%s'.\n", test_names[0]); exit(1); } /* Clean up. */ - xds_destroy(xds); /* Everything went fine. */ - return 0; } @@ -331,9 +280,9 @@ #ifdef XDS_TEST_XDS_SETBUFFER -static int dummy_engine(xds_t * xds, void *engine_context, +static int dummy_engine(xds_t *xds, void *engine_context, void *buffer, size_t buffer_size, - size_t * used_buffer_size, va_list * args) + size_t *used_buffer_size, va_list *args) { assert(xds != NULL); assert(buffer != NULL); @@ -348,14 +297,13 @@ return XDS_OK; } -int main() +int main(int argc, char *argv[]) { xds_t *xds; char *buffer; size_t buffer_size; /* Create XDS context. */ - xds = xds_init(XDS_ENCODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); @@ -363,15 +311,13 @@ } /* Register the callback. */ - if (xds_register(xds, "dummy", &dummy_engine, NULL) != XDS_OK) { printf("Failed to register my encoding engine.\n"); return 1; } /* Give the library a buffer of 32 byte, call the engine once, get the - * buffer back and see whether it has been enlarged or not. */ - + buffer back and see whether it has been enlarged or not. */ buffer_size = 32; buffer = malloc(buffer_size); if (buffer == NULL) { @@ -386,22 +332,19 @@ printf("xds_encode() failed!\n"); return 1; } - if (xds_getbuffer(xds, XDS_GIFT, (void **)&buffer, &buffer_size) != - XDS_OK) { + if (xds_getbuffer(xds, XDS_GIFT, (void **)&buffer, &buffer_size) != XDS_OK) { printf("xds_getbuffer() failed!\n"); return 1; } if (buffer_size < 64) { - printf - ("xds_encode() did not enlarge the buffer after processing the callback\n"); + printf("xds_encode() did not enlarge the buffer after processing the callback\n"); printf("even though all capacity was used up!\n"); return 1; } /* Loan the library a buffer we own, call the engine once to exceed the - * buffer's capacity and check, whether the library returns the correct - * error code. */ - + buffer's capacity and check, whether the library returns the correct + error code. */ buffer = malloc(32); if (buffer == NULL) { printf("Failed to allocate my memory.\n"); @@ -419,11 +362,9 @@ free(buffer); /* Clean up. */ - xds_destroy(xds); /* Everything went fine. */ - return 0; } @@ -431,20 +372,19 @@ #ifdef XDS_TEST_XDS_GETBUFFER -static int dummy_engine(xds_t * xds, void *engine_context, +static int dummy_engine(xds_t *xds, void *engine_context, void *buffer, size_t buffer_size, - size_t * used_buffer_size, va_list * args) + size_t *used_buffer_size, va_list *args) { if (buffer_size < 6) return XDS_ERR_OVERFLOW; else *used_buffer_size = 6; - memmove(buffer, "Hallo!", 6); return XDS_OK; } -int main() +int main(int argc, char *argv[]) { xds_t *xds; char *old; @@ -453,7 +393,6 @@ size_t new_len; /* Create XDS context. */ - xds = xds_init(XDS_ENCODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); @@ -461,16 +400,14 @@ } /* Register the dummy callback under multiple names. */ - if (xds_register(xds, "text", &dummy_engine, (void *)42) != XDS_OK) { printf("Failed to register my encoding engine.\n"); return 1; } /* Encode something, then flush the buffer by calling xds_getbuffer(), - * then encode something new and verify that the old buffer hasn't ben - * overwritten and that the new one contains the correct string. */ - + then encode something new and verify that the old buffer hasn't ben + overwritten and that the new one contains the correct string. */ if (xds_encode(xds, "text text") != XDS_OK) { printf("xds_encode() failed!\n"); return 1; @@ -496,9 +433,8 @@ free(new); /* Encode somthing, then get the buffer via XDS_LOAN and verify the - * contents. Encode something new and compare the new content with what - * we expect. */ - + contents. Encode something new and compare the new content with what + we expect. */ if (xds_encode(xds, "text text") != XDS_OK) { printf("xds_encode() failed!\n"); return 1; @@ -530,11 +466,9 @@ } /* Clean up. */ - xds_destroy(xds); /* Everything went fine. */ - return 0; } @@ -542,9 +476,9 @@ #ifdef XDS_TEST_XDS_ENCODE -static int dummy_engine(xds_t * xds, void *engine_context, +static int dummy_engine(xds_t *xds, void *engine_context, void *buffer, size_t buffer_size, - size_t * used_buffer_size, va_list * args) + size_t *used_buffer_size, va_list *args) { if (xds == NULL) { printf("XDS context isn't passed through to registered engine.\n"); @@ -577,12 +511,11 @@ return XDS_OK; } -int main() +int main(int argc, char *argv[]) { xds_t *xds; /* Create XDS context. */ - xds = xds_init(XDS_ENCODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); @@ -590,7 +523,6 @@ } /* Register the dummy callback under multiple names. */ - if (xds_register(xds, "int", &dummy_engine, (void *)42) != XDS_OK || xds_register(xds, "float", &dummy_engine, (void *)42) != XDS_OK || xds_register(xds, "double", &dummy_engine, (void *)42) != XDS_OK || @@ -600,7 +532,6 @@ } /* Let's go and encode something. */ - if (xds_encode(xds, "int:text double double float") != XDS_OK) { printf("xds_encode() failed!\n"); return 1; @@ -611,11 +542,9 @@ } /* Clean up. */ - xds_destroy(xds); /* Everything went fine. */ - return 0; } @@ -623,9 +552,9 @@ #ifdef XDS_TEST_XDS_DECODE -static int dummy_engine(xds_t * xds, void *engine_context, +static int dummy_engine(xds_t *xds, void *engine_context, void *buffer, size_t buffer_size, - size_t * used_buffer_size, va_list * args) + size_t *used_buffer_size, va_list *args) { if (xds == NULL) { printf("XDS context isn't passed through to registered engine.\n"); @@ -656,21 +585,19 @@ exit(1); } if (memcmp(buffer, "Hallo!", 6) != 0) { - printf - ("The contents of the decode buffer are not what we expected.\n"); + printf("The contents of the decode buffer are not what we expected.\n"); exit(1); } *used_buffer_size = 6; return XDS_OK; } -int main() +int main(int argc, char *argv[]) { xds_t *xds; char buffer[] = "Hallo!Hallo!Hallo!"; /* Create XDS context. */ - xds = xds_init(XDS_DECODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); @@ -678,27 +605,22 @@ } /* Register the dummy callback under multiple names. */ - if (xds_register(xds, "text", &dummy_engine, (void *)42) != XDS_OK) { printf("Failed to register my decoding engines.\n"); return 1; } - /* Decode the buffer and have the callback report when something is - * wrong. */ - + /* Decode the buffer and have the callback report when something is wrong. */ if (xds_setbuffer(xds, XDS_LOAN, buffer, sizeof (buffer) - 1) != XDS_OK) { printf("xds_decode() failed!"); return 1; } - if (xds_decode(xds, "text::text text") != XDS_OK) { printf("xds_decode() failed!"); return 1; } /* Clean up. */ - xds_destroy(xds); /* Everything went fine. */ @@ -710,9 +632,9 @@ #ifdef XDS_TEST_XDS_ENGINE_RESTART -static int dummy_engine(xds_t * xds, void *engine_context, +static int dummy_engine(xds_t *xds, void *engine_context, void *buffer, size_t buffer_size, - size_t * used_buffer_size, va_list * args) + size_t *used_buffer_size, va_list *args) { if (xds == NULL) { printf("XDS context isn't passed through to registered engine.\n"); @@ -749,19 +671,18 @@ return XDS_OK; } -int main() +int main(int argc, char *argv[]) { xds_t *xds; char *buffer; size_t buffer_size; /* Create an XDS context and set a buffer that's too small for the first - * encode() call. Then call encode() with two parameters: the one the - * engine is expecting and a different one after that. The engine will - * complain if it sees the second value -- what would mean that the args - * parameter was not resetted to the original value before the engine is - * restarted after buffer enlargement. */ - + encode() call. Then call encode() with two parameters: the one the + engine is expecting and a different one after that. The engine will + complain if it sees the second value -- what would mean that the args + parameter was not resetted to the original value before the engine is + restarted after buffer enlargement. */ xds = xds_init(XDS_ENCODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); @@ -798,9 +719,9 @@ xds_uint32_t positive; }; -static int encode_mystruct_engine(xds_t * xds, void *engine_context, +static int encode_mystruct_engine(xds_t *xds, void *engine_context, void *buffer, size_t buffer_size, - size_t * used_buffer_size, va_list * args) + size_t *used_buffer_size, va_list *args) { struct mystruct *ms; @@ -814,9 +735,9 @@ return xds_encode(xds, "int32 uint32", ms->small, ms->positive); } -static int decode_mystruct_engine(xds_t * xds, void *engine_context, +static int decode_mystruct_engine(xds_t *xds, void *engine_context, void *buffer, size_t buffer_size, - size_t * used_buffer_size, va_list * args) + size_t *used_buffer_size, va_list *args) { struct mystruct *ms; @@ -830,7 +751,7 @@ return xds_decode(xds, "int32 uint32", &(ms->small), &(ms->positive)); } -int main() +int main(int argc, char *argv[]) { xds_t *xds; char *buffer; @@ -841,14 +762,13 @@ ms.positive = 42; /* Encode our copy of mystruct using our encoding callback. Then get a - * the buffer and destroy the context again. */ - + the buffer and destroy the context again. */ xds = xds_init(XDS_ENCODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); return 1; } - if (xds_register(xds, "mystruct", &encode_mystruct_engine, NULL) != XDS_OK + if ( xds_register(xds, "mystruct", &encode_mystruct_engine, NULL) != XDS_OK || xds_register(xds, "int32", &xdr_encode_int32, NULL) != XDS_OK || xds_register(xds, "uint32", &xdr_encode_uint32, NULL) != XDS_OK) { printf("Failed to register my encoding engines.\n"); @@ -881,7 +801,6 @@ printf("The encoded representation is %u bytes long.\n", buffer_size); /* Now create a decoding context and decode the whole thing again. */ - xds = xds_init(XDS_DECODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); @@ -904,7 +823,6 @@ xds_destroy(xds); /* Both structures must be identical. */ - if (ms.small != new_ms.small || ms.positive != new_ms.positive) { printf("Decoded data does not match the original!\n"); @@ -912,8 +830,8 @@ } /* Everything went fine. */ - return 0; } #endif /* XDS_TEST_XDS_MYSTRUCT */ + Index: ossp-pkg/srpc/libxds/xds_test_xdr.c ============================================================ $ cvs diff -u -r1.2 -r1.3 xds_test_xdr.c --- ossp-pkg/srpc/libxds/xds_test_xdr.c 2001/08/09 19:58:35 1.2 +++ ossp-pkg/srpc/libxds/xds_test_xdr.c 2001/08/09 20:59:05 1.3 @@ -37,7 +37,7 @@ #ifdef XDS_TEST_XDR_INT32 -int main() +int main(int argc, char *argv[]) { XDR xdrs; char xdr_buf[1024]; @@ -59,7 +59,6 @@ size_t i; /* Encode the values array using the RPC-XDR implementation. */ - xdrmem_create(&xdrs, xdr_buf, sizeof (xdr_buf), XDR_ENCODE); for (i = 0; i < sizeof (values) / sizeof (xds_int32_t); ++i) xdr_int32_t(&xdrs, &values[i]); @@ -67,7 +66,6 @@ xdr_destroy(&xdrs); /* Encode the values array using the XDS implementation. */ - xds = xds_init(XDS_ENCODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); @@ -91,7 +89,6 @@ xds_destroy(xds); /* Both buffers must be equal now. */ - if (xdr_buf_size != xds_buf_size) { printf("The buffer sizes don't match: %d != %d.\n", xdr_buf_size, xds_buf_size); @@ -103,9 +100,8 @@ } /* Now we decode the values again using the XDS implementation and - * compare them to our original values. Obviously, they should not - * differ. */ - + compare them to our original values. Obviously, they should not + differ. */ xds = xds_init(XDS_DECODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); @@ -133,7 +129,6 @@ xds_destroy(xds); /* Everything went fine. */ - return 0; } @@ -142,13 +137,13 @@ #ifdef XDS_TEST_XDR_UINT32 #ifdef __FreeBSD__ -static int xdr_uint32_t(XDR * xdrs, uint32_t * val) +static int xdr_uint32_t(XDR *xdrs, uint32_t *val) { return xdr_u_int32_t(xdrs, val); } #endif -int main() +int main(int argc, char *argv[]) { XDR xdrs; char xdr_buf[1024]; @@ -169,7 +164,6 @@ size_t i; /* Encode the values array using the RPC-XDR implementation. */ - xdrmem_create(&xdrs, xdr_buf, sizeof (xdr_buf), XDR_ENCODE); for (i = 0; i < sizeof (values) / sizeof (xds_uint32_t); ++i) xdr_uint32_t(&xdrs, &values[i]); @@ -177,7 +171,6 @@ xdr_destroy(&xdrs); /* Encode the values array using the XDS implementation. */ - xds = xds_init(XDS_ENCODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); @@ -201,7 +194,6 @@ xds_destroy(xds); /* Both buffers must be equal now. */ - if (xdr_buf_size != xds_buf_size) { printf("The buffer sizes don't match: %d != %d.\n", xdr_buf_size, xds_buf_size); @@ -213,9 +205,8 @@ } /* Now we decode the values again using the XDS implementation and - * compare them to our original values. Obviously, they should not - * differ. */ - + compare them to our original values. Obviously, they should not + differ. */ xds = xds_init(XDS_DECODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); @@ -243,7 +234,6 @@ xds_destroy(xds); /* Everything went fine. */ - return 0; } @@ -253,7 +243,7 @@ #ifdef XDS_HAVE_64_BIT_SUPPORT -int main() +int main(int argc, char *argv[]) { XDR xdrs; char xdr_buf[1024]; @@ -275,7 +265,6 @@ size_t i; /* Encode the values array using the RPC-XDR implementation. */ - xdrmem_create(&xdrs, xdr_buf, sizeof (xdr_buf), XDR_ENCODE); for (i = 0; i < sizeof (values) / sizeof (xds_int64_t); ++i) xdr_int64_t(&xdrs, &values[i]); @@ -283,7 +272,6 @@ xdr_destroy(&xdrs); /* Encode the values array using the XDS implementation. */ - xds = xds_init(XDS_ENCODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); @@ -307,7 +295,6 @@ xds_destroy(xds); /* Both buffers must be equal now. */ - if (xdr_buf_size != xds_buf_size) { printf("The buffer sizes don't match: %d != %d.\n", xdr_buf_size, xds_buf_size); @@ -319,9 +306,8 @@ } /* Now we decode the values again using the XDS implementation and - * compare them to our original values. Obviously, they should not - * differ. */ - + compare them to our original values. Obviously, they should not + differ. */ xds = xds_init(XDS_DECODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); @@ -349,7 +335,6 @@ xds_destroy(xds); /* Everything went fine. */ - return 0; } @@ -362,13 +347,13 @@ #ifdef XDS_HAVE_64_BIT_SUPPORT #ifdef __FreeBSD__ -static int xdr_uint64_t(XDR * xdrs, uint64_t * val) +static int xdr_uint64_t(XDR *xdrs, uint64_t *val) { return xdr_u_int64_t(xdrs, val); } #endif -int main() +int main(int argc, char *argv[]) { XDR xdrs; char xdr_buf[1024]; @@ -389,7 +374,6 @@ size_t i; /* Encode the values array using the RPC-XDR implementation. */ - xdrmem_create(&xdrs, xdr_buf, sizeof (xdr_buf), XDR_ENCODE); for (i = 0; i < sizeof (values) / sizeof (xds_uint64_t); ++i) xdr_uint64_t(&xdrs, &values[i]); @@ -397,7 +381,6 @@ xdr_destroy(&xdrs); /* Encode the values array using the XDS implementation. */ - xds = xds_init(XDS_ENCODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); @@ -421,7 +404,6 @@ xds_destroy(xds); /* Both buffers must be equal now. */ - if (xdr_buf_size != xds_buf_size) { printf("The buffer sizes don't match: %d != %d.\n", xdr_buf_size, xds_buf_size); @@ -433,9 +415,8 @@ } /* Now we decode the values again using the XDS implementation and - * compare them to our original values. Obviously, they should not - * differ. */ - + compare them to our original values. Obviously, they should not + differ. */ xds = xds_init(XDS_DECODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); @@ -463,7 +444,6 @@ xds_destroy(xds); /* Everything went fine. */ - return 0; } @@ -473,7 +453,7 @@ #ifdef XDS_TEST_XDR_STRING -int main() +int main(int argc, char *argv[]) { xds_t *xds; char *buffer; @@ -483,8 +463,7 @@ char *new_msg; /* Encode the string as octet stream. Then erase the buffer and decode - * the string back, verifying that it hasn't changed. */ - + the string back, verifying that it hasn't changed. */ xds = xds_init(XDS_ENCODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); @@ -538,7 +517,6 @@ free(new_msg); /* Everything went fine. */ - return 0; } @@ -546,7 +524,7 @@ #ifdef XDS_TEST_XDR_STRING_EMPTY -int main() +int main(int argc, char *argv[]) { xds_t *xds; char *buffer; @@ -556,8 +534,7 @@ char *new_msg; /* Encode the string as octet stream. Then erase the buffer and decode - * the string back, verifying that it hasn't changed. */ - + the string back, verifying that it hasn't changed. */ xds = xds_init(XDS_ENCODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); @@ -607,7 +584,6 @@ free(new_msg); /* Everything went fine. */ - return 0; } @@ -615,7 +591,7 @@ #ifdef XDS_TEST_XDR_OCTETSTREAM -int main() +int main(int argc, char *argv[]) { xds_t *xds; char *buffer; @@ -626,8 +602,7 @@ size_t new_msg_size; /* Encode the string as octet stream. Then erase the buffer and decode - * the string back, verifying that it hasn't changed. */ - + the string back, verifying that it hasn't changed. */ xds = xds_init(XDS_ENCODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); @@ -682,7 +657,6 @@ free(new_msg); /* Everything went fine. */ - return 0; } @@ -690,7 +664,7 @@ #ifdef XDS_TEST_XDR_OCTETSTREAM_EMPTY -int main() +int main(int argc, char *argv[]) { xds_t *xds; char *buffer; @@ -701,8 +675,7 @@ size_t new_msg_size; /* Encode the string as octet stream. Then erase the buffer and decode - * the string back, verifying that it hasn't changed. */ - + the string back, verifying that it hasn't changed. */ xds = xds_init(XDS_ENCODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); @@ -723,8 +696,7 @@ } xds_destroy(xds); if (buffer_size % 4 != 0) { - printf - ("The encoded octet stream's buffer size is not a multiple of 4.\n"); + printf("The encoded octet stream's buffer size is not a multiple of 4.\n"); return 1; } @@ -757,8 +729,8 @@ free(new_msg); /* Everything went fine. */ - return 0; } #endif /* XDS_TEST_XDR_OCTETSTREAM_EMPTY */ + Index: ossp-pkg/srpc/libxds/xds_test_xml.c ============================================================ $ cvs diff -u -r1.2 -r1.3 xds_test_xml.c --- ossp-pkg/srpc/libxds/xds_test_xml.c 2001/08/09 19:58:35 1.2 +++ ossp-pkg/srpc/libxds/xds_test_xml.c 2001/08/09 20:59:05 1.3 @@ -35,7 +35,7 @@ #ifdef XDS_TEST_XML_INT32 -int main() +int main(int argc, char *argv[]) { xds_t *xds; char *buffer; @@ -53,7 +53,6 @@ size_t i; /* Encode the values array, then decode it back and compare the numbers. */ - xds = xds_init(XDS_ENCODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); @@ -125,7 +124,6 @@ xds_destroy(xds); /* Everything went fine. */ - return 0; } @@ -133,7 +131,7 @@ #ifdef XDS_TEST_XML_UINT32 -int main() +int main(int argc, char *argv[]) { xds_t *xds; char *buffer; @@ -150,7 +148,6 @@ size_t i; /* Encode the values array, then decode it back and compare the numbers. */ - xds = xds_init(XDS_ENCODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); @@ -202,7 +199,6 @@ xds_destroy(xds); /* Everything went fine. */ - return 0; } @@ -212,7 +208,7 @@ #ifdef XDS_HAVE_64_BIT_SUPPORT -int main() +int main(int argc, char *argv[]) { xds_t *xds; char *buffer; @@ -230,7 +226,6 @@ size_t i; /* Encode the values array, then decode it back and compare the numbers. */ - xds = xds_init(XDS_ENCODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); @@ -280,7 +275,6 @@ xds_destroy(xds); /* Everything went fine. */ - return 0; } @@ -292,7 +286,7 @@ #ifdef XDS_HAVE_64_BIT_SUPPORT -int main() +int main(int argc, char *argv[]) { xds_t *xds; char *buffer; @@ -309,7 +303,6 @@ size_t i; /* Encode the values array, then decode it back and compare the numbers. */ - xds = xds_init(XDS_ENCODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); @@ -359,7 +352,6 @@ xds_destroy(xds); /* Everything went fine. */ - return 0; } @@ -369,7 +361,7 @@ #ifdef XDS_TEST_XML_DOUBLE -int main() +int main(int argc, char *argv[]) { #if 0 xds_t *xds; @@ -445,7 +437,7 @@ #ifdef XDS_TEST_XML_STRING -int main() +int main(int argc, char *argv[]) { xds_t *xds; char *buffer; @@ -455,8 +447,7 @@ char *new_msg; /* Encode the string, then erase the buffer and decode the string back, - * verifying that it hasn't changed. */ - + verifying that it hasn't changed. */ xds = xds_init(XDS_ENCODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); @@ -512,7 +503,6 @@ free(new_msg); /* Everything went fine. */ - return 0; } @@ -520,7 +510,7 @@ #ifdef XDS_TEST_XML_STRING_EMPTY -int main() +int main(int argc, char *argv[]) { xds_t *xds; char *buffer; @@ -530,8 +520,7 @@ char *new_msg; /* Encode the string, then erase the buffer and decode the string back, - * verifying that it hasn't changed. */ - + verifying that it hasn't changed. */ xds = xds_init(XDS_ENCODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); @@ -587,7 +576,6 @@ free(new_msg); /* Everything went fine. */ - return 0; } @@ -595,7 +583,7 @@ #ifdef XDS_TEST_XML_OCTETSTREAM -int main() +int main(int argc, char *argv[]) { xds_t *xds; char *buffer; @@ -606,8 +594,7 @@ size_t new_msg_size; /* Encode the string as octet stream. Then erase the buffer and decode - * the string back, verifying that it hasn't changed. */ - + the string back, verifying that it hasn't changed. */ xds = xds_init(XDS_ENCODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); @@ -663,7 +650,6 @@ free(new_msg); /* Everything went fine. */ - return 0; } @@ -671,7 +657,7 @@ #ifdef XDS_TEST_XML_OCTETSTREAM_EMPTY -int main() +int main(int argc, char *argv[]) { xds_t *xds; char *buffer; @@ -682,8 +668,7 @@ size_t new_msg_size; /* Encode the string as octet stream. Then erase the buffer and decode - * the string back, verifying that it hasn't changed. */ - + the string back, verifying that it hasn't changed. */ xds = xds_init(XDS_ENCODE); if (xds == NULL) { printf("Failed to initialize XDS context.\n"); @@ -739,8 +724,8 @@ free(new_msg); /* Everything went fine. */ - return 0; } #endif /* XDS_TEST_XML_OCTETSTREAM_EMPTY */ + From ossp-cvs-owner@ossp.org Thu Aug 9 23:00:12 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f79L0BJ49898; Thu, 9 Aug 2001 23:00:11 +0200 (CEST) Date: Thu, 9 Aug 2001 23:00:11 +0200 (CEST) Message-Id: <200108092100.f79L0BJ49898@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds xds.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 09-Aug-2001 23:00:11 Branch: HEAD Handle: 2001080922001000 Modified files: ossp-pkg/srpc/libxds xds.c Log: Add still missing parameter sanity checks Summary: Revision Changes Path 1.5 +8 -0 ossp-pkg/srpc/libxds/xds.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/xds.c ============================================================ $ cvs diff -u -r1.4 -r1.5 xds.c --- ossp-pkg/srpc/libxds/xds.c 2001/08/09 20:59:05 1.4 +++ ossp-pkg/srpc/libxds/xds.c 2001/08/09 21:00:10 1.5 @@ -295,6 +295,10 @@ int rc; va_list args; + /* Sanity checks. */ + xds_check_parameter(xds != NULL); + xds_check_parameter(fmt != NULL); + va_start(args, fmt); rc = xds_vencode(xds, fmt, args); va_end(args); @@ -422,6 +426,10 @@ { int rc; va_list args; + + /* Sanity checks. */ + xds_check_parameter(xds != NULL); + xds_check_parameter(fmt != NULL); va_start(args, fmt); rc = xds_vdecode(xds, fmt, args); From ossp-cvs-owner@ossp.org Thu Aug 9 23:05:20 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f79L5Jl50869; Thu, 9 Aug 2001 23:05:19 +0200 (CEST) Date: Thu, 9 Aug 2001 23:05:19 +0200 (CEST) Message-Id: <200108092105.f79L5Jl50869@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds xds_engine_xdr.c xds_engine_xml.c Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 09-Aug-2001 23:05:19 Branch: HEAD Handle: 2001080922051800 Modified files: ossp-pkg/srpc/libxds xds_engine_xdr.c xds_engine_xml.c Log: Group functions with leading summary comment Summary: Revision Changes Path 1.4 +28 -0 ossp-pkg/srpc/libxds/xds_engine_xdr.c 1.5 +32 -0 ossp-pkg/srpc/libxds/xds_engine_xml.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/xds_engine_xdr.c ============================================================ $ cvs diff -u -r1.3 -r1.4 xds_engine_xdr.c --- ossp-pkg/srpc/libxds/xds_engine_xdr.c 2001/08/09 20:59:05 1.3 +++ ossp-pkg/srpc/libxds/xds_engine_xdr.c 2001/08/09 21:05:18 1.4 @@ -31,6 +31,10 @@ #include "xds.h" +/* + * Encode/decode signed 32-bit integer values. + */ + int xdr_encode_int32(xds_t *xds, void *engine_context, void *buffer, size_t buffer_size, size_t *used_buffer_size, va_list *args) @@ -95,6 +99,10 @@ return XDS_OK; } +/* + * Encode/decode unsigned 32-bit integer values. + */ + int xdr_encode_uint32(xds_t *xds, void *engine_context, void *buffer, size_t buffer_size, size_t *used_buffer_size, va_list *args) @@ -138,6 +146,10 @@ #ifdef XDS_HAVE_64_BIT_SUPPORT +/* + * Encode/decode signed 64-bit integer values. + */ + int xdr_encode_int64(xds_t *xds, void *engine_context, void *buffer, size_t buffer_size, size_t *used_buffer_size, va_list *args) @@ -222,6 +234,10 @@ return XDS_OK; } +/* + * Encode/decode unsigned 64-bit integer values. + */ + int xdr_encode_uint64(xds_t *xds, void *engine_context, void *buffer, size_t buffer_size, size_t *used_buffer_size, va_list *args) @@ -277,6 +293,10 @@ #endif /* XDS_HAVE_64_BIT_SUPPORT */ +/* + * Encode/decode double-precision floating point values. + */ + int xdr_encode_double(xds_t *xds, void *engine_context, void *buffer, size_t buffer_size, size_t *used_buffer_size, va_list *args) @@ -293,6 +313,10 @@ return -1; } +/* + * Encode/decode NUL-terminated character strings. + */ + int xdr_encode_string(xds_t *xds, void *engine_context, void *buffer, size_t buffer_size, size_t *used_buffer_size, va_list *args) @@ -369,6 +393,10 @@ return XDS_OK; } + +/* + * Encode/decode octet streams. + */ int xdr_encode_octetstream(xds_t *xds, void *engine_context, void *buffer, size_t buffer_size, Index: ossp-pkg/srpc/libxds/xds_engine_xml.c ============================================================ $ cvs diff -u -r1.4 -r1.5 xds_engine_xml.c --- ossp-pkg/srpc/libxds/xds_engine_xml.c 2001/08/09 20:59:05 1.4 +++ ossp-pkg/srpc/libxds/xds_engine_xml.c 2001/08/09 21:05:18 1.5 @@ -33,6 +33,10 @@ #include "xds.h" +/* + * Encode/decode XML document framework + */ + static const char xds_xml_begin_text[] = "\n" "\n" @@ -81,6 +85,10 @@ return XDS_OK; } +/* + * Encode/decode signed 32-bit integer values. + */ + int xml_encode_int32(xds_t *xds, void *engine_context, void *buffer, size_t buffer_size, size_t *used_buffer_size, va_list *args) @@ -167,6 +175,10 @@ return XDS_OK; } +/* + * Encode/decode unsigned 32-bit integer values. + */ + int xml_encode_uint32(xds_t *xds, void *engine_context, void *buffer, size_t buffer_size, size_t *used_buffer_size, va_list *args) @@ -237,6 +249,10 @@ #ifdef XDS_HAVE_64_BIT_SUPPORT +/* + * Encode/decode signed 64-bit integer values. + */ + int xml_encode_int64(xds_t *xds, void *engine_context, void *buffer, size_t buffer_size, size_t *used_buffer_size, va_list *args) @@ -323,6 +339,10 @@ return XDS_OK; } +/* + * Encode/decode unsigned 64-bit integer values. + */ + int xml_encode_uint64(xds_t *xds, void *engine_context, void *buffer, size_t buffer_size, size_t *used_buffer_size, va_list *args) @@ -393,6 +413,10 @@ #endif /* XDS_HAVE_64_BIT_SUPPORT */ +/* + * Encode/decode double-precision floating point values. + */ + int xml_encode_double(xds_t *xds, void *engine_context, void *buffer, size_t buffer_size, size_t *used_buffer_size, va_list *args) @@ -409,6 +433,10 @@ return -1; } +/* + * Encode/decode NUL-terminated character strings. + */ + #define bits(c) (0x80 | ((c) & 0x3F)) #define put(c) *strptr++ = (c); #define putbits(c) put(bits(c)) @@ -723,6 +751,10 @@ return XDS_OK; } + +/* + * Encode/decode octet streams. + */ static const char xds_base64[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; From ossp-cvs-owner@ossp.org Thu Aug 9 23:14:46 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f79LEj351767; Thu, 9 Aug 2001 23:14:45 +0200 (CEST) Date: Thu, 9 Aug 2001 23:14:45 +0200 (CEST) Message-Id: <200108092114.f79LEj351767@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds xds-xml.dtd Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 09-Aug-2001 23:14:45 Branch: HEAD Handle: 2001080922144400 Added files: ossp-pkg/srpc/libxds xds-xml.dtd Log: Add (untested) DTD for our XDS XML dialect. Summary: Revision Changes Path 1.1 +44 -0 ossp-pkg/srpc/libxds/xds-xml.dtd ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/xds-xml.dtd ============================================================ $ cvs update -p -r1.1 xds-xml.dtd From ossp-cvs-owner@ossp.org Thu Aug 9 23:19:30 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f79LJSY52614; Thu, 9 Aug 2001 23:19:28 +0200 (CEST) Date: Thu, 9 Aug 2001 23:19:28 +0200 (CEST) Message-Id: <200108092119.f79LJSY52614@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds xds-config.in xds-config.pod Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 09-Aug-2001 23:19:28 Branch: HEAD Handle: 2001080922192800 Added files: ossp-pkg/srpc/libxds xds-config.in xds-config.pod Log: Add xds-config stuff for building applications with OSSP XDS. This will be installed with XDS soon... Summary: Revision Changes Path 1.1 +144 -0 ossp-pkg/srpc/libxds/xds-config.in 1.1 +161 -0 ossp-pkg/srpc/libxds/xds-config.pod ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/xds-config.in ============================================================ $ cvs update -p -r1.1 xds-config.in #!/bin/sh ## ## XDS - OSSP Extensible Data Serialization Library ## Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) ## Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) ## ## This file is part of OSSP XDS, an extensible data serialization ## library which can be found at http://www.ossp.com/pkg/xds/. ## ## 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. ## ## xds-config.in: XDS library build utility ## DIFS=' ' prefix="@prefix@" exec_prefix="@exec_prefix@" xds_prefix="$prefix" xds_exec_prefix="$exec_prefix" xds_bindir="@bindir@" xds_libdir="@libdir@" xds_includedir="@includedir@" xds_mandir="@mandir@" xds_datadir="@datadir@" xds_acdir="@datadir@/aclocal" xds_cflags="@CFLAGS@" xds_ldflags="@LDFLAGS@" xds_libs="@LIBS@" xds_version="@XDS_VERSION_STR@" help=no version=no usage="xds-config" usage="$usage [--help] [--version] [--all]" usage="$usage [--prefix] [--exec-prefix] [--bindir] [--libdir] [--includedir] [--mandir] [--datadir] [--acdir]" usage="$usage [--cflags] [--ldflags] [--libs] [--libs++]" if [ $# -eq 0 ]; then echo "xds-config:Error: Invalid option" 1>&2 echo "xds-config:Usage: $usage" 1>&2 exit 1 fi output='' output_extra='' all=no prev='' OIFS="$IFS" IFS="$DIFS" for option do if [ ".$prev" != . ]; then eval "$prev=\$option" prev='' continue fi case "$option" in -*=*) optarg=`echo "$option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; *) optarg='' ;; esac case "$option" in --help|-h) echo "Usage: $usage" exit 0 ;; --version|-v) echo "OSSP XDS $xds_version" exit 0 ;; --all) all=yes ;; --prefix) output="$output $xds_prefix" ;; --exec-prefix) output="$output $xds_exec_prefix" ;; --bindir) output="$output $xds_bindir" ;; --libdir) output="$output $xds_libdir" ;; --includedir) output="$output $xds_includedir" ;; --mandir) output="$output $xds_mandir" ;; --datadir) output="$output $xds_datadir" ;; --acdir) output="$output $xds_acdir" ;; --cflags) output="$output -I$xds_includedir" output_extra="$output_extra $xds_cflags" ;; --ldflags) output="$output -L$xds_libdir" output_extra="$output_extra $xds_ldflags" ;; --libs) output="$output -lxds" output_extra="$output_extra $xds_libs" ;; * ) echo "xds-config:Error: Invalid option" 1>&2 echo "xds-config:Usage: $usage" 1>&2 exit 1; ;; esac done IFS="$OIFS" if [ ".$prev" != . ]; then echo "xds-config:Error: missing argument to --`echo $prev | sed 's/_/-/g'`" 1>&2 exit 1 fi if [ ".$output" != . ]; then if [ ".$all" = .yes ]; then output="$output $output_extra" fi echo $output fi Index: ossp-pkg/srpc/libxds/xds-config.pod ============================================================ $ cvs update -p -r1.1 xds-config.pod ## ## XDS - OSSP Extensible Data Serialization Library ## Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) ## Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) ## ## This file is part of OSSP XDS, an extensible data serialization ## library which can be found at http://www.ossp.com/pkg/xds/. ## ## 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. ## ## xds-config.pod: XDS library build utility manual page ## =pod =head1 NAME B - XDS library build utility =head1 VERSION OSSP XDS XDS_VERSION_STR =head1 SYNOPSIS B [B<--help>] [B<--version>] [B<--all>] [B<--prefix>] [B<--exec-prefix>] [B<--bindir>] [B<--libdir>] [B<--includedir>] [B<--mandir>] [B<--datadir>] [B<--acdir>] [B<--cflags>] [B<--ldflags>] [B<--libs>] [B<--libs++>] =head1 DESCRIPTION The B program is a little helper utility for easy configuring and building applications based on the xds(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 xds(3) library. =head1 OPTIONS B accepts the following options: =over 4 =item B<--help> Prints the short usage information. =item B<--version> Prints the version number and date of the installed xds(3) library. =item B<--all> Forces the output of all flags, that is, including extra flags which are not B specific. =item B<--prefix> Prints the installation prefix of architecture independent files =item B<--exec-prefix> Prints the installation prefix of architecture dependent files. =item B<--bindir> Prints the installation directory of binaries. =item B<--libdir> Prints the installation directory of libraries. =item B<--includedir> Prints the installation directory of include headers. =item B<--mandir> Prints the installation directory of manual pages. =item B<--datadir> Prints the installation directory of shared data. =item B<--acdir> Prints the installation directory of B data. =item B<--cflags> Prints the C compiler flags which are needed to compile the xds(3)-based application. The output is usually added to the C variable of the applications C. =item B<--ldflags> Prints the linker flags (C<-L>) which are needed to link the application with the xds(3) library. The output is usually added to the C variable of the applications C. =item B<--libs> Prints the library flags (C<-l>) which are needed to link the application with the C xds(3) library. The output is usually added to the C variable of the applications C. =back =head1 EXAMPLE CC = cc CFLAGS = -O `xds-config --cflags` LDFLAGS = `xds-config --ldflags` LIBS = -lm `xds-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 xds(3), cc(1). =head1 AUTHOR Ralf S. Engelschall rse@engelschall.com www.engelschall.com =cut From ossp-cvs-owner@ossp.org Thu Aug 9 23:21:06 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f79LL5I52768; Thu, 9 Aug 2001 23:21:05 +0200 (CEST) Date: Thu, 9 Aug 2001 23:21:05 +0200 (CEST) Message-Id: <200108092121.f79LL5I52768@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds configure.ac Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 09-Aug-2001 23:21:05 Branch: HEAD Handle: 2001080922210400 Modified files: ossp-pkg/srpc/libxds configure.ac Log: Already add xds-config to Autoconf stuff. Summary: Revision Changes Path 1.19 +2 -2 ossp-pkg/srpc/libxds/configure.ac ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/configure.ac ============================================================ $ cvs diff -u -r1.18 -r1.19 configure.ac --- ossp-pkg/srpc/libxds/configure.ac 2001/08/09 19:58:35 1.18 +++ ossp-pkg/srpc/libxds/configure.ac 2001/08/09 21:21:04 1.19 @@ -29,7 +29,7 @@ AC_INIT(xds.h.in) AC_PREREQ(2.52) -AC_REVISION($Revision: 1.18 $) +AC_REVISION($Revision: 1.19 $) dnl Get rid of the lousy -g and -O defaults in CFLAGS. dnl @@ -99,6 +99,6 @@ dnl Write results. dnl -AC_CONFIG_FILES(xds.h Makefile docs/Makefile) +AC_CONFIG_FILES(xds.h xds-config Makefile docs/Makefile) AC_CONFIG_COMMANDS([default], [chmod -w xds.h Makefile docs/Makefile]) AC_OUTPUT From ossp-cvs-owner@ossp.org Thu Aug 9 23:23:51 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f79LNoq52992; Thu, 9 Aug 2001 23:23:50 +0200 (CEST) Date: Thu, 9 Aug 2001 23:23:50 +0200 (CEST) Message-Id: <200108092123.f79LNoq52992@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds .cvsignore Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 09-Aug-2001 23:23:50 Branch: HEAD Handle: 2001080922235000 Modified files: ossp-pkg/srpc/libxds .cvsignore Log: Ignore generated xds-config script Summary: Revision Changes Path 1.6 +1 -0 ossp-pkg/srpc/libxds/.cvsignore ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/.cvsignore ============================================================ $ cvs diff -u -r1.5 -r1.6 .cvsignore --- ossp-pkg/srpc/libxds/.cvsignore 2001/08/08 19:15:23 1.5 +++ ossp-pkg/srpc/libxds/.cvsignore 2001/08/09 21:23:50 1.6 @@ -2,3 +2,4 @@ .*.l xds.3 xds.h Makefile configure +xds-config From ossp-cvs-owner@ossp.org Thu Aug 9 23:28:05 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f79LS4h53349; Thu, 9 Aug 2001 23:28:04 +0200 (CEST) Date: Thu, 9 Aug 2001 23:28:04 +0200 (CEST) Message-Id: <200108092128.f79LS4h53349@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds ChangeLog INSTALL NEWS README Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 09-Aug-2001 23:28:03 Branch: HEAD Handle: 2001080922280300 Added files: ossp-pkg/srpc/libxds ChangeLog INSTALL NEWS README Log: Add a bunch of files in advance to conform to GNU standards Summary: Revision Changes Path 1.1 BLOB ossp-pkg/srpc/libxds/ChangeLog 1.1 BLOB ossp-pkg/srpc/libxds/INSTALL 1.1 BLOB ossp-pkg/srpc/libxds/NEWS 1.1 +41 -0 ossp-pkg/srpc/libxds/README ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/ChangeLog ============================================================ $ cvs update -p -r1.1 ChangeLog | uuencode ChangeLog Index: ossp-pkg/srpc/libxds/INSTALL ============================================================ $ cvs update -p -r1.1 INSTALL | uuencode INSTALL Index: ossp-pkg/srpc/libxds/NEWS ============================================================ $ cvs update -p -r1.1 NEWS | uuencode NEWS Index: ossp-pkg/srpc/libxds/README ============================================================ $ cvs update -p -r1.1 README OSSP XDS - eXtensible Data Serialization Version 0.1.0 (xx-Aug-2001) ABSTRACT The OSSP XDS library is [...] COPYRIGHT AND LICENSE Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) This file is part of OSSP XDS, an extensible data serialization library which can be found at http://www.ossp.com/pkg/xds/. 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/xds/ o ftp://ftp.ossp.org/pkg/xds/ From ossp-cvs-owner@ossp.org Sat Aug 11 17:23:15 2001 Received: by mail.ossp.org (Sendmail 8.11.0+) for ossp-cvs@ossp.org id f7BFNB495288; Sat, 11 Aug 2001 17:23:11 +0200 (CEST) Date: Sat, 11 Aug 2001 17:23:11 +0200 (CEST) Message-Id: <200108111523.f7BFNB495288@ossp.org> From: "Ralf S. Engelschall" To: ossp-cvs@ossp.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [CVS] OSSP: ossp-pkg/srpc/libxds .cvsignore Makefile.in README aclocal... Reply-To: ossp-dev@ossp.org Sender: ossp-cvs-owner@ossp.org Precedence: list User-Agent: OSSP Petidomo 4.0 OSSP CVS Master Repository http://cvs.ossp.org/ ____________________________________________________________________________ Server: cvs.ossp.org Name: Ralf S. Engelschall Root: /e/ossp/cvs Email: rse@engelschall.com Module: ossp-pkg Date: 11-Aug-2001 17:23:11 Branch: HEAD Handle: 2001081116230900 Added files: ossp-pkg/srpc/libxds aclocal.m4 config.guess config.h.in config.sub libtool.m4 ltmain.sh shtool xds.m4 xds_version.c Modified files: ossp-pkg/srpc/libxds .cvsignore Makefile.in README configure.ac xds_p.h xds_test.sh Log: First cut for GNU Libtool 1.4 & GNU Shtool 1.5 support. This needs a little bit more cleanup which will follow later, but I want to flush my pending work now in order to continue with other projects. The XDS build environment now is in sync with the usual style for OSSP libraries. Summary: Revision Changes Path 1.7 +2 -0 ossp-pkg/srpc/libxds/.cvsignore 1.25 +128 -43 ossp-pkg/srpc/libxds/Makefile.in 1.2 +1 -1 ossp-pkg/srpc/libxds/README 1.1 +214 -0 ossp-pkg/srpc/libxds/aclocal.m4 1.1 +1371 -0 ossp-pkg/srpc/libxds/config.guess 1.1 +34 -0 ossp-pkg/srpc/libxds/config.h.in 1.1 +1362 -0 ossp-pkg/srpc/libxds/config.sub 1.20 +21 -64 ossp-pkg/srpc/libxds/configure.ac 1.1 +3397 -0 ossp-pkg/srpc/libxds/libtool.m4 1.1 +4946 -0 ossp-pkg/srpc/libxds/ltmain.sh 1.1 +0 -0 ossp-pkg/srpc/libxds/shtool 1.1 +75 -0 ossp-pkg/srpc/libxds/xds.m4 1.5 +4 -0 ossp-pkg/srpc/libxds/xds_p.h 1.3 +5 -2 ossp-pkg/srpc/libxds/xds_test.sh 1.1 +0 -0 ossp-pkg/srpc/libxds/xds_version.c ____________________________________________________________________________ Index: ossp-pkg/srpc/libxds/.cvsignore ============================================================ $ cvs diff -u -r1.6 -r1.7 .cvsignore --- ossp-pkg/srpc/libxds/.cvsignore 2001/08/09 21:23:50 1.6 +++ ossp-pkg/srpc/libxds/.cvsignore 2001/08/11 15:23:09 1.7 @@ -3,3 +3,5 @@ xds.3 xds.h Makefile configure xds-config +xds-config.1 +config.h Index: ossp-pkg/srpc/libxds/Makefile.in ============================================================ $ cvs diff -u -r1.24 -r1.25 Makefile.in --- ossp-pkg/srpc/libxds/Makefile.in 2001/08/09 19:58:35 1.24 +++ ossp-pkg/srpc/libxds/Makefile.in 2001/08/11 15:23:09 1.25 @@ -27,49 +27,80 @@ ## Makefile.in: make(1) build procedure ## -CC = @CC@ -AR = ar -RANLIB = @RANLIB@ -CPPFLAGS = @CPPFLAGS@ @DEFS@ -D_GNU_SOURCE -CFLAGS = @CFLAGS@ -LDFLAGS = @LDFLAGS@ -LIBS = @LIBS@ -POD2MAN = @POD2MAN@ - -LIB_NAME = libxds.a -LIB_OBJS = xds.o xds_engine_xdr.o xds_engine_xml.o -TST_SRCS = xds_test_lib.c xds_test_xdr.c xds_test_xml.c +@SET_MAKE@ +# installation paths +DESTDIR = +TOP = . +prefix = @prefix@ +exec_prefix = @exec_prefix@ +bindir = @bindir@ +libdir = @libdir@ +includedir = @includedir@ +mandir = @mandir@ + +# build tools +CC = @CC@ +LIBTOOL = ./libtool +SHTOOL = ./shtool +CPPFLAGS = @CPPFLAGS@ @DEFS@ -D_GNU_SOURCE +CFLAGS = @CFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +POD2MAN = @POD2MAN@ + +# list of objects +LIB_NAME = libxds.la +LIB_OBJS = xds.lo xds_engine_xdr.lo xds_engine_xml.lo +TST_SRCS = xds_test_lib.c xds_test_xdr.c xds_test_xml.c + +# file containing the official version information +_VERSION_FILE = \ + xds_version.c + +# helper macro for updating version information +_VERSION = \ + $(SHTOOL) version -lc -nXDS -pxds_ $$OPT $(_VERSION_FILE);\ + V=`$(SHTOOL) version -lc -dlong $(_VERSION_FILE)`;\ + sed -e "s/Version .*(.*)/Version $$V/g" README.n && mv README.n README + +# helper macro for generating a Unix manual page +_MANPAGE = \ + V1=`$(SHTOOL) version -lc -dshort $(_VERSION_FILE)`; \ + V2=`$(SHTOOL) version -lc -dlong $(_VERSION_FILE)`; \ + D=`$(SHTOOL) version -lc -dlong $(_VERSION_FILE) |\ + sed -e 's;.*(;;' -e 's;).*;;'`; \ + $(POD2MAN) --section=$${SEC} --center="$${ONELINE}" \ + --release="$$D" --date="$${NAME} $$V1" $(S)$${BASENAME}.pod |\ + sed -e "s;XDS_VERSION_STR;$$V2;" >$${BASENAME}.$${SEC} + .SUFFIXES: -.SUFFIXES: .c .o .pod .3 +.SUFFIXES: .c .lo + +.PHONY: clean distclean realclean check + +.c.lo: + $(LIBTOOL) --mode=compile --quiet $(CC) -c $(CPPFLAGS) $(CFLAGS) $< + +all: $(LIB_NAME) xds.3 xds-config.1 + +$(LIB_NAME): $(LIB_OBJS) + $(LIBTOOL) --mode=link --quiet $(CC) -o $(LIB_NAME) $(LIB_OBJS) -rpath $(libdir) \ + -version-info `$(SHTOOL) version -l c -d libtool xds_version.c` -.PHONY: clean distclean realclean check docs +clean: + -$(RM) $(LIB_OBJS) + -$(RM) ./.*.t ./.*.l + -$(RM) $(LIB_NAME) + -$(RM) xds.3 -.c.o: - $(CC) $(CPPFLAGS) $(WARNFLAGS) $(OPTFLAGS) $(CFLAGS) -c $< -.pod.3: - $(POD2MAN) --section=3 --center="XDS Library Programmer API" $< >$@ - -all: $(LIB_NAME) xds.3 - -$(LIB_NAME): $(LIB_OBJS) - @rm -f $@ - $(AR) cr $@ $(LIB_OBJS) - $(RANLIB) $@ - -clean:: - @(cd docs && $(MAKE) $@) - -rm -f $(LIB_OBJS) - -rm -f ./.*.t ./.*.l - -rm -f $(LIB_NAME) - -rm -f xds.3 - -distclean:: clean - @(cd docs && $(MAKE) $@) - -rm -f config.log config.status Makefile +distclean: clean + -$(RM) config.log config.status Makefile + -$(RM) -r .libs >/dev/null 2>&1 || true + -$(RM) xds.h -realclean:: distclean - -rm -f configure +realclean: distclean + -$(RM) configure check: $(LIB_NAME) $(TST_SRCS) -@for filename in $(TST_SRCS); do \ @@ -77,15 +108,69 @@ filebase=`echo $$filename | sed -e 's;\.c;;'`; \ testbase=`echo $$testname | sed -e 's;^XDS_TEST_;;'`; \ if [ ! -f ".$$testbase.t" ]; then \ - echo "$(CC) $(CPPFLAGS) $(WARNFLAGS) $(OPTFLAGS) $(CFLAGS) $(LDFLAGS) -D$$testname -o .$$testbase.t $$filebase.c $(LIB_NAME)"; \ - $(CC) $(CPPFLAGS) $(WARNFLAGS) $(OPTFLAGS) $(CFLAGS) $(LDFLAGS) -D$$testname -o .$$testbase.t $$filebase.c $(LIB_NAME); \ + echo "$(LIBTOOL) --mode=link --quiet $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -D$$testname -o .$$testbase.t $$filebase.c $(LIB_NAME) $(LIBS)"; \ + $(LIBTOOL) --mode=link --quiet $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -D$$testname -o .$$testbase.t $$filebase.c $(LIB_NAME) $(LIBS); \ fi; \ done; \ done; \ - sh ./xds_test.sh ./.*.t + sh ./xds_test.sh "$(LIBTOOL) --mode=execute" ./.*.t -docs: - @(cd docs && $(MAKE)) +# build Unix manual pages +xds-config.1: xds-config.pod $(_VERSION_FILE) + BASENAME="xds-config"; SEC=1; \ + NAME="XDS"; ONELINE="Extensible Data Serialization"; \ + $(_MANPAGE) +xds.3: xds.pod $(_VERSION_FILE) + BASENAME="xds"; SEC=3; \ + NAME="XDS"; ONELINE="Extensible Data Serialization"; \ + $(_MANPAGE) + +# perform standard installation procedure +install: all + $(SHTOOL) mkdir -p -f -m 755 $(DESTDIR)$(bindir) + $(SHTOOL) mkdir -p -f -m 755 $(DESTDIR)$(includedir) + $(SHTOOL) mkdir -p -f -m 755 $(DESTDIR)$(libdir) + $(SHTOOL) mkdir -p -f -m 755 $(DESTDIR)$(mandir)/man1 + $(SHTOOL) mkdir -p -f -m 755 $(DESTDIR)$(mandir)/man3 + $(SHTOOL) install -c -m 755 xds-config $(DESTDIR)$(bindir)/xds-config + $(SHTOOL) install -c -m 644 xds-config.1 $(DESTDIR)$(mandir)/man1/xds-config.1 + $(SHTOOL) install -c -m 644 xds.3 $(DESTDIR)$(mandir)/man3/xds.3 + $(SHTOOL) install -c -m 644 xds.h $(DESTDIR)$(includedir)/xds.h + @$(LIBTOOL) --mode=install $(SHTOOL) install -c -m 644 \ + libxds.la $(DESTDIR)$(libdir)/libxds.la + +# perform standard uninstallation procedure +uninstall: + @$(LIBTOOL) --mode=uninstall $(RM) $(DESTDIR)$(libdir)/libxds.la + $(RM) $(DESTDIR)$(includedir)/xds.h + $(RM) $(DESTDIR)$(mandir)/man3/xds.3 + $(RM) $(DESTDIR)$(mandir)/man1/xds-config.1 + $(RM) $(DESTDIR)$(bindir)/xds-config + $(RMDIR) $(DESTDIR)$(mandir)/man3 + $(RMDIR) $(DESTDIR)$(mandir)/man1 + $(RMDIR) $(DESTDIR)$(mandir) + $(RMDIR) $(DESTDIR)$(libdir) + $(RMDIR) $(DESTDIR)$(includedir) + $(RMDIR) $(DESTDIR)$(bindir) + +# roll a distribution tarball +dist: distclean + @$(SHTOOL) fixperm -v .; \ + V=`$(SHTOOL) version -l c -d short xds_version.c`; \ + $(SHTOOL) tarball -o xds-$${V}.tar.gz -d str-$${V} -u ossp -g ossp \ + -e 'CVS,\.cvsignore,\.[ao],^\.' -c 'gzip --best' . + +# increase or update version information +new-version: + @V="$(VERSION)"; \ + if [ ".$$V" != . ]; then \ + OPT="-s$$V"; \ + else \ + OPT="-e"; \ + fi; \ + $(_VERSION) +update-version: + @OPT="-s`$(SHTOOL) version -lc -dshort $(_VERSION_FILE)`" && $(_VERSION) # Dependencies Index: ossp-pkg/srpc/libxds/README ============================================================ $ cvs diff -u -r1.1 -r1.2 README --- ossp-pkg/srpc/libxds/README 2001/08/09 21:28:03 1.1 +++ ossp-pkg/srpc/libxds/README 2001/08/11 15:23:09 1.2 @@ -1,6 +1,6 @@ OSSP XDS - eXtensible Data Serialization - Version 0.1.0 (xx-Aug-2001) + Version 0.9.0 (11-Aug-2001) ABSTRACT Index: ossp-pkg/srpc/libxds/aclocal.m4 ============================================================ $ cvs update -p -r1.1 aclocal.m4 dnl ## dnl ## XDS - OSSP Extensible Data Serialization Library dnl ## Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) dnl ## Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) dnl ## dnl ## This file is part of OSSP XDS, an extensible data serialization dnl ## library which can be found at http://www.ossp.com/pkg/xds/. 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: local autoconf macros dnl ## dnl ## dnl ## Support for Configuration Headers dnl ## dnl ## configure.in: dnl ## AC_HEADLINE(, , dnl ## , , dnl ## ) dnl ## AC_DEFUN(AC_HEADLINE,[dnl AC_DIVERT_PUSH(NOTICE)dnl # configuration header if test ".`echo dummy [$]@ | grep help`" = .; then # bootstrapping shtool ac_prog=[$]0 changequote(, )dnl ac_srcdir=`echo $ac_prog | sed -e 's%/[^/][^/]*$%%' -e 's%\([^/]\)/*$%\1%'` changequote([, ])dnl test ".$ac_srcdir" = ".$ac_prog" && ac_srcdir=. ac_shtool="$ac_srcdir/shtool" # find out terminal sequences TB=`$ac_shtool echo -n -e %B 2>/dev/null` TN=`$ac_shtool echo -n -e %b 2>/dev/null` # find out package version $3_STR="`$ac_shtool version -l c -d long $ac_srcdir/$4`" AC_SUBST($3_STR) # friendly header ;) echo "Configuring ${TB}$1${TN} ($2), Version ${TB}${$3_STR}${TN}" echo "$5" # additionally find out hex version $3_HEX="`$ac_shtool version -l c -d hex $ac_srcdir/$4`" AC_SUBST($3_HEX) fi AC_DIVERT_POP() ])dnl dnl ## dnl ## Display Configuration Headers dnl ## dnl ## configure.in: dnl ## AC_MSG_PART() dnl ## define(AC_MSG_PART,[dnl if test ".$enable_subdir" != .yes; then AC_MSG_RESULT() AC_MSG_RESULT(${TB}$1:${TN}) fi ])dnl dnl ## dnl ## Support for Platform IDs dnl ## dnl ## configure.in: dnl ## AC_PLATFORM() dnl ## AC_DEFUN(AC_PLATFORM,[ if test ".$host" != .NONE && test ".$host" != .; then $1="$host" else $1=`${CONFIG_SHELL-/bin/sh} $srcdir/config.guess` fi $1=`${CONFIG_SHELL-/bin/sh} $srcdir/config.sub $$1` || exit 1 AC_SUBST($1) if test ".$enable_subdir" != .yes; then echo "Platform: ${TB}${$1}${TN}" fi ])dnl dnl ## dnl ## Check whether compiler option works dnl ## dnl ## configure.in: dnl ## AC_COMPILER_OPTION(, ,