X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=profile.c;h=11b01b5035a0e4a1581287cfa3c277cc304f1cf2;hb=5ca49b0460f36ac969b7ef388f586782d584b36d;hp=5dad475bcbc850de7464064afd3acc50e0e38efa;hpb=c4691306c40dedc61110174dde15310c359abb6a;p=ext%2Fsubsurface.git diff --git a/profile.c b/profile.c index 5dad475..11b01b5 100644 --- a/profile.c +++ b/profile.c @@ -166,6 +166,37 @@ static void plot_text(struct graphics_context *gc, const text_render_options_t * cairo_show_text(cr, buffer); } +struct ev_select { + char *ev_name; + gboolean plot_ev; +}; +static struct ev_select *ev_namelist; +static int evn_allocated; +static int evn_used; + +void remember_event(const char *eventname) +{ + int i=0, len; + + if (!eventname || (len = strlen(eventname)) == 0) + return; + while (i < evn_used) { + if (!strncmp(eventname,ev_namelist[i].ev_name,len)) + return; + i++; + } + if (evn_used == evn_allocated) { + evn_allocated += 10; + ev_namelist = realloc(ev_namelist, evn_allocated * sizeof(struct ev_select)); + if (! ev_namelist) + /* we are screwed, but let's just bail out */ + return; + } + ev_namelist[evn_used].ev_name = strdup(eventname); + ev_namelist[evn_used].plot_ev = TRUE; + evn_used++; +} + static void plot_one_event(struct graphics_context *gc, struct plot_info *pi, struct event *event, const text_render_options_t *tro) { int i, depth = 0;