/* Return a time string. */
static char const *
-time_string (struct gl_utmp const *utmp_ent)
+time_string (STRUCT_UTMP const *utmp_ent)
{
static char buf[INT_STRLEN_BOUND (intmax_t) + sizeof "-%m-%d %H:%M"];
struct tm *tmp = localtime (&utmp_ent->ut_ts.tv_sec);
/* Display a line of information about UTMP_ENT. */
static void
-print_entry (struct gl_utmp const *utmp_ent)
+print_entry (STRUCT_UTMP const *utmp_ent)
{
struct stat stats;
time_t last_change;
/* Display UTMP_BUF, which should have N entries. */
static void
-scan_entries (idx_t n, struct gl_utmp const *utmp_buf,
+scan_entries (idx_t n, STRUCT_UTMP const *utmp_buf,
const int argc_names, char *const argv_names[])
{
if (hard_locale (LC_TIME))
const int argc_names, char *const argv_names[])
{
idx_t n_users;
- struct gl_utmp *utmp_buf;
+ STRUCT_UTMP *utmp_buf;
if (read_utmp (filename, &n_users, &utmp_buf, READ_UTMP_USER_PROCESS) != 0)
error (EXIT_FAILURE, errno, "%s", quotef (filename));
proper_name ("Kaveh Ghazi")
static int
-print_uptime (idx_t n, struct gl_utmp const *utmp_buf)
+print_uptime (idx_t n, STRUCT_UTMP const *utmp_buf)
{
int status = EXIT_SUCCESS;
time_t boot_time = 0;
idx_t entries = 0;
for (idx_t i = 0; i < n; i++)
{
- struct gl_utmp const *this = &utmp_buf[i];
+ STRUCT_UTMP const *this = &utmp_buf[i];
entries += IS_USER_PROCESS (this);
if (UT_TYPE_BOOT_TIME (this))
boot_time = this->ut_ts.tv_sec;
uptime (char const *filename, int options)
{
idx_t n_users;
- struct gl_utmp *utmp_buf;
+ STRUCT_UTMP *utmp_buf;
int read_utmp_status = (read_utmp (filename, &n_users, &utmp_buf, options) < 0
? EXIT_FAILURE : EXIT_SUCCESS);
if (read_utmp_status != EXIT_SUCCESS)
}
static void
-list_entries_users (idx_t n, struct gl_utmp const *this)
+list_entries_users (idx_t n, STRUCT_UTMP const *this)
{
char **u = xinmalloc (n, sizeof *u);
idx_t i;
users (char const *filename, int options)
{
idx_t n_users;
- struct gl_utmp *utmp_buf;
+ STRUCT_UTMP *utmp_buf;
options |= READ_UTMP_USER_PROCESS;
if (read_utmp (filename, &n_users, &utmp_buf, options) != 0)
error (EXIT_FAILURE, errno, "%s", quotef (filename));
/* Return a time string. */
static char const *
-time_string (struct gl_utmp const *utmp_ent)
+time_string (STRUCT_UTMP const *utmp_ent)
{
static char buf[INT_STRLEN_BOUND (intmax_t) + sizeof "-%m-%d %H:%M"];
struct tm *tmp = localtime (&utmp_ent->ut_ts.tv_sec);
/* Send properly parsed USER_PROCESS info to print_line. The most
recent boot time is BOOTTIME. */
static void
-print_user (struct gl_utmp const *utmp_ent, time_t boottime)
+print_user (STRUCT_UTMP const *utmp_ent, time_t boottime)
{
struct stat stats;
time_t last_change;
}
static void
-print_boottime (struct gl_utmp const *utmp_ent)
+print_boottime (STRUCT_UTMP const *utmp_ent)
{
print_line ("", ' ', _("system boot"),
time_string (utmp_ent), "", "", "", "");
}
static char *
-make_id_equals_comment (struct gl_utmp const *utmp_ent)
+make_id_equals_comment (STRUCT_UTMP const *utmp_ent)
{
char const *id = UT_ID (utmp_ent);
idx_t idlen = strlen (id);
}
static void
-print_deadprocs (struct gl_utmp const *utmp_ent)
+print_deadprocs (STRUCT_UTMP const *utmp_ent)
{
static char *exitstr;
char *comment = make_id_equals_comment (utmp_ent);
}
static void
-print_login (struct gl_utmp const *utmp_ent)
+print_login (STRUCT_UTMP const *utmp_ent)
{
char *comment = make_id_equals_comment (utmp_ent);
PIDSTR_DECL_AND_INIT (pidstr, utmp_ent);
}
static void
-print_initspawn (struct gl_utmp const *utmp_ent)
+print_initspawn (STRUCT_UTMP const *utmp_ent)
{
char *comment = make_id_equals_comment (utmp_ent);
PIDSTR_DECL_AND_INIT (pidstr, utmp_ent);
}
static void
-print_clockchange (struct gl_utmp const *utmp_ent)
+print_clockchange (STRUCT_UTMP const *utmp_ent)
{
/* FIXME: handle NEW_TIME & OLD_TIME both */
print_line ("", ' ', _("clock change"),
}
static void
-print_runlevel (struct gl_utmp const *utmp_ent)
+print_runlevel (STRUCT_UTMP const *utmp_ent)
{
static char *runlevline, *comment;
unsigned char last = utmp_ent->ut_pid / 256;
/* Print the username of each valid entry and the number of valid entries
in UTMP_BUF, which should have N elements. */
static void
-list_entries_who (idx_t n, struct gl_utmp const *utmp_buf)
+list_entries_who (idx_t n, STRUCT_UTMP const *utmp_buf)
{
idx_t entries = 0;
char const *separator = "";
/* Display UTMP_BUF, which should have N entries. */
static void
-scan_entries (idx_t n, struct gl_utmp const *utmp_buf)
+scan_entries (idx_t n, STRUCT_UTMP const *utmp_buf)
{
char *ttyname_b IF_LINT ( = nullptr);
time_t boottime = TYPE_MINIMUM (time_t);
who (char const *filename, int options)
{
idx_t n_users;
- struct gl_utmp *utmp_buf;
+ STRUCT_UTMP *utmp_buf;
if (short_list)
options |= READ_UTMP_USER_PROCESS;
if (read_utmp (filename, &n_users, &utmp_buf, options) != 0)