Obsolete the ivl_event_name function.

This commit is contained in:
steve 2003-03-06 01:24:37 +00:00
parent 0bf901e9bb
commit 22d392a75c
3 changed files with 39 additions and 9 deletions

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: ivl_target.h,v 1.113 2003/03/06 00:28:41 steve Exp $"
#ident "$Id: ivl_target.h,v 1.114 2003/03/06 01:24:37 steve Exp $"
#endif
#ifdef __cplusplus
@ -388,15 +388,17 @@ extern int ivl_const_signed(ivl_net_const_t net);
* Events are a unification of named events and implicit events
* generated by the @ statements.
*
* ivl_event_name
* ivl_event_name (Obsolete)
* ivl_event_basename
* Return the name of the event. The basename is the name within
* the scope, as declared by the user.
*
* ivl_event_edge
* Return the edge type for the event. If this is a named event
* that has no network input, then the edge is IVL_EDGE_NONE.
*/
extern const char* ivl_event_name(ivl_event_t net);
extern const char* ivl_event_basename(ivl_event_t net);
extern const char* ivl_event_name(ivl_event_t net);
extern const char* ivl_event_basename(ivl_event_t net);
extern unsigned ivl_event_nany(ivl_event_t net);
extern ivl_nexus_t ivl_event_any(ivl_event_t net, unsigned idx);
@ -1144,6 +1146,9 @@ _END_DECL
/*
* $Log: ivl_target.h,v $
* Revision 1.114 2003/03/06 01:24:37 steve
* Obsolete the ivl_event_name function.
*
* Revision 1.113 2003/03/06 00:28:41 steve
* All NetObj objects have lex_string base names.
*

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: t-dll-api.cc,v 1.93 2003/03/06 00:28:42 steve Exp $"
#ident "$Id: t-dll-api.cc,v 1.94 2003/03/06 01:24:37 steve Exp $"
#endif
# include "config.h"
@ -153,12 +153,31 @@ extern "C" int ivl_const_signed(ivl_net_const_t net)
extern "C" const char* ivl_event_name(ivl_event_t net)
{
return net->name;
static char*name_buffer = 0;
static unsigned name_size = 0;
ivl_scope_t scope = net->scope;
const char*sn = ivl_scope_name(scope);
unsigned need = strlen(sn) + 1 + strlen(net->name) + 1;
if (need < name_size) {
name_buffer = (char*)realloc(name_buffer, need);
name_size = need;
}
strcpy(name_buffer, sn);
char*tmp = name_buffer + strlen(sn);
*tmp++ = '.';
strcpy(tmp, net->name);
cerr << "ANACHRONISM: Call to anachronistic ivl_event_name." << endl;
return name_buffer;
}
extern "C" const char* ivl_event_basename(ivl_event_t net)
{
return basename(net->scope, net->name);
return net->name;
}
@ -1733,6 +1752,9 @@ extern "C" ivl_variable_type_t ivl_variable_type(ivl_variable_t net)
/*
* $Log: t-dll-api.cc,v $
* Revision 1.94 2003/03/06 01:24:37 steve
* Obsolete the ivl_event_name function.
*
* Revision 1.93 2003/03/06 00:28:42 steve
* All NetObj objects have lex_string base names.
*

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: t-dll.cc,v 1.106 2003/03/06 00:28:42 steve Exp $"
#ident "$Id: t-dll.cc,v 1.107 2003/03/06 01:24:37 steve Exp $"
#endif
# include "config.h"
@ -625,7 +625,7 @@ void dll_target::event(const NetEvent*net)
struct ivl_event_s *obj = new struct ivl_event_s;
ivl_scope_t scope = find_scope(des_, net->scope());
obj->name = strings_.add(net->full_name().c_str());
obj->name = net->name();
obj->scope = scope;
scope_add_event(scope, obj);
@ -2023,6 +2023,9 @@ extern const struct target tgt_dll = { "dll", &dll_target_obj };
/*
* $Log: t-dll.cc,v $
* Revision 1.107 2003/03/06 01:24:37 steve
* Obsolete the ivl_event_name function.
*
* Revision 1.106 2003/03/06 00:28:42 steve
* All NetObj objects have lex_string base names.
*