From: Daniel J S. <dan...@ie...> - 2004-07-09 20:14:48
|
Ethan Merritt wrote: >On Friday 09 July 2004 09:52 am, Daniel J Sebald wrote: > > >>Hans-Bernhard Broeker wrote: >> >> >>> I would prefer just adding the new arguments unconditionally. >>> >>> >>You must be referring to the df_open() function: >> >>int >>#ifdef BINARY_DATA_FILE >>df_open(int max_using, int plot_mode) >>#else >>df_open(int max_using) >>#endif >>{ >> >> > >With regard to the df_* functions in particular, I hit the same problem >of the plot information not being easily available. See this comment >in plot2d.c: > >#ifdef EAM_HISTOGRAMS > /* EAM FIXME - There are places in df_readline where it would be really */ > /* nice to know what kind of plot we are making, so I think that */ > /* current_plot should be a parameter to df_readline. For now, however, */ > /* I am using a global variable, and only for HISTOGRAMS. */ > df_current_plot = (current_plot->plot_style == HISTOGRAMS) ? current_plot : NULL; >#endif > > >I do not like the idea of extending any of the df_* functions to add only a >single value like plot_mode. I would, however, support the idea of adding >a pointer to the plot itself. E.g. > >df_readline(double v[], int max, struct curve_points *current_plot) >df_open(int max_using, struct curve_points *current_plot) > Such that the information in question can be had inside df_readline and df_open with something like if (current_plot->plot_type == SPLOT) { } ? Or however it is organized. That's just as well. Dan |