/*
* 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 (c) 1997-1999 by Sun Microsystems, Inc.
* All rights reserved.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <stdio.h>
#include <string.h>
#include <limits.h>
#include <malloc.h>
#include "parser.h"
#include "trace.h"
#include "util.h"
#include "symtab.h"
#include "errlog.h"
/* Types */
struct entry_t {
char *e_name;
int e_valid;
int e_line;
char *e_file;
/* base type, ie. char if e_type is char */
char *e_basetype;
int e_pre_uses;
int e_post_uses;
};
typedef struct entry_head_t {
int used;
int n_entries;
} EHEAD;
static struct symtab_t {
/* Includes */
/* Bindings */
/* Types */
/* Error-message information. */
int Line;
/* Trace additions */
int Nonreturn;
int Skip;
/* Adl additions */
/* various assertions, one hopes */
} Symtab;
/* File Globals. */
static EHEAD *create_entry_table(int);
char *, int, char *, int, char *, char *, int, char *, int, int);
static void clear_entries(EHEAD *, int, int);
char *, char *, int, char *, int, int);
char *, int, char *, int, char *, char *, int, char *, int, int);
static void symtab_clear_varargs(void);
static void symtab_clear_globals(void);
static void symtab_clear_print_types(void);
static void symtab_set_nonreturn(int);
/*
* symtab_new_function -- clear counts, variables for a new function.
*/
void
{
}
/*
* symtab_clear_function -- clear function-prototype-derived
* values. Called on each prototype line and at beginning
* of interface.
*/
void
symtab_clear_function(void)
{
}
/*
* symtab_clear_varargs -- called only at end
*/
static void
symtab_clear_varargs(void)
{
}
/*
* symtab_clear_includes -- clear only at end of file (union++)
*/
void
symtab_clear_includes(void)
{
}
static void
symtab_clear_globals(void)
{
}
void
symtab_clear_errval(void)
{
}
void
symtab_clear_exception(void)
{
}
static void
symtab_clear_print_types(void)
{
}
/* Generated by m4 -- character string values */
void
symtab_set_prototype(char *p)
{
}
char *
symtab_get_prototype(void)
{
}
void
symtab_set_formals(char *p)
{
}
char *
symtab_get_formals(void)
{
}
void
symtab_set_actuals(char *p)
{
}
char *
symtab_get_actuals(void)
{
}
void
symtab_set_cast(char *p)
{
}
char *
symtab_get_cast(void)
{
}
void
symtab_set_filename(const char *p)
{
}
char *
symtab_get_filename(void)
{
}
/* Generated by m4 -- int values */
static void
{
}
int
symtab_get_nonreturn(void)
{
}
void
{
}
int
symtab_get_line(void)
{
}
void
{
}
int
symtab_get_skip(void)
{
}
/*
* Manually written access functions for ENTRY * variables.
*/
void
{
}
ENTRY *
symtab_get_function(void)
{
return (NULL);
else
}
void
{
}
ENTRY *
symtab_get_exception(void)
{
return (NULL);
else
}
void
int levels)
{
"", -1, -1);
}
ENTRY *
symtab_get_errval(void)
{
return (NULL);
else
}
/*
* Manually written access function for tables of ENTRYs
*/
void
{
}
}
static int curr_arg;
ENTRY *
symtab_get_first_arg(void)
{
curr_arg = 1;
}
ENTRY *
symtab_get_next_arg(void)
{
}
ENTRY *
symtab_get_last_arg(void)
{
}
void
{
}
}
static int curr_vararg;
ENTRY *
symtab_get_first_vararg(void)
{
curr_vararg = 1;
}
ENTRY *
symtab_get_next_vararg(void)
{
}
void
{
}
}
static int curr_global;
ENTRY *
symtab_get_first_global(void)
{
curr_global = 1;
}
ENTRY *
symtab_get_next_global(void)
{
}
/*
* manually written functions for accessing tables of strings
*/
/*
* symtab_add_print_types -- add only non-void print types (due to
* parser errors in collect.c, yuck). Also note trick compare...
* TBD : common code in db, symtab needs to be
* pulled out, as they're getting out of sync.
*/
void
{
#ifdef notdef
return;
}
#endif
}
&buffer[0]);
}
}
static table_t *
{
return (free_string_table(t));
}
static int curr_print_type;
char *
{
curr_print_type = 1;
}
char *
{
}
void
{
}
}
}
static int curr_include;
char *
symtab_get_first_include(void)
{
curr_include = 1;
}
char *
symtab_get_next_include(void)
{
}
void
symtab_sort_includes(void)
{
}
/*
* ENTRYs -- access functions to contents of an entry.
*/
char *
{
return (e->e_name);
}
int
{
if (e == NULL)
return (NO);
else
return (e->e_valid);
}
int
{
return (e->e_line);
}
char *
{
return (e->e_file);
}
/*
* x_type_of -- return (type with an extension: an embedded %s where
* the name goes.
*/
char *
{
return (e->e_type);
else
return (NULL);
}
/*
* type_of -- return (just the type, with the %s removed. This is the common
* case, and its also the slowest... TBD.
*/
char *
{
char *p, *q;
p = e->e_type;
q = &buffer[0];
while (*p != NULL) {
if (*p == '%') {
p += 2;
} else {
*q++ = *p++;
}
}
*q = NULL;
}
else
return (NULL);
}
char *
{
return (e->e_basetype);
else
return (NULL);
}
int
{
return (e->e_levels);
else
return (NULL);
}
char *
{
return (e->e_attribute);
else
return (NULL);
}
char *
{
return (e->e_attribute);
else
return (NULL);
}
int
{
if (e)
return (e->e_pre_uses);
else
return (-1);
}
int
{
if (e)
return (e->e_post_uses);
else
return (-1);
}
/*
* allocate_entry -- make a parameter list into a complete
* ENTRY struct, allocated dynamically.
*/
/* ARGSUSED -- lint bug */
static ENTRY *
{
if (e == NULL) {
}
}
}
/*
* set_entry -- set a passed-in entry, using
* passed parameters, to values suitable for a
* symtab entry
*/
static ENTRY *
{
if (e == NULL) {
}
switch (kind) {
case PRIMITIVE:
break;
case COMPOSITE:
break;
case VARARG:
break;
default:
}
e->e_pre_uses = npre;
e->e_post_uses = npost;
return (e);
}
/*
* free_entry -- really just mark an entry as invalid
*/
static ENTRY *
{
if (e != NULL)
return (e);
}
/*
* ENTRY tables.
*/
static EHEAD *
create_entry_table(int n)
{
EHEAD *p;
}
p->used = -1;
p->n_entries = n;
return (p);
}
static EHEAD *
{
if (t == NULL) {
}
t->used++;
}
t = t2;
t->n_entries += ENTRY_INCREMENT;
}
return (t);
}
static ENTRY *
{
if (t == NULL) {
return (NULL);
return (NULL);
} else {
}
}
static EHEAD *
{
if (t != NULL)
t->used = -1;
return (t);
}
static void
{
int i;
}
}