1 /* vlock.h -- main header file for vlock, the VT locking program for linux
3 * This program is copyright (C) 2007 Frank Benkstein, and is free
4 * software which is freely distributable under the terms of the
5 * GNU General Public License version 2, included as the file COPYING in this
6 * distribution. It is NOT public domain software, and any
7 * redistribution not permitted by the GNU General Public License is
8 * expressly forbidden without prior written permission from
13 /* name of the virtual console device */
15 #define CONSOLE "/dev/ttyv0"
17 #define CONSOLE "/dev/tty0"
19 /* template for the device of a given virtual console */
21 #define VTNAME "/dev/ttyv%x"
23 #define VTNAME "/dev/tty%d"
26 /* magic characters to clear the current terminal */
27 #define CLEAR_SCREEN "\033[H\033[J"
29 /* hard coded paths */
30 #define VLOCK_ALL PREFIX "/sbin/vlock-all"
31 #define VLOCK_CURRENT PREFIX "/sbin/vlock-current"
32 #define VLOCK_NEW PREFIX "/sbin/vlock-new"
34 /* Try to authenticate the user. When the user is successfully authenticated
35 * this function returns 1. When the authentication fails for whatever reason
36 * the function returns 0.
38 int auth(const char *user
);
40 /* Prompt for a string with the given message. The string is returned if
41 * successfully read, otherwise NULL. The caller is responsible for freeing
42 * the resulting buffer. */
43 char *prompt(const char *msg
, const struct timespec
*timeout
);
45 /* Prompt for a string with the given message without echoing input characters
46 * The string is returned if successfully read, NULL otherwise. The caller is
47 * responsible for freeing the resulting buffer. */
48 char *prompt_echo_off(const char *msg
, const struct timespec
*timeout
);