- ttyprt(&dz_tty[0], 0);
- if (nl[SNDZ].n_type == 0)
- goto dh;
- if (kflg) {
- nl[SNDZ].n_value = clear(nl[SNDZ].n_value);
- nl[SDZ].n_value = clear(nl[SDZ].n_value);
- }
- lseek(fc, (long)nl[SNDZ].n_value, 0);
- read(fc, &ndz, sizeof(ndz));
- printf("%d dz lines\n", ndz);
- lseek(fc, (long)nl[SDZ].n_value, 0);
- read(fc, dz_tty, ndz * sizeof (struct tty));
- for (tp = dz_tty; tp < &dz_tty[ndz]; tp++)
- ttyprt(tp, tp - dz_tty);
-dh:
- if (nl[SNDH].n_type == 0)
- goto pty;
- if (kflg) {
- nl[SNDH].n_value = clear(nl[SNDH].n_value);
- nl[SDH].n_value = clear(nl[SDH].n_value);
- }
- lseek(fc, (long)nl[SNDH].n_value, 0);
- read(fc, &ndz, sizeof(ndz));
- printf("%d dh lines\n", ndz);
- lseek(fc, (long)nl[SDH].n_value, 0);
- read(fc, dz_tty, ndz * sizeof(struct tty));
- for (tp = dz_tty; tp < &dz_tty[ndz]; tp++)
- ttyprt(tp, tp - dz_tty);
-pty:
- if (nl[SPTY].n_type == 0)
- goto pty;
+ ttyprt(&tty[0], 0);
+ if (nl[SNDZ].n_type != 0)
+ dottytype("dz", SDZ, SNDZ);
+ if (nl[SNDH].n_type != 0)
+ dottytype("dh", SDH, SNDH);
+ if (nl[SNDMF].n_type != 0)
+ dottytype("dmf", SDMF, SNDMF);
+ if (nl[SNDHU].n_type != 0)
+ dottytype("dhu", SDHU, SNDHU);
+ if (nl[SNDMZ].n_type != 0)
+ dottytype("dmz", SDMZ, SNDMZ);
+ if (nl[SNPTY].n_type != 0)
+ dottytype("pty", SPTY, SNPTY);
+}
+
+dottytype(name, type, number)
+char *name;
+{
+ int ntty;
+ register struct tty *tp;
+ extern char *realloc();
+
+ if (tty == (struct tty *)0)
+ return;