--- libwww/Library/src/HTEvent.c 1996/12/02 20:19:44 2.5 +++ libwww/Library/src/HTEvent.c 1996/12/13 22:06:01 2.6 @@ -3,7 +3,7 @@ ** ** (c) COPYRIGHT MIT 1996. ** Please first read the full copyright statement in the file COPYRIGH. -** @(#) $Id: HTEvent.c,v 2.5 1996/12/02 20:19:44 frystyk Exp $ +** @(#) $Id: HTEvent.c,v 2.6 1996/12/13 22:06:01 eric Exp $ ** ** The event dispatcher allows applications to register their own event ** models. They may register the standard HTEventrg methods from @@ -114,3 +114,15 @@ PUBLIC BOOL HTEvent_setTimeout(HTEvent * return NO; } +PUBLIC char * HTEvent_type2str(HTEventType type) +{ + int i; + static char space[20]; /* in case we have to sprintf type */ + static struct {int type; char * str;} match[] = {HT_EVENT_INITIALIZER}; + for (i = 0; i < sizeof(match)/sizeof(match[0]); i++) + if (match[i].type == type) + return match[i].str; + sprintf(space, "0x%x", type); + return space; +} +