db.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* 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"
/*
* db.c -- the tiny database for trace. Only stores
* global things: see symtab for per-function data.
*
*/
#include <stdio.h>
#include <string.h>
#include <libgen.h>
#include <limits.h>
#include "parser.h"
#include "trace.h"
#include "util.h"
#include "errlog.h"
#include "db.h"
static int curr_print_type;
static struct {
char Current_Library[PATH_MAX];
char Current_File[PATH_MAX];
char Output_File[PATH_MAX];
char Current_Interface[PATH_MAX];
char Source_Directory[PATH_MAX];
char Target_Directory[PATH_MAX];
int NFiles;
int Verbosity;
char Library_List[PATH_MAX];
char Translator[MAXNAMELEN];
char Test_Type[MAXNAMELEN];
int Flags;
char const *Arch;
} Database;
/* Generated by m4 -- character string values */
void
db_set_current_library(char const *p)
{
sizeof (Database.Current_Library));
}
char *
db_get_current_library(void)
{
return (Database.Current_Library);
}
void
db_set_current_interface(char const *p)
{
sizeof (Database.Current_Interface));
}
char *
db_get_current_interface(void)
{
return (Database.Current_Interface);
}
void
db_set_source_directory(char const *p)
{
sizeof (Database.Source_Directory));
'\0';
}
char *
db_get_source_directory(void)
{
return (Database.Source_Directory);
}
void
db_set_target_directory(char const *p)
{
sizeof (Database.Target_Directory));
'\0';
}
char *
db_get_target_directory(void)
{
return (Database.Target_Directory);
}
void
db_set_current_file(char const *p)
{
sizeof (Database.Current_File));
}
char *
db_get_current_file(void)
{
return (Database.Current_File);
}
/*
* Output File -- set from either -o option or file name.
*/
void
db_set_output_file(char const *p)
{
char *q;
if (p == NULL) {
return;
}
*q = '\0';
} else {
}
}
char *
db_get_output_file(void)
{
char *p, *q;
/* It was set with the -o option */
return (Database.Output_File);
} else {
/* We generate it from the current input file. */
*q = '\0';
}
return (p);
}
}
/*
* Manually written table code.
*/
/*
* add_print_types -- add legal print types. Check for void
* moved here out of collect, as collect isn't good enough
* quality of parser to have a single code path for
* types. (Shudder) Subsequently changed to use special-purpose
* test for membership. Also shudder!
*/
void
{
}
&buffer[0]);
}
}
char *
db_get_first_print_type(void)
{
curr_print_type = 1;
}
char *
db_get_next_print_type(void)
{
}
void
db_sort_print_types(void)
{
}
void
db_set_arch(char const *arch)
{
}
char const *
db_get_arch(void)
{
}