home *** CD-ROM | disk | FTP | other *** search
- Path: wupost!uunet!mcsun!unido!estevax!norisc!iain
- From: iain@norisc.UUCP (Iain Lea)
- Newsgroups: alt.sources
- Subject: tin v1.00 - YAN (Yet Another Newsreader) Part 03/08
- Message-ID: <584@norisc.UUCP>
- Date: 23 Aug 91 13:52:58 GMT
- Sender: iain@norisc.UUCP (Iain Lea)
- Organization: What organization?
- Lines: 1718
-
- Submitted-by: iain@estevax.uucp
- Archive-name: tin/part03
-
- #!/bin/sh
- # this is tin.shar.03 (part 3 of tin)
- # do not concatenate these parts, unpack them in order with /bin/sh
- # file kill.c continued
- #
- if touch 2>&1 | fgrep '[-amc]' > /dev/null
- then TOUCH=touch
- else TOUCH=true
- fi
- if test ! -r shar3_seq_.tmp; then
- echo "Please unpack part 1 first!"
- exit 1
- fi
- (read Scheck
- if test "$Scheck" != 3; then
- echo "Please unpack part $Scheck next!"
- exit 1
- else
- exit 0
- fi
- ) < shar3_seq_.tmp || exit 1
- echo "x - Continuing file kill.c"
- sed 's/^X//' << 'SHAR_EOF' >> kill.c &&
- X case KILL_BOTH:
- X if (str_str (arts[i].subject, killf[j].kill_subj) != 0) {
- X arts[i].tagged = TRUE;
- X killed = TRUE;
- X }
- X if (str_str (arts[i].from, killf[j].kill_from) != 0) {
- X arts[i].tagged = TRUE;
- X killed = TRUE;
- X }
- X break;
- X }
- X }
- X }
- X }
- X }
- X return (killed);
- X}
- SHAR_EOF
- echo "File kill.c is complete" &&
- $TOUCH -am 0819090291 kill.c &&
- chmod 0600 kill.c ||
- echo "restore of kill.c failed"
- set `wc -c kill.c`;Wc_c=$1
- if test "$Wc_c" != "9014"; then
- echo original size 9014, current size $Wc_c
- fi
- # ============= lang.c ==============
- echo "x - extracting lang.c (Text)"
- sed 's/^X//' << 'SHAR_EOF' > lang.c &&
- X/*
- X * Project : tin - a visual threaded usenet newsreader
- X * Module : lang.c
- X * Author : R.Skrenta / I.Lea
- X * Created : 01-04-91
- X * Updated : 23-08-91
- X * Release : 1.0
- X * Notes :
- X * Copyright : (c) Copyright 1991 by Rich Skrenta & Iain Lea
- X * You may freely copy or redistribute this software,
- X * so long as there is no profit made from its use, sale
- X * trade or reproduction. You may not change this copy-
- X * right notice, and it must be included in any copy made
- X */
- X
- X#ifdef LANG_GERMAN
- X
- X#else
- X
- X/*
- X * art.c
- X */
- X
- Xchar *txt_group = "Group %s... ";
- Xchar *txt_cannot_open_dir = "can't open dir %s\n";
- Xchar *txt_cannot_open_art = "can't open article %s: ";
- Xchar *txt_indexing = "Indexing...%4d";
- Xchar *txt_corrupt_index = "Index file %s corrupted. error %d on record %d";
- X
- X/*
- X * group.c
- X */
- X
- Xchar *txt_inverse_on = "Inverse video enabled";
- Xchar *txt_inverse_off = "Inverse video disabled";
- Xchar *txt_subscribed_to = "subscribed to %s";
- Xchar *txt_unsubscribed_to = "unsubscribed from %s";
- Xchar *txt_mark_all_read = "Mark everything as read? (y/n): ";
- Xchar *txt_marked_as_read = "All articles marked as read";
- Xchar *txt_no_more_groups = "No more groups";
- Xchar *txt_no_prev_group = "No previous group";
- Xchar *txt_no_arts = "*** No Articles ***";
- Xchar *txt_end_of_arts = "*** End of Articles ***";
- Xchar *txt_no_next_unread_art = "No next unread article";
- Xchar *txt_no_prev_unread_art = "No previous unread article";
- Xchar *txt_no_last_message = "No last message";
- Xchar *txt_bad_command = "Bad command. Type 'h' for help.";
- Xchar *txt_you_have_mail = " you have mail\n";
- Xchar *txt_type_h_for_help = "Type 'h' for help\n";
- Xchar *txt_read_art = "Read article> ";
- Xchar *txt_search_forwards = "Search forwards [%s]> ";
- Xchar *txt_search_backwards = "Search backwards [%s]> ";
- Xchar *txt_author_search_forwards = "Author search forwards [%s]> ";
- Xchar *txt_author_search_backwards = "Author search backwards [%s]> ";
- Xchar *txt_no_search_string = "No search string";
- Xchar *txt_no_match = "No match";
- Xchar *txt_post_subject = "Post Subject: ";
- Xchar *txt_cannot_open = "can't open %s";
- Xchar *txt_posting = "Posting...";
- Xchar *txt_art_posted = "-- article posted --";
- Xchar *txt_art_rejected = "-- article rejected --";
- Xchar *txt_abort_edit_post = "a)bort, e)dit, p)ost: ";
- Xchar *txt_help_i_4 = "4$ Select article 4 ($=select last article)\r\n";
- Xchar *txt_help_ctrl_k = "^K Kill current article\r\n";
- Xchar *txt_help_ctrl_l = "^L Redraw page\r\n";
- Xchar *txt_help_ctrl_d = "^D^U Down (^U=up) a page\r\n";
- Xchar *txt_help_i_cr = "<CR> Read current article\r\n";
- Xchar *txt_help_i_tab = "<TAB> View next unread article or group\r\n";
- Xchar *txt_help_m = "m Move current group within group selection list\r\n";
- Xchar *txt_help_M = "M Menu of configurable options\r\n";
- Xchar *txt_help_a = "aA Author forward (A=backward) search\r\n";
- Xchar *txt_help_c = "c Mark all articles as read\r\n";
- Xchar *txt_help_g = "g Choose a new group by name\r\n";
- Xchar *txt_help_I = "I Toggle inverse video\r\n";
- Xchar *txt_help_K = "K Mark article/thread as read & advance\r\n";
- Xchar *txt_help_j = "jk Down (k=up) a line\r\n";
- Xchar *txt_help_i_n = "nN Go to next (N=next unread) group\r\n";
- Xchar *txt_help_i_p = "pP Go to previous (P=previous unread) group\r\n";
- Xchar *txt_help_q = "q Quit\r\n";
- Xchar *txt_help_s = "su Subscribe (u=unsubscribe) to this group\r\n";
- Xchar *txt_help_S = "SU Subscribe (U=unsubscribe) groups that match pattern\r\n";
- Xchar *txt_help_i_S = "S Save articles matching pattern\r\n";
- Xchar *txt_help_t = "T Tag current article for saving\r\n";
- Xchar *txt_help_T = "t Return to group selection index\r\n";
- Xchar *txt_help_U = "U Untag all articles\r\n";
- Xchar *txt_help_w = "w Post an article\r\n";
- Xchar *txt_help_i_search = "/? Subject forward (?=backward) search\r\n";
- Xchar *txt_help_dash = "- Show last message\r\n";
- X#ifdef DONT_USE_REGEX
- Xchar *txt_save_pattern = "Enter save pattern [%s]> ";
- X#else
- Xchar *txt_save_pattern = "Enter regex save pattern [%s]> ";
- X#endif
- Xchar *txt_base_file_name = "Enter base file name> ";
- Xchar *txt_base_subdir = "Enter sub directory name> ";
- Xchar *txt_saved_pattern_to = "-- saved pattern to %s - %s --";
- Xchar *txt_saved_to_mailbox = "-- saved to mailbox %s --";
- Xchar *txt_switch_on_kill_art_menu = "Kill Article Menu is switched OFF. Select Options Menu to switch it ON.";
- X
- X/*
- X * help.c:
- X */
- X
- Xchar *txt_group_select_com_1 = "Group Selection Commands (page 1 of 2)";
- Xchar *txt_group_select_com_2 = "Group Selection Commands (page 2 of 2)";
- Xchar *txt_index_page_com_1 = "Index Page Commands (page 1 of 2)";
- Xchar *txt_index_page_com_2 = "Index Page Commands (page 2 of 2)";
- Xchar *txt_art_pager_com_1 = "Article Pager Commands (page 1 of 2)";
- Xchar *txt_art_pager_com_2 = "Article Pager Commands (page 2 of 2)";
- Xchar *txt_hit_space_for_more = "-- Hit space for more commands --";
- Xchar *txt_select_info = "Group Select Help (page %d of %d)";
- Xchar *txt_group_info = "Group Help (page %d of %d)";
- Xchar *txt_page_info = "Page Help (page %d of %d)";
- X
- X/*
- X * kill.c:
- X */
- X
- Xchar *txt_kill_menu = "Kill Article Menu";
- Xchar *txt_kill_subject = "Kill Subject [%-45s] (y/n): ";
- Xchar *txt_kill_from = "Kill From [%-45s] (y/n): ";
- Xchar *txt_kill_text = "Kill text pattern : ";
- Xchar *txt_kill_text_type = "Apply pattern to : ";
- Xchar *txt_kill_group = "Kill pattern scope: ";
- Xchar *txt_help_kill_subject = "Subject: line to add to kill file. Press backspace key to clear field.";
- Xchar *txt_help_kill_from = "From: line to add to kill file. Press backspace key to clear field.";
- Xchar *txt_help_kill_text = "Enter text pattern to kill if Subject: & From: lines are not what you want.";
- Xchar *txt_help_kill_text_type = "Select where text pattern should be applied. Use <SPACE> to toggle choices.";
- Xchar *txt_help_kill_group = "Apply kill to current group only or all groups. Use <SPACE> to toggle choices.";
- Xchar *txt_abort_edit_save_killfile = "a)bort e)dit s)ave killfile: ";
- X
- X
- X/*
- X * main.c:
- X */
- X
- Xchar *txt_not_in_active_file = "Group %s not found in active file";
- Xchar *txt_screen_init_failed = "Screen initialization failed\n";
- Xchar *txt_bad_active_file = "Active file corrupt\n";
- X
- X/*
- X * misc.c
- X */
- X
- Xchar *txt_cannot_find_base_art = "Cannot find base article %s";
- Xchar *txt_out_of_memory = "%s: out of memory\n";
- X
- X/*
- X * nntp_open.c
- X */
- X
- Xchar *txt_cannot_get_nntp_server_name = "Cannot get nntp server name\n";
- Xchar *txt_server_name_in_file_env_var = "Either put the name in the file %s,\nor put it in the environment variable NNTPSERVER\n";
- Xchar *txt_failed_to_connect_to_server = "failed to connect to (%s) server\n";
- Xchar *txt_rejected_by_nntpserver = "rejected by server, nntp error %d\n";
- Xchar *txt_connection_to_server_broken = "connection to server broken\n";
- Xchar *txt_stuff_nntp_cannot_open = "stuff_nntp: can't open %s: ";
- Xchar *txt_nntp_to_fp_cannot_reopen = "nntp_to_fp: can't reopen %s: ";
- Xchar *txt_nntp_to_fd_cannot_reopen = "nntp_to_fd: can't reopen %s: ";
- X
- X/*
- X * page.c
- X */
- X
- Xchar *txt_quit = "Do you really want to quit? (y/n): ";
- Xchar *txt_art_unavailable = "[Article %ld unvailable]\r\r";
- Xchar *txt_art_marked_as_unread = "Article marked as unread";
- Xchar *txt_thread_marked_as_unread = "Thread marked as unread";
- Xchar *txt_begin_of_art = "*** Beginning of article ***";
- Xchar *txt_next_resp = "-- next response --";
- Xchar *txt_last_resp = "-- last response --";
- Xchar *txt_more = "--More--";
- Xchar *txt_more_percent = "--More--(%d%%) [%ld/%ld]";
- Xchar *txt_note_x_of_n = "%sNote %3d of %3d\r\n";
- Xchar *txt_art = "Article %ld ";
- Xchar *txt_resp_x_of_n = "Resp %3d of %3d\r\n";
- Xchar *txt_no_resp = "No responses\r\n";
- Xchar *txt_1_resp = "1 Response\r\n";
- Xchar *txt_x_resp = "%d Responses\r\n";
- Xchar *txt_s_at_s = "%s at %s";
- Xchar *txt_note_resp_page = "Note %d of %d, Resp %d (page %d): %s";
- Xchar *txt_note_page = "Note %d of %d (page %d): %s";
- Xchar *txt_read_resp = "Read response> ";
- Xchar *txt_help_p_0 = "0 Read the base article in this thread\r\n";
- Xchar *txt_help_p_4 = "4 Read response 4 in this thread\r\n";
- Xchar *txt_help_p_cr = "<CR> Skip to next base article\r\n";
- Xchar *txt_help_p_tab = "<TAB> Advance to next page or unread article\r\n";
- Xchar *txt_help_b = "b<SPACE> Back (<SPACE>=forward) a page\r\n";
- Xchar *txt_help_bug = "B Mail bug/gripe/comment to %s\r\n";
- Xchar *txt_help_p_f = "fF Post (F=copy text) a followup\r\n";
- Xchar *txt_help_ctrl_h = "^H Show articles header\r\n";
- Xchar *txt_help_h = "hH Command (H=context sensitive) help\r\n";
- Xchar *txt_help_p_i = "i Return to index page\r\n";
- Xchar *txt_help_p_k = "kK Mark article (K=thread) as read & advance to next unread\r\n";
- Xchar *txt_help_p_m = "m Mail this article to someone\r\n";
- Xchar *txt_help_p_n = "nN Go to to the next (N=unread) article\r\n";
- Xchar *txt_help_p_o = "oO Output article (O=thread) to printer\r\n";
- Xchar *txt_help_p_p = "pP Go to the previous (P=unread) article\r\n";
- Xchar *txt_help_p_r = "rR Reply through mail (R=copy text) to author\r\n";
- Xchar *txt_help_p_s = "sS Save article (S=thread) to file\r\n";
- Xchar *txt_help_p_z = "zZ Mark article (Z=thread) as unread\r\n";
- Xchar *txt_help_p_ctrl_r = "^R$ Redisplay first page ($=last page) of article\r\n";
- Xchar *txt_help_p_d = "d Toggle rot-13 decoding for this article\r\n";
- Xchar *txt_help_p_pipe = "| Pipe article into command\r\n";
- Xchar *txt_help_p_search = "/ Article forward search\r\n";
- Xchar *txt_mail_art_to = "Mail article to: ";
- Xchar *txt_abort_edit_send = "a)bort, e)dit, s)end: ";
- Xchar *txt_mailing_to = "Mailing to %s...";
- Xchar *txt_message_sent = "-- Message sent --";
- Xchar *txt_command_failed_s = "Command failed: %s\n";
- Xchar *txt_in_art_you_write = "In article %s you write:\n";
- Xchar *txt_resp_to_poster = "Responses have been directed to the poster. Post anyway? (y/n): ";
- Xchar *txt_resp_redirect = "Responses have been directed to the following newsgroups";
- Xchar *txt_continue = "Continue? (y/n): ";
- Xchar *txt_writes = "%s writes:\n";
- Xchar *txt_save_art_to_file = "Save article to file> ";
- Xchar *txt_art_not_saved = "-- article not saved --";
- Xchar *txt_print_art_yn = "Do you really want to print the article? (y/n): ";
- Xchar *txt_print_thread_yn = "Do you really want to print the thread? (y/n): ";
- Xchar *txt_no_filename = "No filename";
- Xchar *txt_saving = "Saving... ";
- Xchar *txt_art_saved_to = "-- article saved to %s --";
- Xchar *txt_save_thread_to = "Save thread to file> ";
- Xchar *txt_thread_not_saved = "-- thread not saved --";
- Xchar *txt_thread_saved_to_many = "-- thread saved to %s - %s --";
- Xchar *txt_thread_saved_to = "-- thread saved to %s --";
- Xchar *txt_pipe_to_command = "Pipe to command: ";
- Xchar *txt_error_printing_art = "-- error printing article --";
- Xchar *txt_printing = "Printing...";
- Xchar *txt_art_printed = "-- article printed --";
- Xchar *txt_error_printing_thread = "-- error printing thread --";
- Xchar *txt_thread_printed = "-- thread printed --";
- Xchar *txt_append_to_file = "File %s exists. Append? (y/n): ";
- X
- X/*
- X * posted.c
- X */
- X
- Xchar *txt_post_history_menu = "Posted articles history";
- Xchar *txt_no_arts_posted = "No articles have been posted";
- X
- X/*
- X * prompt.c
- X */
- X
- Xchar *txt_hit_any_key = "-- Hit any key to continue --";
- X
- X/*
- X * rcfile.c
- X */
- X
- Xchar *txt_opt_autosave = " 1. Auto save : ";
- Xchar *txt_opt_save_separate = " 2. Save separate : ";
- Xchar *txt_opt_mark_saved_read = " 3. Mark saved read : ";
- Xchar *txt_opt_kill_articles = " 4. Kill articles : ";
- Xchar *txt_opt_show_author = " 5. Show Author : ";
- Xchar *txt_opt_draw_arrow = " 6. Draw arrow : ";
- Xchar *txt_opt_post_process = " 7. Post process : ";
- Xchar *txt_opt_print_header = " 8. Print header : ";
- Xchar *txt_opt_process_type = " 9. Process type : ";
- Xchar *txt_opt_sort_type = " 10 Sort article by : ";
- Xchar *txt_opt_savedir = " 11 Save directory : ";
- Xchar *txt_opt_maildir = " 12 Mail directory : ";
- Xchar *txt_opt_printer = " 13 Printer : ";
- Xchar *txt_options_menu = "Options Menu";
- Xchar *txt_post_process_sh = "shell archive";
- Xchar *txt_post_process_uud = "uudecode";
- Xchar *txt_post_process_uud_zoo = "uudecode & zoo";
- Xchar *txt_post_process_uud_lzh = "uudecode & lharc";
- Xchar *txt_post_process_uud_arc = "uudecode & arc";
- Xchar *txt_post_process_uud_zip = "uudecode & zip";
- Xchar *txt_post_process_patch = "patch";
- Xchar *txt_sort_by_none = "Nothing";
- Xchar *txt_sort_by_subj = "Subject: field";
- Xchar *txt_sort_by_from = "From: field";
- Xchar *txt_sort_by_date = "Date: field";
- Xchar *txt_help_autosave = "Auto save article/thread by Archive-name: header. Use <SPACE> to toggle ON/OFF.";
- Xchar *txt_help_save_separate = "Save articles/threads to separate files. Use <SPACE> to toggle ON/OFF.";
- Xchar *txt_help_print_header = "Print complete mail header or Subject: & From:. Use <SPACE> to toggle ON/OFF.";
- Xchar *txt_help_show_author = "Show Subject & From (author) fields in group menu. Use <SPACE> to toggle ON/OFF.";
- Xchar *txt_help_draw_arrow = "Draw -> or highlighted bar for selection. Use <SPACE> to toggle ON/OFF.";
- Xchar *txt_help_kill_articles = "Kill articles that match entries in kill file. Use <SPACE> to toggle ON/OFF.";
- Xchar *txt_help_post_process = "Post process (ie. unshar) saved article/thread. Use <SPACE> to toggle ON/OFF.";
- Xchar *txt_help_mark_saved_read = "Mark saved articles/threads as read. Use <SPACE> to toggle ON/OFF.";
- Xchar *txt_help_post_proc_type = "Post processing to apply to articles/threads. Use <SPACE> to toggle choices.";
- Xchar *txt_help_sort_type = "Sort articles by Subject, From or Date fields. Use <SPACE> to toggle choices.";
- Xchar *txt_help_savedir = "The directory where you want articles/threads saved.";
- Xchar *txt_help_maildir = "The directory where articles/threads are to be saved in mailbox format.";
- Xchar *txt_help_printer = "The printer program with options that is to be used to print articles/threads.";
- Xchar *txt_save_options = "Save options? (y/n): ";
- X
- X/*
- X * save.c
- X */
- X
- Xchar *txt_post_processing = "Post processing...";
- Xchar *txt_deleting = "Deleting...";
- X
- X/*
- X * search.c
- X */
- X
- Xchar *txt_searching = "Searching...";
- X
- X/*
- X * select.c
- X */
- X
- Xchar *txt_moving = "Moving...";
- X#ifdef DONT_USE_REGEX
- Xchar *txt_subscribe_pattern = "Enter subscribe pattern> ";
- Xchar *txt_unsubscribe_pattern = "Enter subscribe pattern> ";
- X#else
- Xchar *txt_subscribe_pattern = "Enter regex subscribe pattern> ";
- Xchar *txt_unsubscribe_pattern = "Enter regex subscribe pattern> ";
- X#endif
- Xchar *txt_subscribing = "Subscribing...";
- Xchar *txt_subscribing_to = "Subscribing to %s...";
- Xchar *txt_unsubscribing = "Unsubscribing...";
- Xchar *txt_unsubscribing_from = "Unsubscribing from %s...";
- Xchar *txt_subscribed_num_groups = "subscribed to %d groups";
- Xchar *txt_unsubscribed_num_groups = "unsubscribed from %d groups";
- Xchar *txt_del_group_in_newsrc = "Delete current group from .newsrc? (y/n): ";
- Xchar *txt_group_deleted = "Group deleted";
- Xchar *txt_mark_group_read = "Mark group as read? (y/n): ";
- Xchar *txt_no_groups_to_delete = "No groups to delete";
- Xchar *txt_reset_newsrc = "Reset newsrc? (y/n): ";
- Xchar *txt_no_groups_to_read = "No more groups to read";
- Xchar *txt_added_groups = "Added %d group%s";
- Xchar *txt_plural = "s";
- Xchar *txt_no_groups_to_yank_in = "No more groups to yank in";
- Xchar *txt_group_selection = "Group Selection";
- Xchar *txt_select_group = "Select group> ";
- Xchar *txt_help_g_4 = "4$ Select group 4 ($=select last group)\r\n";
- Xchar *txt_help_g_ctrl_r = "^R Reset .newsrc\r\n";
- Xchar *txt_help_g_ctrl_k = "^Kz Delete (z=undelete) group from .newsrc\r\n";
- Xchar *txt_help_g_cr = "<CR> Read current group\r\n";
- Xchar *txt_help_g_tab = "<TAB> View next unread group\r\n";
- Xchar *txt_help_g_c = "c Mark group as all read\r\n";
- Xchar *txt_help_W = "W List articles posted by user\r\n";
- Xchar *txt_help_g_y = "y Yank in groups that are not in the .newsrc\r\n";
- Xchar *txt_help_g_dollar = "Y Reread group list from .newsrc\r\n";
- Xchar *txt_help_g_search = "/? Group forward (?=backward) search\r\n";
- Xchar *txt_newsgroup = "Newsgroup> ";
- Xchar *txt_newsgroup_position = "Position %s in group list [1,2,..,$]> ";
- X
- X#endif
- X
- SHAR_EOF
- $TOUCH -am 0823134091 lang.c &&
- chmod 0600 lang.c ||
- echo "restore of lang.c failed"
- set `wc -c lang.c`;Wc_c=$1
- if test "$Wc_c" != "16340"; then
- echo original size 16340, current size $Wc_c
- fi
- # ============= lang.h ==============
- echo "x - extracting lang.h (Text)"
- sed 's/^X//' << 'SHAR_EOF' > lang.h &&
- X/*
- X * Project : tin - a visual threaded usenet newsreader
- X * Module : lang.h
- X * Author : I.Lea
- X * Created : 01-04-91
- X * Updated : 21-08-91
- X * Release : 1.0
- X * Notes :
- X * Copyright : (c) Copyright 1991 by Iain Lea
- X * You may freely copy or redistribute this software,
- X * so long as there is no profit made from its use, sale
- X * trade or reproduction. You may not change this copy-
- X * right notice, and it must be included in any copy made
- X */
- X
- X/*
- X * art.c
- X */
- X
- Xextern char *txt_group;
- Xextern char *txt_cannot_open_dir;
- Xextern char *txt_cannot_open_art;
- Xextern char *txt_indexing;
- Xextern char *txt_corrupt_index;
- X
- X/*
- X * group.c
- X */
- X
- Xextern char *txt_inverse_on;
- Xextern char *txt_inverse_off;
- Xextern char *txt_subscribed_to;
- Xextern char *txt_unsubscribed_to;
- Xextern char *txt_mark_all_read;
- Xextern char *txt_marked_as_read;
- Xextern char *txt_no_more_groups;
- Xextern char *txt_no_prev_group;
- Xextern char *txt_no_arts;
- Xextern char *txt_end_of_arts;
- Xextern char *txt_no_next_unread_art;
- Xextern char *txt_no_prev_unread_art;
- Xextern char *txt_no_last_message;
- Xextern char *txt_bad_command;
- Xextern char *txt_you_have_mail;
- Xextern char *txt_type_h_for_help;
- Xextern char *txt_read_art;
- Xextern char *txt_author_search_forwards;
- Xextern char *txt_author_search_backwards;
- Xextern char *txt_search_forwards;
- Xextern char *txt_search_backwards;
- Xextern char *txt_no_search_string;
- Xextern char *txt_no_match;
- Xextern char *txt_post_subject;
- Xextern char *txt_cannot_open;
- Xextern char *txt_posting;
- Xextern char *txt_art_posted;
- Xextern char *txt_art_rejected;
- Xextern char *txt_abort_edit_post;
- Xextern char *txt_index_page_com_1;
- Xextern char *txt_index_page_com_2;
- Xextern char *txt_hit_space_for_more;
- Xextern char *txt_help_i_4;
- Xextern char *txt_help_ctrl_k;
- Xextern char *txt_help_ctrl_l;
- Xextern char *txt_help_ctrl_d;
- Xextern char *txt_help_i_cr;
- Xextern char *txt_help_i_tab;
- Xextern char *txt_help_m;
- Xextern char *txt_help_M;
- Xextern char *txt_help_a;
- Xextern char *txt_help_c;
- Xextern char *txt_help_g;
- Xextern char *txt_help_I;
- Xextern char *txt_help_K;
- Xextern char *txt_help_j;
- Xextern char *txt_help_i_n;
- Xextern char *txt_help_i_p;
- Xextern char *txt_help_q;
- Xextern char *txt_help_s;
- Xextern char *txt_help_S;
- Xextern char *txt_help_i_S;
- Xextern char *txt_help_t;
- Xextern char *txt_help_T;
- Xextern char *txt_help_U;
- Xextern char *txt_help_i_u;
- Xextern char *txt_help_w;
- Xextern char *txt_help_i_search;
- Xextern char *txt_help_dash;
- Xextern char *txt_save_pattern;
- Xextern char *txt_base_file_name;
- Xextern char *txt_base_subdir;
- Xextern char *txt_saved_pattern_to;
- Xextern char *txt_saved_to_mailbox;
- Xextern char *txt_switch_on_kill_art_menu;
- X
- X/*
- X * help.c:
- X */
- X
- Xextern char *txt_select_info;
- Xextern char *txt_group_info;
- Xextern char *txt_page_info;
- X
- X/*
- X * kill.c:
- X */
- X
- Xextern char *txt_kill_menu;
- Xextern char *txt_kill_subject;
- Xextern char *txt_kill_from;
- Xextern char *txt_kill_text;
- Xextern char *txt_kill_text_type;
- Xextern char *txt_kill_group;
- Xextern char *txt_help_kill_subject;
- Xextern char *txt_help_kill_from;
- Xextern char *txt_help_kill_text;
- Xextern char *txt_help_kill_text_type;
- Xextern char *txt_help_kill_group;
- Xextern char *txt_abort_edit_save_killfile;
- X
- X/*
- X * page.c
- X */
- X
- Xextern char *txt_quit;
- Xextern char *txt_art_unavailable;
- Xextern char *txt_art_marked_as_unread;
- Xextern char *txt_thread_marked_as_unread;
- Xextern char *txt_begin_of_art;
- Xextern char *txt_next_resp;
- Xextern char *txt_last_resp;
- Xextern char *txt_more_percent;
- Xextern char *txt_more;
- Xextern char *txt_note_x_of_n;
- Xextern char *txt_art;
- Xextern char *txt_resp_x_of_n;
- Xextern char *txt_no_resp;
- Xextern char *txt_1_resp;
- Xextern char *txt_x_resp;
- Xextern char *txt_s_at_s;
- Xextern char *txt_note_resp_page;
- Xextern char *txt_note_page;
- Xextern char *txt_read_resp;
- Xextern char *txt_art_pager_com_1;
- Xextern char *txt_art_pager_com_2;
- Xextern char *txt_help_p_0;
- Xextern char *txt_help_p_4;
- Xextern char *txt_help_p_cr;
- Xextern char *txt_help_p_tab;
- Xextern char *txt_help_b;
- Xextern char *txt_help_bug;
- Xextern char *txt_help_p_f;
- Xextern char *txt_help_ctrl_h;
- Xextern char *txt_help_h;
- Xextern char *txt_help_p_i;
- Xextern char *txt_help_p_k;
- Xextern char *txt_help_p_m;
- Xextern char *txt_help_p_n;
- Xextern char *txt_help_p_o;
- Xextern char *txt_help_p_p;
- Xextern char *txt_help_p_r;
- Xextern char *txt_help_p_s;
- Xextern char *txt_help_p_z;
- Xextern char *txt_help_p_ctrl_r;
- Xextern char *txt_help_p_d;
- Xextern char *txt_help_p_pipe;
- Xextern char *txt_help_p_search;
- Xextern char *txt_mail_art_to;
- Xextern char *txt_abort_edit_send;
- Xextern char *txt_mailing_to;
- Xextern char *txt_message_sent;
- Xextern char *txt_command_failed_s;
- Xextern char *txt_in_art_you_write;
- Xextern char *txt_resp_to_poster;
- Xextern char *txt_resp_redirect;
- Xextern char *txt_continue;
- Xextern char *txt_writes;
- Xextern char *txt_save_art_to_file;
- Xextern char *txt_art_not_saved;
- Xextern char *txt_print_art_yn;
- Xextern char *txt_print_thread_yn;
- Xextern char *txt_no_filename;
- Xextern char *txt_saving;
- Xextern char *txt_art_saved_to;
- Xextern char *txt_save_thread_to;
- Xextern char *txt_thread_not_saved;
- Xextern char *txt_thread_saved_to_many;
- Xextern char *txt_thread_saved_to;
- Xextern char *txt_pipe_to_command;
- Xextern char *txt_command_failed;
- Xextern char *txt_error_printing_art;
- Xextern char *txt_printing;
- Xextern char *txt_art_printed;
- Xextern char *txt_error_printing_thread;
- Xextern char *txt_thread_printed;
- Xextern char *txt_append_to_file;
- X
- X/*
- X * prompt.c
- X */
- X
- Xextern char *txt_hit_any_key;
- X
- X/*
- X * main.c:
- X */
- X
- Xextern char *txt_not_in_active_file;
- Xextern char *txt_screen_init_failed;
- Xextern char *txt_bad_active_file;
- X
- X/*
- X * misc.c
- X */
- X
- Xextern char *txt_cannot_find_base_art;
- Xextern char *txt_out_of_memory;
- X
- X/*
- X * nntp.c
- X */
- X
- Xextern char *txt_cannot_get_nntp_server_name;
- Xextern char *txt_server_name_in_file_env_var;
- Xextern char *txt_failed_to_connect_to_server;
- Xextern char *txt_rejected_by_nntpserver;
- Xextern char *txt_connection_to_server_broken;
- Xextern char *txt_stuff_nntp_cannot_open;
- Xextern char *txt_nntp_to_fp_cannot_reopen;
- Xextern char *txt_nntp_to_fd_cannot_reopen;
- X
- X/*
- X * posted.c
- X */
- X
- Xextern char *txt_post_history_menu;
- Xextern char *txt_no_arts_posted;
- X
- X/*
- X * rcfile.c
- X */
- X
- Xextern char *txt_opt_autosave;
- Xextern char *txt_opt_save_separate;
- Xextern char *txt_opt_mark_saved_read;
- Xextern char *txt_opt_kill_articles;
- Xextern char *txt_opt_show_author;
- Xextern char *txt_opt_draw_arrow;
- Xextern char *txt_opt_post_process;
- Xextern char *txt_opt_print_header;
- Xextern char *txt_opt_process_type;
- Xextern char *txt_opt_sort_type;
- Xextern char *txt_post_process_sh;
- Xextern char *txt_post_process_uud;
- Xextern char *txt_post_process_uud_zoo;
- Xextern char *txt_post_process_uud_lzh;
- Xextern char *txt_post_process_uud_arc;
- Xextern char *txt_post_process_uud_zip;
- Xextern char *txt_post_process_patch;
- Xextern char *txt_sort_by_none;
- Xextern char *txt_sort_by_subj;
- Xextern char *txt_sort_by_from;
- Xextern char *txt_sort_by_date;
- Xextern char *txt_opt_savedir;
- Xextern char *txt_opt_maildir;
- Xextern char *txt_opt_printer;
- Xextern char *txt_opt_kill_subj;
- Xextern char *txt_opt_kill_from;
- Xextern char *txt_options_menu;
- Xextern char *txt_help_autosave;
- Xextern char *txt_help_save_separate;
- Xextern char *txt_help_print_header;
- Xextern char *txt_help_show_author;
- Xextern char *txt_help_draw_arrow;
- Xextern char *txt_help_kill_articles;
- Xextern char *txt_help_post_process;
- Xextern char *txt_help_mark_saved_read;
- Xextern char *txt_help_post_proc_type;
- Xextern char *txt_help_sort_type;
- Xextern char *txt_help_savedir;
- Xextern char *txt_help_maildir;
- Xextern char *txt_help_printer;
- Xextern char *txt_save_options;
- X
- X/*
- X * save.c
- X */
- X
- Xextern char *txt_post_processing;
- Xextern char *txt_deleting;
- X
- X/*
- X * search.c
- X */
- X
- Xextern char *txt_searching;
- X
- X/*
- X * select.c
- X */
- X
- Xextern char *txt_moving;
- Xextern char *txt_subscribe_pattern;
- Xextern char *txt_unsubscribe_pattern;
- Xextern char *txt_subscribing;
- Xextern char *txt_subscribing_to;
- Xextern char *txt_unsubscribing;
- Xextern char *txt_unsubscribing_from;
- Xextern char *txt_subscribed_num_groups;
- Xextern char *txt_unsubscribed_num_groups;
- Xextern char *txt_del_group_in_newsrc;
- Xextern char *txt_group_deleted;
- Xextern char *txt_mark_group_read;
- Xextern char *txt_no_groups_to_delete;
- Xextern char *txt_reset_newsrc;
- Xextern char *txt_no_groups_to_read;
- Xextern char *txt_added_groups;
- Xextern char *txt_rewriting_newsrc_file;
- Xextern char *txt_plural;
- Xextern char *txt_no_groups_to_yank_in;
- Xextern char *txt_group_selection;
- Xextern char *txt_select_group;
- Xextern char *txt_group_select_com_1;
- Xextern char *txt_group_select_com_2;
- Xextern char *txt_help_g_4;
- Xextern char *txt_help_g_ctrl_r;
- Xextern char *txt_help_g_ctrl_k;
- Xextern char *txt_help_g_cr;
- Xextern char *txt_help_g_tab;
- Xextern char *txt_help_g_c;
- Xextern char *txt_help_W;
- Xextern char *txt_help_g_y;
- Xextern char *txt_help_g_dollar;
- Xextern char *txt_help_g_search;
- Xextern char *txt_newsgroup;
- Xextern char *txt_newsgroup_position;
- X
- SHAR_EOF
- $TOUCH -am 0821133491 lang.h &&
- chmod 0600 lang.h ||
- echo "restore of lang.h failed"
- set `wc -c lang.h`;Wc_c=$1
- if test "$Wc_c" != "8856"; then
- echo original size 8856, current size $Wc_c
- fi
- # ============= mail.c ==============
- echo "x - extracting mail.c (Text)"
- sed 's/^X//' << 'SHAR_EOF' > mail.c &&
- X/*
- X * Project : tin - a visual threaded usenet newsreader
- X * Module : mail.c
- X * Author : R.Skrenta
- X * Created : 01-04-91
- X * Updated : 10-08-91
- X * Release : 1.0
- X * Notes :
- X * Copyright : (c) Copyright 1991 by Rich Skrenta
- X * You may freely copy or redistribute this software,
- X * so long as there is no profit made from its use, sale
- X * trade or reproduction. You may not change this copy-
- X * right notice, and it must be included in any copy made
- X */
- X
- X#include <stdio.h>
- X#include <sys/types.h>
- X#include <sys/stat.h>
- X
- X#define TRUE 1
- X#define FALSE 0
- X
- X
- Xchar *mailbox_name = NULL;
- Xoff_t mailbox_size;
- X
- X
- X/*
- X * Record size of mailbox so we can detect if new mail has arrived
- X */
- X
- Xvoid mail_setup ()
- X{
- X struct stat buf;
- X extern char *getenv();
- X
- X if (mailbox_name == NULL)
- X mailbox_name = getenv("MAIL");
- X
- X if (mailbox_name == NULL)
- X mailbox_size = 0;
- X else {
- X if (stat(mailbox_name, &buf) >= 0)
- X mailbox_size = buf.st_size;
- X else
- X mailbox_size = 0;
- X }
- X}
- X
- X
- X/*
- X * Return TRUE if new mail has arrived
- X */
- X
- Xint mail_check ()
- X{
- X struct stat buf;
- X
- X if (mailbox_name != NULL
- X && stat(mailbox_name, &buf) >= 0
- X && mailbox_size < buf.st_size)
- X return TRUE;
- X
- X return FALSE;
- X}
- X
- SHAR_EOF
- $TOUCH -am 0819090291 mail.c &&
- chmod 0600 mail.c ||
- echo "restore of mail.c failed"
- set `wc -c mail.c`;Wc_c=$1
- if test "$Wc_c" != "1260"; then
- echo original size 1260, current size $Wc_c
- fi
- # ============= main.c ==============
- echo "x - extracting main.c (Text)"
- sed 's/^X//' << 'SHAR_EOF' > main.c &&
- X/*
- X * Project : tin - a visual threaded usenet newsreader
- X * Module : main.c
- X * Author : R.Skrenta / I.Lea
- X * Created : 01-04-91
- X * Updated : 20-08-91
- X * Release : 1.0
- X * Notes :
- X * Copyright : (c) Copyright 1991 by Rich Skrenta & Iain Lea
- X * You may freely copy or redistribute this software,
- X * so long as there is no profit made from its use, sale
- X * trade or reproduction. You may not change this copy-
- X * right notice, and it must be included in any copy made
- X */
- X
- X#include "tin.h"
- X
- Xchar *version = "v1.00";
- Xchar cvers[LEN+1];
- Xchar nntp_server[LEN+1];
- X
- Xint max_subj = 0;
- Xint max_from = 0;
- Xint max_active;
- Xint group_hash[TABLE_SIZE]; /* group name --> active[] */
- Xint *my_group; /* .newsrc --> active[] */
- Xint *unread; /* highest art read in group */
- Xint num_active; /* one past top of active */
- Xint local_top; /* one past top of my_group */
- Xint catchup = FALSE; /* mark all arts read in all subscribed groups */
- Xint update = FALSE; /* update index files only mode */
- Xint verbose = FALSE; /* update index files only mode */
- Xint start_line_offset; /* used by invoke_editor for line no. */
- Xint read_news_via_nntp = FALSE; /* read news locally or via NNTP */
- Xint max_art;
- Xint top = 0;
- Xint top_base;
- Xint tin_uid;
- Xint tin_gid;
- Xint real_uid;
- Xint real_gid;
- Xint local_index; /* do private indexing? */
- X
- Xlong *base;
- X
- Xstruct group_ent *active; /* active file */
- Xstruct header *arts;
- X
- X
- X#ifdef SIGTSTP
- Xvoid main_susp (sig)
- X int sig;
- X{
- X Raw(FALSE);
- X putchar('\n');
- X signal(SIGTSTP, SIG_DFL);
- X#ifdef BSD
- X sigsetmask(sigblock(0) & ~(1 << (SIGTSTP -1)));
- X#endif
- X kill(0, SIGTSTP);
- X
- X signal(SIGTSTP, main_susp);
- X mail_setup();
- X if (! update) {
- X Raw(TRUE);
- X }
- X}
- X#endif
- X
- X
- Xvoid signal_handler (sig)
- X int sig;
- X{
- X if (sig == SIGINT) {
- X signal (SIGINT, signal_handler);
- X } else {
- X free_all_arrays ();
- X Raw(FALSE);
- X printf("\n%s: signal handler caught signal %d\n", progname,sig);
- X exit(1);
- X }
- X}
- X
- X
- Xvoid main (argc, argv)
- X int argc;
- X char *argv[];
- X{
- X extern int optind, opterr;
- X extern char *optarg;
- X extern char author_search_string[LEN+1];
- X extern char group_search_string[LEN+1];
- X extern char subject_search_string[LEN+1];
- X int c, i;
- X struct stat st;
- X
- X signal(SIGINT, signal_handler); /* ctrl-C */
- X signal(SIGQUIT, signal_handler); /* ctrl-\ */
- X signal(SIGILL, signal_handler);
- X signal(SIGBUS, signal_handler);
- X signal(SIGSEGV, signal_handler);
- X
- X signal(SIGPIPE, SIG_IGN);
- X#ifdef SIGTSTP
- X signal(SIGTSTP, main_susp);
- X#endif
- X
- X debug = FALSE;
- X
- X strcpy (progname, argv[0]);
- X
- X nntp_server[0] = '\0';
- X group_search_string[0] = '\0';
- X author_search_string[0] = '\0';
- X subject_search_string[0] = '\0';
- X
- X hash_init ();
- X for (i = 0; i < TABLE_SIZE; i++) {
- X group_hash[i] = -1;
- X }
- X
- X tin_uid = geteuid();
- X tin_gid = getegid();
- X real_uid = getuid();
- X real_gid = getgid();
- X
- X init_selfinfo (); /* set up char *'s: homedir, newsrc, etc. */
- X init_alloc (); /* allocate initial array sizes */
- X
- X if (tin_uid == real_uid) { /* run out of someone's account */
- X local_index = TRUE; /* index in their home directory */
- X mkdir(indexdir, 0755);
- X } else { /* we're setuid, index in /usr/spool/news */
- X local_index = FALSE;
- X }
- X
- X while ((c = getopt (argc, argv, "cd:Df:hm:M:p:rS:uv")) != EOF) {
- X switch(c) {
- X case 'c':
- X catchup = TRUE;
- X update = TRUE;
- X break;
- X
- X case 'd':
- X my_strncpy (savedir, optarg, LEN);
- X if (stat (savedir,&st) == -1) {
- X mkdir (savedir, 0755);
- X }
- X break;
- X
- X case 'D': /* debug mode */
- X debug = TRUE;
- X break;
- X
- X case 'f':
- X my_strncpy (newsrc, optarg, LEN);
- X break;
- X
- X case 'm':
- X my_strncpy (mailer, optarg, LEN);
- X break;
- X
- X case 'M':
- X my_strncpy (maildir, optarg, LEN);
- X if (stat (maildir,&st) == -1) {
- X mkdir (maildir, 0755);
- X }
- X break;
- X
- X case 'p':
- X my_strncpy (printer, optarg, LEN);
- X default_printer = FALSE;
- X break;
- X
- X case 'r': /* read news remotely from default NNTP server */
- X#ifdef USE_NNTP
- X read_news_via_nntp = TRUE;
- X#else
- X printf ("Option not enabled. Recompile %s with -DUSE_NNTP.\n", progname);
- X exit (1);
- X#endif
- X break;
- X
- X case 'S':
- X my_strncpy (spooldir, optarg, LEN);
- X break;
- X
- X case 'u':
- X update = TRUE;
- X break;
- X
- X case 'v':
- X verbose = TRUE;
- X update = TRUE;
- X break;
- X
- X case 'h':
- X case '?':
- X default:
- X usage (progname);
- X exit (1);
- X }
- X }
- X
- X sprintf (page_header, "%s %s%s", progname, version, is_remote ());
- X sprintf (cvers, "%s (c) Copyright 1991 Iain Lea.", page_header);
- X
- X if (! update) {
- X printf ("%s\n", cvers);
- X fflush (stdout);
- X }
- X
- X nntp_startup (); /* connect server if we are using nntp */
- X read_active (); /* load the active file into active[] */
- X
- X if (optind < argc) {
- X while (optind < argc) {
- X if (add_group (argv[optind], TRUE) < 0) {
- X fprintf (stderr, txt_not_in_active_file, argv[optind]);
- X fprintf (stderr, "\n");
- X }
- X optind++;
- X }
- X } else {
- X read_newsrc(TRUE);
- X }
- X
- X if (InitScreen () == FALSE) {
- X fprintf(stderr,txt_screen_init_failed);
- X exit(1);
- X }
- X
- X ScreenSize (&LINES, &COLS);
- X Raw(TRUE);
- X
- X#ifdef TIOCGWINSZ
- X {
- X struct winsize win;
- X
- X if (ioctl (0, TIOCGWINSZ, &win) == 0) {
- X if (win.ws_row != 0)
- X LINES = win.ws_row - 1;
- X if (win.ws_col != 0)
- X COLS = win.ws_col;
- X }
- X }
- X#endif
- X
- X max_subj = (COLS/2) - 2;
- X max_from = (COLS-max_subj) - 17;
- X
- X if (kill_articles) { /* read in users kill file */
- X read_kill_file ();
- X }
- X
- X if (update) { /* index file updater only */
- X Raw (FALSE);
- X do_update ();
- X exit (0);
- X }
- X
- X init_screen_array (TRUE); /* allocate screen array */
- X
- X mail_setup (); /* record mailbox size for "you have mail" */
- X
- X#ifndef USE_CLEARSCREEN
- X ClearScreen();
- X#endif
- X
- X selection_index ();
- X
- X tin_done (0);
- X
- X exit (0);
- X}
- X
- X/*
- X * usage
- X */
- X
- Xvoid usage (progname)
- X char *progname;
- X{
- X fprintf(stderr, "%s %s - threaded usenet newsreader. Copyright 1991 Iain Lea.\n\n", progname, version);
- X fprintf(stderr, "Usage: %s [options] [newsgroups]\n",progname);
- X fprintf(stderr, " -c mark all articles as read in subscribed newsgroups\n");
- X fprintf(stderr, " -d dir save articles to directory [default=%s]\n",savedir);
- X fprintf(stderr, " -f file subscribed newsgroups file [default=%s/.newsrc]\n", homedir);
- X fprintf(stderr, " -h help\n");
- X fprintf(stderr, " -m file mail program [default=%s]\n",DEFAULT_MAILER);
- X fprintf(stderr, " -M dir mailbox directory [default=%s]\n",maildir);
- X fprintf(stderr, " -p file print program with options [default=%s]\n",DEFAULT_PRINTER);
- X fprintf(stderr, " -r read news remotely from default NNTP server\n",DEFAULT_PRINTER);
- X fprintf(stderr, " -S dir spool directory [default=%s]\n",SPOOLDIR);
- X fprintf(stderr, " -u update index files only\n");
- X fprintf(stderr, " -v update index files only (verbose)\n");
- X}
- SHAR_EOF
- $TOUCH -am 0820174191 main.c &&
- chmod 0600 main.c ||
- echo "restore of main.c failed"
- set `wc -c main.c`;Wc_c=$1
- if test "$Wc_c" != "6852"; then
- echo original size 6852, current size $Wc_c
- fi
- # ============= memory.c ==============
- echo "x - extracting memory.c (Text)"
- sed 's/^X//' << 'SHAR_EOF' > memory.c &&
- X/*
- X * Project : tin - a visual threaded usenet newsreader
- X * Module : memory.c
- X * Author : R.Skrenta / I.Lea
- X * Created : 01-04-91
- X * Updated : 22-08-91
- X * Release : 1.0
- X * Notes :
- X * Copyright : (c) Copyright 1991 by Rich Skrenta & Iain Lea
- X * You may freely copy or redistribute this software,
- X * so long as there is no profit made from its use, sale
- X * trade or reproduction. You may not change this copy-
- X * right notice, and it must be included in any copy made
- X */
- X
- X#include "tin.h"
- X
- Xint active_num = 0;
- Xint article_num = 0;
- X
- X/*
- X * Dynamic table management
- X * These settings are memory conservative: small initial allocations
- X * and a 50% expansion on table overflow. A fast vm system with
- X * much memory might want to start with higher initial allocations
- X * and a 100% expansion on overflow, especially for the arts[] array.
- X */
- X
- Xvoid init_alloc ()
- X{
- X if (active_num) { /* initial alloc */
- X max_active = active_num;
- X } else {
- X max_active = DEFAULT_ACTIVE_NUM;
- X }
- X
- X active = (struct group_ent *) my_malloc((unsigned) sizeof(*active) * max_active);
- X my_group = (int *) my_malloc((unsigned) sizeof(int) * max_active);
- X unread = (int *) my_malloc((unsigned) sizeof(int) * max_active);
- X
- X if(article_num) { /* initial alloc */
- X max_art = article_num;
- X } else {
- X max_art = DEFAULT_ARTICLE_NUM;
- X }
- X
- X arts = (struct header *) my_malloc((unsigned) sizeof(*arts) * max_art);
- X base = (long *) my_malloc((unsigned) sizeof(long) * max_art);
- X
- X max_kill = DEFAULT_KILL_NUM;
- X
- X killf = (struct kill_t *) my_malloc((unsigned) sizeof(*killf) * max_kill);
- X
- X max_save = DEFAULT_SAVE_NUM;
- X
- X save = (struct save_t *) my_malloc((unsigned) sizeof(*save) * max_save);
- X}
- X
- X
- Xvoid expand_art()
- X{
- X max_art += max_art / 2; /* increase by 50% */
- X
- X arts = (struct header *) my_realloc((char *) arts, (unsigned) sizeof(*arts) * max_art);
- X base = (long *) my_realloc((char *) base, (unsigned) sizeof(long) * max_art);
- X}
- X
- X
- Xvoid free_art_array ()
- X{
- X register int i;
- X
- X for (i=0 ; i < top ; i++) {
- X arts[i].artnum = 0L;
- X arts[i].thread = ART_NORMAL;
- X arts[i].inthread = FALSE;
- X arts[i].unread = ART_UNREAD;
- X arts[i].tagged = FALSE;
- X if (arts[i].part) {
- X free (arts[i].part);
- X arts[i].part = (char *) 0;
- X }
- X if (arts[i].patch) {
- X free (arts[i].patch);
- X arts[i].patch = (char *) 0;
- X }
- X }
- X}
- X
- X
- Xvoid expand_active()
- X{
- X max_active += max_active / 2; /* increase by 50% */
- X
- X active = (struct group_ent *) my_realloc((char *) active,
- X (unsigned) sizeof(*active) * max_active);
- X my_group = (int *) my_realloc((char *) my_group, (unsigned) sizeof(int) * max_active);
- X unread = (int *) my_realloc((char *) unread, (unsigned) sizeof(int) * max_active);
- X}
- X
- X
- Xvoid expand_kill()
- X{
- X max_kill += max_kill / 2; /* increase by 50% */
- X
- X killf = (struct kill_t *) my_realloc((char *) killf, (unsigned) sizeof(struct kill_t) * max_kill);
- X}
- X
- X
- Xvoid expand_save()
- X{
- X max_save += max_save / 2; /* increase by 50% */
- X
- X save = (struct save_t *) my_realloc((char *) save, (unsigned) sizeof(struct save_t) * max_save);
- X}
- X
- X
- Xvoid init_screen_array (allocate)
- X int allocate;
- X{
- X int i;
- X
- X if (allocate) {
- X screen = (struct screen_t *) my_malloc((unsigned) sizeof(*screen) * LINES);
- X
- X for (i=0 ; i < LINES ; i++) {
- X screen[i].col = (char *) my_malloc ((unsigned) COLS+1);
- X }
- X } else {
- X for (i=0 ; i < LINES ; i++) {
- X if (screen[i].col) {
- X free (screen[i].col);
- X screen[i].col = (char *) 0;
- X }
- X }
- X
- X free (screen);
- X }
- X}
- X
- X
- Xvoid free_all_arrays ()
- X{
- X register int i;
- X
- X hash_reclaim ();
- X
- X init_screen_array (FALSE);
- X
- X free_art_array ();
- X
- X if (my_group) {
- X free (my_group);
- X }
- X
- X if (unread) {
- X free (unread);
- X }
- X
- X if (base) {
- X free (base);
- X }
- X
- X if (killf) {
- X free_kill_array ();
- X if (killf) {
- X free (killf);
- X }
- X }
- X
- X if (save) {
- X free_save_array ();
- X if (save) {
- X free (save);
- X }
- X }
- X
- X if (active) {
- X for (i=0 ; i < max_active ; i++) {
- X if (active[i].name) {
- X free (active[i].name);
- X }
- X }
- X free (active);
- X }
- X
- X if (arts) {
- X free (arts);
- X }
- X}
- X
- X
- Xvoid free_kill_array ()
- X{
- X int i;
- X
- X for (i=0 ; i < kill_num ; i++) {
- X if (killf[i].kill_subj) {
- X free (killf[i].kill_subj);
- X killf[i].kill_subj = (char *) 0;
- X }
- X if (killf[i].kill_from) {
- X free (killf[i].kill_from);
- X killf[i].kill_from = (char *) 0;
- X }
- X }
- X}
- X
- X
- X/*
- X * reset save list array to 0 and free's all its allocated memory
- X */
- X
- Xvoid free_save_array ()
- X{
- X int i;
- X
- X for (i=0 ; i < save_num ; i++) {
- X if (save[i].subject) {
- X free (save[i].subject);
- X save[i].subject = (char *) 0;
- X }
- X if (save[i].archive) {
- X free (save[i].archive);
- X save[i].archive = (char *) 0;
- X }
- X if (save[i].dir) {
- X free (save[i].dir);
- X save[i].dir = (char *) 0;
- X }
- X if (save[i].file) {
- X free (save[i].file);
- X save[i].file = (char *) 0;
- X }
- X if (save[i].part) {
- X free (save[i].part);
- X save[i].part = (char *) 0;
- X }
- X if (save[i].patch) {
- X free (save[i].patch);
- X save[i].patch = (char *) 0;
- X }
- X save[i].index = -1;
- X save[i].saved = FALSE;
- X save[i].is_mailbox = FALSE;
- X }
- X
- X save_num = 0;
- X}
- X
- Xchar *my_malloc (size)
- X unsigned size;
- X{
- X char *p;
- X
- X if ((p = (char *) calloc (1, (int) size)) == NULL) {
- X fprintf (stderr, txt_out_of_memory, progname);
- X exit (1);
- X }
- X return p;
- X}
- X
- X
- Xchar *my_realloc (p, size)
- X char *p;
- X unsigned size;
- X{
- X if (! p) {
- X p = (char *) calloc (1, (int) size);
- X } else {
- X p = (char *) realloc (p, (int) size);
- X }
- X
- X if (! p) {
- X fprintf (stderr, txt_out_of_memory, progname);
- X exit (1);
- X }
- X return p;
- X}
- X
- SHAR_EOF
- $TOUCH -am 0822175591 memory.c &&
- chmod 0600 memory.c ||
- echo "restore of memory.c failed"
- set `wc -c memory.c`;Wc_c=$1
- if test "$Wc_c" != "5489"; then
- echo original size 5489, current size $Wc_c
- fi
- # ============= misc.c ==============
- echo "x - extracting misc.c (Text)"
- sed 's/^X//' << 'SHAR_EOF' > misc.c &&
- X/*
- X * Project : tin - a visual threaded usenet newsreader
- X * Module : misc.c
- X * Author : R.Skrenta / I.Lea
- X * Created : 01-04-91
- X * Updated : 20-08-91
- X * Release : 1.0
- X * Notes :
- X * Copyright : (c) Copyright 1991 by Rich Skrenta & Iain Lea
- X * You may freely copy or redistribute this software,
- X * so long as there is no profit made from its use, sale
- X * trade or reproduction. You may not change this copy-
- X * right notice, and it must be included in any copy made
- X */
- X
- X#include "tin.h"
- X
- X
- Xchar rcdir[LEN+1];
- Xchar rcfile[LEN+1];
- Xchar indexdir[LEN+1];
- Xchar killfile[LEN+1];
- Xchar postfile[LEN+1];
- X
- Xchar active_file[LEN+1];
- Xchar homedir[LEN+1];
- Xchar userid[LEN+1];
- Xchar delgroups[LEN+1];
- Xchar newsrc[LEN+1];
- Xchar newnewsrc[LEN+1];
- Xchar add_addr[LEN+1]; /* address to add to rR reply to author with mail */
- Xchar reply_to[LEN+1]; /* reply-to address */
- Xchar my_org[LEN+1]; /* organization */
- Xchar sig[LEN+1];
- Xchar signature[LEN+1];
- Xchar killsubj[LEN+1]; /* contains Subject:'s not to be shown */
- Xchar killfrom[LEN+1]; /* conatins From:'s not to be shown */
- Xchar page_header[LEN+1]; /* page header of pgm name and version */
- Xchar savedir[LEN+1]; /* directory to save articles to */
- Xchar spooldir[LEN+1]; /* directory where new is */
- Xchar mailer[LEN+1]; /* mail program */
- Xchar maildir[LEN+1]; /* mailbox dir where = saves are stored */
- Xchar printer[LEN+1]; /* printer program */
- Xchar progname[LEN+1]; /* program name */
- Xint sort_art_type; /* sort arts[] array by subject,from or date field */
- Xint save_separate; /* save a each part of a thread to a separate file */
- Xint save_archive_name; /* save thread with name from Archive-name: field */
- Xint default_printer; /* set to false if user give a printer with -p switch */
- Xint print_header; /* print all of mail header or just Subject: & From lines */
- Xint show_author; /* show Subject & From or only Subject in group menu */
- Xint draw_arrow_mark; /* draw -> or highlighted bar */
- Xint kill_articles; /* kill articles matching kill file contents */
- Xint post_process; /* post process (ie. unshar/uudecode) saved article/thread */
- Xint mark_saved_read; /* mark saved article/thread as read */
- Xint post_proc_type; /* type of post processing to be performed */
- Xint num_of_tagged_files;
- X
- X/*
- X * init_selfinfo
- X * Deterimines users home directory, userid, and a path
- X * for an rc file in the home directory
- X */
- X
- Xvoid init_selfinfo()
- X{
- X char nam[LEN+1];
- X char *p;
- X extern char *getenv();
- X extern struct passwd *getpwuid();
- X FILE *fp;
- X struct passwd *myentry;
- X struct stat sb;
- X
- X myentry = getpwuid (getuid());
- X strcpy (userid, myentry->pw_name);
- X strcpy (homedir, myentry->pw_dir);
- X
- X default_printer = TRUE;
- X draw_arrow_mark = FALSE;
- X kill_articles = FALSE;
- X mark_saved_read = TRUE;
- X num_of_tagged_files = 0;
- X post_process = FALSE;
- X post_proc_type = POST_PROC_SH;
- X print_header = FALSE;
- X save_separate = TRUE;
- X save_archive_name = TRUE;
- X show_author = TRUE;
- X sort_art_type = SORT_BY_NONE;
- X
- X killsubj[0] = '\0';
- X killfrom[0] = '\0';
- X
- X author_search_string[0] = '\0';
- X group_search_string[0] = '\0';
- X subject_search_string[0] = '\0';
- X art_search_string[0] = '\0';
- X default_regex_pattern[0] = '\0';
- X
- X sprintf (rcdir, "%s/%s", homedir, RCDIR);
- X sprintf (indexdir, "%s/%s", rcdir, INDEXDIR);
- X sprintf (rcfile, "%s/%s", rcdir, RCFILE);
- X sprintf (indexdir, "%s/%s", rcdir, INDEXDIR);
- X sprintf (killfile, "%s/%s", rcdir, KILLFILE);
- X sprintf (postfile, "%s/%s", rcdir, POSTFILE);
- X
- X if (stat (rcdir, &sb) == -1) {
- X mkdir (rcdir, 0755);
- X if (stat (indexdir, &sb) == -1) {
- X mkdir (indexdir, 0755);
- X }
- X }
- X
- X sprintf (signature, "%s/.signature", homedir);
- X sprintf (sig, "%s/.Sig", homedir);
- X sprintf (newsrc, "%s/.newsrc", homedir);
- X sprintf (newnewsrc, "%s/.newnewsrc", homedir);
- X sprintf (delgroups, "%s/.delgroups", homedir);
- X sprintf (active_file, "%s/active", LIBDIR);
- X sprintf (savedir, "%s/News",homedir);
- X sprintf (maildir, "%s/%s",homedir,DEFAULT_MAILBOX);
- X
- X strcpy (mailer, DEFAULT_MAILER);
- X strcpy (printer, DEFAULT_PRINTER);
- X strcpy (spooldir, SPOOLDIR);
- X
- X read_rcfile ();
- X
- X if (stat(savedir,&sb) == -1) {
- X mkdir(savedir, 0755);
- X }
- X if (stat(maildir,&sb) == -1) {
- X mkdir(maildir, 0755);
- X }
- X
- X if (stat(active_file, &sb) >= 0)
- X goto got_active;
- X
- X/*
- X * I hate forgetting to define LIBDIR correctly. Guess a
- X * couple of likely places if it's not where LIBDIR says it is.
- X */
- X
- X strcpy (active_file, "/usr/lib/news/active");
- X if (stat(active_file, &sb) >= 0)
- X goto got_active;
- X
- X strcpy(active_file, "/usr/local/lib/news/active");
- X if (stat(active_file, &sb) >= 0)
- X goto got_active;
- X
- X strcpy(active_file, "/usr/public/lib/news/active");
- X if (stat(active_file, &sb) >= 0)
- X goto got_active;
- X
- X/*
- X * Oh well. Revert to what LIBDIR says it is to produce a
- X * useful error message when read_active() fails later.
- X */
- X
- X sprintf(active_file, "%s/active", LIBDIR);
- X
- Xgot_active:
- X
- X/*
- X * check enviroment for organization
- X */
- X my_org[0] = '\0';
- X if ((p = getenv("ORGANIZATION")) != NULL) {
- X my_strncpy (my_org, p, LEN);
- X goto got_org;
- X }
- X
- X/*
- X * check ~/.org for organization
- X */
- X sprintf(nam, "%s/organization", rcdir);
- X fp = fopen (nam, "r");
- X
- X/*
- X * check LIBDIR/organization for system wide organization
- X */
- X if (fp == NULL) {
- X sprintf(nam, "%s/organization", LIBDIR);
- X fp = fopen(nam, "r");
- X }
- X
- X if (fp == NULL) {
- X sprintf(nam, "/usr/lib/news/organization");
- X fp = fopen(nam, "r");
- X }
- X
- X if (fp == NULL) {
- X sprintf(nam, "/usr/local/lib/news/organization");
- X fp = fopen(nam, "r");
- X }
- X
- X if (fp == NULL) {
- X sprintf(nam, "/usr/public/lib/news/organization");
- X fp = fopen(nam, "r");
- X }
- X
- X if (fp == NULL) {
- X sprintf(nam, "/etc/organization");
- X fp = fopen(nam, "r");
- X }
- X
- X if (fp != NULL) {
- X if (fgets(my_org, LEN, fp) != NULL) {
- X for (p = my_org; *p && *p != '\n'; p++) ;
- X *p = '\0';
- X }
- X fclose(fp);
- X }
- X
- Xgot_org:;
- X
- X/*
- X * check enviroment for REPLY_TO
- X */
- X reply_to[0] = '\0';
- X if ((p = getenv("REPLY_TO")) != NULL) {
- X my_strncpy (reply_to, p, LEN);
- X goto got_reply;
- X }
- X
- X sprintf(nam, "%s/reply_to", rcdir);
- X fp = fopen(nam, "r");
- X
- X if (fp != NULL) {
- X if (fgets(reply_to, LEN, fp) != NULL) {
- X for (p = reply_to; *p && *p != '\n'; p++) ;
- X *p = '\0';
- X }
- X fclose(fp);
- X }
- X
- Xgot_reply:;
- X
- X/*
- X * check enviroment for ADD_ADDR
- X */
- X add_addr[0] = '\0';
- X if ((p = getenv("ADD_ADDR")) != NULL) {
- X my_strncpy (add_addr, p, LEN);
- X goto got_addr;
- X }
- X
- X sprintf(nam, "%s/add_addr", rcdir);
- X fp = fopen(nam, "r");
- X
- X if (fp != NULL) {
- X if (fgets(add_addr, LEN, fp) != NULL) {
- X for (p = add_addr; *p && *p != '\n'; p++) ;
- X *p = '\0';
- X }
- X fclose(fp);
- X }
- X
- Xgot_addr:;
- X
- X}
- X
- X
- X/*
- X * Which base note (an index into base[]) does a respnum
- X * (an index into arts[]) corresponsd to?
- X *
- X * In other words, base[] points to an entry in arts[] which is
- SHAR_EOF
- echo "End of tin part 3"
- echo "File misc.c is continued in part 4"
- echo "4" > shar3_seq_.tmp
- exit 0
-
- --
- NAME Iain Lea
- EMAIL norisc!iain@estevax.UUCP ...!unido!estevax!norisc!iain
- SNAIL Siemens AG, AUT 922C, Postfach 4848, Nuernberg, Germany
- PHONE +49-911-895-3853, +49-911-895-3877, +49-911-331963
-