+#ifdef SSHCMD
+/*
+ 2010/03/01...
+ Reopen a connection that was made with an external ssh client
+ after it has been closed.
+ */
+int
+redossh() {
+ int x, netsave;
+ x = nettype;
+ debug(F111,"redossh nettype",ttname,nettype);
+ if ((y = setlin(XXSSH,0,1)) < 0) {
+ if (errno)
+ printf("?%s\n",ck_errstr());
+ else
+ return(y);
+ nettype = x; /* Failed, restore net type. */
+ success = 0;
+ return(y);
+ }
+ netsave = x;
+ return(y);
+}
+#endif /* SSHCMD */
+
+/*
+ Like hmsga() in ckuus2.c but takes a single substitution parameter, s2,
+ which replaces every occurrence of "%s" in the first argument.
+ Added to print text containing the copyright year, so the year doesn't
+ have to be hardwired into lots of scattered text strings.
+*/
+int /* Print an array of lines, */
+#ifdef CK_ANSIC
+hmsgaa(char *s[], char *s2) /* pausing at end of each screen. */
+#else
+hmsgaa(s,s2) char *s[]; char *s2;
+#endif /* CK_ANSIC */
+{
+ extern int hmtopline;
+#ifdef OS2
+ extern int tt_rows[], tt_cols[];
+#else /* OS2 */
+ extern int tt_rows, tt_cols;
+#endif /* OS2 */
+ int x, y, i, j, k, n;
+ if ((x = cmcfm()) < 0) return(x);
+
+#ifdef CK_TTGWSIZ
+#ifdef OS2
+ ttgcwsz();
+#else /* OS2 */
+ /* Check whether window size changed */
+ if (ttgwsiz() > 0) {
+ if (tt_rows > 0 && tt_cols > 0) {
+ cmd_rows = tt_rows;
+ cmd_cols = tt_cols;
+ }
+ }
+#endif /* OS2 */
+#endif /* CK_TTGWSIZ */
+
+ printf("\n"); /* Start off with a blank line */
+ n = (hmtopline > 0) ? hmtopline : 1; /* Line counter */
+ for (i = 0; *s[i]; i++) {
+ printf((char *)s[i],s2); /* Print a line. */
+ printf("\n");
+ y = (int)strlen(s[i]);
+ k = 1;
+ for (j = 0; j < y; j++) /* See how many newlines were */
+ if (s[i][j] == '\n') k++; /* in the string... */
+ n += k;
+ if (n > (cmd_rows - 3) && *s[i+1]) /* After a screenful, give them */
+ if (!askmore()) return(0); /* a "more?" prompt. */
+ else n = 0;
+ }
+ printf("\n");
+ return(0);
+}
+