From: Arlin Davis Date: Thu, 27 Mar 2008 01:58:17 +0000 (-0800) Subject: Remove improperly licensed GETOPT code from dtest source tree. X-Git-Tag: dapl-2.0.8-1~20 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=632af34f0ea15e12b572c656fe2ef561a0ad62b7;p=~ardavis%2Fdapl.git Remove improperly licensed GETOPT code from dtest source tree. Signed-off by: Arlin Davis ardavis@ichips.intel.com --- diff --git a/test/dtest/GETOPT.C b/test/dtest/GETOPT.C deleted file mode 100644 index c366289..0000000 --- a/test/dtest/GETOPT.C +++ /dev/null @@ -1,148 +0,0 @@ -/*------------------------------------------------------------------------ -** -** Copyright (c) 1996, Intel Corp. All rights reserved. -** -** THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF -** Intel Corp. -** The copyright notice above does not evidence any -** actual or intended publication of such source code. -** -** -** Module: getopt.c -** -** Source: PAL, Intel Corp. Mike Ripley -** -** Abstract: -** This is source for the standard getopt() library. -** Original source was obtained from the public domain, -** and modified to better suit DOS and Win32 environments. -** -** Environment: -** Microsoft Win32 -** Microsoft Visual C++ 4.0 - - ---------------------------------------------------------------------- - - LIMITATION OF LIABILITY AND DISCLAIMER - OF - WARRANTY FOR SOFTWARE - - - - - -THE SOFTWARE THAT YOU ARE RECEIVING IS LICENSED FREE OF CHARGE. THE SOFTWARE -IS PROVIDED "AS IS." INTEL MAKES NO WARRANTY OF ANY KIND REGARDING THE -SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE STATE LAW. INTEL WILL NOT -PROVIDE ANY INSTALLATION OR TECHNICAL SUPPORT, OR ANY OTHER KIND OF -ASSISTANCE TO YOU REGARDING YOUR USE OF THE SOFTWARE. IF THE SOFTWARE PROVES -DEFECTIVE ANYWAY, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR -CORRECTION. INTEL WILL NOT PROVIDE ANY UPDATES, ENHANCEMENTS OR EXTENSIONS -TO THE SOFTWARE. - -ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED -WARRANTIES MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE EXCLUDED, -AND DO NOT APPLY TO THE SOFTWARE YOU ARE RECEIVING. - -IN ADDITION TO ANY OTHER DISCLAIMER SET FORTH HEREIN, INTEL WILL NOT HAVE ANY -LIABILITY TO YOU FOR: - - a) any defects in the software you are receiving; or - - b) any inability by you to operate the software you are receiving to any - performance specification; or - - c) any claim by you or any third party with respect to, or arising out - of, the use of the software. - - -INTEL DOES NOT MAKE ANY WARRANTIES OF ANY KIND THAT THE SOFTWARE DOES NOT OR -WILL NOT INFRINGE ANY COPYRIGHT, PATENT, TRADE SECRET OR ANY OTHER -INTELLECTUAL PROPERTY RIGHT OF ANY THIRD PARTY IN ANY COUNTRY. - -IN NO EVENT, SHALL INTEL BE LIABLE TO YOU OR ANY THIRD PARTY FOR ANY INDIRECT, -SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES OF ANY KIND, INCLUDING BUT NOT -LIMITED TO LOSS OF PROFITS, LOSS OF USE OF DATA, OR INTERRUPTION OF BUSINESS, -EVEN IF ADVISED OF THE POSSIBILITIES OF SUCH DAMAGES. - - --------------------------------------------------------------------------*/ - - - -/* Comment header from original: - * - * Here's something you've all been waiting for: the AT&T public domain - * source for getopt(3). It is the code which was given out at the 1985 - * UNIFORUM conference in Dallas. I obtained it by electronic mail - * directly from AT&T. The people there assure me that it is indeed - * in the public domain. - * - * There is no manual page. That is because the one they gave out at - * UNIFORUM was slightly different from the current System V Release 2 - * manual page. The difference apparently involved a note about the - * famous rules 5 and 6, recommending using white space between an option - * and its first argument, and not grouping options that have arguments. - * Getopt itself is currently lenient about both of these things. White - * space is allowed, but not mandatory, and the last option in a group can - * have an argument. That particular version of the man page evidently - * has no official existence, and my source at AT&T did not send a copy. - * The current SVR2 man page reflects the actual behavor of this getopt. - * However, I am not about to post a copy of anything licensed by AT&T. - */ - -#include -#include - -int opterr = 1; -int optind = 1; -int optopt; -char *optarg; - -int getopt(int argc, char **argv, char *opts) -{ - static int sp = 1; - register int c; - register char *cp; - - if(sp == 1) - if(optind >= argc || - argv[optind][0] != '-' || argv[optind][1] == '\0') - return(EOF); - else if(strcmp(argv[optind], "--") == 0) { - optind++; - return(EOF); - } - optopt = c = argv[optind][sp]; - if(c == ':' || (cp=strchr(opts, c)) == NULL) { - if (opterr) - fprintf(stderr,"%s: illegal option -- %c\n",argv[0],c); - if(argv[optind][++sp] == '\0') { - optind++; - sp = 1; - } - return('?'); - } - if(*++cp == ':') { - if(argv[optind][sp+1] != '\0') - optarg = &argv[optind++][sp+1]; - else if(++optind >= argc) { - if (opterr) - fprintf(stderr, - "%s: option requires argument -- %c\n", - argv[0], c); - sp = 1; - return('?'); - } else - optarg = argv[optind++]; - sp = 1; - } else { - if(argv[optind][++sp] == '\0') { - sp = 1; - optind++; - } - optarg = NULL; - } - return(c); -} diff --git a/test/dtest/GETOPT.H b/test/dtest/GETOPT.H deleted file mode 100644 index 30025d6..0000000 --- a/test/dtest/GETOPT.H +++ /dev/null @@ -1,78 +0,0 @@ -/*------------------------------------------------------------------------ -** -** Copyright (c) 1994, Intel Corp. All rights reserved. -** -** THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF Intel Corp. -** The copyright notice above does not evidence any -** actual or intended publication of such source code. -** -** -** Module: getopt.h -** -** Source: PAL, Intel Corp. Mike Ripley -** -** Abstract: -** This an include file for the standard getopt() library. -** -** Environment: -** Microsoft Win32 -** Microsoft Visual C++ 4.0 -** ---------------------------------------------------------------------- - - LIMITATION OF LIABILITY AND DISCLAIMER - OF - WARRANTY FOR SOFTWARE - - - - - -THE SOFTWARE THAT YOU ARE RECEIVING IS LICENSED FREE OF CHARGE. THE SOFTWARE -IS PROVIDED "AS IS." INTEL MAKES NO WARRANTY OF ANY KIND REGARDING THE -SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE STATE LAW. INTEL WILL NOT -PROVIDE ANY INSTALLATION OR TECHNICAL SUPPORT, OR ANY OTHER KIND OF -ASSISTANCE TO YOU REGARDING YOUR USE OF THE SOFTWARE. IF THE SOFTWARE PROVES -DEFECTIVE ANYWAY, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR -CORRECTION. INTEL WILL NOT PROVIDE ANY UPDATES, ENHANCEMENTS OR EXTENSIONS -TO THE SOFTWARE. - -ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED -WARRANTIES MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE EXCLUDED, -AND DO NOT APPLY TO THE SOFTWARE YOU ARE RECEIVING. - -IN ADDITION TO ANY OTHER DISCLAIMER SET FORTH HEREIN, INTEL WILL NOT HAVE ANY -LIABILITY TO YOU FOR: - - a) any defects in the software you are receiving; or - - b) any inability by you to operate the software you are receiving to any - performance specification; or - - c) any claim by you or any third party with respect to, or arising out - of, the use of the software. - - -INTEL DOES NOT MAKE ANY WARRANTIES OF ANY KIND THAT THE SOFTWARE DOES NOT OR -WILL NOT INFRINGE ANY COPYRIGHT, PATENT, TRADE SECRET OR ANY OTHER -INTELLECTUAL PROPERTY RIGHT OF ANY THIRD PARTY IN ANY COUNTRY. - -IN NO EVENT, SHALL INTEL BE LIABLE TO YOU OR ANY THIRD PARTY FOR ANY INDIRECT, -SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES OF ANY KIND, INCLUDING BUT NOT -LIMITED TO LOSS OF PROFITS, LOSS OF USE OF DATA, OR INTERRUPTION OF BUSINESS, -EVEN IF ADVISED OF THE POSSIBILITIES OF SUCH DAMAGES. - - --------------------------------------------------------------------------*/ - -#ifndef _GETOPT_H_ -#define _GETOPT_H_ - -extern int getopt(int argc, char **argv, char *opts); - -extern int optind; -extern int optopt; -extern char *optarg; -extern int opterr; - -#endif // _GETOPT_H_