/***********************************************************************1* *2* This software is part of the ast package *3* Copyright (c) 1985-2011 AT&T Intellectual Property *4* and is licensed under the *5* Eclipse Public License, Version 1.0 *6* by AT&T Intellectual Property *7* *8* A copy of the License is available at *9* http://www.eclipse.org/org/documents/epl-v10.html *10* (with md5 checksum b35adb5213ca9657e911e9befb180842) *11* *12* Information and Software Systems Research *13* AT&T Research *14* Florham Park NJ *15* *16* Glenn Fowler <[email protected]> *17* David Korn <[email protected]> *18* Phong Vo <[email protected]> *19* *20***********************************************************************/21#pragma prototyped22/*23* Xopen 4.2 compatibility24*/2526#include <ast.h>2728#undef _lib_getsubopt /* we can satisfy the api */2930#if _lib_getsubopt3132NoN(getsubopt)3334#else3536#undef _BLD_ast /* enable ast imports since we're user static */3738#include <error.h>3940extern int41getsubopt(register char** op, char* const* tp, char** vp)42{43register char* b;44register char* s;45register char* v;4647if (*(b = *op))48{49v = 0;50s = b;51for (;;)52{53switch (*s++)54{55case 0:56s--;57break;58case ',':59*(s - 1) = 0;60break;61case '=':62if (!v)63{64*(s - 1) = 0;65v = s;66}67continue;68default:69continue;70}71break;72}73*op = s;74*vp = v;75for (op = (char**)tp; *op; op++)76if (streq(b, *op))77return op - (char**)tp;78}79*vp = b;80return -1;81}8283#endif848586