home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 3 / 3896 < prev    next >
Encoding:
Internet Message Format  |  1991-08-24  |  49.5 KB

  1. Path: wupost!uunet!mcsun!unido!estevax!norisc!iain
  2. From: iain@norisc.UUCP (Iain Lea)
  3. Newsgroups: alt.sources
  4. Subject: tin v1.00 - YAN (Yet Another Newsreader) Part 03/08
  5. Message-ID: <584@norisc.UUCP>
  6. Date: 23 Aug 91 13:52:58 GMT
  7. Sender: iain@norisc.UUCP (Iain Lea)
  8. Organization: What organization?
  9. Lines: 1718
  10.  
  11. Submitted-by: iain@estevax.uucp
  12. Archive-name: tin/part03
  13.  
  14. #!/bin/sh
  15. # this is tin.shar.03 (part 3 of tin)
  16. # do not concatenate these parts, unpack them in order with /bin/sh
  17. # file kill.c continued
  18. #
  19. if touch 2>&1 | fgrep '[-amc]' > /dev/null
  20.  then TOUCH=touch
  21.  else TOUCH=true
  22. fi
  23. if test ! -r shar3_seq_.tmp; then
  24.     echo "Please unpack part 1 first!"
  25.     exit 1
  26. fi
  27. (read Scheck
  28.  if test "$Scheck" != 3; then
  29.     echo "Please unpack part $Scheck next!"
  30.     exit 1
  31.  else
  32.     exit 0
  33.  fi
  34. ) < shar3_seq_.tmp || exit 1
  35. echo "x - Continuing file kill.c"
  36. sed 's/^X//' << 'SHAR_EOF' >> kill.c &&
  37. X                        case KILL_BOTH:
  38. X                            if (str_str (arts[i].subject, killf[j].kill_subj) != 0) {
  39. X                                arts[i].tagged = TRUE;
  40. X                                killed = TRUE;
  41. X                            }
  42. X                            if (str_str (arts[i].from, killf[j].kill_from) != 0) {
  43. X                                arts[i].tagged = TRUE;
  44. X                                killed = TRUE;
  45. X                            }
  46. X                            break;
  47. X                    }
  48. X                }
  49. X            }
  50. X        }
  51. X    }
  52. X    return (killed);
  53. X}
  54. SHAR_EOF
  55. echo "File kill.c is complete" &&
  56. $TOUCH -am 0819090291 kill.c &&
  57. chmod 0600 kill.c ||
  58. echo "restore of kill.c failed"
  59. set `wc -c kill.c`;Wc_c=$1
  60. if test "$Wc_c" != "9014"; then
  61.     echo original size 9014, current size $Wc_c
  62. fi
  63. # ============= lang.c ==============
  64. echo "x - extracting lang.c (Text)"
  65. sed 's/^X//' << 'SHAR_EOF' > lang.c &&
  66. X/*
  67. X *  Project   : tin - a visual threaded usenet newsreader
  68. X *  Module    : lang.c
  69. X *  Author    : R.Skrenta / I.Lea
  70. X *  Created   : 01-04-91
  71. X *  Updated   : 23-08-91
  72. X *  Release   : 1.0
  73. X *  Notes     :
  74. X *  Copyright : (c) Copyright 1991 by Rich Skrenta & Iain Lea
  75. X *                You may  freely  copy or  redistribute  this software,
  76. X *              so  long as there is no profit made from its use, sale
  77. X *              trade or  reproduction.  You may not change this copy-
  78. X *              right notice, and it must be included in any copy made
  79. X */
  80. X
  81. X#ifdef LANG_GERMAN
  82. X
  83. X#else
  84. X
  85. X/*
  86. X *  art.c
  87. X */
  88. X
  89. Xchar *txt_group = "Group %s...    ";
  90. Xchar *txt_cannot_open_dir = "can't open dir %s\n";
  91. Xchar *txt_cannot_open_art = "can't open article %s: ";
  92. Xchar *txt_indexing = "Indexing...%4d";
  93. Xchar *txt_corrupt_index = "Index file %s corrupted. error %d on record %d";
  94. X
  95. X/*
  96. X *  group.c
  97. X */
  98. X
  99. Xchar *txt_inverse_on = "Inverse video enabled";
  100. Xchar *txt_inverse_off = "Inverse video disabled";
  101. Xchar *txt_subscribed_to = "subscribed to %s";
  102. Xchar *txt_unsubscribed_to = "unsubscribed from %s";
  103. Xchar *txt_mark_all_read = "Mark everything as read? (y/n): ";
  104. Xchar *txt_marked_as_read = "All articles marked as read";
  105. Xchar *txt_no_more_groups = "No more groups";
  106. Xchar *txt_no_prev_group = "No previous group";
  107. Xchar *txt_no_arts = "*** No Articles ***";
  108. Xchar *txt_end_of_arts = "*** End of Articles ***";
  109. Xchar *txt_no_next_unread_art = "No next unread article";
  110. Xchar *txt_no_prev_unread_art = "No previous unread article";
  111. Xchar *txt_no_last_message = "No last message";
  112. Xchar *txt_bad_command = "Bad command.  Type 'h' for help.";
  113. Xchar *txt_you_have_mail = "    you have mail\n";
  114. Xchar *txt_type_h_for_help = "Type 'h' for help\n";
  115. Xchar *txt_read_art = "Read article> ";
  116. Xchar *txt_search_forwards = "Search forwards [%s]> ";
  117. Xchar *txt_search_backwards = "Search backwards [%s]> ";
  118. Xchar *txt_author_search_forwards = "Author search forwards [%s]> ";
  119. Xchar *txt_author_search_backwards = "Author search backwards [%s]> ";
  120. Xchar *txt_no_search_string = "No search string";
  121. Xchar *txt_no_match = "No match";
  122. Xchar *txt_post_subject = "Post Subject: ";
  123. Xchar *txt_cannot_open = "can't open %s";
  124. Xchar *txt_posting = "Posting...";
  125. Xchar *txt_art_posted = "-- article posted --";
  126. Xchar *txt_art_rejected = "-- article rejected --";
  127. Xchar *txt_abort_edit_post = "a)bort, e)dit, p)ost: ";
  128. Xchar *txt_help_i_4 = "4$       Select article 4 ($=select last article)\r\n";
  129. Xchar *txt_help_ctrl_k = "^K       Kill current article\r\n";
  130. Xchar *txt_help_ctrl_l = "^L       Redraw page\r\n";
  131. Xchar *txt_help_ctrl_d = "^D^U     Down (^U=up) a page\r\n";
  132. Xchar *txt_help_i_cr = "<CR>     Read current article\r\n";
  133. Xchar *txt_help_i_tab = "<TAB>    View next unread article or group\r\n";
  134. Xchar *txt_help_m = "m        Move current group within group selection list\r\n";
  135. Xchar *txt_help_M = "M        Menu of configurable options\r\n";
  136. Xchar *txt_help_a = "aA       Author forward (A=backward) search\r\n";
  137. Xchar *txt_help_c = "c        Mark all articles as read\r\n";
  138. Xchar *txt_help_g = "g        Choose a new group by name\r\n";
  139. Xchar *txt_help_I = "I        Toggle inverse video\r\n";
  140. Xchar *txt_help_K = "K        Mark article/thread as read & advance\r\n";
  141. Xchar *txt_help_j = "jk       Down (k=up) a line\r\n";
  142. Xchar *txt_help_i_n = "nN       Go to next (N=next unread) group\r\n";
  143. Xchar *txt_help_i_p = "pP       Go to previous (P=previous unread) group\r\n";
  144. Xchar *txt_help_q = "q        Quit\r\n";
  145. Xchar *txt_help_s = "su       Subscribe (u=unsubscribe) to this group\r\n";
  146. Xchar *txt_help_S = "SU       Subscribe (U=unsubscribe) groups that match pattern\r\n";
  147. Xchar *txt_help_i_S = "S        Save articles matching pattern\r\n";
  148. Xchar *txt_help_t = "T        Tag current article for saving\r\n";
  149. Xchar *txt_help_T = "t        Return to group selection index\r\n";
  150. Xchar *txt_help_U = "U        Untag all articles\r\n";
  151. Xchar *txt_help_w = "w        Post an article\r\n";
  152. Xchar *txt_help_i_search = "/?       Subject forward (?=backward) search\r\n";
  153. Xchar *txt_help_dash = "-        Show last message\r\n";
  154. X#ifdef DONT_USE_REGEX 
  155. Xchar *txt_save_pattern = "Enter save pattern [%s]> ";
  156. X#else
  157. Xchar *txt_save_pattern = "Enter regex save pattern [%s]> ";
  158. X#endif
  159. Xchar *txt_base_file_name = "Enter base file name> ";
  160. Xchar *txt_base_subdir = "Enter sub directory name> ";
  161. Xchar *txt_saved_pattern_to = "-- saved pattern to %s - %s --";
  162. Xchar *txt_saved_to_mailbox = "-- saved to mailbox %s --";
  163. Xchar *txt_switch_on_kill_art_menu = "Kill Article Menu is switched OFF. Select Options Menu to switch it ON.";
  164. X
  165. X/* 
  166. X *  help.c:
  167. X */
  168. X
  169. Xchar *txt_group_select_com_1 = "Group Selection Commands (page 1 of 2)";
  170. Xchar *txt_group_select_com_2 = "Group Selection Commands (page 2 of 2)";
  171. Xchar *txt_index_page_com_1 = "Index Page Commands (page 1 of 2)";
  172. Xchar *txt_index_page_com_2 = "Index Page Commands (page 2 of 2)";
  173. Xchar *txt_art_pager_com_1 = "Article Pager Commands (page 1 of 2)";
  174. Xchar *txt_art_pager_com_2 = "Article Pager Commands (page 2 of 2)";
  175. Xchar *txt_hit_space_for_more = "-- Hit space for more commands --";
  176. Xchar *txt_select_info = "Group Select Help (page %d of %d)";
  177. Xchar *txt_group_info = "Group Help (page %d of %d)";
  178. Xchar *txt_page_info = "Page Help (page %d of %d)";
  179. X
  180. X/* 
  181. X *  kill.c:
  182. X */
  183. X
  184. Xchar *txt_kill_menu = "Kill Article Menu";
  185. Xchar *txt_kill_subject = "Kill Subject [%-45s] (y/n): ";
  186. Xchar *txt_kill_from =    "Kill From    [%-45s] (y/n): ";
  187. Xchar *txt_kill_text = "Kill text pattern : ";
  188. Xchar *txt_kill_text_type = "Apply pattern to  : ";
  189. Xchar *txt_kill_group =     "Kill pattern scope: ";
  190. Xchar *txt_help_kill_subject = "Subject: line to add to kill file. Press backspace key to clear field.";
  191. Xchar *txt_help_kill_from = "From: line to add to kill file. Press backspace key to clear field.";
  192. Xchar *txt_help_kill_text = "Enter text pattern to kill if Subject: & From: lines are not what you want.";
  193. Xchar *txt_help_kill_text_type = "Select where text pattern should be applied. Use <SPACE> to toggle choices.";
  194. Xchar *txt_help_kill_group = "Apply kill to current group only or all groups. Use <SPACE> to toggle choices.";
  195. Xchar *txt_abort_edit_save_killfile = "a)bort e)dit s)ave killfile: ";
  196. X
  197. X
  198. X/* 
  199. X *  main.c:
  200. X */
  201. X
  202. Xchar *txt_not_in_active_file = "Group %s not found in active file";
  203. Xchar *txt_screen_init_failed = "Screen initialization failed\n";
  204. Xchar *txt_bad_active_file = "Active file corrupt\n";
  205. X
  206. X/*
  207. X *  misc.c
  208. X */
  209. X
  210. Xchar *txt_cannot_find_base_art = "Cannot find base article %s";
  211. Xchar *txt_out_of_memory = "%s: out of memory\n";
  212. X
  213. X/*
  214. X *  nntp_open.c
  215. X */
  216. X
  217. Xchar *txt_cannot_get_nntp_server_name = "Cannot get nntp server name\n";
  218. 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";
  219. Xchar *txt_failed_to_connect_to_server = "failed to connect to (%s) server\n";
  220. Xchar *txt_rejected_by_nntpserver = "rejected by server, nntp error %d\n";
  221. Xchar *txt_connection_to_server_broken = "connection to server broken\n";
  222. Xchar *txt_stuff_nntp_cannot_open = "stuff_nntp: can't open %s: ";
  223. Xchar *txt_nntp_to_fp_cannot_reopen = "nntp_to_fp: can't reopen %s: ";
  224. Xchar *txt_nntp_to_fd_cannot_reopen = "nntp_to_fd: can't reopen %s: ";
  225. X
  226. X/*
  227. X *  page.c
  228. X */
  229. X
  230. Xchar *txt_quit = "Do you really want to quit? (y/n): ";
  231. Xchar *txt_art_unavailable = "[Article %ld unvailable]\r\r";
  232. Xchar *txt_art_marked_as_unread = "Article marked as unread";
  233. Xchar *txt_thread_marked_as_unread = "Thread marked as unread";
  234. Xchar *txt_begin_of_art = "*** Beginning of article ***";
  235. Xchar *txt_next_resp = "-- next response --";
  236. Xchar *txt_last_resp = "-- last response --";
  237. Xchar *txt_more = "--More--";
  238. Xchar *txt_more_percent = "--More--(%d%%) [%ld/%ld]";
  239. Xchar *txt_note_x_of_n = "%sNote %3d of %3d\r\n";
  240. Xchar *txt_art = "Article %ld  ";
  241. Xchar *txt_resp_x_of_n = "Resp %3d of %3d\r\n";
  242. Xchar *txt_no_resp = "No responses\r\n";
  243. Xchar *txt_1_resp = "1 Response\r\n";
  244. Xchar *txt_x_resp = "%d Responses\r\n";
  245. Xchar *txt_s_at_s = "%s at %s";
  246. Xchar *txt_note_resp_page = "Note %d of %d, Resp %d (page %d):  %s";
  247. Xchar *txt_note_page = "Note %d of %d (page %d):  %s";
  248. Xchar *txt_read_resp = "Read response> ";
  249. Xchar *txt_help_p_0 = "0        Read the base article in this thread\r\n";
  250. Xchar *txt_help_p_4 = "4        Read response 4 in this thread\r\n";
  251. Xchar *txt_help_p_cr = "<CR>     Skip to next base article\r\n";
  252. Xchar *txt_help_p_tab = "<TAB>    Advance to next page or unread article\r\n";
  253. Xchar *txt_help_b = "b<SPACE> Back (<SPACE>=forward) a page\r\n";
  254. Xchar *txt_help_bug = "B        Mail bug/gripe/comment to %s\r\n";
  255. Xchar *txt_help_p_f = "fF       Post (F=copy text) a followup\r\n";
  256. Xchar *txt_help_ctrl_h = "^H       Show articles header\r\n";
  257. Xchar *txt_help_h =      "hH       Command (H=context sensitive) help\r\n";
  258. Xchar *txt_help_p_i = "i        Return to index page\r\n";
  259. Xchar *txt_help_p_k = "kK       Mark article (K=thread) as read & advance to next unread\r\n";
  260. Xchar *txt_help_p_m = "m        Mail this article to someone\r\n";
  261. Xchar *txt_help_p_n = "nN       Go to to the next (N=unread) article\r\n";
  262. Xchar *txt_help_p_o = "oO       Output article (O=thread) to printer\r\n";
  263. Xchar *txt_help_p_p = "pP       Go to the previous (P=unread) article\r\n";
  264. Xchar *txt_help_p_r = "rR       Reply through mail (R=copy text) to author\r\n";
  265. Xchar *txt_help_p_s = "sS       Save article (S=thread) to file\r\n";
  266. Xchar *txt_help_p_z = "zZ       Mark article (Z=thread) as unread\r\n";
  267. Xchar *txt_help_p_ctrl_r = "^R$      Redisplay first page ($=last page) of article\r\n";
  268. Xchar *txt_help_p_d = "d        Toggle rot-13 decoding for this article\r\n";
  269. Xchar *txt_help_p_pipe = "|        Pipe article into command\r\n";
  270. Xchar *txt_help_p_search = "/        Article forward search\r\n";
  271. Xchar *txt_mail_art_to = "Mail article to: ";
  272. Xchar *txt_abort_edit_send = "a)bort, e)dit, s)end: ";
  273. Xchar *txt_mailing_to = "Mailing to %s...";
  274. Xchar *txt_message_sent = "-- Message sent --";
  275. Xchar *txt_command_failed_s = "Command failed: %s\n";
  276. Xchar *txt_in_art_you_write = "In article %s you write:\n";
  277. Xchar *txt_resp_to_poster = "Responses have been directed to the poster. Post anyway? (y/n): ";
  278. Xchar *txt_resp_redirect = "Responses have been directed to the following newsgroups";
  279. Xchar *txt_continue = "Continue? (y/n): ";
  280. Xchar *txt_writes = "%s writes:\n";
  281. Xchar *txt_save_art_to_file = "Save article to file> ";
  282. Xchar *txt_art_not_saved = "-- article not saved --";
  283. Xchar *txt_print_art_yn = "Do you really want to print the article? (y/n): ";
  284. Xchar *txt_print_thread_yn = "Do you really want to print the thread? (y/n): ";
  285. Xchar *txt_no_filename = "No filename";
  286. Xchar *txt_saving = "Saving...    ";
  287. Xchar *txt_art_saved_to = "-- article saved to %s --";
  288. Xchar *txt_save_thread_to = "Save thread to file> ";
  289. Xchar *txt_thread_not_saved = "-- thread not saved --";
  290. Xchar *txt_thread_saved_to_many = "-- thread saved to %s - %s --";
  291. Xchar *txt_thread_saved_to = "-- thread saved to %s --";
  292. Xchar *txt_pipe_to_command = "Pipe to command: ";
  293. Xchar *txt_error_printing_art = "-- error printing article --";
  294. Xchar *txt_printing = "Printing...";
  295. Xchar *txt_art_printed = "-- article printed --";
  296. Xchar *txt_error_printing_thread = "-- error printing thread --";
  297. Xchar *txt_thread_printed = "-- thread printed --";
  298. Xchar *txt_append_to_file = "File %s exists. Append? (y/n): ";
  299. X
  300. X/*
  301. X *  posted.c
  302. X */
  303. X
  304. Xchar *txt_post_history_menu = "Posted articles history";
  305. Xchar *txt_no_arts_posted = "No articles have been posted";
  306. X
  307. X/*
  308. X *  prompt.c
  309. X */
  310. X
  311. Xchar *txt_hit_any_key = "-- Hit any key to continue --";
  312. X
  313. X/*
  314. X *  rcfile.c
  315. X */
  316. Xchar *txt_opt_autosave =        "    1. Auto save       : ";
  317. Xchar *txt_opt_save_separate =   "    2. Save separate   : ";
  318. Xchar *txt_opt_mark_saved_read = "    3. Mark saved read : ";
  319. Xchar *txt_opt_kill_articles =   "    4. Kill articles   : ";
  320. Xchar *txt_opt_show_author =     "    5. Show Author     : ";
  321. Xchar *txt_opt_draw_arrow =      "    6. Draw arrow      : ";
  322. Xchar *txt_opt_post_process =    "    7. Post process    : ";
  323. Xchar *txt_opt_print_header =    "    8. Print header    : ";
  324. Xchar *txt_opt_process_type = "    9. Process type    : ";
  325. Xchar *txt_opt_sort_type = "    10 Sort article by : ";
  326. Xchar *txt_opt_savedir = "    11 Save directory  : ";
  327. Xchar *txt_opt_maildir = "    12 Mail directory  : ";
  328. Xchar *txt_opt_printer = "    13 Printer         : ";
  329. Xchar *txt_options_menu = "Options Menu";
  330. Xchar *txt_post_process_sh = "shell archive";
  331. Xchar *txt_post_process_uud = "uudecode";
  332. Xchar *txt_post_process_uud_zoo = "uudecode & zoo";
  333. Xchar *txt_post_process_uud_lzh = "uudecode & lharc";
  334. Xchar *txt_post_process_uud_arc = "uudecode & arc";
  335. Xchar *txt_post_process_uud_zip = "uudecode & zip";
  336. Xchar *txt_post_process_patch = "patch";
  337. Xchar *txt_sort_by_none = "Nothing";
  338. Xchar *txt_sort_by_subj = "Subject: field";
  339. Xchar *txt_sort_by_from = "From: field";
  340. Xchar *txt_sort_by_date = "Date: field";
  341. Xchar *txt_help_autosave = "Auto save article/thread by Archive-name: header. Use <SPACE> to toggle ON/OFF.";
  342. Xchar *txt_help_save_separate = "Save articles/threads to separate files. Use <SPACE> to toggle ON/OFF.";
  343. Xchar *txt_help_print_header = "Print complete mail header or Subject: & From:. Use <SPACE> to toggle ON/OFF.";
  344. Xchar *txt_help_show_author = "Show Subject & From (author) fields in group menu. Use <SPACE> to toggle ON/OFF.";
  345. Xchar *txt_help_draw_arrow = "Draw -> or highlighted bar for selection. Use <SPACE> to toggle ON/OFF.";
  346. Xchar *txt_help_kill_articles = "Kill articles that match entries in kill file. Use <SPACE> to toggle ON/OFF.";
  347. Xchar *txt_help_post_process = "Post process (ie. unshar) saved article/thread. Use <SPACE> to toggle ON/OFF."; 
  348. Xchar *txt_help_mark_saved_read = "Mark saved articles/threads as read. Use <SPACE> to toggle ON/OFF."; 
  349. Xchar *txt_help_post_proc_type = "Post processing to apply to articles/threads. Use <SPACE> to toggle choices.";
  350. Xchar *txt_help_sort_type = "Sort articles by Subject, From or Date fields. Use <SPACE> to toggle choices.";
  351. Xchar *txt_help_savedir = "The directory where you want articles/threads saved.";
  352. Xchar *txt_help_maildir = "The directory where articles/threads are to be saved in mailbox format.";
  353. Xchar *txt_help_printer = "The printer program with options that is to be used to print articles/threads.";
  354. Xchar *txt_save_options = "Save options? (y/n): ";
  355. X
  356. X/*
  357. X *  save.c
  358. X */
  359. X
  360. Xchar *txt_post_processing = "Post processing...";
  361. Xchar *txt_deleting = "Deleting...";
  362. X
  363. X/*
  364. X *  search.c
  365. X */
  366. X
  367. Xchar *txt_searching = "Searching...";
  368. X
  369. X/*
  370. X *  select.c
  371. X */
  372. X
  373. Xchar *txt_moving = "Moving...";
  374. X#ifdef DONT_USE_REGEX 
  375. Xchar *txt_subscribe_pattern = "Enter subscribe pattern> ";
  376. Xchar *txt_unsubscribe_pattern = "Enter subscribe pattern> ";
  377. X#else
  378. Xchar *txt_subscribe_pattern = "Enter regex subscribe pattern> ";
  379. Xchar *txt_unsubscribe_pattern = "Enter regex subscribe pattern> ";
  380. X#endif
  381. Xchar *txt_subscribing = "Subscribing...";
  382. Xchar *txt_subscribing_to = "Subscribing to %s...";
  383. Xchar *txt_unsubscribing = "Unsubscribing...";
  384. Xchar *txt_unsubscribing_from = "Unsubscribing from %s...";
  385. Xchar *txt_subscribed_num_groups = "subscribed to %d groups";
  386. Xchar *txt_unsubscribed_num_groups = "unsubscribed from %d groups";
  387. Xchar *txt_del_group_in_newsrc = "Delete current group from .newsrc? (y/n): ";
  388. Xchar *txt_group_deleted = "Group deleted";
  389. Xchar *txt_mark_group_read = "Mark group as read? (y/n): ";
  390. Xchar *txt_no_groups_to_delete = "No groups to delete";
  391. Xchar *txt_reset_newsrc = "Reset newsrc? (y/n): ";
  392. Xchar *txt_no_groups_to_read = "No more groups to read";
  393. Xchar *txt_added_groups = "Added %d group%s";
  394. Xchar *txt_plural = "s";
  395. Xchar *txt_no_groups_to_yank_in = "No more groups to yank in";
  396. Xchar *txt_group_selection = "Group Selection";
  397. Xchar *txt_select_group = "Select group> ";
  398. Xchar *txt_help_g_4 = "4$       Select group 4 ($=select last group)\r\n";
  399. Xchar *txt_help_g_ctrl_r = "^R       Reset .newsrc\r\n";
  400. Xchar *txt_help_g_ctrl_k = "^Kz      Delete (z=undelete) group from .newsrc\r\n";
  401. Xchar *txt_help_g_cr = "<CR>     Read current group\r\n";
  402. Xchar *txt_help_g_tab = "<TAB>    View next unread group\r\n";
  403. Xchar *txt_help_g_c = "c        Mark group as all read\r\n";
  404. Xchar *txt_help_W = "W        List articles posted by user\r\n";
  405. Xchar *txt_help_g_y = "y        Yank in groups that are not in the .newsrc\r\n";
  406. Xchar *txt_help_g_dollar = "Y        Reread group list from .newsrc\r\n";
  407. Xchar *txt_help_g_search = "/?       Group forward (?=backward) search\r\n";
  408. Xchar *txt_newsgroup = "Newsgroup> ";
  409. Xchar *txt_newsgroup_position = "Position %s in group list [1,2,..,$]> ";
  410. X
  411. X#endif
  412. X
  413. SHAR_EOF
  414. $TOUCH -am 0823134091 lang.c &&
  415. chmod 0600 lang.c ||
  416. echo "restore of lang.c failed"
  417. set `wc -c lang.c`;Wc_c=$1
  418. if test "$Wc_c" != "16340"; then
  419.     echo original size 16340, current size $Wc_c
  420. fi
  421. # ============= lang.h ==============
  422. echo "x - extracting lang.h (Text)"
  423. sed 's/^X//' << 'SHAR_EOF' > lang.h &&
  424. X/*
  425. X *  Project   : tin - a visual threaded usenet newsreader
  426. X *  Module    : lang.h
  427. X *  Author    : I.Lea
  428. X *  Created   : 01-04-91
  429. X *  Updated   : 21-08-91
  430. X *  Release   : 1.0
  431. X *  Notes     :
  432. X *  Copyright : (c) Copyright 1991 by Iain Lea
  433. X *                You may  freely  copy or  redistribute  this software,
  434. X *              so  long as there is no profit made from its use, sale
  435. X *              trade or  reproduction.  You may not change this copy-
  436. X *              right notice, and it must be included in any copy made
  437. X */
  438. X
  439. X/*
  440. X *  art.c
  441. X */
  442. X
  443. Xextern char *txt_group;
  444. Xextern char *txt_cannot_open_dir;
  445. Xextern char *txt_cannot_open_art;
  446. Xextern char *txt_indexing;
  447. Xextern char *txt_corrupt_index;
  448. X
  449. X/*
  450. X *  group.c
  451. X */
  452. X
  453. Xextern char *txt_inverse_on;
  454. Xextern char *txt_inverse_off;
  455. Xextern char *txt_subscribed_to;
  456. Xextern char *txt_unsubscribed_to;
  457. Xextern char *txt_mark_all_read;
  458. Xextern char *txt_marked_as_read;
  459. Xextern char *txt_no_more_groups;
  460. Xextern char *txt_no_prev_group;
  461. Xextern char *txt_no_arts;
  462. Xextern char *txt_end_of_arts;
  463. Xextern char *txt_no_next_unread_art;
  464. Xextern char *txt_no_prev_unread_art;
  465. Xextern char *txt_no_last_message;
  466. Xextern char *txt_bad_command;
  467. Xextern char *txt_you_have_mail;
  468. Xextern char *txt_type_h_for_help;
  469. Xextern char *txt_read_art;
  470. Xextern char *txt_author_search_forwards;
  471. Xextern char *txt_author_search_backwards;
  472. Xextern char *txt_search_forwards;
  473. Xextern char *txt_search_backwards;
  474. Xextern char *txt_no_search_string;
  475. Xextern char *txt_no_match;
  476. Xextern char *txt_post_subject;
  477. Xextern char *txt_cannot_open;
  478. Xextern char *txt_posting;
  479. Xextern char *txt_art_posted;
  480. Xextern char *txt_art_rejected;
  481. Xextern char *txt_abort_edit_post;
  482. Xextern char *txt_index_page_com_1;
  483. Xextern char *txt_index_page_com_2;
  484. Xextern char *txt_hit_space_for_more;
  485. Xextern char *txt_help_i_4;
  486. Xextern char *txt_help_ctrl_k;
  487. Xextern char *txt_help_ctrl_l;
  488. Xextern char *txt_help_ctrl_d;
  489. Xextern char *txt_help_i_cr;
  490. Xextern char *txt_help_i_tab;
  491. Xextern char *txt_help_m;
  492. Xextern char *txt_help_M;
  493. Xextern char *txt_help_a;
  494. Xextern char *txt_help_c;
  495. Xextern char *txt_help_g;
  496. Xextern char *txt_help_I;
  497. Xextern char *txt_help_K;
  498. Xextern char *txt_help_j;
  499. Xextern char *txt_help_i_n;
  500. Xextern char *txt_help_i_p;
  501. Xextern char *txt_help_q;
  502. Xextern char *txt_help_s;
  503. Xextern char *txt_help_S;
  504. Xextern char *txt_help_i_S;
  505. Xextern char *txt_help_t;
  506. Xextern char *txt_help_T;
  507. Xextern char *txt_help_U;
  508. Xextern char *txt_help_i_u;
  509. Xextern char *txt_help_w;
  510. Xextern char *txt_help_i_search;
  511. Xextern char *txt_help_dash;
  512. Xextern char *txt_save_pattern;
  513. Xextern char *txt_base_file_name;
  514. Xextern char *txt_base_subdir;
  515. Xextern char *txt_saved_pattern_to;
  516. Xextern char *txt_saved_to_mailbox;
  517. Xextern char *txt_switch_on_kill_art_menu;
  518. X
  519. X/* 
  520. X *  help.c:
  521. X */
  522. X
  523. Xextern char *txt_select_info;
  524. Xextern char *txt_group_info;
  525. Xextern char *txt_page_info;
  526. X
  527. X/* 
  528. X *  kill.c:
  529. X */
  530. X
  531. Xextern char *txt_kill_menu;
  532. Xextern char *txt_kill_subject;
  533. Xextern char *txt_kill_from;
  534. Xextern char *txt_kill_text;
  535. Xextern char *txt_kill_text_type;
  536. Xextern char *txt_kill_group;
  537. Xextern char *txt_help_kill_subject;
  538. Xextern char *txt_help_kill_from;
  539. Xextern char *txt_help_kill_text;
  540. Xextern char *txt_help_kill_text_type;
  541. Xextern char *txt_help_kill_group;
  542. Xextern char *txt_abort_edit_save_killfile;
  543. X
  544. X/*
  545. X *  page.c
  546. X */
  547. X
  548. Xextern char *txt_quit;
  549. Xextern char *txt_art_unavailable;
  550. Xextern char *txt_art_marked_as_unread;
  551. Xextern char *txt_thread_marked_as_unread;
  552. Xextern char *txt_begin_of_art;
  553. Xextern char *txt_next_resp;
  554. Xextern char *txt_last_resp;
  555. Xextern char *txt_more_percent;
  556. Xextern char *txt_more;
  557. Xextern char *txt_note_x_of_n;
  558. Xextern char *txt_art;
  559. Xextern char *txt_resp_x_of_n;
  560. Xextern char *txt_no_resp;
  561. Xextern char *txt_1_resp;
  562. Xextern char *txt_x_resp;
  563. Xextern char *txt_s_at_s;
  564. Xextern char *txt_note_resp_page;
  565. Xextern char *txt_note_page;
  566. Xextern char *txt_read_resp;
  567. Xextern char *txt_art_pager_com_1;
  568. Xextern char *txt_art_pager_com_2;
  569. Xextern char *txt_help_p_0;
  570. Xextern char *txt_help_p_4;
  571. Xextern char *txt_help_p_cr;
  572. Xextern char *txt_help_p_tab;
  573. Xextern char *txt_help_b;
  574. Xextern char *txt_help_bug;
  575. Xextern char *txt_help_p_f;
  576. Xextern char *txt_help_ctrl_h;
  577. Xextern char *txt_help_h;
  578. Xextern char *txt_help_p_i;
  579. Xextern char *txt_help_p_k;
  580. Xextern char *txt_help_p_m;
  581. Xextern char *txt_help_p_n;
  582. Xextern char *txt_help_p_o;
  583. Xextern char *txt_help_p_p;
  584. Xextern char *txt_help_p_r;
  585. Xextern char *txt_help_p_s;
  586. Xextern char *txt_help_p_z;
  587. Xextern char *txt_help_p_ctrl_r;
  588. Xextern char *txt_help_p_d;
  589. Xextern char *txt_help_p_pipe;
  590. Xextern char *txt_help_p_search;
  591. Xextern char *txt_mail_art_to;
  592. Xextern char *txt_abort_edit_send;
  593. Xextern char *txt_mailing_to;
  594. Xextern char *txt_message_sent;
  595. Xextern char *txt_command_failed_s;
  596. Xextern char *txt_in_art_you_write;
  597. Xextern char *txt_resp_to_poster;
  598. Xextern char *txt_resp_redirect;
  599. Xextern char *txt_continue;
  600. Xextern char *txt_writes;
  601. Xextern char *txt_save_art_to_file;
  602. Xextern char *txt_art_not_saved;
  603. Xextern char *txt_print_art_yn;
  604. Xextern char *txt_print_thread_yn;
  605. Xextern char *txt_no_filename;
  606. Xextern char *txt_saving;
  607. Xextern char *txt_art_saved_to;
  608. Xextern char *txt_save_thread_to;
  609. Xextern char *txt_thread_not_saved;
  610. Xextern char *txt_thread_saved_to_many;
  611. Xextern char *txt_thread_saved_to;
  612. Xextern char *txt_pipe_to_command;
  613. Xextern char *txt_command_failed;
  614. Xextern char *txt_error_printing_art;
  615. Xextern char *txt_printing;
  616. Xextern char *txt_art_printed;
  617. Xextern char *txt_error_printing_thread;
  618. Xextern char *txt_thread_printed;
  619. Xextern char *txt_append_to_file;
  620. X
  621. X/*
  622. X *  prompt.c
  623. X */
  624. X
  625. Xextern char *txt_hit_any_key;
  626. X/* 
  627. X *  main.c:
  628. X */
  629. X
  630. Xextern char *txt_not_in_active_file;
  631. Xextern char *txt_screen_init_failed;
  632. Xextern char *txt_bad_active_file;
  633. X
  634. X/*
  635. X *  misc.c
  636. X */
  637. X
  638. Xextern char *txt_cannot_find_base_art;
  639. Xextern char *txt_out_of_memory;
  640. X
  641. X/*
  642. X *  nntp.c
  643. X */
  644. X
  645. Xextern char *txt_cannot_get_nntp_server_name;
  646. Xextern char *txt_server_name_in_file_env_var;
  647. Xextern char *txt_failed_to_connect_to_server;
  648. Xextern char *txt_rejected_by_nntpserver;
  649. Xextern char *txt_connection_to_server_broken;
  650. Xextern char *txt_stuff_nntp_cannot_open;
  651. Xextern char *txt_nntp_to_fp_cannot_reopen;
  652. Xextern char *txt_nntp_to_fd_cannot_reopen;
  653. X
  654. X/*
  655. X *  posted.c
  656. X */
  657. X
  658. Xextern char *txt_post_history_menu;
  659. Xextern char *txt_no_arts_posted;
  660. X
  661. X/*
  662. X *  rcfile.c
  663. X */
  664. X
  665. Xextern char *txt_opt_autosave;
  666. Xextern char *txt_opt_save_separate;
  667. Xextern char *txt_opt_mark_saved_read;
  668. Xextern char *txt_opt_kill_articles;
  669. Xextern char *txt_opt_show_author;
  670. Xextern char *txt_opt_draw_arrow;
  671. Xextern char *txt_opt_post_process;
  672. Xextern char *txt_opt_print_header;
  673. Xextern char *txt_opt_process_type;
  674. Xextern char *txt_opt_sort_type;
  675. Xextern char *txt_post_process_sh;
  676. Xextern char *txt_post_process_uud;
  677. Xextern char *txt_post_process_uud_zoo;
  678. Xextern char *txt_post_process_uud_lzh;
  679. Xextern char *txt_post_process_uud_arc;
  680. Xextern char *txt_post_process_uud_zip;
  681. Xextern char *txt_post_process_patch;
  682. Xextern char *txt_sort_by_none;
  683. Xextern char *txt_sort_by_subj;
  684. Xextern char *txt_sort_by_from;
  685. Xextern char *txt_sort_by_date;
  686. Xextern char *txt_opt_savedir;
  687. Xextern char *txt_opt_maildir;
  688. Xextern char *txt_opt_printer;
  689. Xextern char *txt_opt_kill_subj;
  690. Xextern char *txt_opt_kill_from;
  691. Xextern char *txt_options_menu;
  692. Xextern char *txt_help_autosave;
  693. Xextern char *txt_help_save_separate;
  694. Xextern char *txt_help_print_header;
  695. Xextern char *txt_help_show_author;
  696. Xextern char *txt_help_draw_arrow;
  697. Xextern char *txt_help_kill_articles;
  698. Xextern char *txt_help_post_process;
  699. Xextern char *txt_help_mark_saved_read;
  700. Xextern char *txt_help_post_proc_type;
  701. Xextern char *txt_help_sort_type;
  702. Xextern char *txt_help_savedir;
  703. Xextern char *txt_help_maildir;
  704. Xextern char *txt_help_printer;
  705. Xextern char *txt_save_options;
  706. X
  707. X/*
  708. X *  save.c
  709. X */
  710. X
  711. Xextern char *txt_post_processing;
  712. Xextern char *txt_deleting;
  713. X
  714. X/*
  715. X *  search.c
  716. X */
  717. X
  718. Xextern char *txt_searching;
  719. X
  720. X/*
  721. X *  select.c
  722. X */
  723. X
  724. Xextern char *txt_moving;
  725. Xextern char *txt_subscribe_pattern;
  726. Xextern char *txt_unsubscribe_pattern;
  727. Xextern char *txt_subscribing;
  728. Xextern char *txt_subscribing_to;
  729. Xextern char *txt_unsubscribing;
  730. Xextern char *txt_unsubscribing_from;
  731. Xextern char *txt_subscribed_num_groups;
  732. Xextern char *txt_unsubscribed_num_groups;
  733. Xextern char *txt_del_group_in_newsrc;
  734. Xextern char *txt_group_deleted;
  735. Xextern char *txt_mark_group_read;
  736. Xextern char *txt_no_groups_to_delete;
  737. Xextern char *txt_reset_newsrc;
  738. Xextern char *txt_no_groups_to_read;
  739. Xextern char *txt_added_groups;
  740. Xextern char *txt_rewriting_newsrc_file;
  741. Xextern char *txt_plural;
  742. Xextern char *txt_no_groups_to_yank_in;
  743. Xextern char *txt_group_selection;
  744. Xextern char *txt_select_group;
  745. Xextern char *txt_group_select_com_1;
  746. Xextern char *txt_group_select_com_2;
  747. Xextern char *txt_help_g_4;
  748. Xextern char *txt_help_g_ctrl_r;
  749. Xextern char *txt_help_g_ctrl_k;
  750. Xextern char *txt_help_g_cr;
  751. Xextern char *txt_help_g_tab;
  752. Xextern char *txt_help_g_c;
  753. Xextern char *txt_help_W;
  754. Xextern char *txt_help_g_y;
  755. Xextern char *txt_help_g_dollar;
  756. Xextern char *txt_help_g_search;
  757. Xextern char *txt_newsgroup;
  758. Xextern char *txt_newsgroup_position;
  759. X
  760. SHAR_EOF
  761. $TOUCH -am 0821133491 lang.h &&
  762. chmod 0600 lang.h ||
  763. echo "restore of lang.h failed"
  764. set `wc -c lang.h`;Wc_c=$1
  765. if test "$Wc_c" != "8856"; then
  766.     echo original size 8856, current size $Wc_c
  767. fi
  768. # ============= mail.c ==============
  769. echo "x - extracting mail.c (Text)"
  770. sed 's/^X//' << 'SHAR_EOF' > mail.c &&
  771. X/*
  772. X *  Project   : tin - a visual threaded usenet newsreader
  773. X *  Module    : mail.c
  774. X *  Author    : R.Skrenta
  775. X *  Created   : 01-04-91
  776. X *  Updated   : 10-08-91
  777. X *  Release   : 1.0
  778. X *  Notes     :
  779. X *  Copyright : (c) Copyright 1991 by Rich Skrenta
  780. X *                You may  freely  copy or  redistribute  this software,
  781. X *              so  long as there is no profit made from its use, sale
  782. X *              trade or  reproduction.  You may not change this copy-
  783. X *              right notice, and it must be included in any copy made
  784. X */
  785. X
  786. X#include    <stdio.h>
  787. X#include    <sys/types.h>
  788. X#include    <sys/stat.h>
  789. X
  790. X#define        TRUE        1
  791. X#define        FALSE        0
  792. X
  793. X
  794. Xchar *mailbox_name = NULL;
  795. Xoff_t mailbox_size;
  796. X
  797. X
  798. X/*
  799. X *  Record size of mailbox so we can detect if new mail has arrived
  800. X */
  801. X
  802. Xvoid mail_setup ()
  803. X{
  804. X    struct stat buf;
  805. X    extern char *getenv();
  806. X
  807. X    if (mailbox_name == NULL)
  808. X        mailbox_name = getenv("MAIL");
  809. X
  810. X    if (mailbox_name == NULL)
  811. X        mailbox_size = 0;
  812. X    else {
  813. X        if (stat(mailbox_name, &buf) >= 0)
  814. X            mailbox_size = buf.st_size;
  815. X        else
  816. X            mailbox_size = 0;
  817. X    }
  818. X}
  819. X
  820. X
  821. X/*
  822. X *  Return TRUE if new mail has arrived
  823. X */
  824. X
  825. Xint mail_check ()
  826. X{
  827. X    struct stat buf;
  828. X
  829. X    if (mailbox_name != NULL
  830. X    &&  stat(mailbox_name, &buf) >= 0
  831. X    &&  mailbox_size < buf.st_size)
  832. X        return TRUE;
  833. X
  834. X    return FALSE;
  835. X}
  836. X
  837. SHAR_EOF
  838. $TOUCH -am 0819090291 mail.c &&
  839. chmod 0600 mail.c ||
  840. echo "restore of mail.c failed"
  841. set `wc -c mail.c`;Wc_c=$1
  842. if test "$Wc_c" != "1260"; then
  843.     echo original size 1260, current size $Wc_c
  844. fi
  845. # ============= main.c ==============
  846. echo "x - extracting main.c (Text)"
  847. sed 's/^X//' << 'SHAR_EOF' > main.c &&
  848. X/*
  849. X *  Project   : tin - a visual threaded usenet newsreader
  850. X *  Module    : main.c
  851. X *  Author    : R.Skrenta / I.Lea
  852. X *  Created   : 01-04-91
  853. X *  Updated   : 20-08-91
  854. X *  Release   : 1.0
  855. X *  Notes     :
  856. X *  Copyright : (c) Copyright 1991 by Rich Skrenta & Iain Lea
  857. X *                You may  freely  copy or  redistribute  this software,
  858. X *              so  long as there is no profit made from its use, sale
  859. X *              trade or  reproduction.  You may not change this copy-
  860. X *              right notice, and it must be included in any copy made
  861. X */
  862. X
  863. X#include    "tin.h"
  864. X
  865. Xchar *version = "v1.00";
  866. Xchar cvers[LEN+1];
  867. Xchar nntp_server[LEN+1];
  868. X
  869. Xint max_subj = 0;
  870. Xint max_from = 0;
  871. Xint max_active;
  872. Xint group_hash[TABLE_SIZE];            /* group name --> active[] */
  873. Xint *my_group;                        /* .newsrc --> active[] */
  874. Xint *unread;                        /* highest art read in group */
  875. Xint num_active;                        /* one past top of active */
  876. Xint local_top;                        /* one past top of my_group */
  877. Xint catchup = FALSE;                /* mark all arts read in all subscribed groups */
  878. Xint update = FALSE;                    /* update index files only mode */
  879. Xint verbose = FALSE;                /* update index files only mode */
  880. Xint start_line_offset;                /* used by invoke_editor for line no. */
  881. Xint read_news_via_nntp = FALSE;        /* read news locally or via NNTP */
  882. Xint max_art;
  883. Xint top = 0;
  884. Xint top_base;
  885. Xint tin_uid;
  886. Xint tin_gid;
  887. Xint real_uid;
  888. Xint real_gid;
  889. Xint local_index;                    /* do private indexing? */
  890. X
  891. Xlong *base;
  892. X
  893. Xstruct group_ent *active;            /* active file */
  894. Xstruct header *arts;
  895. X
  896. X
  897. X#ifdef SIGTSTP
  898. Xvoid main_susp (sig)
  899. X    int sig;
  900. X{
  901. X    Raw(FALSE);
  902. X    putchar('\n');
  903. X    signal(SIGTSTP, SIG_DFL);
  904. X#ifdef BSD
  905. X    sigsetmask(sigblock(0) & ~(1 << (SIGTSTP -1)));
  906. X#endif
  907. X    kill(0, SIGTSTP);
  908. X
  909. X    signal(SIGTSTP, main_susp);
  910. X    mail_setup();
  911. X    if (! update) {
  912. X        Raw(TRUE);
  913. X    }
  914. X}
  915. X#endif
  916. X
  917. X
  918. Xvoid signal_handler (sig)
  919. X    int sig;
  920. X{
  921. X    if (sig == SIGINT) {
  922. X        signal (SIGINT, signal_handler);
  923. X    } else {
  924. X        free_all_arrays ();
  925. X        Raw(FALSE);
  926. X        printf("\n%s: signal handler caught signal %d\n", progname,sig);
  927. X        exit(1);
  928. X    }
  929. X}
  930. X
  931. X
  932. Xvoid main (argc, argv)
  933. X    int argc;    
  934. X    char *argv[];
  935. X{
  936. X    extern int optind, opterr;
  937. X    extern char *optarg;
  938. X    extern char author_search_string[LEN+1];
  939. X    extern char group_search_string[LEN+1];
  940. X    extern char subject_search_string[LEN+1];
  941. X    int c, i;
  942. X    struct stat st;
  943. X    
  944. X    signal(SIGINT, signal_handler);        /* ctrl-C */
  945. X    signal(SIGQUIT, signal_handler);    /* ctrl-\ */
  946. X    signal(SIGILL, signal_handler);
  947. X    signal(SIGBUS, signal_handler);
  948. X    signal(SIGSEGV, signal_handler);
  949. X    
  950. X    signal(SIGPIPE, SIG_IGN);
  951. X#ifdef SIGTSTP
  952. X    signal(SIGTSTP, main_susp);
  953. X#endif
  954. X
  955. X    debug = FALSE;
  956. X
  957. X    strcpy (progname, argv[0]);
  958. X
  959. X    nntp_server[0] = '\0';
  960. X    group_search_string[0] = '\0';
  961. X    author_search_string[0] = '\0';
  962. X    subject_search_string[0] = '\0';
  963. X
  964. X    hash_init ();
  965. X    for (i = 0; i < TABLE_SIZE; i++) {
  966. X        group_hash[i] = -1;
  967. X    }
  968. X
  969. X    tin_uid = geteuid();
  970. X    tin_gid = getegid();
  971. X    real_uid = getuid();
  972. X    real_gid = getgid();
  973. X
  974. X    init_selfinfo ();    /* set up char *'s: homedir, newsrc, etc. */
  975. X    init_alloc ();        /* allocate initial array sizes */
  976. X
  977. X    if (tin_uid == real_uid) {    /* run out of someone's account */
  978. X        local_index = TRUE;    /* index in their home directory */
  979. X        mkdir(indexdir, 0755);
  980. X    } else {            /* we're setuid, index in /usr/spool/news */
  981. X        local_index = FALSE;
  982. X    }
  983. X
  984. X    while ((c = getopt (argc, argv, "cd:Df:hm:M:p:rS:uv")) != EOF) {
  985. X        switch(c) {
  986. X            case 'c':
  987. X                catchup = TRUE;
  988. X                update = TRUE;
  989. X                break;
  990. X                
  991. X            case 'd':
  992. X                my_strncpy (savedir, optarg, LEN);
  993. X                if (stat (savedir,&st) == -1) {
  994. X                    mkdir (savedir, 0755);
  995. X                }
  996. X                break;
  997. X
  998. X            case 'D':        /* debug mode */
  999. X                debug = TRUE;
  1000. X                break;
  1001. X
  1002. X            case 'f':
  1003. X                my_strncpy (newsrc, optarg, LEN);
  1004. X                break;
  1005. X
  1006. X            case 'm':
  1007. X                my_strncpy (mailer, optarg, LEN);
  1008. X                break;
  1009. X
  1010. X            case 'M':
  1011. X                my_strncpy (maildir, optarg, LEN);
  1012. X                if (stat (maildir,&st) == -1) {
  1013. X                    mkdir (maildir, 0755);
  1014. X                }
  1015. X                break;
  1016. X
  1017. X            case 'p':
  1018. X                my_strncpy (printer, optarg, LEN);
  1019. X                default_printer = FALSE;
  1020. X                break;
  1021. X
  1022. X            case 'r':    /* read news remotely from default NNTP server */
  1023. X#ifdef USE_NNTP            
  1024. X                read_news_via_nntp = TRUE;
  1025. X#else
  1026. X                printf ("Option not enabled. Recompile %s with -DUSE_NNTP.\n", progname);
  1027. X                exit (1);
  1028. X#endif
  1029. X                break;
  1030. X
  1031. X            case 'S':
  1032. X                my_strncpy (spooldir, optarg, LEN);
  1033. X                break;
  1034. X
  1035. X            case 'u':
  1036. X                update = TRUE;
  1037. X                break;
  1038. X
  1039. X            case 'v':
  1040. X                verbose = TRUE;
  1041. X                update = TRUE;
  1042. X                break;
  1043. X
  1044. X            case 'h':
  1045. X            case '?':
  1046. X            default:
  1047. X                usage (progname);
  1048. X                exit (1);
  1049. X        }
  1050. X    }
  1051. X
  1052. X    sprintf (page_header, "%s %s%s", progname, version, is_remote ());     
  1053. X    sprintf (cvers, "%s (c) Copyright 1991 Iain Lea.", page_header);
  1054. X
  1055. X    if (! update) {
  1056. X        printf ("%s\n", cvers);
  1057. X        fflush (stdout);
  1058. X    }
  1059. X
  1060. X    nntp_startup ();    /* connect server if we are using nntp */
  1061. X    read_active ();        /* load the active file into active[] */
  1062. X
  1063. X    if (optind < argc) {
  1064. X        while (optind < argc) {
  1065. X            if (add_group (argv[optind], TRUE) < 0) {
  1066. X                fprintf (stderr, txt_not_in_active_file, argv[optind]);
  1067. X                fprintf (stderr, "\n");
  1068. X            }
  1069. X            optind++;
  1070. X        }
  1071. X    } else {
  1072. X        read_newsrc(TRUE);
  1073. X    }
  1074. X
  1075. X    if (InitScreen () == FALSE) {
  1076. X        fprintf(stderr,txt_screen_init_failed);
  1077. X        exit(1);
  1078. X    }
  1079. X
  1080. X    ScreenSize (&LINES, &COLS);
  1081. X    Raw(TRUE);
  1082. X
  1083. X#ifdef TIOCGWINSZ
  1084. X    {
  1085. X        struct winsize win;
  1086. X
  1087. X        if (ioctl (0, TIOCGWINSZ, &win) == 0) {
  1088. X            if (win.ws_row != 0)
  1089. X                LINES = win.ws_row - 1;
  1090. X            if (win.ws_col != 0)
  1091. X                COLS = win.ws_col;
  1092. X        }
  1093. X    }
  1094. X#endif
  1095. X
  1096. X    max_subj = (COLS/2) - 2;
  1097. X    max_from = (COLS-max_subj) - 17;
  1098. X
  1099. X    if (kill_articles) {            /* read in users kill file */
  1100. X        read_kill_file ();
  1101. X    }
  1102. X    
  1103. X    if (update) {            /* index file updater only */
  1104. X        Raw (FALSE);
  1105. X        do_update ();
  1106. X        exit (0);
  1107. X    }
  1108. X
  1109. X    init_screen_array (TRUE);        /* allocate screen array */
  1110. X    
  1111. X    mail_setup ();        /* record mailbox size for "you have mail" */
  1112. X
  1113. X#ifndef USE_CLEARSCREEN
  1114. X    ClearScreen();
  1115. X#endif
  1116. X
  1117. X    selection_index ();
  1118. X
  1119. X    tin_done (0);
  1120. X
  1121. X    exit (0);
  1122. X}
  1123. X
  1124. X/*
  1125. X * usage
  1126. X */
  1127. X
  1128. Xvoid usage (progname)
  1129. X    char *progname;
  1130. X{
  1131. X    fprintf(stderr, "%s %s - threaded usenet newsreader. Copyright 1991 Iain Lea.\n\n", progname, version);
  1132. X    fprintf(stderr, "Usage: %s [options] [newsgroups]\n",progname);
  1133. X    fprintf(stderr, "  -c       mark all articles as read in subscribed newsgroups\n");
  1134. X    fprintf(stderr, "  -d dir   save articles to directory [default=%s]\n",savedir);
  1135. X    fprintf(stderr, "  -f file  subscribed newsgroups file [default=%s/.newsrc]\n", homedir);
  1136. X    fprintf(stderr, "  -h       help\n");
  1137. X    fprintf(stderr, "  -m file  mail program [default=%s]\n",DEFAULT_MAILER);
  1138. X    fprintf(stderr, "  -M dir   mailbox directory [default=%s]\n",maildir);
  1139. X    fprintf(stderr, "  -p file  print program with options [default=%s]\n",DEFAULT_PRINTER);
  1140. X    fprintf(stderr, "  -r       read news remotely from default NNTP server\n",DEFAULT_PRINTER);
  1141. X    fprintf(stderr, "  -S dir   spool directory [default=%s]\n",SPOOLDIR);
  1142. X    fprintf(stderr, "  -u       update index files only\n");
  1143. X    fprintf(stderr, "  -v       update index files only (verbose)\n");
  1144. X}
  1145. SHAR_EOF
  1146. $TOUCH -am 0820174191 main.c &&
  1147. chmod 0600 main.c ||
  1148. echo "restore of main.c failed"
  1149. set `wc -c main.c`;Wc_c=$1
  1150. if test "$Wc_c" != "6852"; then
  1151.     echo original size 6852, current size $Wc_c
  1152. fi
  1153. # ============= memory.c ==============
  1154. echo "x - extracting memory.c (Text)"
  1155. sed 's/^X//' << 'SHAR_EOF' > memory.c &&
  1156. X/*
  1157. X *  Project   : tin - a visual threaded usenet newsreader
  1158. X *  Module    : memory.c
  1159. X *  Author    : R.Skrenta / I.Lea
  1160. X *  Created   : 01-04-91
  1161. X *  Updated   : 22-08-91
  1162. X *  Release   : 1.0
  1163. X *  Notes     :
  1164. X *  Copyright : (c) Copyright 1991 by Rich Skrenta & Iain Lea
  1165. X *                You may  freely  copy or  redistribute  this software,
  1166. X *              so  long as there is no profit made from its use, sale
  1167. X *              trade or  reproduction.  You may not change this copy-
  1168. X *              right notice, and it must be included in any copy made
  1169. X */
  1170. X
  1171. X#include    "tin.h"
  1172. X
  1173. Xint active_num = 0;
  1174. Xint article_num = 0;
  1175. X
  1176. X/*
  1177. X *  Dynamic table management
  1178. X *  These settings are memory conservative:  small initial allocations
  1179. X *  and a 50% expansion on table overflow.  A fast vm system with
  1180. X *  much memory might want to start with higher initial allocations
  1181. X *  and a 100% expansion on overflow, especially for the arts[] array.
  1182. X */
  1183. X
  1184. Xvoid init_alloc ()
  1185. X{
  1186. X    if (active_num) {    /* initial alloc */
  1187. X        max_active = active_num;
  1188. X    } else {
  1189. X        max_active = DEFAULT_ACTIVE_NUM;
  1190. X    }
  1191. X
  1192. X    active = (struct group_ent *) my_malloc((unsigned) sizeof(*active) * max_active);
  1193. X    my_group = (int *) my_malloc((unsigned) sizeof(int) * max_active);
  1194. X    unread = (int *) my_malloc((unsigned) sizeof(int) * max_active);
  1195. X
  1196. X    if(article_num) {    /* initial alloc */
  1197. X        max_art = article_num;
  1198. X    } else {
  1199. X        max_art = DEFAULT_ARTICLE_NUM;
  1200. X    }
  1201. X
  1202. X    arts = (struct header *) my_malloc((unsigned) sizeof(*arts) * max_art);
  1203. X    base = (long *) my_malloc((unsigned) sizeof(long) * max_art);
  1204. X
  1205. X    max_kill = DEFAULT_KILL_NUM;
  1206. X    
  1207. X    killf = (struct kill_t *) my_malloc((unsigned) sizeof(*killf) * max_kill);
  1208. X
  1209. X    max_save = DEFAULT_SAVE_NUM;
  1210. X    
  1211. X    save = (struct save_t *) my_malloc((unsigned) sizeof(*save) * max_save);
  1212. X}
  1213. X
  1214. X
  1215. Xvoid expand_art()
  1216. X{
  1217. X    max_art += max_art / 2;        /* increase by 50% */
  1218. X
  1219. X    arts = (struct header *) my_realloc((char *) arts, (unsigned) sizeof(*arts) * max_art);
  1220. X    base = (long *) my_realloc((char *) base, (unsigned) sizeof(long) * max_art);
  1221. X}
  1222. X
  1223. X
  1224. Xvoid free_art_array ()
  1225. X{
  1226. X    register int i;
  1227. X
  1228. X    for (i=0 ; i < top ; i++) {
  1229. X        arts[i].artnum = 0L;
  1230. X        arts[i].thread = ART_NORMAL;
  1231. X        arts[i].inthread = FALSE;
  1232. X        arts[i].unread = ART_UNREAD;
  1233. X        arts[i].tagged = FALSE;
  1234. X        if (arts[i].part) {
  1235. X            free (arts[i].part);
  1236. X            arts[i].part = (char *) 0;
  1237. X        }
  1238. X        if (arts[i].patch) {
  1239. X            free (arts[i].patch);
  1240. X            arts[i].patch = (char *) 0;
  1241. X        }
  1242. X    }
  1243. X}
  1244. X
  1245. X
  1246. Xvoid expand_active()
  1247. X{
  1248. X    max_active += max_active / 2;        /* increase by 50% */
  1249. X
  1250. X    active = (struct group_ent *) my_realloc((char *) active,
  1251. X                        (unsigned) sizeof(*active) * max_active);
  1252. X    my_group = (int *) my_realloc((char *) my_group, (unsigned) sizeof(int) * max_active);
  1253. X    unread = (int *) my_realloc((char *) unread, (unsigned) sizeof(int) * max_active);
  1254. X}
  1255. X
  1256. X
  1257. Xvoid expand_kill()
  1258. X{
  1259. X    max_kill += max_kill / 2;        /* increase by 50% */
  1260. X
  1261. X    killf = (struct kill_t *) my_realloc((char *) killf, (unsigned) sizeof(struct kill_t) * max_kill);
  1262. X}
  1263. X
  1264. X
  1265. Xvoid expand_save()
  1266. X{
  1267. X    max_save += max_save / 2;        /* increase by 50% */
  1268. X
  1269. X    save = (struct save_t *) my_realloc((char *) save, (unsigned) sizeof(struct save_t) * max_save);
  1270. X}
  1271. X
  1272. X
  1273. Xvoid init_screen_array (allocate)
  1274. X    int allocate;
  1275. X{
  1276. X    int i;
  1277. X
  1278. X    if (allocate) {
  1279. X        screen = (struct screen_t *) my_malloc((unsigned) sizeof(*screen) * LINES);
  1280. X
  1281. X        for (i=0 ; i < LINES ; i++) {
  1282. X            screen[i].col = (char *) my_malloc ((unsigned) COLS+1);
  1283. X        }
  1284. X    } else {
  1285. X        for (i=0 ; i < LINES ; i++) {
  1286. X            if (screen[i].col) {
  1287. X                free (screen[i].col);
  1288. X                screen[i].col = (char *) 0;
  1289. X            }
  1290. X        }
  1291. X
  1292. X        free (screen);
  1293. X    }
  1294. X}
  1295. X
  1296. X
  1297. Xvoid free_all_arrays ()
  1298. X{
  1299. X    register int i;
  1300. X
  1301. X    hash_reclaim ();
  1302. X    
  1303. X    init_screen_array (FALSE);
  1304. X
  1305. X    free_art_array ();
  1306. X
  1307. X    if (my_group) {
  1308. X        free (my_group);
  1309. X    }
  1310. X
  1311. X    if (unread) {
  1312. X        free (unread);
  1313. X    }
  1314. X
  1315. X    if (base) {
  1316. X        free (base);
  1317. X    }
  1318. X
  1319. X    if (killf) {
  1320. X        free_kill_array ();
  1321. X        if (killf) {
  1322. X            free (killf);
  1323. X        }
  1324. X    }
  1325. X
  1326. X    if (save) {
  1327. X        free_save_array ();
  1328. X        if (save) {
  1329. X            free (save);
  1330. X        }
  1331. X    }
  1332. X
  1333. X    if (active) { 
  1334. X        for (i=0 ; i < max_active ; i++) {
  1335. X            if (active[i].name) {
  1336. X                free (active[i].name);
  1337. X            }
  1338. X        }
  1339. X        free (active);
  1340. X    }
  1341. X
  1342. X    if (arts) {
  1343. X        free (arts);
  1344. X    }
  1345. X}
  1346. X
  1347. X
  1348. Xvoid free_kill_array ()
  1349. X{
  1350. X    int i;
  1351. X    
  1352. X    for (i=0 ; i < kill_num ; i++) {
  1353. X        if (killf[i].kill_subj) {
  1354. X            free (killf[i].kill_subj);
  1355. X            killf[i].kill_subj = (char *) 0;
  1356. X        }
  1357. X        if (killf[i].kill_from) {
  1358. X            free (killf[i].kill_from);
  1359. X            killf[i].kill_from = (char *) 0;
  1360. X        }
  1361. X    }
  1362. X}
  1363. X
  1364. X
  1365. X/*
  1366. X *  reset save list array to 0 and free's all its allocated memory
  1367. X */
  1368. Xvoid free_save_array ()
  1369. X{
  1370. X    int i;
  1371. X    
  1372. X    for (i=0 ; i < save_num ; i++) {
  1373. X        if (save[i].subject) {
  1374. X            free (save[i].subject);
  1375. X            save[i].subject = (char *) 0;
  1376. X        }
  1377. X        if (save[i].archive) {
  1378. X            free (save[i].archive);
  1379. X            save[i].archive = (char *) 0;
  1380. X        }
  1381. X        if (save[i].dir) {
  1382. X            free (save[i].dir);
  1383. X            save[i].dir = (char *) 0;
  1384. X        }
  1385. X        if (save[i].file) {
  1386. X            free (save[i].file);
  1387. X            save[i].file = (char *) 0;
  1388. X        }
  1389. X        if (save[i].part) {
  1390. X            free (save[i].part);
  1391. X            save[i].part = (char *) 0;
  1392. X        }
  1393. X        if (save[i].patch) {
  1394. X            free (save[i].patch);
  1395. X            save[i].patch = (char *) 0;
  1396. X        }
  1397. X        save[i].index   = -1;
  1398. X        save[i].saved   = FALSE;
  1399. X        save[i].is_mailbox = FALSE;
  1400. X    }
  1401. X    
  1402. X    save_num = 0;
  1403. X}
  1404. X
  1405. Xchar *my_malloc (size)
  1406. X    unsigned size;
  1407. X{
  1408. X    char *p;
  1409. X
  1410. X    if ((p = (char *) calloc (1, (int) size)) == NULL) {
  1411. X        fprintf (stderr, txt_out_of_memory, progname);
  1412. X        exit (1);
  1413. X    }
  1414. X    return p;
  1415. X}
  1416. X
  1417. X
  1418. Xchar *my_realloc (p, size)
  1419. X    char *p;
  1420. X    unsigned size;
  1421. X{
  1422. X    if (! p) {
  1423. X        p = (char *) calloc (1, (int) size);
  1424. X    } else {
  1425. X        p = (char *) realloc (p, (int) size);
  1426. X    }
  1427. X
  1428. X    if (! p) {
  1429. X        fprintf (stderr, txt_out_of_memory, progname);
  1430. X        exit (1);
  1431. X    }
  1432. X    return p;
  1433. X}
  1434. X
  1435. SHAR_EOF
  1436. $TOUCH -am 0822175591 memory.c &&
  1437. chmod 0600 memory.c ||
  1438. echo "restore of memory.c failed"
  1439. set `wc -c memory.c`;Wc_c=$1
  1440. if test "$Wc_c" != "5489"; then
  1441.     echo original size 5489, current size $Wc_c
  1442. fi
  1443. # ============= misc.c ==============
  1444. echo "x - extracting misc.c (Text)"
  1445. sed 's/^X//' << 'SHAR_EOF' > misc.c &&
  1446. X/*
  1447. X *  Project   : tin - a visual threaded usenet newsreader
  1448. X *  Module    : misc.c
  1449. X *  Author    : R.Skrenta / I.Lea
  1450. X *  Created   : 01-04-91
  1451. X *  Updated   : 20-08-91
  1452. X *  Release   : 1.0
  1453. X *  Notes     :
  1454. X *  Copyright : (c) Copyright 1991 by Rich Skrenta & Iain Lea
  1455. X *                You may  freely  copy or  redistribute  this software,
  1456. X *              so  long as there is no profit made from its use, sale
  1457. X *              trade or  reproduction.  You may not change this copy-
  1458. X *              right notice, and it must be included in any copy made
  1459. X */
  1460. X
  1461. X#include    "tin.h"
  1462. X
  1463. X
  1464. Xchar rcdir[LEN+1];
  1465. Xchar rcfile[LEN+1];
  1466. Xchar indexdir[LEN+1];
  1467. Xchar killfile[LEN+1];
  1468. Xchar postfile[LEN+1];
  1469. X
  1470. Xchar active_file[LEN+1];
  1471. Xchar homedir[LEN+1];
  1472. Xchar userid[LEN+1];
  1473. Xchar delgroups[LEN+1];
  1474. Xchar newsrc[LEN+1];
  1475. Xchar newnewsrc[LEN+1];
  1476. Xchar add_addr[LEN+1];        /* address to add to rR reply to author with mail */
  1477. Xchar reply_to[LEN+1];        /* reply-to address */
  1478. Xchar my_org[LEN+1];            /* organization */
  1479. Xchar sig[LEN+1];
  1480. Xchar signature[LEN+1];
  1481. Xchar killsubj[LEN+1];        /* contains Subject:'s not to be shown */
  1482. Xchar killfrom[LEN+1];        /* conatins From:'s not to be shown */
  1483. Xchar page_header[LEN+1];    /* page header of pgm name and version */
  1484. Xchar savedir[LEN+1];        /* directory to save articles to */
  1485. Xchar spooldir[LEN+1];        /* directory where new is */
  1486. Xchar mailer[LEN+1];            /* mail program */
  1487. Xchar maildir[LEN+1];        /* mailbox dir where = saves are stored */
  1488. Xchar printer[LEN+1];        /* printer program */
  1489. Xchar progname[LEN+1];        /* program name */
  1490. Xint sort_art_type;            /* sort arts[] array by subject,from or date field */
  1491. Xint save_separate;            /* save a each part of a thread to a separate file */
  1492. Xint save_archive_name;        /* save thread with name from Archive-name: field */
  1493. Xint default_printer;        /* set to false if user give a printer with -p switch */
  1494. Xint print_header;            /* print all of mail header or just Subject: & From lines */
  1495. Xint show_author;            /* show Subject & From or only Subject in group menu */
  1496. Xint draw_arrow_mark;        /* draw -> or highlighted bar */
  1497. Xint kill_articles;            /* kill articles matching kill file contents */
  1498. Xint post_process;            /* post process (ie. unshar/uudecode) saved article/thread */
  1499. Xint mark_saved_read;        /* mark saved article/thread as read */
  1500. Xint post_proc_type;            /* type of post processing to be performed */
  1501. Xint num_of_tagged_files;
  1502. X
  1503. X/*
  1504. X * init_selfinfo
  1505. X *   Deterimines users home directory, userid, and a path
  1506. X *   for an rc file in the home directory
  1507. X */
  1508. X
  1509. Xvoid init_selfinfo()
  1510. X{
  1511. X    char nam[LEN+1];
  1512. X    char *p;
  1513. X    extern char *getenv();
  1514. X    extern struct passwd *getpwuid();
  1515. X    FILE *fp;
  1516. X    struct passwd *myentry;
  1517. X    struct stat sb;
  1518. X
  1519. X    myentry = getpwuid (getuid());
  1520. X    strcpy (userid, myentry->pw_name);
  1521. X    strcpy (homedir, myentry->pw_dir);
  1522. X
  1523. X    default_printer = TRUE;
  1524. X    draw_arrow_mark = FALSE;
  1525. X    kill_articles = FALSE;
  1526. X    mark_saved_read = TRUE;
  1527. X    num_of_tagged_files = 0;
  1528. X    post_process = FALSE;
  1529. X    post_proc_type = POST_PROC_SH;
  1530. X    print_header = FALSE;
  1531. X    save_separate = TRUE;
  1532. X    save_archive_name = TRUE;
  1533. X    show_author = TRUE;
  1534. X    sort_art_type = SORT_BY_NONE;
  1535. X
  1536. X    killsubj[0] = '\0';
  1537. X    killfrom[0] = '\0';
  1538. X    
  1539. X    author_search_string[0] = '\0';
  1540. X    group_search_string[0] = '\0';
  1541. X    subject_search_string[0] = '\0';
  1542. X    art_search_string[0] = '\0';
  1543. X    default_regex_pattern[0] = '\0';
  1544. X    
  1545. X    sprintf (rcdir,  "%s/%s", homedir, RCDIR);
  1546. X    sprintf (indexdir, "%s/%s", rcdir, INDEXDIR);
  1547. X    sprintf (rcfile,   "%s/%s", rcdir, RCFILE);
  1548. X    sprintf (indexdir, "%s/%s", rcdir, INDEXDIR);
  1549. X    sprintf (killfile, "%s/%s", rcdir, KILLFILE);
  1550. X    sprintf (postfile, "%s/%s", rcdir, POSTFILE);
  1551. X
  1552. X    if (stat (rcdir, &sb) == -1) {
  1553. X        mkdir (rcdir, 0755);
  1554. X        if (stat (indexdir, &sb) == -1) {
  1555. X            mkdir (indexdir, 0755);
  1556. X        }
  1557. X    }
  1558. X
  1559. X    sprintf (signature, "%s/.signature", homedir);
  1560. X    sprintf (sig, "%s/.Sig", homedir);
  1561. X    sprintf (newsrc, "%s/.newsrc", homedir);
  1562. X    sprintf (newnewsrc, "%s/.newnewsrc", homedir);
  1563. X    sprintf (delgroups, "%s/.delgroups", homedir);
  1564. X    sprintf (active_file, "%s/active", LIBDIR);
  1565. X    sprintf (savedir, "%s/News",homedir);
  1566. X    sprintf (maildir, "%s/%s",homedir,DEFAULT_MAILBOX);
  1567. X
  1568. X    strcpy (mailer, DEFAULT_MAILER);
  1569. X    strcpy (printer, DEFAULT_PRINTER);
  1570. X    strcpy (spooldir, SPOOLDIR);
  1571. X
  1572. X    read_rcfile ();
  1573. X
  1574. X    if (stat(savedir,&sb) == -1) {
  1575. X        mkdir(savedir, 0755);
  1576. X    }
  1577. X    if (stat(maildir,&sb) == -1) {
  1578. X        mkdir(maildir, 0755);
  1579. X    }
  1580. X    
  1581. X    if (stat(active_file, &sb) >= 0)
  1582. X        goto got_active;
  1583. X
  1584. X/*
  1585. X *  I hate forgetting to define LIBDIR correctly.  Guess a
  1586. X *  couple of likely places if it's not where LIBDIR says it is.
  1587. X */
  1588. X
  1589. X    strcpy (active_file, "/usr/lib/news/active");
  1590. X    if (stat(active_file, &sb) >= 0)
  1591. X        goto got_active;
  1592. X
  1593. X    strcpy(active_file, "/usr/local/lib/news/active");
  1594. X    if (stat(active_file, &sb) >= 0)
  1595. X        goto got_active;
  1596. X
  1597. X    strcpy(active_file, "/usr/public/lib/news/active");
  1598. X    if (stat(active_file, &sb) >= 0)
  1599. X        goto got_active;
  1600. X
  1601. X/*
  1602. X *  Oh well.  Revert to what LIBDIR says it is to produce a
  1603. X *  useful error message when read_active() fails later.
  1604. X */
  1605. X
  1606. X    sprintf(active_file, "%s/active", LIBDIR);
  1607. X
  1608. Xgot_active:
  1609. X
  1610. X/*
  1611. X *  check enviroment for organization
  1612. X */
  1613. X    my_org[0] = '\0';
  1614. X    if ((p = getenv("ORGANIZATION")) != NULL) {
  1615. X        my_strncpy (my_org, p, LEN);
  1616. X        goto got_org;
  1617. X    }
  1618. X
  1619. X/*
  1620. X *  check ~/.org for organization
  1621. X */
  1622. X    sprintf(nam, "%s/organization", rcdir);
  1623. X    fp = fopen (nam, "r");
  1624. X
  1625. X/*
  1626. X *  check LIBDIR/organization for system wide organization
  1627. X */
  1628. X    if (fp == NULL) {
  1629. X        sprintf(nam, "%s/organization", LIBDIR);
  1630. X        fp = fopen(nam, "r");
  1631. X    }
  1632. X
  1633. X    if (fp == NULL) {
  1634. X        sprintf(nam, "/usr/lib/news/organization");
  1635. X        fp = fopen(nam, "r");
  1636. X    }
  1637. X
  1638. X    if (fp == NULL) {
  1639. X        sprintf(nam, "/usr/local/lib/news/organization");
  1640. X        fp = fopen(nam, "r");
  1641. X    }
  1642. X
  1643. X    if (fp == NULL) {
  1644. X        sprintf(nam, "/usr/public/lib/news/organization");
  1645. X        fp = fopen(nam, "r");
  1646. X    }
  1647. X
  1648. X    if (fp == NULL) {
  1649. X        sprintf(nam, "/etc/organization");
  1650. X        fp = fopen(nam, "r");
  1651. X    }
  1652. X
  1653. X    if (fp != NULL) {
  1654. X        if (fgets(my_org, LEN, fp) != NULL) {
  1655. X            for (p = my_org; *p && *p != '\n'; p++) ;
  1656. X            *p = '\0';
  1657. X        }
  1658. X        fclose(fp);
  1659. X    }
  1660. X
  1661. Xgot_org:;
  1662. X
  1663. X/*
  1664. X *  check enviroment for REPLY_TO
  1665. X */
  1666. X    reply_to[0] = '\0';
  1667. X    if ((p = getenv("REPLY_TO")) != NULL) {
  1668. X        my_strncpy (reply_to, p, LEN);
  1669. X        goto got_reply;
  1670. X    }
  1671. X
  1672. X    sprintf(nam, "%s/reply_to", rcdir);
  1673. X    fp = fopen(nam, "r");
  1674. X    
  1675. X    if (fp != NULL) {
  1676. X        if (fgets(reply_to, LEN, fp) != NULL) {
  1677. X            for (p = reply_to; *p && *p != '\n'; p++) ;
  1678. X            *p = '\0';
  1679. X        }
  1680. X        fclose(fp);
  1681. X    }
  1682. X
  1683. Xgot_reply:;
  1684. X
  1685. X/*
  1686. X *  check enviroment for ADD_ADDR
  1687. X */
  1688. X    add_addr[0] = '\0';
  1689. X    if ((p = getenv("ADD_ADDR")) != NULL) {
  1690. X        my_strncpy (add_addr, p, LEN);
  1691. X        goto got_addr;
  1692. X    }
  1693. X
  1694. X    sprintf(nam, "%s/add_addr", rcdir);
  1695. X    fp = fopen(nam, "r");
  1696. X    
  1697. X    if (fp != NULL) {
  1698. X        if (fgets(add_addr, LEN, fp) != NULL) {
  1699. X            for (p = add_addr; *p && *p != '\n'; p++) ;
  1700. X            *p = '\0';
  1701. X        }
  1702. X        fclose(fp);
  1703. X    }
  1704. X
  1705. Xgot_addr:;
  1706. X
  1707. X}
  1708. X
  1709. X
  1710. X/*
  1711. X *  Which base note (an index into base[]) does a respnum
  1712. X *  (an index into arts[]) corresponsd to?
  1713. X *
  1714. X *  In other words, base[] points to an entry in arts[] which is
  1715. SHAR_EOF
  1716. echo "End of tin part 3"
  1717. echo "File misc.c is continued in part 4"
  1718. echo "4" > shar3_seq_.tmp
  1719. exit 0
  1720.  
  1721. --
  1722. NAME   Iain Lea
  1723. EMAIL  norisc!iain@estevax.UUCP  ...!unido!estevax!norisc!iain
  1724. SNAIL  Siemens AG, AUT 922C, Postfach 4848, Nuernberg, Germany
  1725. PHONE  +49-911-895-3853, +49-911-895-3877, +49-911-331963
  1726.