home *** CD-ROM | disk | FTP | other *** search
- /*
- * Project : tin - a threaded Netnews reader
- * Module : rcfile.c
- * Author : I.Lea
- * Created : 01-04-91
- * Updated : 09-05-92
- * Notes :
- * Copyright : (c) Copyright 1991-92 by Iain Lea
- * You may freely copy or redistribute this software,
- * so long as there is no profit made from its use, sale
- * trade or reproduction. You may not change this copy-
- * right notice, and it must be included in any copy made
- */
-
- #include "tin.h"
-
- extern int index_point;
-
- static int COL1;
- static int COL2;
- static int COL3;
-
- /*
- * read_rcfile - read defaults from ~/.tin/tinrc
- */
-
- int read_rcfile ()
- {
- char buf[LEN];
- FILE *fp;
-
- if ((fp = fopen (rcfile, "r")) == NULL) {
- return (FALSE);
- }
-
- while (fgets (buf, sizeof (buf), fp) != NULL) {
- if (buf[0] == '#' || buf[0] == '\n') {
- continue;
- }
- if (match_boolean (buf, "save_archive=", &save_archive_name)) {
- continue;
- }
- if (match_boolean (buf, "start_editor_offset=", &start_editor_offset)) {
- continue;
- }
- if (match_boolean (buf, "mark_saved_read=", &mark_saved_read)) {
- continue;
- }
- if (match_boolean (buf, "draw_arrow=", &draw_arrow_mark)) {
- if (draw_arrow_mark == FALSE && inverse_okay == FALSE) {
- inverse_okay = TRUE;
- }
- continue;
- }
- if (match_boolean (buf, "print_header=", &print_header)) {
- continue;
- }
- if (match_number (buf, "kill_level=", &kill_level)) {
- continue;
- }
- if (match_boolean (buf, "pos_first_unread=", &pos_first_unread)) {
- continue;
- }
- if (match_boolean (buf, "full_page_scroll=", &full_page_scroll)) {
- continue;
- }
- if (match_boolean (buf, "catchup_read_groups=", &catchup_read_groups)) {
- continue;
- }
- if (match_boolean (buf, "thread_articles=", &thread_arts)) {
- continue;
- }
- if (match_boolean (buf, "unlink_article=", &unlink_article)) {
- continue;
- }
- if (match_boolean (buf, "show_only_unread=", &show_only_unread)) {
- continue;
- }
- if (match_boolean (buf, "confirm_action=", &confirm_action)) {
- continue;
- }
- if (match_number (buf, "show_author=", &default_show_author)) {
- continue;
- }
- if (match_number (buf, "post_process_type=", &post_proc_type)) {
- switch (post_proc_type) {
- case POST_PROC_SHAR:
- proc_ch_default = 's';
- break;
- case POST_PROC_UUDECODE:
- proc_ch_default = 'u';
- break;
- case POST_PROC_UUD_LST_ZOO:
- proc_ch_default = 'U';
- break;
- case POST_PROC_UUD_EXT_ZOO:
- proc_ch_default = 'U';
- break;
- case POST_PROC_NONE:
- default:
- proc_ch_default = 'n';
- break;
- }
- continue;
- }
- if (match_number (buf, "sort_article_type=", &sort_art_type)) {
- continue;
- }
- if (match_string (buf, "savedir=", default_savedir, sizeof (default_savedir))) {
- if (default_savedir[0] == '.' && strlen (default_savedir) == 1) {
- #if defined(BSD) && ! defined(sinix)
- getwd (buf);
- #else
- getcwd (buf, LEN);
- #endif
- my_strncpy (default_savedir, buf, sizeof (default_savedir));
- }
- continue;
- }
- if (match_string (buf, "maildir=", default_maildir, sizeof (default_maildir))) {
- continue;
- }
- if (match_string (buf, "printer=", printer, sizeof (printer))) {
- continue;
- }
- if (match_string (buf, "default_spooldir_alias=", spooldir_alias, sizeof (spooldir_alias))) {
- set_tindir ();
- continue;
- }
- if (match_string (buf, "default_author_search=", default_author_search, sizeof (default_author_search))) {
- continue;
- }
- if (match_string (buf, "default_goto_group=", default_goto_group, sizeof (default_goto_group))) {
- continue;
- }
- if (match_string (buf, "default_group_search=", default_group_search, sizeof (default_group_search))) {
- continue;
- }
- if (match_string (buf, "default_subject_search=", default_subject_search, sizeof (default_subject_search))) {
- continue;
- }
- if (match_string (buf, "default_art_search=", default_art_search, sizeof (default_art_search))) {
- continue;
- }
- if (match_string (buf, "default_crosspost_group=", default_crosspost_group, sizeof (default_crosspost_group))) {
- continue;
- }
- if (match_string (buf, "default_mail_address=", default_mail_address, sizeof (default_mail_address))) {
- continue;
- }
- if (match_number (buf, "default_move_group=", &default_move_group)) {
- continue;
- }
- if (match_string (buf, "default_pipe_command=", default_pipe_command, sizeof (default_pipe_command))) {
- continue;
- }
- if (match_string (buf, "default_post_subject=", default_post_subject, sizeof (default_post_subject))) {
- continue;
- }
- if (match_string (buf, "default_regex_pattern=", default_regex_pattern, sizeof (default_regex_pattern))) {
- continue;
- }
- if (match_string (buf, "default_save_file=", default_save_file, sizeof (default_save_file))) {
- continue;
- }
- if (match_string (buf, "default_shell_command=", default_shell_command, sizeof (default_shell_command))) {
- continue;
- }
- }
- fclose (fp);
- return TRUE;
- }
-
-
- /*
- * write_rcfile - write defaults to ~/.tin/tinrc
- */
-
- void write_rcfile ()
- {
- FILE *fp;
-
- if ((fp = fopen (rcfile, "w")) == NULL) {
- return;
- }
-
- if (! cmd_line) {
- wait_message (txt_saving);
- }
- fprintf (fp, "# if ON articles/threads with Archive-name: in mail header will\n");
- fprintf (fp, "# be automatically saved with the Archive-name & part/patch no.\n");
- fprintf (fp, "save_archive=%s\n\n", (save_archive_name ? "ON" : "OFF"));
- fprintf (fp, "# if ON articles of a threads will be saved to separate files\n");
- fprintf (fp, "# otherwise the whole thread will be saved to one file\n");
- fprintf (fp, "start_editor_offset=%s\n\n", (start_editor_offset ? "ON" : "OFF"));
- fprintf (fp, "# if ON mark articles that are saved as read\n");
- fprintf (fp, "mark_saved_read=%s\n\n", (mark_saved_read ? "ON" : "OFF"));
- fprintf (fp, "# if 0 killed articles are simply marked as being read\n");
- fprintf (fp, "# if 1 killed articles are removed and never seen\n");
- fprintf (fp, "kill_level=%d\n\n", kill_level);
- fprintf (fp, "# if ON use -> otherwise highlighted bar for selection\n");
- fprintf (fp, "draw_arrow=%s\n\n", (draw_arrow_mark ? "ON" : "OFF"));
- fprintf (fp, "# if ON print all of mail header otherwise Subject: & From: lines\n");
- fprintf (fp, "print_header=%s\n\n", (print_header ? "ON" : "OFF"));
- fprintf (fp, "# if ON put cursor at first unread art in group otherwise last art\n");
- fprintf (fp, "pos_first_unread=%s\n\n", (pos_first_unread ? "ON" : "OFF"));
- fprintf (fp, "# if ON scroll full page of groups/articles otherwise half a page\n");
- fprintf (fp, "full_page_scroll=%s\n\n", (full_page_scroll ? "ON" : "OFF"));
- fprintf (fp, "# if ON ask user if read groups should all be marked read\n");
- fprintf (fp, "catchup_read_groups=%s\n\n", (catchup_read_groups ? "ON" : "OFF"));
- fprintf (fp, "# if ON confirm certain commands with y/n before executing\n");
- fprintf (fp, "confirm_action=%s\n\n", (confirm_action ? "ON" : "OFF"));
- fprintf (fp, "# part of from field to display 0) none 1) address 2) full name 3) both\n");
- fprintf (fp, "show_author=%d\n\n", default_show_author);
- fprintf (fp, "# type of post processing to perform after saving articles.\n");
- fprintf (fp, "# 0=(none) 1=(shar) 2=(uudecode) 3=(uud & list zoo) 4=(uud & extract zoo) 5=(patch).\n");
- fprintf (fp, "post_process_type=%d\n\n", post_proc_type);
- fprintf (fp, "# if ON and group not in ~/.tin/unthread articles will be threaded.\n");
- fprintf (fp, "thread_articles=%s\n\n", (thread_arts ? "ON" : "OFF"));
- fprintf (fp, "# if ON remove ~/.article after posting.\n");
- fprintf (fp, "unlink_article=%s\n\n", (unlink_article ? "ON" : "OFF"));
- fprintf (fp, "# if ON show only new/unread articles otherwise show all.\n");
- fprintf (fp, "show_only_unread=%s\n\n", (show_only_unread ? "ON" : "OFF"));
- fprintf (fp, "# sort articles by 0=(nothing) 1=(Subject descend) 2=(Subject ascend)\n");
- fprintf (fp, "# 3=(From descend) 4=(From ascend) 5=(Date descend) 6=(Date ascend).\n");
- fprintf (fp, "sort_article_type=%d\n\n", sort_art_type);
- fprintf (fp, "# (-d) directory where articles/threads are saved\n");
- fprintf (fp, "savedir=%s\n\n", default_savedir);
- fprintf (fp, "# (-M) directory where articles/threads are saved in mailbox format\n");
- fprintf (fp, "maildir=%s\n\n", default_maildir);
- fprintf (fp, "# (-p) print program with parameters used to print articles/threads\n");
- fprintf (fp, "printer=%s\n\n", printer);
-
- fprintf (fp, "# default actions/prompt strings for questions\n");
- fprintf (fp, "default_spooldir_alias=%s\n", spooldir_alias);
- fprintf (fp, "default_author_search=%s\n", default_author_search);
- fprintf (fp, "default_goto_group=%s\n", default_goto_group);
- fprintf (fp, "default_group_search=%s\n", default_group_search);
- fprintf (fp, "default_subject_search=%s\n", default_subject_search);
- fprintf (fp, "default_art_search=%s\n", default_art_search);
- fprintf (fp, "default_crosspost_group=%s\n", default_crosspost_group);
- fprintf (fp, "default_mail_address=%s\n", default_mail_address);
- fprintf (fp, "default_move_group=%d\n", default_move_group);
- fprintf (fp, "default_pipe_command=%s\n", default_pipe_command);
- fprintf (fp, "default_post_subject=%s\n", default_post_subject);
- fprintf (fp, "default_regex_pattern=%s\n", default_regex_pattern);
- fprintf (fp, "default_save_file=%s\n", default_save_file);
- fprintf (fp, "default_shell_command=%s\n", default_shell_command);
-
- fclose (fp);
- chmod (rcfile, 0600);
- }
-
- /*
- * options menu so that the user can dynamically change parameters
- */
-
- int change_rcfile (group, kill_at_once)
- char *group;
- int kill_at_once;
- {
- char *str = (char *) 0;
- int ch, i;
- int kill_changed = FALSE;
- int orig_kill_state;
- int orig_show_only_unread;
- int orig_thread_arts;
- int option;
- int ret_code = NO_KILLING;
- int var_orig;
-
- #ifdef SIGTSTP
- sigtype_t (*susp)() = (sigtype_t *) 0;
-
- if (do_sigtstp) {
- susp = sigdisp (SIGTSTP, SIG_DFL);
- }
- #endif
-
- COL1 = 0;
- COL2 = ((COLS / 3) * 1) + 1;
- COL3 = ((COLS / 3) * 2) + 2;
-
- show_rcfile_menu ();
-
- while (1) {
-
- #ifdef SIGTSTP
- if (do_sigtstp) {
- sigdisp (SIGTSTP, rcfile_suspend);
- }
- #endif
- MoveCursor (LINES, 0);
- ch = ReadCh ();
- if (ch >= '1' && ch <= '9') {
- option = prompt_num (ch, "Enter option number> ");
- } else {
- if (ch == 'q' || ch == ESC) {
- option = -1;
- } else {
- option = 0;
- }
- }
- #ifdef SIGTSTP
- if (do_sigtstp) {
- sigdisp (SIGTSTP, SIG_IGN);
- }
- #endif
- switch (option) {
- case 0:
- write_rcfile ();
- /* FALLTHRU */
- case -1:
- if (kill_changed) {
- if (kill_at_once) {
- if (killed_articles = read_kill_file ()) {
- if (kill_any_articles (group)) {
- make_threads (FALSE);
- find_base (show_only_unread);
- }
- } else {
- if (unkill_all_articles()) {
- make_threads (FALSE);
- find_base (show_only_unread);
- }
- }
- }
- ret_code = KILLING;
- }
-
- clear_note_area ();
- #ifdef SIGTSTP
- if (do_sigtstp) {
- sigdisp (SIGTSTP, susp);
- }
- #endif
- return ret_code;
-
- case 1: /* auto save */
- prompt_on_off (INDEX_TOP, COL1, &save_archive_name,
- txt_help_autosave, txt_opt_autosave);
- break;
-
- case 2: /* start editor with line offset */
- prompt_on_off (INDEX_TOP, COL2, &start_editor_offset,
- txt_help_start_editor_offset, txt_opt_start_editor_offset);
- break;
-
- case 3: /* mark saved articles read */
- prompt_on_off (INDEX_TOP, COL3, &mark_saved_read,
- txt_help_mark_saved_read, txt_opt_mark_saved_read);
- break;
-
- case 4: /* confirm action */
- prompt_on_off (INDEX_TOP+2, COL1, &confirm_action,
- txt_help_confirm_action, txt_opt_confirm_action);
- break;
-
- case 5: /* draw -> / highlighted bar */
- prompt_on_off (INDEX_TOP+2, COL2, &draw_arrow_mark,
- txt_help_draw_arrow, txt_opt_draw_arrow);
- if (draw_arrow_mark == FALSE && inverse_okay == FALSE) {
- inverse_okay = TRUE;
- }
- break;
-
- case 6: /* print header */
- prompt_on_off (INDEX_TOP+2, COL3, &print_header,
- txt_help_print_header, txt_opt_print_header);
- break;
-
- case 7: /* position cursor at first / last unread art */
- prompt_on_off (INDEX_TOP+4, COL1, &pos_first_unread,
- txt_help_pos_first_unread, txt_opt_pos_first_unread);
- break;
-
- case 8: /* scroll half/full page of groups/articles */
- prompt_on_off (INDEX_TOP+4, COL2, &full_page_scroll,
- txt_help_page_scroll, txt_opt_page_scroll);
- break;
-
- case 9: /* catchup read groups when quitting */
- prompt_on_off (INDEX_TOP+4, COL3, &catchup_read_groups,
- txt_help_catchup_groups, txt_opt_catchup_groups);
- break;
-
- case 10: /* thread/unthread all groups except those in ~/.tin/unthreaded */
- orig_thread_arts = thread_arts;
- prompt_on_off (INDEX_TOP+6, COL1, &thread_arts,
- txt_help_thread_arts, txt_opt_thread_arts);
- if (thread_arts != orig_thread_arts || group != (char *) 0) {
- make_threads (TRUE);
- find_base (show_only_unread);
- }
- break;
-
- case 11: /* show all arts or just new/unread arts */
- orig_show_only_unread = show_only_unread;
- prompt_on_off (INDEX_TOP+6, COL2, &show_only_unread,
- txt_help_show_only_unread, txt_opt_show_only_unread);
- if (show_only_unread != orig_show_only_unread || group != (char *) 0) {
- make_threads (TRUE);
- find_base (show_only_unread);
- if (space_mode) {
- for (i = 0; i < top_base; i++) {
- if (new_responses (i)) {
- break;
- }
- }
- if (i < top_base) {
- index_point = i;
- } else {
- index_point = top_base - 1;
- }
- } else {
- index_point = top_base - 1;
- }
- }
- break;
-
- case 13: /* show subject & author / subject only */
- var_orig = show_author;
- show_menu_help (txt_help_show_author);
- do {
- MoveCursor (INDEX_TOP+8, COL1 + (int) strlen (txt_opt_show_author));
- if ((ch = ReadCh()) == ' ') {
- if (show_author + 1 > SHOW_FROM_BOTH) {
- show_author = SHOW_FROM_NONE;
- } else {
- show_author++;
- }
- switch (show_author) {
- case SHOW_FROM_NONE:
- str = txt_show_from_none;
- break;
- case SHOW_FROM_ADDR:
- str = txt_show_from_addr;
- break;
- case SHOW_FROM_NAME:
- str = txt_show_from_name;
- break;
- case SHOW_FROM_BOTH:
- str = txt_show_from_both;
- break;
- }
- fputs (str, stdout);
- fflush (stdout);
- }
- } while (ch != CR && ch != ESC);
-
- if (ch == ESC) { /* restore original value */
- show_author = var_orig;
- switch (show_author) {
- case SHOW_FROM_NONE:
- str = txt_show_from_none;
- break;
- case SHOW_FROM_ADDR:
- str = txt_show_from_addr;
- break;
- case SHOW_FROM_NAME:
- str = txt_show_from_name;
- break;
- case SHOW_FROM_BOTH:
- str = txt_show_from_both;
- break;
- }
- fputs (str, stdout);
- fflush (stdout);
- } else {
- default_show_author = show_author;
- set_subj_from_size (COLS);
- }
- break;
-
- case 14:
- var_orig = post_proc_type;
- show_menu_help (txt_help_post_proc_type);
- do {
- MoveCursor (INDEX_TOP+8, COL2 + (int) strlen (txt_opt_process_type));
- if ((ch = ReadCh()) == ' ') {
- if (post_proc_type + 1 > POST_PROC_UUD_EXT_ZOO) {
- post_proc_type = POST_PROC_NONE;
- } else {
- post_proc_type++;
- }
- switch (post_proc_type) {
- case POST_PROC_NONE:
- str = txt_post_process_none;
- proc_ch_default = 'n';
- break;
- case POST_PROC_SHAR:
- str = txt_post_process_sh;
- proc_ch_default = 's';
- break;
- case POST_PROC_UUDECODE:
- str = txt_post_process_uudecode;
- proc_ch_default = 'u';
- break;
- case POST_PROC_UUD_LST_ZOO:
- str = txt_post_process_uud_lst_zoo;
- proc_ch_default = 'U';
- break;
- case POST_PROC_UUD_EXT_ZOO:
- str = txt_post_process_uud_ext_zoo;
- proc_ch_default = 'U';
- break;
- }
- CleartoEOLN ();
- fputs (str, stdout);
- fflush (stdout);
- }
- } while (ch != CR && ch != ESC);
-
- if (ch == ESC) { /* restore original value */
- post_proc_type = var_orig;
- switch (post_proc_type) {
- case POST_PROC_NONE:
- str = txt_post_process_none;
- proc_ch_default = 'n';
- break;
- case POST_PROC_SHAR:
- str = txt_post_process_sh;
- proc_ch_default = 's';
- break;
- case POST_PROC_UUDECODE:
- str = txt_post_process_uudecode;
- proc_ch_default = 'u';
- break;
- case POST_PROC_UUD_LST_ZOO:
- str = txt_post_process_uud_lst_zoo;
- proc_ch_default = 'U';
- break;
- case POST_PROC_UUD_EXT_ZOO:
- str = txt_post_process_uud_ext_zoo;
- proc_ch_default = 'U';
- break;
- }
- CleartoEOLN ();
- fputs (str, stdout);
- fflush (stdout);
- }
- break;
-
- case 15:
- var_orig = sort_art_type;
- show_menu_help (txt_help_sort_type);
- do {
- MoveCursor (INDEX_TOP+10, COL1 + (int) strlen (txt_opt_sort_type));
- if ((ch = ReadCh()) == ' ') {
- if (sort_art_type + 1 > SORT_BY_DATE_ASCEND) {
- sort_art_type = SORT_BY_NOTHING;
- } else {
- sort_art_type++;
- }
- switch (sort_art_type) {
- case SORT_BY_NOTHING:
- str = txt_sort_by_nothing;
- break;
- case SORT_BY_SUBJ_DESCEND:
- str = txt_sort_by_subj_descend;
- break;
- case SORT_BY_SUBJ_ASCEND:
- str = txt_sort_by_subj_ascend;
- break;
- case SORT_BY_FROM_DESCEND:
- str = txt_sort_by_from_descend;
- break;
- case SORT_BY_FROM_ASCEND:
- str = txt_sort_by_from_ascend;
- break;
- case SORT_BY_DATE_DESCEND:
- str = txt_sort_by_date_descend;
- break;
- case SORT_BY_DATE_ASCEND:
- str = txt_sort_by_date_ascend;
- break;
- }
- CleartoEOLN ();
- fputs (str, stdout);
- fflush (stdout);
- }
- } while (ch != CR && ch != ESC);
-
- if (ch == ESC) { /* restore original value */
- sort_art_type = var_orig;
- switch (sort_art_type) {
- case SORT_BY_NOTHING:
- str = txt_sort_by_nothing;
- break;
- case SORT_BY_SUBJ_DESCEND:
- str = txt_sort_by_subj_descend;
- break;
- case SORT_BY_SUBJ_ASCEND:
- str = txt_sort_by_subj_ascend;
- break;
- case SORT_BY_FROM_DESCEND:
- str = txt_sort_by_from_descend;
- break;
- case SORT_BY_FROM_ASCEND:
- str = txt_sort_by_from_ascend;
- break;
- case SORT_BY_DATE_DESCEND:
- str = txt_sort_by_date_descend;
- break;
- case SORT_BY_DATE_ASCEND:
- str = txt_sort_by_date_ascend;
- break;
- }
- CleartoEOLN ();
- fputs (str, stdout);
- fflush (stdout);
- }
- break;
-
- case 16:
- show_menu_help (txt_help_savedir);
- prompt_menu_string (INDEX_TOP+12, COL1 + (int) strlen (txt_opt_savedir), default_savedir);
- expand_rel_abs_pathname (INDEX_TOP+12, COL1 + (int) strlen (txt_opt_savedir), default_savedir);
- break;
-
- case 17:
- show_menu_help (txt_help_maildir);
- prompt_menu_string (INDEX_TOP+14, COL1 + (int) strlen (txt_opt_maildir), default_maildir);
- expand_rel_abs_pathname (INDEX_TOP+14, COL1 + (int) strlen (txt_opt_maildir), default_maildir);
- break;
-
- case 18:
- show_menu_help (txt_help_printer);
- prompt_menu_string (INDEX_TOP+16, COL1 + (int) strlen (txt_opt_printer), printer);
- expand_rel_abs_pathname (INDEX_TOP+16, COL1 + (int) strlen (txt_opt_printer), printer);
- break;
- }
- show_menu_help (txt_select_rcfile_option);
- }
- }
-
-
- void show_rcfile_menu ()
- {
- char *str = (char *) 0;
-
- ClearScreen ();
-
- center_line (0, TRUE, txt_options_menu);
-
- MoveCursor (INDEX_TOP, 0);
- printf ("%s%s\r\n\r\n", txt_opt_autosave, (save_archive_name ? "ON " : "OFF"));
- printf ("%s%s\r\n\r\n", txt_opt_confirm_action, (confirm_action ? "ON " : "OFF"));
- printf ("%s%s\r\n\r\n", txt_opt_pos_first_unread, (pos_first_unread ? "ON " : "OFF"));
- printf ("%s%s", txt_opt_thread_arts, (thread_arts ? "ON " : "OFF"));
-
- MoveCursor(INDEX_TOP, COL2);
- printf ("%s%s", txt_opt_start_editor_offset, (start_editor_offset ? "ON " : "OFF"));
- MoveCursor(INDEX_TOP+2, COL2);
- printf ("%s%s", txt_opt_draw_arrow, (draw_arrow_mark ? "ON " : "OFF"));
- MoveCursor(INDEX_TOP+4, COL2);
- printf ("%s%s", txt_opt_page_scroll, (full_page_scroll ? "ON " : "OFF"));
- MoveCursor(INDEX_TOP+6, COL2);
- printf ("%s%s", txt_opt_show_only_unread, (show_only_unread ? "ON " : "OFF"));
-
- MoveCursor(INDEX_TOP, COL3);
- printf ("%s%s", txt_opt_mark_saved_read, (mark_saved_read ? "ON " : "OFF"));
- MoveCursor(INDEX_TOP+2, COL3);
- printf ("%s%s", txt_opt_print_header, (print_header ? "ON " : "OFF"));
- MoveCursor(INDEX_TOP+4, COL3);
- printf ("%s%s", txt_opt_catchup_groups, (catchup_read_groups ? "ON " : "OFF"));
-
- MoveCursor(INDEX_TOP+8, COL1);
- switch (show_author) {
- case SHOW_FROM_NONE:
- str = txt_show_from_none;
- break;
- case SHOW_FROM_ADDR:
- str = txt_show_from_addr;
- break;
- case SHOW_FROM_NAME:
- str = txt_show_from_name;
- break;
- case SHOW_FROM_BOTH:
- str = txt_show_from_both;
- break;
- }
- printf ("%s%s", txt_opt_show_author, str);
- MoveCursor(INDEX_TOP+8, COL2);
- switch (post_proc_type) {
- case POST_PROC_NONE:
- str = txt_post_process_none;
- break;
- case POST_PROC_SHAR:
- str = txt_post_process_sh;
- break;
- case POST_PROC_UUDECODE:
- str = txt_post_process_uudecode;
- break;
- case POST_PROC_UUD_LST_ZOO:
- str = txt_post_process_uud_lst_zoo;
- break;
- case POST_PROC_UUD_EXT_ZOO:
- str = txt_post_process_uud_ext_zoo;
- break;
- }
- printf ("%s%s\r\n\r\n", txt_opt_process_type, str);
-
- MoveCursor(INDEX_TOP+10, COL1);
- switch (sort_art_type) {
- case SORT_BY_NOTHING:
- str = txt_sort_by_nothing;
- break;
- case SORT_BY_SUBJ_DESCEND:
- str = txt_sort_by_subj_descend;
- break;
- case SORT_BY_SUBJ_ASCEND:
- str = txt_sort_by_subj_ascend;
- break;
- case SORT_BY_FROM_DESCEND:
- str = txt_sort_by_from_descend;
- break;
- case SORT_BY_FROM_ASCEND:
- str = txt_sort_by_from_ascend;
- break;
- case SORT_BY_DATE_DESCEND:
- str = txt_sort_by_date_descend;
- break;
- case SORT_BY_DATE_ASCEND:
- str = txt_sort_by_date_ascend;
- break;
- }
- printf ("%s%s\r\n\r\n", txt_opt_sort_type, str);
-
- printf ("%s%s\r\n\r\n", txt_opt_savedir, default_savedir);
- printf ("%s%s\r\n\r\n", txt_opt_maildir, default_maildir);
- printf ("%s%s\r\n\r\n", txt_opt_printer, printer);
- fflush(stdout);
-
- show_menu_help (txt_select_rcfile_option);
- MoveCursor (LINES, 0);
- }
-
- /*
- * expand ~/News to /usr/username/News and print to screen
- */
-
- void expand_rel_abs_pathname (line, col, str)
- int line;
- int col;
- char *str;
- {
- char buf[LEN];
-
- if (str[0] == '~') {
- if (strlen (str) == 1) {
- strcpy (str, homedir);
- } else {
- sprintf (buf, "%s%s", homedir, str+1);
- strcpy (str, buf);
- }
- }
- MoveCursor (line, col);
- CleartoEOLN ();
- puts (str);
- fflush (stdout);
- }
-
- /*
- * show_menu_help
- */
-
- void show_menu_help (help_message)
- char *help_message;
- {
- MoveCursor (LINES-2, 0);
- CleartoEOLN ();
- center_line (LINES-2, FALSE, help_message);
- }
-
-
- int match_boolean (line, pat, dst)
- char *line;
- char *pat;
- int *dst;
- {
- int patlen = strlen (pat);
-
- if (strncmp (line, pat, patlen) == 0) {
- *dst = (strncmp (&line[patlen], "ON", 2) == 0 ? TRUE : FALSE);
- return TRUE;
- }
- return FALSE;
- }
-
-
- int match_number (line, pat, dst)
- char *line;
- char *pat;
- int *dst;
- {
- int patlen = strlen (pat);
-
- if (strncmp (line, pat, patlen) == 0) {
- *dst = atoi (&line[patlen]);
- return TRUE;
- }
- return FALSE;
- }
-
-
- int match_string (line, pat, dst, dstlen)
- char *line;
- char *pat;
- char *dst;
- int dstlen;
- {
- int patlen = strlen (pat);
-
- if (strncmp (line, pat, patlen) == 0) {
- strncpy (dst, &line[patlen], dstlen);
- dst[strlen (dst) - 1] = '\0';
- return TRUE;
- }
- return FALSE;
- }
-
-