/* (C) Copyright International Business Machines Corporation 23 January */
/* 1990.  All Rights Reserved. */
/*  */
/* See the file USERAGREEMENT distributed with this software for full */
/* terms and conditions of use. */
/* File: resolve.c */
/* Author: David F. Bacon */
#ifndef lint
static char sccsinfo[] = "@(#)resolve.c	1.4 3/13/90";
#endif

/*
 * global variables used to pass information around, since this ain't no
 * attribute grammar.
 */

#include <string.h>

#include "li.h"
#include "storage.h"

#include "resdefs.h"

object *Absprog;		/* the main mother */

object *Currentdefinition;	/* type or attribute being defined.  only */
				/*  used by complex types like record which */
				/*  need to know their typeid before the end */
				/*  of the definition is parsed. */

object *Typedefinitions;
object *Attrdefinitions;



char *
copystring(src)
char *src;
{
    char *newstring;


    newstring = (char *) tempalloc(strlen(src)+1);
    strcpy(newstring, src);
    return(newstring);
}


char *downcase(s)
char *s;
{
    char *os;

    os = s;

    while (*s) {
	if (*s >= 'A' and *s <= 'Z')
	  *s = *s + 32;
	s++;
    }

    return(os);
}


object *
new_object()
{
    object *obj;

    obj = (object *) tempalloc(sizeof(object));
    obj->tsdr = &dr_bottom;

    return(obj);
}


object *
void_obj()
{
    return(nil);
}


void
set_pragma(Str, pragm)
object *Str;			/* inout charstring */
char *pragm;			/* in string */
{
    if (pragm)
      chs_lit(Str, pragm);
    else
      chs_lit(Str, "");
}
