/* * set_log_file: sets the log file name. If logging is on already, this * closes the last log file and reopens it with the new name. This is called * automatically when you SET LOGFILE. */ void set_log_file (const void *stuff) { const char *filename = (const char *)stuff; Filename expand; if (!filename) return; if (normalize_filename(filename, expand)) { say("SET LOGFILE: %s contains an invalid directory", filename); return; } set_string_var(LOGFILE_VAR, expand); if (irclog_fp) { int value; value = 0; logger(&value); value = 1; logger(&value); } }
void speakup_register_var(struct var_t *var) { static char nothing[2] = "\0"; int i; struct st_var_header *p_header; BUG_ON(!var || var->var_id < 0 || var->var_id >= MAXVARS); if (var_ptrs[0] == NULL) { for (i = 0; i < MAXVARS; i++) { p_header = &var_headers[i]; var_ptrs[p_header->var_id] = p_header; p_header->data = NULL; } } p_header = var_ptrs[var->var_id]; if (p_header->data != NULL) return; p_header->data = var; switch (p_header->var_type) { case VAR_STRING: set_string_var(nothing, p_header, 0); break; case VAR_NUM: case VAR_TIME: set_num_var(0, p_header, E_DEFAULT); break; default: break; } return; }
static void set_mangle_logfiles (Window *win, char *value, int unused) { char *nv = NULL; Window *tmp = NULL; while (traverse_all_windows(&tmp)) tmp->mangler = parse_mangle(value, tmp->mangler, &nv); set_string_var(MANGLE_LOGFILES_VAR, nv); new_free(&nv); }
void set_cd_device(Window *win, char *str, int blah) { if (drive) close(drive); if (!str || !check_mount(str)) { put_it("%s: ERROR: CDROM is already mounted, please unmount, and try again",cparse(cdrom_prompt)); set_string_var(CD_DEVICE_VAR,NULL); return; } if (cd_init(str) < 0) { put_it("%s: ERROR: Could not initalize the CDROM, check if a disk is inside",cparse(cdrom_prompt)); set_string_var(CD_DEVICE_VAR,NULL); return; } put_it("%s: CDROM device is now set to - %s",cparse(cdrom_prompt),str); set_string_var(CD_DEVICE_VAR,str); }
void toggle_reverse_status(Window *win, char *unused, int value) { if (!value) set_int_var(REVERSE_STATUS_VAR, 1); else set_int_var(REVERSE_STATUS_VAR, 0); #ifndef ONLY_STD_CHARS set_string_var(SHOW_NUMERICS_STR_VAR, value ? "[1;31mù[0m[1;37mí[1;31mù[0m" : "-:-"); set_numeric_string(current_window, value ? "[1;31mù[0m[1;37mí[1;31mù[0m":"-:-", 0); #endif reinit_status(win, unused, value); }
void convert_swatch(Window *win, char *str, int unused) { unsigned long flag; char *p; if (from_server != -1) { flag = ircop_str_to_flags(get_server_ircop_flags(from_server), str); set_server_ircop_flags(from_server, flag); } else flag = ircop_str_to_flags(default_swatch, str); default_swatch = flag; p = ircop_flags_to_str(flag); set_string_var(SWATCH_VAR, p); new_free(&p); }
/* * set_log_file: sets the log file name. If logging is on already, this * closes the last log file and reopens it with the new name. This is called * automatically when you SET LOGFILE. */ void set_log_file(Window * win, char *filename, int unused) { char *expanded; if (filename) { if (strcmp(filename, get_string_var(LOGFILE_VAR))) expanded = expand_twiddle(filename); else expanded = expand_twiddle(get_string_var(LOGFILE_VAR)); set_string_var(LOGFILE_VAR, expanded); new_free(&expanded); if (irclog_fp) { logger(curr_scr_win, NULL, 0); logger(curr_scr_win, NULL, 1); } } }
void debug_window(Window *win, char *value, int unused) { Window *old_win = win; char *nv = NULL; internal_debug = parse_debug(value, internal_debug, &nv); set_string_var(DEBUG_VAR, nv); if (internal_debug) { Window *tmp = NULL; if (!get_window_by_name("debug") && (tmp = new_window(win->screen))) { malloc_strcpy(&tmp->name, "debug"); tmp->double_status = 0; hide_window(tmp); tmp->window_level = LOG_DEBUG; tmp->absolute_size = 1; tmp->skip = 1; debugging_window = tmp; set_wset_string_var(tmp->wset, STATUS_FORMAT1_WSET, DEFAULT_FORMAT_DEBUG_FSET); build_status(tmp, NULL, 0); update_all_windows(); set_input_prompt(win, get_string_var(INPUT_PROMPT_VAR), 0); cursor_to_input(); set_screens_current_window(old_win->screen, old_win); } } else { if ((old_win = get_window_by_name("debug"))) { delete_window(old_win); debugging_window = NULL; update_all_windows(); set_input_prompt(current_window, get_string_var(INPUT_PROMPT_VAR), 0); cursor_to_input(); } } new_free(&nv); }
static void set_speed(Window *win, char *value, int unused) { int def_speed = 0; if (value && *value) { for (def_speed = 0; _n_speed[def_speed]; def_speed++) { if (!my_strnicmp(value, _n_speed[def_speed], strlen(value))) break; } if (def_speed > MAX_SPEED) if (isdigit(*value)) def_speed = my_atol(value); if (def_speed > MAX_SPEED) def_speed = 0; } send_all_servers(CMDS_CHANGESPEED, "%d", def_speed); set_int_var(DEFAULT_SPEED_VAR, def_speed); set_string_var(DEFAULT_SPEED_VAR, _n_speed[def_speed]); return; }
static char *parse_args (char *argv[], int argc, char **envp) { int ac; int add_servers = 0; char *channel = NULL; char *ptr; *nickname = 0; *password = 0; if ((ptr = getenv("NAPNICK"))) strmcpy(nickname, ptr, NICKNAME_LEN); if ((ptr = getenv("NAPPASS"))) strmcpy(password, ptr, NICKNAME_LEN); if ((ptr = getenv("NAP_HOST")) || (ptr = getenv("NAPHOST"))) malloc_strcpy(&LocalHostName, ptr); for ( ac = 1; ac < argc; ac++ ) { if (argv[ac][0] == '-') { switch (argv[ac][1]) { case 'r': /* Load list of servers from this file */ { char *what = empty_string; if (argv[ac][2]) what = &argv[ac][2]; else if (argv[ac+1] && argv[ac+1][0] != '-') { what = argv[ac+1]; ac++; } else fprintf(stderr, "Missing argumenT to -r\n"); if (*what) { add_servers = 1; malloc_strcpy(&ircservers_file, what); } break; } case 'a': /* add server, not replace */ { add_servers = 1; if (argv[ac][2]) fprintf(stderr, "Ignoring junk after -a\n"); break; } case 'H': { char *what = empty_string; if (argv[ac][2]) what = &(argv[ac][2]); else if (argv[ac+1] && argv[ac+1][0] != '-') { what = argv[ac+1]; ac++; } else { fprintf(stderr, "Specify a hostname\n"); exit(1); } malloc_strcpy(&LocalHostName, what); break; } case 'S': { if (argv[ac][2]) { char *what; what = &argv[ac][2]; starting_server = my_atol(what); } else { ac++; starting_server = my_atol(argv[ac]); } break; } case 'n': { char *what = empty_string; if (argv[ac][2]) what = &(argv[ac][2]); else if (argv[ac+1] && argv[ac+1][0] != '-') { what = argv[ac+1]; ac++; } else { fprintf(stderr,"Missing argument for -n\n"); exit(1); } strmcpy(nickname, what, NICKNAME_LEN); break; } case 'p': { char *pass = NULL; if ((pass = getpass("Enter Password :"******"%s %s\n", nap_version, internal_version); exit(1); #if defined(WINNT) || defined(EMX) case 's': setup_autoexec(); exit(1); #endif default: fprintf(stderr, "Unknown flag: %s\n",argv[ac]); case 'h': fprintf(stderr, "%s", switch_help); #if defined(WINNT) || defined(EMX) fprintf(stderr, "%s", switch_help_w); #endif exit(1); } /* End of switch */ } else { if (!strchr(argv[ac], '.')) strmcpy(nickname, argv[ac], NICKNAME_LEN); else build_server_list(argv[ac]); } } if ((ptr = getenv("NAPLIB"))) irc_lib = m_opendup("/", ptr, "/", NULL); else { char *s; if ((s = expand_twiddle(NAPLIB))) irc_lib = s; else malloc_strcpy(&irc_lib, NAPLIB); } if ((ptr = getenv("NAPPATH"))) malloc_strcpy(&irc_path, ptr); else { #ifdef NAPPATH malloc_strcpy(&irc_path, NAPPATH); #else #ifdef WINNT malloc_strcpy(&irc_path, ".:~/TekNap:"); #else malloc_strcpy(&irc_path, ".:~/.TekNap:"); #endif irc_path = m_opendup(irc_lib, "/", "script", NULL); #endif } if (LocalHostName) { struct hostent *hp; printf("Your hostname appears to be [%s]\n", LocalHostName); memset((void *)&LocalHostAddr, 0, sizeof(LocalHostAddr)); if ((hp = gethostbyname(LocalHostName))) memcpy((void *)&LocalHostAddr.sin_addr, hp->h_addr, sizeof(struct in_addr)); } if (!check_nickname(nickname)) { fprintf(stderr, "\n Invalid Nickname\n"); exit(1); } set_string_var(LOAD_PATH_VAR, irc_path); new_free(&irc_path); if ((ptr = getenv("HOME"))) malloc_strcpy(&my_path, ptr); if (!my_path || !*my_path) #ifdef WINNT { malloc_strcpy(&my_path, "//c/TekNap/"); bsd_setenv("HOME", "//c/TekNap", 1); } if (access("//c/TekNap", F_OK) != 0) { fprintf(stderr, "Directory doesn't exist, creating //c/TekNap\n"); mkdir("//c/TekNap", S_IWUSR|S_IRUSR|S_IXUSR); } #else malloc_strcpy(&my_path, "/"); #endif #if defined(WINNT) || defined(__EMX__) convert_unix(my_path); #endif if (!bircrc_file) malloc_sprintf(&bircrc_file, "%s%s", my_path, IRCRC_NAME); if ((ptr = getenv("NAPPORT"))) nap_port = my_atol(ptr); if ((ptr = getenv("NAPSERVER"))) build_server_list(ptr); #ifdef DEFAULT_SERVER { if (!read_server_list()) { ptr = LOCAL_COPY(DEFAULT_SERVER); build_server_list(ptr); } } #endif return (channel); }
/* * set_translation: Called when the TRANSLATION variable is SET. * Attempts to load a new translation table. */ void set_translation(Window *win, char *tablename, int unused) { FILE *table; unsigned char temp_table[512]; char *filename = NULL, *s; int inputs[8]; int j, c = 0; char buffer[BIG_BUFFER_SIZE + 1]; if (!tablename) { translation = 0; return; } for (s = tablename; *s; s++) { if (isspace((unsigned char)*s)) { *s = '\0'; break; } } tablename = upper(tablename); /* Check for transparent mode; ISO-8859/1, Latin-1 */ if (!strcmp("LATIN_1", tablename)) { translation = 0; return; } /* Else try loading the translation table from disk. */ malloc_strcpy(&filename, TRANSLATION_PATH "/"); malloc_strcat(&filename, tablename); if ( !(table = uzfopen(&filename, ".", 0)) ) { say("Cannot open character table definition \"%s\" !", tablename); set_string_var(TRANSLATION_VAR, NULL); new_free(&filename); return; } /* Any problems in the translation tables between hosts are * almost certain to be caused here. * many scanf implementations do not work as defined. In particular, * scanf should ignore white space including new lines (many stop * at the new line character, hence the fgets and sscanf workaround), * many fail to read 0xab as a hexadecimal number (failing on the * x) despite the 0x being defined as optionally existing on input, * and others zero out all the output variables if there is trailing * non white space in the format string which doesn't appear on the * input. Overall, the standard I/O libraries have a tendancy not * to be very standard. */ while (fgets(buffer, 80, table)) { sscanf(buffer, "0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x", inputs+0, inputs+1, inputs+2, inputs+3, inputs+4, inputs+5, inputs+6, inputs+7); for (j = 0; j<8; j++) temp_table[c++] = (unsigned char) inputs[j]; } fclose(table); new_free(&filename); if (c == 512) { for (c = 0; c <= 255; c++) { transToClient[c] = temp_table[c]; transFromClient[c] = temp_table[c | 256]; } #if 0 for (c = 0; c <= 255; c++) transToClient[c] = c; #endif translation = 1; } else { say("Error loading translation table \"%s\" !", tablename); set_string_var(TRANSLATION_VAR, NULL); } }
/* * This function is called when a user echos a value to one of the * variable parameters. */ ssize_t spk_var_store(struct kobject *kobj, struct kobj_attribute *attr, const char *buf, size_t count) { struct st_var_header *param; int ret; int len; char *cp; struct var_t *var_data; int value; unsigned long flags; param = var_header_by_name(attr->attr.name); if (param == NULL) return -EINVAL; if (param->data == NULL) return 0; ret = 0; cp = xlate((char *) buf); spk_lock(flags); switch (param->var_type) { case VAR_NUM: case VAR_TIME: if (*cp == 'd' || *cp == 'r' || *cp == '\0') len = E_DEFAULT; else if (*cp == '+' || *cp == '-') len = E_INC; else len = E_SET; speakup_s2i(cp, &value); ret = set_num_var(value, param, len); if (ret == E_RANGE) { var_data = param->data; pr_warn("value for %s out of range, expect %d to %d\n", attr->attr.name, var_data->u.n.low, var_data->u.n.high); } break; case VAR_STRING: len = strlen(buf); if ((len >= 1) && (buf[len - 1] == '\n')) --len; if ((len >= 2) && (buf[0] == '"') && (buf[len - 1] == '"')) { ++buf; len -= 2; } cp = (char *) buf; cp[len] = '\0'; ret = set_string_var(buf, param, len); if (ret == E_TOOLONG) pr_warn("value too long for %s\n", attr->attr.name); break; default: pr_warn("%s unknown type %d\n", param->name, (int)param->var_type); break; } /* * If voice was just changed, we might need to reset our default * pitch and volume. */ if (strcmp(attr->attr.name, "voice") == 0) { if (synth && synth->default_pitch) { param = var_header_by_name("pitch"); if (param) { set_num_var(synth->default_pitch[value], param, E_NEW_DEFAULT); set_num_var(0, param, E_DEFAULT); } } if (synth && synth->default_vol) { param = var_header_by_name("vol"); if (param) { set_num_var(synth->default_vol[value], param, E_NEW_DEFAULT); set_num_var(0, param, E_DEFAULT); } } } spk_unlock(flags); if (ret == SET_DEFAULT) pr_info("%s reset to default value\n", attr->attr.name); return count; }
/* * init_variables: initializes the string variables that can't really be * initialized properly above */ void init_variables() { #if defined(WINNT) || defined(__EMX__) char *shell; #endif int old_display = window_display; int i; char *s; for (i = 1; i < NUMBER_OF_VARIABLES - 1; i++) if (strcmp(irc_variable[i-1].name, irc_variable[i].name) >= 0) nappanic("Variable [%d] (%s) is out of order.", i, irc_variable[i].name); window_display = 0; set_string_var(DEFAULT_EMAIL_VAR, "blah@opennap"); set_string_var(DEFAULT_SERVER_VAR, "bitchx.dimension6.com"); if (*password) set_string_var(DEFAULT_PASSWORD_VAR, password); else set_string_var(DEFAULT_PASSWORD_VAR, "blah"); if (*nickname) set_string_var(DEFAULT_NICKNAME_VAR, nickname); else set_string_var(DEFAULT_NICKNAME_VAR, "blah"); set_string_var(DEFAULT_SPEED_VAR, "?"); set_string_var(PTEST_CHANGE_PORT_VAR, "8899 0"); s = m_strdup(irc_lib); malloc_strcat(&s, "/help"); set_string_var(HELP_PATH_VAR, s); new_free(&s); set_string_var(LOGFILE_VAR, DEFAULT_LOGFILE); set_string_var(FORMAT_DIRECTORY_VAR, "%d"); set_string_var(FORMAT_FILENAME_VAR, "%g4.1L %b %t %f"); set_string_var(SEARCH_FORMAT_VAR, "%-40f %b %3.1H %t %g4.1L %N %1.3p"); set_string_var(NAMES_NICKCOLOR_VAR, FORMAT_NICKCOLOR); set_string_var(DOWNLOAD_DIRECTORY_VAR, DEFAULT_DOWNLOAD_DIRECTORY); set_string_var(SHOW_NUMERICS_STR_VAR, DEFAULT_SHOW_NUMERICS_STR); set_numeric_string(current_window, DEFAULT_SHOW_NUMERICS_STR, 0); set_string_var(CMDCHARS_VAR, DEFAULT_CMDCHARS); set_string_var(LOGFILE_VAR, DEFAULT_LOGFILE); set_string_var(WORD_BREAK_VAR, DEFAULT_WORD_BREAK); #if defined(__EMX__) if ((shell = getenv("SHELL"))) { set_string_var(SHELL_VAR, path_search(shell, getenv("PATH"))); if (getenv("SHELL_FLAGS")) set_string_var(SHELL_FLAGS_VAR, getenv("SHELL_FLAGS")); } else { shell = "cmd.exe"; set_string_var(SHELL_FLAGS_VAR, "/c"); set_string_var(SHELL_VAR, convert_dos(path_search(shell, getenv("PATH")))); } #elif WINNT if ((shell = getenv("SHELL"))) { set_string_var(SHELL_VAR, path_search(shell, getenv("PATH"))); if (getenv("SHELL_FLAGS")) set_string_var(SHELL_FLAGS_VAR, getenv("SHELL_FLAGS")); } else if (gdwPlatform == VER_PLATFORM_WIN32_WINDOWS) { shell = "command.com"; set_string_var(SHELL_FLAGS_VAR, "/c"); set_string_var(SHELL_VAR, convert_dos(path_search(shell, getenv("PATH")))); } else { shell = "cmd.exe"; set_string_var(SHELL_FLAGS_VAR, "/c"); set_string_var(SHELL_VAR, convert_dos(path_search(shell, getenv("PATH")))); } #else set_string_var(SHELL_VAR, DEFAULT_SHELL); set_string_var(SHELL_FLAGS_VAR, DEFAULT_SHELL_FLAGS); #endif set_string_var(CONTINUED_LINE_VAR, DEFAULT_CONTINUED_LINE); set_string_var(INPUT_PROMPT_VAR, DEFAULT_INPUT_PROMPT); set_string_var(HIGHLIGHT_CHAR_VAR, DEFAULT_HIGHLIGHT_CHAR); set_string_var(LASTLOG_LEVEL_VAR, DEFAULT_LASTLOG_LEVEL); set_string_var(STATUS_FORMAT1_VAR, DEFAULT_STATUS_FORMAT1); set_string_var(STATUS_FORMAT2_VAR, DEFAULT_STATUS_FORMAT2); set_string_var(STATUS_CHANNEL_VAR, DEFAULT_STATUS_CHANNEL); set_string_var(STATUS_CLOCK_VAR, DEFAULT_STATUS_CLOCK); set_string_var(STATUS_CPU_SAVER_VAR, DEFAULT_STATUS_CPU_SAVER); set_string_var(STATUS_HOLD_VAR, DEFAULT_STATUS_HOLD); set_string_var(STATUS_HOLD_LINES_VAR, DEFAULT_STATUS_HOLD_LINES); set_string_var(STATUS_INSERT_VAR, DEFAULT_STATUS_INSERT); set_string_var(STATUS_NICK_VAR, DEFAULT_STATUS_NICK); set_string_var(STATUS_NOTIFY_VAR, DEFAULT_STATUS_NOTIFY); set_string_var(STATUS_OVERWRITE_VAR, DEFAULT_STATUS_OVERWRITE); set_string_var(STATUS_QUERY_VAR, DEFAULT_STATUS_QUERY); set_string_var(STATUS_SERVER_VAR, DEFAULT_STATUS_SERVER); set_string_var(STATUS_STATS_VAR, DEFAULT_STATUS_STATS); set_string_var(STATUS_USER0_VAR, DEFAULT_STATUS_USER); set_string_var(STATUS_USER1_VAR, DEFAULT_STATUS_USER1); set_string_var(STATUS_USER2_VAR, DEFAULT_STATUS_USER2); set_string_var(STATUS_USER3_VAR, DEFAULT_STATUS_USER3); set_string_var(STATUS_USER4_VAR, DEFAULT_STATUS_USER4); set_string_var(STATUS_USER5_VAR, DEFAULT_STATUS_USER5); set_string_var(STATUS_USER6_VAR, DEFAULT_STATUS_USER6); set_string_var(STATUS_USER7_VAR, DEFAULT_STATUS_USER7); set_string_var(STATUS_USER8_VAR, DEFAULT_STATUS_USER8); set_string_var(STATUS_USER9_VAR, DEFAULT_STATUS_USER9); set_string_var(STATUS_USER10_VAR, DEFAULT_STATUS_USER10); set_string_var(STATUS_USER11_VAR, DEFAULT_STATUS_USER11); set_string_var(STATUS_USER12_VAR, DEFAULT_STATUS_USER12); set_string_var(STATUS_USER13_VAR, DEFAULT_STATUS_USER13); set_string_var(STATUS_USER14_VAR, DEFAULT_STATUS_USER14); set_string_var(STATUS_USER15_VAR, DEFAULT_STATUS_USER15); set_string_var(STATUS_USER16_VAR, DEFAULT_STATUS_USER16); set_string_var(STATUS_USER17_VAR, DEFAULT_STATUS_USER17); set_string_var(STATUS_USER18_VAR, DEFAULT_STATUS_USER18); set_string_var(STATUS_USER19_VAR, DEFAULT_STATUS_USER19); set_string_var(STATUS_USER20_VAR, DEFAULT_STATUS_USER20); set_string_var(STATUS_USER21_VAR, DEFAULT_STATUS_USER21); set_string_var(STATUS_USER22_VAR, DEFAULT_STATUS_USER22); set_string_var(STATUS_USER23_VAR, DEFAULT_STATUS_USER23); set_string_var(STATUS_USER24_VAR, DEFAULT_STATUS_USER24); set_string_var(STATUS_USER25_VAR, DEFAULT_STATUS_USER25); set_string_var(STATUS_USER26_VAR, DEFAULT_STATUS_USER26); set_string_var(STATUS_USER27_VAR, DEFAULT_STATUS_USER27); set_string_var(STATUS_USER28_VAR, DEFAULT_STATUS_USER28); set_string_var(STATUS_USER29_VAR, DEFAULT_STATUS_USER29); set_string_var(STATUS_USER30_VAR, DEFAULT_STATUS_USER30); set_string_var(STATUS_USER31_VAR, DEFAULT_STATUS_USER31); set_string_var(STATUS_USER32_VAR, DEFAULT_STATUS_USER32); set_string_var(STATUS_USER33_VAR, DEFAULT_STATUS_USER33); set_string_var(STATUS_USER34_VAR, DEFAULT_STATUS_USER34); set_string_var(STATUS_USER35_VAR, DEFAULT_STATUS_USER35); set_string_var(STATUS_USER36_VAR, DEFAULT_STATUS_USER36); set_string_var(STATUS_USER37_VAR, DEFAULT_STATUS_USER37); set_string_var(STATUS_USER38_VAR, DEFAULT_STATUS_USER38); set_string_var(STATUS_USER39_VAR, DEFAULT_STATUS_USER39); set_string_var(STATUS_WINDOW_VAR, DEFAULT_STATUS_WINDOW); set_string_var(STATUS_SCROLLBACK_VAR, DEFAULT_STATUS_SCROLLBACK); set_string_var(ILLEGAL_CHARS_VAR, DEFAULT_ILLEGAL_CHARS); set_beep_on_msg(current_window, DEFAULT_BEEP_ON_MSG, 0); set_cd_device(current_window, "/dev/cdrom", 0); set_lastlog_size(current_window, NULL, irc_variable[LASTLOG_VAR].integer); set_history_size(current_window, NULL, irc_variable[HISTORY_VAR].integer); set_lastlog_level(current_window, irc_variable[LASTLOG_LEVEL_VAR].string, 0); set_input_prompt(current_window, DEFAULT_INPUT_PROMPT, 0); build_status(current_window, NULL, 0); window_display = old_display; }
void set_new_server_lastlog_level (Window *win, char *str, int unused) { new_server_lastlog_level = parse_lastlog_level(str, 1); set_string_var(NEW_SERVER_LASTLOG_LEVEL_VAR, bits_to_lastlog_level(new_server_lastlog_level)); }
/* * set_msglog_level: called whenever a "SET MSGLOG_LEVEL" is done. It * parses the settings and sets the msglog_level variable appropriately. It * also rewrites the MSGLOG_LEVEL variable to make it look nice */ void set_msglog_level(Window *win, char *str, int unused) { msglog_level = parse_lastlog_level(str, 1); set_string_var(MSGLOG_LEVEL_VAR, bits_to_lastlog_level(msglog_level)); }
/* * set_lastlog_level: called whenever a "SET LASTLOG_LEVEL" is done. It * parses the settings and sets the lastlog_level variable appropriately. It * also rewrites the LASTLOG_LEVEL variable to make it look nice */ void set_lastlog_level(Window *win, char *str, int unused) { lastlog_level = parse_lastlog_level(str, 1); set_string_var(LASTLOG_LEVEL_VAR, bits_to_lastlog_level(lastlog_level)); current_window->lastlog_level = lastlog_level; }