eft.c revision 0cc1f05e1162eb7e8c9e1404cd1f6ac9e4a4260e
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <stdio.h>
#include <string.h>
#include <libnvpair.h>
#include "out.h"
#include "stats.h"
#include "alloc.h"
#include "stable.h"
#include "literals.h"
#include "lut.h"
#include "esclex.h"
#include "tree.h"
#include "ipath.h"
#include "itree.h"
#include "ptree.h"
#include "check.h"
#include "version.h"
#include "fme.h"
#include "eval.h"
#include "config.h"
#include "platform.h"
/*
* eversholt diagnosis engine (eft.so) main entry points
*/
char *Autoclose; /* close cases automatically after solving */
int Autoconvict; /* true if autoconvict set in conf file */
int Verbose;
int Estats;
char **Efts;
int Max_fme; /* Maximum number of open FMEs */
/* stuff exported by yacc-generated parsers */
extern void yyparse(void);
extern int yydebug;
extern void literals_init(void);
extern void literals_fini(void);
/*ARGSUSED*/
static void
{
static char prefix[] = "ereport.";
"eft_recv: event class \"%s\" does not begin with %s",
}
/*ARGSUSED*/
static void
{
return;
}
/*ARGSUSED*/
static void
{
}
static const fmd_prop_t eft_props[] = {
};
static const fmd_hdl_ops_t eft_ops = {
eft_recv, /* fmdo_recv */
eft_timeout, /* fmdo_timeout */
eft_close, /* fmdo_close */
NULL, /* fmdo_stats */
NULL, /* fmdo_gc */
};
#define str(s) #s
static const fmd_hdl_info_t fmd_info = {
"eft diagnosis engine",
};
/*
* ename_strdup -- like strdup but ename comes in and class string goes out
*/
static char *
{
int len;
char *buf;
/* calculate length of buffer required */
len = 0;
buf[0] = '\0';
/* now build the string */
while (np) {
if (np)
}
return (buf);
}
/*ARGSUSED*/
static void
{
}
/*
* Call all of the _fini() routines to clean up the exiting DE
*/
void
call_finis(void)
{
fme_fini();
itree_fini();
ipath_fini();
lex_free();
check_fini();
tree_fini();
lut_fini();
stable_fini();
stats_fini();
out_fini();
alloc_fini();
}
/*ARGSUSED*/
static void
{
}
void
{
int count;
char *fname;
/* keep handle for routines like out() which need it */
alloc_init();
out_init("eft");
stable_init(0);
lut_init();
tree_init();
ipath_init();
check_init();
/*
* If we read no .eft files, we can't do any
* diagnosing, so we just unload ourselves
*/
if (stats_counter_value(Filecount) == 0) {
(void) lex_fini();
call_finis();
return;
}
yyparse();
(void) lex_fini();
tree_report();
if (count = out_errcount())
/* subscribe to events we expect to consume */
/* open dictionaries referenced by all .eft files */
}
(void) setlinebuf(fp);
}
"initialized, verbose %d warn %d autoclose %s autoconvict %d "
}
}
/*ARGSUSED*/
void
{
call_finis();
}