__unused static void showsmopts(struct smopts_s *sp) { (void)printf("%s (%p)\n", sp->s_name, sp); showname(sp->s_smopts); }
/****************************************************************** * redraw_screen * *******************************************************************/ void redraw_screen(int *bell, int maxmoves, int num, long score, int nf, int diamonds, int mx, int sx, int sy, char (*frow)[ROWLEN + 1]) { char buffer[50]; clear(); move(0, 48); addstr("Score\t Diamonds"); move(1, 48); addstr("\tFound\tTotal"); move(3, 48); sprintf(buffer, "%ld\t %d\t %d ", score, nf, diamonds); addstr(buffer); if (!edit_mode) { move(6, 48); sprintf(buffer, "Current screen %d", num); addstr(buffer); } if (maxmoves != -1) sprintf(buffer, "Moves remaining = %d ", maxmoves); else strcpy(buffer, " Unlimited moves "); move(15, 48); addstr(buffer); move(17, 56); if (*bell) addstr("Bell ON "); else addstr("Bell OFF"); if (mx != -1) { /* tell player if monster exists */ draw_symbol(50, 11, 'M'); move(12, 56); addstr("Monster on the"); move(13, 56); printw("%-14s", "loose!"); } else { draw_symbol(50, 11, ' '); move(12, 56); printw("%14s", ""); move(13, 56); printw("%14s", ""); } showname(); if (!debug_disp) display(sx, sy, frow); else map(frow); }
int main(int argc, char *argv[]) { int opt; int i; int status = 0; (void) setlocale(LC_ALL, ""); (void) textdomain(TEXT_DOMAIN); /* * PRIV_FILE_DAC_READ is needed to read the QFNAME file * Clear all other privleges from the limit set, and add * the required privilege to the bracketed set. */ if (__init_suid_priv(PU_CLEARLIMITSET, PRIV_FILE_DAC_READ, NULL) == -1) { (void) fprintf(stderr, gettext("Insufficient privileges, " "quota must be set-uid root or have " "file_dac_read privileges\n")); exit(1); } load_libzfs(); while ((opt = getopt(argc, argv, "vV")) != EOF) { switch (opt) { case 'v': vflag++; break; case 'V': /* Print command line */ { char *opt_text; int opt_count; (void) fprintf(stdout, "quota -F UFS "); for (opt_count = 1; opt_count < argc; opt_count++) { opt_text = argv[opt_count]; if (opt_text) (void) fprintf(stdout, " %s ", opt_text); } (void) fprintf(stdout, "\n"); } break; case '?': fprintf(stderr, "usage: quota [-v] [username]\n"); zexit(32); } } if (quotactl(Q_ALLSYNC, NULL, (uid_t)0, NULL) < 0 && errno == EINVAL) { if (vflag) fprintf(stderr, "There are no quotas on this system\n"); nolocalquota++; } if (argc == optind) { showuid(getuid()); zexit(0); } for (i = optind; i < argc; i++) { if (alldigits(argv[i])) { showuid((uid_t)atoi(argv[i])); } else status |= showname(argv[i]); } __priv_relinquish(); return (status); }