mmsp_common.c revision cee0fb94c0d4227de0a00efc162fb2739844b641
/*
* 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 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <thread.h>
#include <synch.h>
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#include <sys/int_types.h>
#include <mmsp_yacc.h>
#include <mms_list.h>
#include <mms_sym.h>
#include <mms_parser.h>
#include <mms_par_impl.h>
#include <mmsp_yacc.h>
#include <mms_sym.h>
#define yyparse mms_mmsp_parse
int mms_mmsp_debug;
extern int mms_mmsp__flex_debug;
extern uchar_t *mms_token_flags;
/*
* The symbol table will be sorted in ascending order when the parser
* is initialized. There is no need to add new symbols in any particular order.
*/
extern mms_sym_t *mms_symtab;
extern int mms_num_syms;
static int mms_symtab_initialized = 0;
mms_pw_t *
{
/* Can't get mem for wka */
return (NULL);
}
return (NULL);
}
return (NULL);
}
(void) mutex_lock(&mms_symtab_mutex);
if (!mms_symtab_initialized) {
}
if (!(*depend_symtab_initialized)) {
}
(void) mutex_unlock(&mms_symtab_mutex);
return (wka);
}
/*
* The following is the symbols for all the MMP commands.
*/
extern mms_sym_t *mms_mmp_symtab;
extern int mms_num_mmsp_syms;
static int mms_mmp_symtab_initialized = 0;
/*
*
* mmp_parse_buf(), dmpm_parse_buf(), dmpd_parse_buf(), lmpm_parse_buf()
* lmpl_parse_buf()
*
* Parameters:
* cmd_node Ptr to the generated parse tree of XML cmd string
* msg_list List needed by parser routine if errors encountered
* buf XML cmd string that needs to be parsed.
*
* These functions are less specific version of the functions less the _buf
* These routines use the generic mms_par_input routine as the input routine
* used by the parser, thus if a user has a character string, they can
* use these routines instead of having to generate their own input routine
* and data structure that retains an index into the cmd string as the
* parser parses the cmd.
*
* Return Value:
* 0 If cmd parsed without errors.
* 1 If cmd parsed with errors.
* -1 If unable to allocate enough memory for parse tree.
*
*/
int
{
int rc = 0;
mms_mmsp__flex_debug = 0;
mms_mmsp_debug = 0;
sizeof (wka->par_wka_parser));
return (-1);
}
/* LINTED assignment */
rc = 1;
}
}
return (rc);
}
/*
* These are the DMPM commands
*/
extern mms_sym_t *mms_dmpm_symtab;
extern int mms_num_dmpm_syms;
static int mms_dmpm_symtab_initialized = 0;
int
{
int rc = 0;
mms_mmsp__flex_debug = 0;
mms_mmsp_debug = 0;
sizeof (wka->par_wka_parser));
return (-1);
}
rc = 1;
}
return (rc);
}
/*
* These are the DMPD commands
*/
extern mms_sym_t *mms_dmpd_symtab;
extern int mms_num_dmpd_syms;
static int mms_dmpd_symtab_initialized = 0;
int
{
int rc = 0;
mms_mmsp__flex_debug = 0;
mms_mmsp_debug = 0;
sizeof (wka->par_wka_parser));
return (-1);
}
rc = 1;
}
return (rc);
}
/*
* These are the LMPM commands
*/
extern mms_sym_t *mms_lmpm_symtab;
extern int mms_num_lmpm_syms;
static int mms_lmpm_symtab_initialized = 0;
int
{
int rc = 0;
mms_mmsp__flex_debug = 0;
mms_mmsp_debug = 0;
sizeof (wka->par_wka_parser));
return (-1);
}
rc = 1;
}
return (rc);
}
/*
* These are the LMPD commands
*/
extern mms_sym_t *mms_lmpl_symtab;
extern int mms_num_lmpl_syms;
static int mms_lmpl_symtab_initialized = 0;
int
{
int rc = 0;
mms_mmsp__flex_debug = 0;
mms_mmsp_debug = 0;
sizeof (wka->par_wka_parser));
return (-1);
}
rc = 1;
}
return (rc);
}