/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* Just in case we're not in a build environment, make sure that
* TEXT_DOMAIN gets set to something.
*/
#if !defined(TEXT_DOMAIN)
#endif
#include <meta.h>
#include <ctype.h>
/*
* free md.tab struct
*/
void
)
{
}
}
}
}
/*
* (re)allocate argv array
*/
static void
)
{
/* allocate in chunks */
return;
/* (re)allocate */
} else {
}
/* zero out new stuff */
/* adjust for new size */
}
/*
* (re)allocate line array
*/
static void
)
{
/* allocate in chunks */
return;
/* (re)allocate */
} else {
}
/* zero out new stuff */
/* adjust for new size */
}
/*
* parse up md.tab struct
*/
static void
char *metatab_name,
)
{
char *context;
/* we can count on '\n\0' as the last characters */
/* allocate context buffer "file line XXX" */
/* parse lines */
while (p < e && *p != '\0') {
char *t;
/* allocate new line */
lineno);
/* comments */
if (*p == '#') {
while (*p != '\n')
++p;
}
/* coalesce \ continuations */
t = p;
while (*t != '\n') {
if ((*t == '\\') && (*(t + 1) == '\n')) {
*t++ = ' ';
*t = ' ';
++lineno;
}
++t;
}
/* leading whitespace */
while ((*p != '\n') && (isspace(*p)))
++p;
/* count lines */
if (*p == '\n') {
++p;
++lineno;
continue;
}
/* tokenize line */
while ((p < e) && (*p != '\n')) {
char **argvp;
/* allocate new token */
/* find end of token */
*argvp = p;
while ((*p != '\n') && (! isspace(*p)))
++p;
/* terminate */
if (*p == '\n') {
*p++ = '\0';
++lineno;
break;
}
/* eat white space */
*p++ = '\0';
while ((p < e) && (*p != '\n') && (isspace(*p)))
++p;
}
/* fill in the rest */
break;
}
}
/* cleanup */
}
/*
* read in md.tab file and return struct
*/
md_tab_t *
char *filename,
)
{
char *p;
/* open tab file */
goto out;
}
goto out;
}
/* allocate table */
/* read in data */
sofar = 0;
int cnt;
goto out;
} else if (cnt == 0) {
goto out;
}
p += cnt;
}
/* close file */
fd = -1;
goto out;
}
fd = -1;
/* parse it up */
/* return success if file was correctly parsed */
return (tabp);
/* cleanup, return error */
out:
if (fd >= 0)
return (NULL);
}
/*
* find line in md.tab
*/
char *name,
)
{
/* if name is not legal meta name then return NULL */
return (NULL);
return (linep);
}
}
return (NULL);
}