home *** CD-ROM | disk | FTP | other *** search
/ Unix System Administration Handbook 1997 October / usah_oct97.iso / news / nn.tar / nn-6.5.1 / global.h < prev    next >
C/C++ Source or Header  |  1996-08-17  |  23KB  |  812 lines

  1. /*
  2.  *    (c) Copyright 1990, Kim Fabricius Storm.  All rights reserved.
  3.  *
  4.  *    Global declarations and definitions.
  5.  */
  6.  
  7. #ifndef _NN_GLOBAL_H
  8. #define _NN_GLOBAL_H 1
  9.  
  10. /*
  11.  *    Marks for global/external variables
  12.  */
  13.  
  14. #define    export            /* export variable from module */
  15. #define import    extern        /* import variable into module */
  16.  
  17. /*
  18.  *    Various constants and types
  19.  */
  20.  
  21. typedef int8      attr_type;
  22. typedef int32     flag_type;
  23.  
  24. #ifdef I286_BUG
  25. #    define FLAG(n)    (1L<<(n-1))
  26. #else
  27. #    define FLAG(n)    (((flag_type)1)<<(n-1))
  28. #endif
  29.  
  30. typedef int32    article_number;
  31. typedef int16    group_number;
  32. typedef uint32    time_stamp;
  33.  
  34. typedef int    (* fct_type )();
  35. #define CALL(fct)  (* (fct))
  36. #define NULL_FCT  (fct_type)NULL
  37.  
  38. /* frequently used characters */
  39.  
  40. #define NUL    '\0'
  41. #define TAB    '\t'
  42. #define NL    '\n'
  43. #define CR    '\r'
  44. #define BS    '\b'
  45. #define SP    ' '
  46.  
  47. /* misc macros */
  48.  
  49. #define fl fflush(stdout)
  50.  
  51. #ifdef CONTROL_
  52. #undef CONTROL_
  53. #endif
  54. #define CONTROL_(c)    (c&037)
  55.  
  56. #ifndef HAVE_STRCHR
  57. #define    strrchr        rindex
  58. #define strchr        index
  59. #endif
  60.  
  61. #ifdef SIGNAL_HANDLERS_ARE_VOID
  62. #define sig_type void
  63. #else
  64. #define sig_type int
  65. #endif
  66.  
  67. #ifndef NNTP
  68. #undef NNTP_POST
  69. #endif
  70.  
  71. /* define types of library functions */
  72.  
  73. char     *getenv(), *ctime();
  74. #ifndef MALLOC_FUNC_CHECK
  75. char     *strchr(), *strrchr();
  76. #endif
  77. off_t     lseek();
  78. long    ftell();
  79. int    atoi();
  80. long    atol();
  81.  
  82.  
  83. /* define types of own functions */
  84.  
  85. char *mk_file_name(), *home_relative();
  86. char *date_time(), *user_name(), *plural();
  87. char *copy_str();
  88.  
  89. time_t    file_exist(), m_time(), cur_time();
  90.  
  91. extern FILE *open_file();
  92. char *relative();
  93.  
  94. #define    OPEN_READ    0    /* open for reading */
  95. #define    OPEN_UPDATE    1    /* open/create for update */
  96. #define    OPEN_CREATE    2    /* create/truncate for write */
  97. #define    OPEN_APPEND    3    /* open for append */
  98. #define OPEN_CREATE_RW    4    /* create for read/write */
  99.  
  100. #define    DONT_CREATE    0x40    /* return if file does not exist */
  101. #define    MUST_EXIST    0x80    /* fatal error if cannot open */
  102. #define    OPEN_UNLINK    0x100    /* unlink after open (not OPEN_UPDATE) */
  103.  
  104.  
  105. /*
  106.  *    Other external definitions
  107.  *
  108.  *    NOTICE: the distinction between pointers and arrays is important
  109.  *        here (they are global variables - not function arguments)
  110.  */
  111.  
  112. extern char
  113.  
  114.     *nn_directory,
  115.     *lib_directory,
  116.     version_id[];
  117.  
  118. #ifdef NNTP
  119. extern int  use_nntp;   /* 1 iff we are using nntp */
  120. #else
  121. #define use_nntp 0    /* for optimizers */
  122. #endif
  123.  
  124. extern int
  125.     s_hangup,    /* hangup signal */
  126.     s_keyboard,    /* keyboard signal */
  127.     s_pipe,    /* broken pipe */
  128.     s_redraw;    /* continue signal after stop */
  129.  
  130. extern int who_am_i;
  131.  
  132. #define I_AM_MASTER    0
  133. #define I_AM_NN        1
  134. #define I_AM_ADMIN    2
  135. #define I_AM_CHECK    3
  136. #define I_AM_TIDY    4
  137. #define I_AM_EMACS    5
  138. #define I_AM_GOBACK    6
  139. #define I_AM_POST    7
  140. #define I_AM_GREP    8
  141. #define I_AM_DAILY    9
  142. #define I_AM_SPEW    10
  143. #define I_AM_EXPIRE    11
  144. #define I_AM_ACCT    12
  145. #define I_AM_VIEW    13
  146.  
  147. extern unsigned short        /* as they are on most systems... */
  148.     user_id,
  149.     group_id;
  150.  
  151. extern int
  152.     process_id;
  153.  
  154. extern int errno;
  155.  
  156. /*
  157.  *    Storage management
  158.  */
  159.  
  160. extern char *mem_obj(), *mem_resize(), *mem_str();
  161.  
  162. #define    newobj(type, nelt) \
  163.     (type *)mem_obj(sizeof(type), (int32)(nelt))
  164.  
  165. #define    newstr(nelt) \
  166.     mem_str((int32)(nelt))
  167.  
  168. #define    resizeobj(obj, type, nelt) \
  169.     (type *)mem_resize((char *)(obj), sizeof(type), (int32)(nelt))
  170.  
  171. #define    clearobj(obj, type, nelt) \
  172.     mem_clear((char *)(obj), sizeof(type), (int32)(nelt))
  173.  
  174. #define    freeobj(obj) mem_free((char *)(obj))
  175.  
  176. #ifdef __STDC__
  177. #define quicksort(a,n,t,f) qsort((char *)(a), (unsigned)(n), sizeof(t), (int (*)(const void *,const void *)) f)
  178. #else
  179. #define quicksort(a,n,t,f) qsort((char *)(a), (unsigned)(n), sizeof(t), f)
  180. #endif
  181.  
  182. #include "vararg.h"
  183. #include "data.h"
  184.  
  185. /*
  186.  *    db external data
  187.  */
  188.  
  189. extern master_header master;
  190.  
  191. /* group headers */
  192.  
  193. #ifdef MALLOC_64K_LIMITATION
  194. extern group_header **active_groups, **sorted_groups;
  195. #else
  196. extern group_header *active_groups, **sorted_groups;
  197. #endif
  198.  
  199. /* current group information */
  200.  
  201. extern char     group_path_name[];
  202. extern char    *group_file_name;
  203.  
  204. extern group_header *current_group, *group_sequence, *rc_sequence;
  205.  
  206. extern group_header *lookup();
  207.  
  208.  
  209. int l_g_index, s_g_first;
  210.  
  211. #define    Loop_Groups_Number(num) \
  212.     for (num = 0; num < master.number_of_groups; num++)
  213.  
  214. #ifdef MALLOC_64K_LIMITATION
  215. #define Loop_Groups_Header(gh) \
  216.     for (l_g_index = 0; \
  217.      (l_g_index < master.number_of_groups) && \
  218.      (gh = active_groups[l_g_index]) ;\
  219.      l_g_index++)
  220. #else
  221. #define Loop_Groups_Header(gh) \
  222.     for (l_g_index = 0, gh=active_groups; \
  223.      l_g_index < master.number_of_groups; \
  224.      l_g_index++, gh++)
  225. #endif
  226.  
  227. #define Loop_Groups_Sorted(gh) \
  228.     for (l_g_index = s_g_first; \
  229.      (l_g_index < master.number_of_groups) && \
  230.      (gh = sorted_groups[l_g_index]) ;\
  231.      l_g_index++)
  232.  
  233. #define    Loop_Groups_Sequence(gh) \
  234.     for (gh = group_sequence; gh; gh = gh->next_group)
  235.  
  236. #define    Loop_Groups_Newsrc(gh) \
  237.     for (gh = rc_sequence; gh; gh = gh->newsrc_seq)
  238.  
  239. #ifdef MALLOC_64K_LIMITATION
  240. #define ACTIVE_GROUP(n)    active_groups[n]
  241. #else
  242. #define ACTIVE_GROUP(n)    &active_groups[n]
  243. #endif
  244.  
  245. /* 8 bit support (ISO 8859/...) */
  246.  
  247. #ifdef HAVE_8BIT_CTYPE
  248. #ifdef isascii
  249. #undef isascii
  250. #endif
  251. #define isascii(c)    1
  252.  
  253. #define iso8859(c)    (isprint(c))
  254. #else
  255. #define iso8859(c)    ((c) & 0x60)
  256. #endif
  257.  
  258. #include <sys/types.h>
  259. #include <errno.h>
  260. #include <stdio.h>
  261.  
  262. #ifdef HAVE_STRING_H
  263. #include <string.h>
  264. #else
  265. # ifdef HAVE_STRINGS_H
  266. # include <strings.h>
  267. # endif
  268. #endif
  269. #ifdef HAVE_UNISTD_H
  270. #include <unistd.h>
  271. #endif
  272. #ifdef HAVE_STDLIB_H
  273. #include <stdlib.h>
  274. #endif
  275. #ifdef HAVE_MEMORY_H
  276. #include <memory.h>
  277. #endif
  278. #ifdef HAVE_FCNTL_H
  279. #include <fcntl.h>
  280. #endif
  281.  
  282.  
  283. /* Global Functions... */
  284.  
  285. #if defined(__STDC__) || defined(__cplusplus)
  286. #define __APROTO(s) s
  287. #else
  288. #define __APROTO(s) ()
  289. #endif
  290.  
  291. #include "articles.h"
  292. #include "data.h"
  293. #include "db.h"
  294. #include "keymap.h"
  295. #include "news.h"
  296. #include "regexp.h"
  297. #include "options.h"
  298.                     
  299. /*
  300.  *    Some systems don't define these in <sys/stat.h>
  301.  */
  302.  
  303. #ifndef S_IFMT
  304. #define    S_IFMT    0170000            /* type of file */
  305. #define S_IFDIR    0040000            /* directory */
  306. #define S_IFREG    0100000            /* regular */
  307. #endif
  308.  
  309. #ifndef O_RDONLY
  310. #define    O_RDONLY    0
  311. #define    O_WRONLY    1
  312. #define    O_RDWR        2
  313. #endif
  314.  
  315. /* account.c */
  316.  
  317. int    main        __APROTO((int argc, char *argv[]));
  318. void    nn_exit        __APROTO((int n));
  319. void    nn_exitmsg    __APROTO(());
  320. int    suspend_nn    __APROTO((void));
  321.  
  322. /* active.c */
  323.  
  324. void    read_active_file __APROTO((FILE *act, FILE *copy));
  325.  
  326. /* admin.c */
  327.  
  328. void    admin_mode    __APROTO((char *input_string));
  329.  
  330. /* answer.c */
  331.  
  332. FILE *    open_purpose_file  __APROTO((void));
  333. int    display_group_list __APROTO((int get_regexp));
  334. int    answer        __APROTO((article_header *ah, int command, int incl));
  335. int    cancel        __APROTO((article_header *ah));
  336. void    do_nnpost    __APROTO((int argc, char *argv[]));
  337. int    post_menu    __APROTO((void));
  338. void    init_answer    __APROTO((void));
  339.  
  340. /* articles.c */
  341.  
  342. article_header *alloc_art __APROTO((void));
  343. char *    alloc_str    __APROTO((int len));
  344. void    free_memory    __APROTO((void));
  345. void    mark_str    __APROTO((string_marker *str_marker));
  346. void    release_str    __APROTO((string_marker *str_marker));
  347. void    mark_memory    __APROTO((memory_marker *mem_marker));
  348. void    release_memory    __APROTO((memory_marker *mem_marker));
  349. void    merge_memory    __APROTO((void));
  350. void    add_article    __APROTO((article_header *art));
  351. int    access_group    __APROTO((group_header *gh,
  352.                   article_number first_article,
  353.                   article_number last_article,
  354.                   flag_type flags, char *mask));
  355.  
  356. /* chset.c */
  357.  
  358. struct chset *    getchset __APROTO((char *name));
  359.  
  360. /* collect.c */
  361.  
  362. int    do_collect    __APROTO((void));
  363.  
  364. /* db.c */
  365.  
  366. int    init_group    __APROTO((group_header *gh));
  367. int    open_groups    __APROTO((int mode));
  368. void    close_groups    __APROTO((void));
  369. void    db_append_group    __APROTO((group_header *gh));
  370. void    db_rewrite_groups __APROTO((int save_groups, group_header *group_list));
  371. int    db_parse_group    __APROTO((group_header *gh, int trust_master));
  372. void    open_master    __APROTO((int mode));
  373. void    db_expand_master __APROTO((void));
  374. void    close_master    __APROTO((void));
  375. int    update_group    __APROTO((group_header *gh));
  376. void    sort_groups    __APROTO((void));
  377. group_header *lookup_no_alias __APROTO((char *name));
  378. group_header *lookup    __APROTO((char *name));
  379. int    art_collected    __APROTO((group_header *gh, article_number art_num));
  380. char *    db_data_path    __APROTO((char *namebuf, group_header *gh, int d_or_x));
  381. FILE *    open_data_file    __APROTO((group_header *gh, int d_or_x, int mode));
  382. void    db_read_master    __APROTO((void));
  383. void    db_write_master    __APROTO((void));
  384. #ifdef NOV
  385. void    db_read_group    __APROTO((group_header *gh, article_number low, article_number high));
  386. #else
  387. void    db_read_group    __APROTO((group_header *gh));
  388. #endif
  389. void    db_write_group    __APROTO((group_header *gh));
  390. off_t    db_read_art    __APROTO((FILE *f));
  391. int    db_write_art    __APROTO((FILE *f));
  392. off_t    get_index_offset __APROTO((group_header *gh, article_number art_num));
  393. off_t    get_data_offset     __APROTO((group_header *gh, article_number art_num));
  394. int    db_read_offset    __APROTO((FILE *f, off_t *offset));
  395. int    db_write_offset    __APROTO((FILE *f, off_t *offset));
  396.  
  397. /* decode.c */
  398.  
  399. void    uud_start    __APROTO((char *dir));
  400. void    uud_end        __APROTO((void));
  401. int    uudecode    __APROTO((article_header *ah, FILE *in));
  402.  
  403. /* digest.c */
  404.  
  405. void    init_digest_parsing    __APROTO((void));
  406. int    is_digest        __APROTO((char *subject));
  407. int    is_mail_from_line    __APROTO((char *line, char *namebuf));
  408. int    get_folder_type        __APROTO((FILE *f));
  409. int    get_digest_article    __APROTO((FILE *f, news_header_buffer hdrbuf));
  410. int    skip_digest_body    __APROTO((FILE *f));
  411. int    parse_digest_header    __APROTO((FILE *f, int all, news_header_buffer hdrbuf));
  412.  
  413. /* dir.c */
  414.  
  415. int    list_directory        __APROTO((char *dir, char *prefix));
  416. int    next_directory        __APROTO((char *buffer, int add_slash));
  417. int    compl_help_directory    __APROTO((void));
  418. void    close_directory        __APROTO((void));
  419.  
  420. /* execute.c */
  421.  
  422. void    init_execute    __APROTO((void));
  423. int    execute        __APROTO((char *path, char **args, int toggle_visual));
  424. int    shell_escape    __APROTO((void));
  425. int    run_shell    __APROTO((char *command, int clear, int init_sh));
  426. int    suspend_nn    __APROTO((void));
  427.  
  428. /* expire.c */
  429.  
  430. int    do_expire    __APROTO((void));
  431.  
  432. /* folder.c */
  433.  
  434. int    expand_file_name __APROTO((char *dest, char *src, int expand_mode));
  435. int    file_completion     __APROTO((char *path, int index));
  436. void    fcancel         __APROTO((article_header *ah));
  437. int    folder_menu     __APROTO((char *path, int mode));
  438. void    rewrite_folder     __APROTO((void));
  439.  
  440. /* fullname.c */
  441.  
  442. char *full_name        __APROTO((void));
  443.  
  444. /* global.c */
  445.  
  446. sig_type catch_hangup    __APROTO((int n));
  447. int    init_global    __APROTO((void));
  448. void    new_temp_file    __APROTO((void));
  449. FILE *    open_file    __APROTO((char *name, int mode));
  450. FILE *    open_file_search_path    __APROTO((char *name, int mode));
  451. int    fgets_multi    __APROTO((char *buf, int size, FILE *f));
  452. char *    relative    __APROTO((char *dir, char *name));
  453. char *    mk_file_name    __APROTO((char *dir, char *name));
  454. char *    home_relative    __APROTO((char *dir));
  455. char *    substchr    __APROTO((char *str, int c1, int c2));
  456. char *    copy_str    __APROTO((char *str));
  457. time_t    m_time        __APROTO((FILE *f));
  458. time_t    file_exist    __APROTO((char *name, char *mode));
  459. int32    copy_file    __APROTO((char *src, char *dest, int append));
  460. int    move_file    __APROTO((char *old, char *new, int may_keep_old));
  461. int    save_old_file    __APROTO((char *name, char *suffix));
  462. void    sys_error    __APROTO(());
  463. int    sys_warning    __APROTO(());
  464. int    log_entry    __APROTO(());
  465. char *    user_name    __APROTO((void));
  466. time_t    cur_time    __APROTO((void));
  467. char *    date_time    __APROTO((time_t t));
  468. char *    plural        __APROTO((long n));
  469. char *    mem_obj        __APROTO((unsigned size, int32 nelt));
  470. char *    mem_str        __APROTO((int32 nelt));
  471. char *    mem_resize    __APROTO((char *obj, unsigned size, int32 nelt));
  472. void    mem_clear    __APROTO((char *obj, unsigned size, int32 nelt));
  473. void    mem_free    __APROTO((char *obj));
  474. int    nn_truncate    __APROTO((char *path, off_t len));
  475. char *    strsave        __APROTO((char *s));
  476. char *    str3save    __APROTO((char *s1, char *s2, char *s3));
  477. char *    fgetstr        __APROTO((FILE *f));
  478.  
  479. /* group.c */
  480.  
  481. int    group_completion    __APROTO((char *hbuf, int ix));
  482. int    group_menu        __APROTO((group_header *gh,
  483.                       article_number first_art,
  484.                       flag_type access_mode,
  485.                       char *mask, fct_type menu));
  486. group_header *lookup_regexp    __APROTO((char *name, char *pr, int flag));
  487. int    goto_group        __APROTO((int command, article_header *ah,
  488.                       flag_type access_mode));
  489. void    merge_and_read        __APROTO((flag_type access_mode, char *mask));
  490. int    unsubscribe        __APROTO((group_header *gh));
  491. void    group_overview        __APROTO((int amount));
  492.  
  493. /* hostname.c */
  494.  
  495. void    nn_gethostname    __APROTO((char *name, int length));
  496.  
  497. /* init.c */
  498.  
  499. void    init_message    __APROTO(());
  500. void    visit_init_file    __APROTO((int only_seq, char *first_arg));
  501. int    alt_completion    __APROTO((char *buf, int index));
  502. int    parse_command    __APROTO((char *cmd, int ok_val, FILE *initf));
  503. void    display_help    __APROTO((char *subject));
  504.  
  505. /* keymap.c */
  506.  
  507. void    init_key_map    __APROTO((void));
  508. int    lookup_command    __APROTO((char *command, int restriction));
  509. int    cmd_completion    __APROTO((char *path, int index));
  510. char *    command_name    __APROTO((int cmd));
  511. key_type parse_key    __APROTO((char *str));
  512. char *    key_name    __APROTO((int c));
  513. void    dump_global_map    __APROTO((void));
  514. int    dump_key_map    __APROTO((char *where));
  515. int    lookup_keymap    __APROTO((char *name));
  516. int    make_keymap    __APROTO((char *name));
  517. int    keymap_completion __APROTO((char *buf, int ix));
  518.  
  519. /* kill.c */
  520.  
  521. int    kill_article        __APROTO((article_header *ah));
  522. int    auto_select_article    __APROTO((article_header *ah, int do_select));
  523. void    enter_kill_file        __APROTO((group_header *gh, char *pattern,
  524.                       flag_type flag, int days));
  525. int    kill_menu        __APROTO((article_header *ah));
  526. int    init_kill        __APROTO((void));
  527. void    rm_kill_file        __APROTO((void));
  528. void    free_kill_entries    __APROTO((void));
  529. void    dump_kill_list        __APROTO((void));
  530.  
  531. /* macro.c */
  532.  
  533. void    init_macro    __APROTO((void));
  534. char *    m_define    __APROTO((char *id, FILE *f));
  535. char *    m_get_macro    __APROTO((char *id));
  536. char *    parse_enter_macro __APROTO((FILE *f, int c));
  537. void    m_invoke    __APROTO((int n));
  538. void    m_startinput    __APROTO((void));
  539. void    m_endinput    __APROTO((void));
  540. void    m_advinput    __APROTO((void));
  541. void    m_break_entry    __APROTO((void));
  542. void    m_break        __APROTO((void));
  543. void    macro_dbg    __APROTO((void));
  544. int    m_getc        __APROTO((int *cp));
  545. int    m_gets        __APROTO((char *s));
  546. int    m_yes        __APROTO((void));
  547.  
  548. /* master.c */
  549.  
  550. void    nn_exit        __APROTO((int n));
  551. void    clean_group    __APROTO((group_header *gh));
  552. group_header *add_new_group __APROTO((char *name));
  553. int    main        __APROTO((int argc, char **argv));
  554. int    receive_admin    __APROTO((void));
  555. void    write_error    __APROTO((void));
  556. void    nn_exitmsg    __APROTO(());
  557. void    dummy_error    __APROTO((char *name));
  558. int    suspend_nn    __APROTO((void));
  559. void    msg        __APROTO(());
  560. void    user_delay    __APROTO((int n));
  561.  
  562. /* match.c */
  563.  
  564. void    fold_string    __APROTO((char *mask));
  565. int    streq_fold    __APROTO((char *mask, char *str));
  566. int    strmatch_fold    __APROTO((char *mask, char *str));
  567. int    strmatch    __APROTO((char *mask, char *str));
  568. int    strmatch_cf    __APROTO((char *mask, char *str));
  569. int    regexec_fold    __APROTO((regexp *prog, char *string));
  570. int    regexec_cf    __APROTO((regexp *prog, char *string));
  571.  
  572. /* menu.c */
  573.  
  574. int    prt_replies    __APROTO((int level));
  575. char *    pct        __APROTO((long start, long end,    
  576.                   long first, long last));
  577. int    menu        __APROTO((fct_type print_header));
  578. article_header *get_menu_article    __APROTO((void));
  579. int    alt_command    __APROTO((void));
  580.  
  581. /* more.c */
  582.  
  583. int    get_header_field    __APROTO((int code, char **namep, char **valp,
  584.                    article_header *ah));
  585. void    scan_header_fields    __APROTO((char *fields, article_header *ah));
  586. int    next_header_field    __APROTO((char **namep, char **valp,
  587.                       fct_type *attrp));
  588. int    more            __APROTO((article_header *ah, int mode,
  589.                       int screen_offset));
  590. void    rot13_line        __APROTO((char *cp));
  591. #ifdef NOV
  592. void    setpos            __APROTO((article_header *ah, FILE *art));
  593. #endif
  594. /* news.c */
  595.  
  596. char *    parse_header    __APROTO((FILE *f, char **(*hdr_field)(), 
  597.                   int modes, news_header_buffer hdrbuf));
  598. int    is_header_line    __APROTO((char *line));
  599. FILE *    open_news_article __APROTO((article_header *art, int modes,
  600.                     news_header_buffer buffer1,
  601.                     news_header_buffer buffer2));
  602.  
  603. /* newsrc.c */
  604.  
  605. void    visit_rc_file    __APROTO((void));
  606. void    use_newsrc    __APROTO((group_header *gh, int mode));
  607. attr_type test_article    __APROTO((article_header *ah));
  608. void    flush_newsrc    __APROTO((void));
  609. int    restore_bak    __APROTO((void));
  610. void    update_rc    __APROTO((group_header *gh));
  611. void    update_rc_all    __APROTO((group_header *gh, int unsub));
  612. void    add_to_newsrc    __APROTO((group_header *gh));
  613. int32    restore_rc    __APROTO((group_header *gh, article_number last));
  614. int    restore_unread    __APROTO((group_header *gh));
  615. void    count_unread_articles    __APROTO((void));
  616. void    prt_unread    __APROTO((char *format));
  617. int    add_unread    __APROTO((group_header *gh, int mode));
  618. void    opt_nngrep    __APROTO((int argc, char *argv[]));
  619. void    do_grep        __APROTO((char **pat));
  620. int    opt_nntidy    __APROTO((int argc, char *argv[]));
  621. void    do_tidy_newsrc    __APROTO((void));
  622. int    opt_nngoback    __APROTO((int argc, char ***argvp));
  623. void    do_goback    __APROTO((void));
  624. group_header *add_new_group    __APROTO((char *name));
  625.  
  626. /* nn.c */
  627.  
  628. flag_type parse_access_flags    __APROTO((void));
  629. int    unread_mail    __APROTO((time_t t));
  630. void    stop_usage    __APROTO((void));
  631. time_t    tick_usage    __APROTO((void));
  632. void    log_usage    __APROTO((void));
  633. void    emacs_mode    __APROTO((void));
  634. int    display_motd    __APROTO((int check));
  635. void    clean_group    __APROTO((group_header *gh));
  636. int    main        __APROTO((int argc, char *argv[]));
  637. void    nn_exit        __APROTO((int n));
  638.  
  639. /* nnmail.c */
  640.  
  641. int    main        __APROTO((int argc, char **argv));
  642. void    nn_exit        __APROTO((int n));
  643. void    nn_exitmsg    __APROTO(());
  644. int    suspend_nn    __APROTO((void));
  645.  
  646. /* nntp.c */
  647.  
  648. int    nntp_check        __APROTO((void));
  649. int    nntp_no_post        __APROTO((void));
  650. int    nntp_set_group        __APROTO((group_header *gh));
  651. int    nntp_get_active        __APROTO((void));
  652. FILE *    nntp_get_newsgroups    __APROTO((void));
  653. struct novgroup *nntp_get_overview    __APROTO((group_header *gh,
  654.                 article_number low, article_number high));
  655. FILE *    nntp_fopen_list        __APROTO((char *cmd));
  656. char *    nntp_fgets        __APROTO((char *buf, int size));
  657. article_number *nntp_get_article_list    __APROTO((group_header *gh));
  658. FILE *    nntp_get_article    __APROTO((article_number article, int mode));
  659. char *    nntp_get_filename    __APROTO((article_number art, group_header *gh));
  660. void    nntp_close_server    __APROTO((void));
  661. int    nntp_cleanup        __APROTO((void));
  662.  
  663. /* options.c */
  664.  
  665. char *    program_name        __APROTO((char **av));
  666. int    parse_options        __APROTO((int ac, char **av, char *envname,
  667.                       struct option_descr options[],
  668.                       char *usage));
  669.  
  670. /* pack_date.c */
  671.  
  672. time_stamp    pack_date    __APROTO((char *date));
  673.  
  674. /* pack_name.c */
  675.  
  676. int    pack_name        __APROTO((char *dest, char *source,
  677.                       int length));
  678.  
  679. /* pack_subject.c */
  680.  
  681. int    pack_subject        __APROTO((char *dest, char *src,
  682.                       int *re_counter_ptr,
  683.                       int max_length));
  684.  
  685. /* prefix.c */
  686.  
  687. int    main    __APROTO((int argc, char *argv[]));
  688. void    nn_exit    __APROTO((int n));
  689. void    nn_exitmsg    __APROTO(());
  690. int    suspend_nn    __APROTO((void));
  691.  
  692. /* proto.c */
  693.  
  694. int    proto_lock    __APROTO((int prog, int command));
  695. FILE *    open_gate_file    __APROTO((int mode));
  696. void    send_master    __APROTO((int command, group_header *gh, int opt, long arg));
  697.  
  698. /* regexp.c */
  699.  
  700. regexp *regcomp    __APROTO((char *exp));
  701. int    regexec    __APROTO((regexp *prog, char *string));
  702. void    regsub    __APROTO((regexp *prog, char *source, char *dest));
  703. void    regerror    __APROTO((char *s));
  704.  
  705. /* reroute.c */
  706.  
  707. int    reroute    __APROTO((char *route, char *address));
  708.  
  709. /* save.c */
  710.  
  711. void    set_folder_type    __APROTO((char *name));
  712. char *    init_save    __APROTO((int command, char **mode_textp));
  713. int    save    __APROTO((article_header *ah));
  714. int    end_save    __APROTO((void));
  715. void    store_header    __APROTO((article_header *ah, FILE *f, char *dir, char *file));
  716. int    mailbox_format    __APROTO((FILE *f, int top));
  717. char *    run_mkdir    __APROTO((char *dir, char *name_buf));
  718. int    change_dir    __APROTO((char *dir, int in_init));
  719.  
  720. /* sequence.c */
  721.  
  722. int    only_folder_args    __APROTO((char **args));
  723. void    parse_save_files    __APROTO((FILE *sf));
  724. void    named_group_sequence    __APROTO((char **groups));
  725. void    normal_group_sequence    __APROTO((void));
  726. void    start_group_search    __APROTO((char *group));
  727. group_header *get_group_search    __APROTO((void));
  728.  
  729. /* sort.c */
  730.  
  731. void    sort_articles    __APROTO((int mode));
  732. void    no_sort_articles    __APROTO((void));
  733. int    elim_articles    __APROTO((article_number *list, int list_lgt));
  734.  
  735. /* term.c */
  736.  
  737. void    micro_alarm    __APROTO((int n));
  738. void    enter_multi_key    __APROTO((int code, key_type *keys));
  739. void    dump_multi_keys    __APROTO((void));
  740. void    init_term    __APROTO((int full));
  741. void    home    __APROTO((void));
  742. void    save_xy    __APROTO((void));
  743. void    restore_xy    __APROTO((void));
  744. void    gotoxy    __APROTO((int c, int l));
  745. void    clrdisp    __APROTO((void));
  746. void    clrline    __APROTO((void));
  747. void    clrline_noflush    __APROTO((void));
  748. void    clrpage    __APROTO((void));
  749. void    tprintf    __APROTO(());
  750. void    tvprintf    __APROTO((va_list zZap));
  751. void    tputc    __APROTO((int c));
  752. int    so_gotoxy    __APROTO((int c, int l, int blank));
  753. void    so_printf    __APROTO(());
  754. void    so_vprintf    __APROTO((va_list zZap));
  755. void    so_end    __APROTO((void));
  756. void    so_printxy    __APROTO(());
  757. int    underline    __APROTO((int on));
  758. int    highlight    __APROTO((int on));
  759. int    shadeline    __APROTO((int on));
  760. int    standout    __APROTO((int on));
  761. void    visual_on    __APROTO((void));
  762. int    visual_off    __APROTO((void));
  763. void    nn_raw    __APROTO((void));
  764. int    no_raw    __APROTO((void));
  765. int    unset_raw    __APROTO((void));
  766. void    flush_input    __APROTO((void));
  767. int    get_c    __APROTO((void));
  768. char *    get_s    __APROTO((char *dflt, char *prefill, char *break_chars, fct_type completion));
  769. int    list_completion    __APROTO((char *str));
  770. int    yes    __APROTO((int must_answer));
  771. void    ding    __APROTO((void));
  772. void    display_file    __APROTO((char *name, int modes));
  773. void    nn_exitmsg    __APROTO(());
  774. void    msg    __APROTO(());
  775. void    push_msg    __APROTO((char *str));
  776. void    vmsg    __APROTO((va_list zZap));
  777. void    clrmsg    __APROTO((int col));
  778. void    prompt    __APROTO(());
  779. int    any_key    __APROTO((int line));
  780. void    pg_init    __APROTO((int first_line, int cols));
  781. int    pg_scroll    __APROTO((int n));
  782. int    pg_next    __APROTO((void));
  783. void    pg_indent    __APROTO((int pos));
  784. int    pg_end    __APROTO((void));
  785. void    user_delay    __APROTO((int ticks));
  786.  
  787. /* unshar.c */
  788.  
  789. int    unshar_position    __APROTO((FILE *fil));
  790.  
  791. /* usercheck.c */
  792.  
  793. int    main    __APROTO((int argc, char *argv[]));
  794.  
  795. /* variable.c */
  796.  
  797. int    set_variable    __APROTO((char *variable, int on, char *val_string));
  798. void    toggle_variable    __APROTO((char *variable));
  799. void    lock_variable    __APROTO((char *variable));
  800. int    test_variable    __APROTO((char *expr));
  801. void    var_compl_opts    __APROTO((int col));
  802. int    var_completion    __APROTO((char *path, int index));
  803. void    mark_var_stack    __APROTO((void));
  804. int    push_variable    __APROTO((char *variable));
  805. void    restore_variables    __APROTO((void));
  806. void    disp_variables    __APROTO((int all, char *rexp));
  807. void    print_variable_config    __APROTO((FILE *f, int all));
  808. void    var_options    __APROTO((char **str, char *options, flag_type *res));
  809.  
  810.  
  811. #endif /* _NN_GLOBAL_H */
  812.