> struct gp_event_t {
> int type; /* see below */
> int mx, my; /* current mouse coordinates */
> int par1, par2; /* other parameters, depending on the event type */
> char text[100]; /* literal command string for type=GE_cmd */
> };
>
>
> As of this morning, there are exactly zero uses of text[] in gnuplot
> code, and no instances that generate event types GE_stderr, GE_stdout,
> or GE_cmd.
>
> I propose to remove all of these
The Presentation Manager terminal has a menu entry, where you can put a
command for gnuplot, and that gets passed into gnuplot and executed. You can
enjoy this feature when piping data to gnuplot, where the interactive
terminal prompt is not available. This command works via the shared memory
and input_from_PM_Terminal, as all the data from gnupmdrv.exe go to
gnuplot.exe.
That field "text[100]" was intended for a similar functionality in X11/Mac
et al terminals. As X11 still lacks any menus and user buttons, it was
never implemented.
> but there is one bit of OS2-specific code that puzzles me. At the very
> end of src/gpexecute.c is this:
>
> /* OS/2 communication via shared memory; coded according to gp_execute() */
> #ifdef OS2_IPC
> if (input_from_PM_Terminal == NULL)
> return;
> ((char *) input_from_PM_Terminal)[0] = '%';
> /* copy the command to shared memory */
> memcpy(((char *) input_from_PM_Terminal) + 1, &ge, sizeof(ge));
> if (pausing) { /* no communication during pause */
> /* DosBeep(440,111); */
> ((char *) input_from_PM_Terminal)[0] = 0;
> return;
> }
> gp_post_shared_mem();
> #endif
>
> Who is at the other end of this communication channel?
It is in command.c, where the reader runs in a thread (the other thread is
normal readline). That's why there are no such communication nightmares in
OS/2 as there were with the select() and stdin and others under unixes.
Search that file for "input_from_PM_Terminal".
> Does it go to some external program that thinks it knows sizeof(gp_event_t)?
> Is struct gp_event_t (including the 100 char text field) a native
> structure in OS2 that gnuplot tries to be compatible with?
No, it's not necessary.
> Petr:
>
> Could you check whether the attached small patch removing unused
> commands and text array breaks the pm terminal?
The current cvs compiles OK on OS/2.
---
PM
|