/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 1982-2012 AT&T Intellectual Property *
* and is licensed under the *
* Eclipse Public License, Version 1.0 *
* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
* *
* Information and Software Systems Research *
* AT&T Research *
* Florham Park NJ *
* *
* David Korn <dgk@research.att.com> *
* *
***********************************************************************/
#pragma prototyped
/*
* getopts optstring name [arg...]
*
* David Korn
* AT&T Labs
* research!dgk
*
*/
#include "defs.h"
#include "variables.h"
#include <error.h>
#include <nval.h>
#include "builtins.h"
{
#if SHOPT_NAMESPACE
#else
#endif /* SHOPT_NAMESPACE */
{
}
return(1);
}
{
int jmpval;
struct {
} disc;
value[1] = 0;
key[1] = 0;
{
case 'a':
break;
case ':':
break;
case '?':
break;
}
if(argc>2)
{
argv +=1;
argc -=1;
}
else
{
}
options++;
if(jmpval)
{
if(r==0)
return(2);
sh_exit(2);
}
switch(opt_info.index>=0 && opt_info.index<=argc?(opt_info.num= LONG_MIN,flag=optget(argv,options)):0)
{
case '?':
if(mode==0)
/* FALL THRU */
case ':':
flag = '?';
if(mode)
else
{
flag = '?';
}
{
}
break;
case 0:
{
com[0] = "-?";
com[1] = 0;
}
*options = '?';
r=1;
break;
default:
}
if(r<0)
r = 0;
else if (opt_info.arg && opt_info.num > 0 && isalpha((char)opt_info.num) && !isdigit(opt_info.arg[0]) && opt_info.arg[0] != '-' && opt_info.arg[0] != '+')
{
key[1] = 0;
}
else if(extended)
{
Sfdouble_t d;
}
else
return(r);
}