source: trunk/athena/bin/discuss/edsc/edsc.h @ 19062

Revision 19062, 3.4 KB checked in by ghudson, 22 years ago (diff)
Use errno.h.
Line 
1/*
2 *
3 *      Copyright (C) 1989 by the Massachusetts Institute of Technology
4 *      Developed by the MIT Student Information Processing Board (SIPB).
5 *      For copying information, see the file mit-copyright.h in this release.
6 *
7 */
8
9/*
10 * edsc.h --- include file for the emacs discuss back-end program
11 */
12
13#include <discuss/discuss.h>
14#include <errno.h>
15
16extern char *user_id;
17extern tfile stdout_tf;
18extern int bit_bucket();
19extern char *do_quote();
20tfile unix_tfile();
21extern int cache_activated, cache_working;
22extern int use_vectors;
23
24extern char *malloc();
25
26extern int      do_quit(), do_gmi(), do_gti(), do_gcm(), do_gml(), do_gt();
27extern int      do_gtf(), do_grt(), do_grtn(), do_ss(), do_at(), do_nut();
28extern int      do_sfl(), do_am(), do_dm(), do_gpv();
29extern int      do_pacl(), do_sacl(), do_dacl();
30extern int      do_dt(), do_rt(), do_ls();
31
32extern char *short_time();
33
34/* selection flags */
35#define flag_AREF               8
36
37/* filtering flags */
38#define filter_INCLUDE_DELETED 1
39#define filter_ONLY_DELETED    2
40#define filter_ONLY_INITIAL    4
41#define filter_ONLY_TERMINAL   16
42#define filter_FLAG_SET        32
43#define filter_FLAG_RESET      64
44
45/*
46 * Here is the cache information.....
47 */
48
49/*
50 * The caching is only enabled if EDSC_CACHE is defined....
51 */
52#define EDSC_CACHE
53
54#ifdef EDSC_CACHE
55#define CACHE_DIR       "/tmp"
56#define CACHE_FN_SIZE   80
57#define CACHE_STRATEGY_SIZE     256
58#define CACHE_DEFAULT_SIZE      50
59
60#define CACHE_FLG_INFO  1
61#define CACHE_FLG_TEXT  2
62
63struct cache_meeting {
64        int     ref_count;
65        name_blk        nb;
66        mtg_info        m_info;
67        int             meeting_code; /* Error code when fetching */
68                                      /* meeting info */
69        struct cache_meeting    *next;
70        struct cache_meeting    *prev;
71};
72
73struct cache_info {
74        trn_nums trn_num;
75        struct cache_meeting    *meeting;
76        int     flags;
77        char    filename[CACHE_FN_SIZE];
78        trn_info3 t_info;
79        int     info_code;      /* Error code when fetching info */
80        int     text_code;      /* Error code when fetch the text */
81        struct cache_info       *next;  /* Used to keep LRU list */
82                                        /* Also used for empty list */
83        struct cache_info       *prev;
84};
85
86/*
87 * The cache work instructions are divided into two fields:
88 *
89 * The upper 4 bits define the opcode, the lower 4 bites define the
90 * direction, if any.
91 *
92 * OPCODES:
93 *      STOP --- Stop doing any cache work.
94 *      GET_CUR --- Get the current transaction
95 *      FETCH_CUR --- Fetch the article one away in the indicated direction
96 *                      from the current article.
97 *      SET_PTR --- Set the pointer to the current article
98 *      MFETCH_PTR --- Move the pointer one in the indicated direction and
99 *                      fetch that article
100 */
101
102typedef char    cache_dir;
103
104#define CACHE_OP_MASK           0xF0
105#define CACHE_OP_STOP           (0 << 4)
106#define CACHE_OP_GET_CUR        (1 << 4)
107#define CACHE_OP_FETCH_CUR      (2 << 4)
108#define CACHE_OP_SET_PTR        (3 << 4)
109#define CACHE_OP_MFETCH_PTR     (4 << 4)
110
111#define CACHE_DIR_MASK          0x0F
112#define CACHE_DIR_CURRENT       0
113#define CACHE_DIR_NEXT          1
114#define CACHE_DIR_PREV          2
115#define CACHE_DIR_NREF          3
116#define CACHE_DIR_PREF          4
117#define CACHE_DIR_FREF          5
118#define CACHE_DIR_LREF          6
119
120
121/*
122 * Function declarations
123 */
124       
125struct cache_info *cache_empty(), *cache_search();
126struct cache_meeting *get_cache_meeting(), *search_cache_meetings();
127
128void cache_get_transaction_text(), cache_flush(), free_cache_entry();
129void free_cache_meeting(), do_cache_work(), cache_init();
130
131extern int      do_scd(), do_gtfc(), do_it(), do_itn(), do_im();
132extern int      cache_pc;
133extern struct cache_info *cache_current;
134extern cache_dir                cache_current_direction;
135       
136       
137#endif /* EDSC_CACHE */
138
Note: See TracBrowser for help on using the repository browser.