/*
* 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"
/*
* Events, FMRIs and authorities must be declared before they can be used.
* Routines in this file, driven by the parser, create the data structures
* associated with the declarations.
*/
#include <assert.h>
#include <string.h>
#include <inj_event.h>
#include <inj_err.h>
#include <inj_lex.h>
#include <inj_list.h>
#include <inj.h>
static int inj_decls_initialized;
static inj_hash_t *
{
int i;
if (!inj_decls_initialized) {
for (i = 0; i < sizeof (inj_decls) / sizeof (inj_hash_t); i++)
inj_strhash_create(&inj_decls[i]);
}
}
{
inj_var_t *v;
return (NULL);
return (inj_hash_get_cookie(v));
}
void
{
}
{
return (dlm);
}
/* An embedded event, authority, or FMRI */
{
return (NULL);
}
return (dlm);
}
{
return (dlm);
}
/* Turn a previously-declared member into an array */
void
{
}
void
{
inj_declmem_t *m, *n;
n = inj_list_next(m);
}
}
{
return (decl);
}
void
{
inj_var_t *v;
NULL) {
yyerror("duplicate member name %s (other on line %d)\n",
return;
}
}
/*
* The various declaration types - events, FMRIs, and authorities - each have
* their own semantic validation requirements.
*/
/* No user-defined class member. If ena isn't present, we'll generate it */
static int
{
yyerror("class may not be explicitly declared\n");
return (0);
}
return (1);
}
/* FMRIs must have a string scheme member */
static int
{
inj_var_t *v;
yyerror("fmri declared without scheme member\n");
return (0);
}
dlm = inj_hash_get_cookie(v);
yyerror("scheme member must be a string\n");
return (0);
}
return (1);
}
/*ARGSUSED*/
static int
{
return (1);
}
void
{
static int (*const validators[])(inj_decl_t *) = {
inj_decl_validate_nop, /* no validation for auth */
inj_decl_validate_nop /* no validation for lists */
};
inj_var_t *v;
return;
}
yyerror("duplicate %s name %s (other on line %d)\n",
return;
}
}