|
|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T s
Length: 2833 (0xb11)
Types: TextFile
Names: »support.c«
└─⟦a05ed705a⟧ Bits:30007078 DKUUG GNU 2/12/89
└─⟦34cc4e2f7⟧ »./UNRELEASED/xgdb3.2.tar.Z«
└─⟦80fac5d7c⟧
└─⟦this⟧ »./support.c«
└─⟦a05ed705a⟧ Bits:30007078 DKUUG GNU 2/12/89
└─⟦e10a7c8ba⟧ »./UNRELEASED/xgdb.tar.Z«
└─⟦ae30648b5⟧
└─⟦this⟧ »./support.c«
\f
#ifndef lint
static char rcsid[] = "$Header: support.c,v 1.1 89/07/05 15:36:47 hubbard Exp $";
#endif
/*
*
* Copyright 1988, 1989
* PCS Computer Systeme, GmbH
* Munich, West Germany
*
* All rights reserved.
*
* This is unsupported software and is subject to change without notice.
* PCS makes no representations about the suitability of this software
* for any purpose. It is supplied "as is" without express or implied
* warranty.
*
* Permission to use, copy, modify, and distribute this software and its
* documentation for any purpose and without fee is hereby granted, provided
* that the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of PCS Computer Systeme not be used in
* advertising or publicity pertaining to distribution of the software
* without specific, written prior permission.
*
*/
/*
* Author: Jordan K. Hubbard
* For: PCS Computer Systems, GmbH.
* When: January 5th, 1989.
*
* $Log: support.c,v $
* Revision 1.1 89/07/05 15:36:47 hubbard
* Initial revision
*
*
*/
#if !defined(SAVERTNAME)
char *_Curr_rtn = "(unknown)";
#else
char *_Curr_rtn;
#endif
#if !defined(TRACE)
char *Curr_rtn()
{
return("(Unknown)");
}
#else
#include "xgdb.h"
typedef struct _func_stack {
String rtn_name;
struct _func_stack *next;
} FunctionStack;
static FunctionStack *Head;
int _rtn_level;
int _rtn_trace;
char *Curr_rtn()
{
if (Head == (FunctionStack *)NULL)
return((char *)NULL);
else
return(Head->rtn_name);
}
void push_rtn(s)
register char *s;
{
if (!Head) {
Head = (FunctionStack *)XtMalloc(sizeof(FunctionStack));
Head->rtn_name = s;
Head->next = 0;
}
else {
FunctionStack *ptr;
ptr = (FunctionStack *)XtMalloc(sizeof(FunctionStack));
ptr->rtn_name = s;
ptr->next = Head;
Head = ptr;
}
_rtn_level++;
if (_rtn_trace) {
Cardinal i;
for (i = 0; i < _rtn_level; i++)
putchar('\t');
printf("Pushing to: %s (level %d)\n", Head->rtn_name, _rtn_level);
}
}
void pop_rtn()
{
FunctionStack *ptr;
if (Head == (FunctionStack *)NULL)
return;
ptr = Head;
Head = Head->next;
if (_rtn_trace) {
Cardinal i;
for (i = 0; i < _rtn_level; i++)
putchar('\t');
fprintf(stderr, "Popping from: %s (level %d)\n", ptr->rtn_name,
_rtn_level);
}
XtFree(ptr);
_rtn_level--;
}
/*
* Some systems retch when you pass strlen() a NULL pointer.
* Here's a way of getting around it.
*/
#ifdef hlh
strlen(s)
char *s;
{
int count = 0;
if (s == 0)
return(0);
while (*s++)
count++;
return(count);
}
#endif /* hlh */
#endif /* TRACE */