- RoteTermPrivate *pd; /* private state data */
-
- bool insert; /* insert or replace mode */
-
- /* --- dirtiness flags: the following flags will be raised when the
- * corresponding items are modified. They can only be unset by YOU
- * (when, for example, you redraw the term or something) --- */
- bool curpos_dirty; /* whether cursor location has changed */
- bool *line_dirty; /* whether each row is dirty */
- /* --- end dirtiness flags */
-} RoteTerm;
-
-/* Creates a new virtual terminal with the given dimensions. You
- * must destroy it with rote_vt_destroy after you are done with it.
- * The terminal will be initially blank and the cursor will
- * be at the top-left corner.
- *
- * Returns NULL on error.
- */
-RoteTerm *rote_vt_create(int rows, int cols);
-
-/* Destroys a virtual terminal previously created with
- * rote_vt_create. If rt == NULL, does nothing. */
-void rote_vt_destroy(RoteTerm *rt);
-
-/* Starts a forked process in the terminal. The <command> parameter
- * is a shell command to execute (it will be interpreted by '/bin/sh -c')
- * Returns the pid of the forked process.
- *
- * Some useful reminders: If you want to be notified when child processes exit,
- * you should handle the SIGCHLD signal. If, on the other hand, you want to
- * ignore exitting child processes, you should set the SIGCHLD handler to
- * SIG_IGN to prevent child processes from hanging around the system as 'zombie
- * processes'.
- *
- * Continuing to write to a RoteTerm whose child process has died does not
- * accomplish a lot, but is not an error and should not cause your program
- * to crash or block indefinitely or anything of that sort :-)
- * If, however, you want to be tidy and inform the RoteTerm that its
- * child has died, call rote_vt_forsake_child when appropriate.
- *
- * If there is an error, returns -1. Notice that passing an invalid
- * command will not cause an error at this level: the shell will try
- * to execute the command and will exit with status 127. You can catch
- * that by installing a SIGCHLD handler if you want.
- */
-pid_t rote_vt_forkpty(RoteTerm *rt, const char *path, const char *argv[]);
-
-/* Disconnects the RoteTerm from its forked child process. This function
- * should be called when the child process dies or something of the sort.
- * It is not strictly necessary to call this function, but it is
- * certainly tidy. */
-void rote_vt_forsake_child(RoteTerm *rt);
-
-int rote_vt_read(RoteTerm *rt, char *buf, int buflen);
-
-/* Puts data into the terminal: if there is a forked process running,
- * the data will be sent to it. If there is no forked process,
- * the data will simply be injected into the terminal (as in
- * rote_vt_inject) */
-void rote_vt_write(RoteTerm *rt, const char *data, int length);
-
-/* Inject data into the terminal. <data> needs NOT be 0-terminated:
- * its length is solely determined by the <length> parameter. Please
- * notice that this writes directly to the terminal, that is,
- * this function does NOT send the data to the forked process
- * running in the terminal (if any). For that, you might want
- * to use rote_vt_write.
- */
-void rote_vt_inject(RoteTerm *rt, const char *data, int length);
-
-#ifdef USE_NCURSES
-/* Paints the virtual terminal screen on the given window, putting
- * the top-left corner at the given position. The cur_set_attr
- * function must set the curses attributes given a Rote attribute
- * byte. It should, for example, do wattrset(win, COLOR_PAIR(n)) where
- * n is the colorpair appropriate for the attribute and such.
- *
- * If you pass NULL for cur_set_attr, the default implementation will
- * set the color pair given by (bg * 8 + 7 - fg), which seems to be
- * a common mapping, and the bold and blink attributes will be mapped
- * to A_BOLD and A_BLINK.
- *
- * At the end of the function, the cursor will be left where the virtual
- * cursor of the terminal is supposed to be.
- *
- * This function does not call wrefresh(win); you have to do that yourself.
- */
-void rote_vt_draw(RoteTerm *rt, WINDOW *win, int startrow, int startcol,
- void (*cur_set_attr)(WINDOW *win, unsigned char attr));