no more stupid warnings.
[apps/madtty.git] / madtty / madtty.h
index cb34762..63dc94b 100644 (file)
@@ -85,7 +85,7 @@
 
 /* Represents each of the text cells in the terminal screen */
 typedef struct RoteCell_ {
-    unsigned char ch;    /* >= 32, that is, control characters are not
+    unsigned int ch;     /* >= 32, that is, control characters are not
                           * allowed to be on the virtual screen */
 
     unsigned char attr;  /* a color attribute, as described previously */
@@ -118,12 +118,14 @@ typedef struct RoteTerm_ {
                                   * that will be used for newly inserted
                                   * characters */
 
+    int   pty;                   /* pty of the process */
     pid_t childpid;              /* pid of the child process running in the
                                   * terminal; 0 for none. This is READ-ONLY. */
 
     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) --- */
@@ -174,15 +176,6 @@ pid_t rote_vt_forkpty(RoteTerm *rt, const char *path, const char *argv[]);
  * certainly tidy. */
 void rote_vt_forsake_child(RoteTerm *rt);
 
-/* Does some data plumbing, that is, sees if the sub process has
- * something to write to the terminal, and if so, write it. If you
- * called rote_vt_fork to start a forked process, you must call
- * this function regularly to update the terminal. 
- *
- * This function will not block, that is, if there is no data to be
- * read from the child process it will return immediately. */
-void rote_vt_update(RoteTerm *rt);
-
 int rote_vt_read(RoteTerm *rt, char *buf, int buflen);
 
 /* Puts data into the terminal: if there is a forked process running,
@@ -216,8 +209,6 @@ void rote_vt_inject(RoteTerm *rt, const char *data, int length);
  * cursor of the terminal is supposed to be.
  *
  * This function does not call wrefresh(win); you have to do that yourself.
- * This function automatically calls rote_vt_update prior to drawing
- * so that the drawn contents are accurate.
  */
 void rote_vt_draw(RoteTerm *rt, WINDOW *win, int startrow, int startcol,
                   void (*cur_set_attr)(WINDOW *win, unsigned char attr));
@@ -242,13 +233,4 @@ void *rote_vt_take_snapshot(RoteTerm *rt);
  * This function does NOT free() the passed buffer */
 void rote_vt_restore_snapshot(RoteTerm *rt, void *snapbuf);
 
-/* Returns the pseudo tty descriptor associated with the given terminal.
- * Please don't do weird things with it (like close it for instance),
- * or things will break 
- * 
- * This function returns -1 if the given terminal does not yet have
- * an associated pty. A pty is only associated to a terminal when
- * needed, e.g. on a call to rote_vt_forkpty. */
-int rote_vt_get_pty_fd(RoteTerm *rt);
-
 #endif /* MADTTY_MADTTY_H */