/****************************************************************************
- * Copyright (c) 1998-2012,2016 Free Software Foundation, Inc. *
+ * Copyright 2018,2020 Thomas E. Dickey *
+ * Copyright 1998-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
/*
* Author: Thomas E. Dickey (1998-on)
*
- * $Id: ditto.c,v 1.43 2016/02/06 21:19:28 tom Exp $
+ * $Id: ditto.c,v 1.49 2020/02/02 23:34:34 tom Exp $
*
* The program illustrates how to set up multiple screens from a single
* program.
#include <test.priv.h>
#include <sys/stat.h>
+#if HAVE_DELSCREEN
+
#ifdef USE_PTHREADS
#include <pthread.h>
#endif
static void
usage(void)
{
- fprintf(stderr, "usage: ditto [terminal1 ...]\n");
+ fprintf(stderr, "Usage: ditto [terminal1 ...]\n");
ExitProgram(EXIT_FAILURE);
}
errno = EISDIR;
failed(slave_name);
}
- sprintf(s_option, "-S%s/%d", slave_name, aslave);
+ _nc_SPRINTF(s_option, _nc_SLIMIT(sizeof(s_option))
+ "-S%s/%d", slave_name, aslave);
if (fork()) {
execlp(xterm_prog, xterm_prog, s_option, "-title", path, (char *) 0);
_exit(0);
return fp;
}
-static void
+static int
init_screen(
#if HAVE_USE_WINDOW
SCREEN *sp GCC_UNUSED,
target->windows[k] = inner;
}
doupdate();
+ return TRUE;
}
static void
}
ExitProgram(EXIT_SUCCESS);
}
+#else
+int
+main(void)
+{
+ printf("This program requires the curses delscreen function\n");
+ ExitProgram(EXIT_FAILURE);
+}
+#endif