/**********************************************************************
 * lucy/lucy.h -- header file for lucy
 *
 * $Source: /afs/athena.mit.edu/astaff/project/lucydev/src/include/lucy/RCS/lucy.h,v $
 * $Author: brlewis $
 * $Header: /afs/athena.mit.edu/astaff/project/lucydev/src/include/lucy/RCS/lucy.h,v 1.1 92/04/02 14:20:18 brlewis Exp Locker: brlewis $
 *
 * Copyright 1990 by the Massachusetts Institute of Technology.
 * For copying and distribution information, see the file
 * "mit-copyright.h".
 **********************************************************************/
#include "mit-copyright.h"

#ifndef lint
static char rcsid_lucy_h[] = "$Header: /afs/athena.mit.edu/astaff/project/lucydev/src/include/lucy/RCS/lucy.h,v 1.1 92/04/02 14:20:18 brlewis Exp Locker: brlewis $";
#endif /* lint */

#include <stdio.h>		/* needed for some function decls */
#include <rpc/rpc.h>
#include <discuss/discuss.h>
#include <lucy/etlucy.h>

#ifdef DEBUG
#define LUCY_DEBUG(x) com_err x
#else /* DEBUG */
#define LUCY_DEBUG(x)
#endif /* DEBUG */

typedef trn_info3 ltrn;		/* lucy transactions = discuss trn3 */

/* special transaction numbers */
#define LUCY_NULLQ ((trn_nums) 0)
#define LUCY_LOWQ ((trn_nums) 2)

/* Flags to mark questions */
#define LUCY_FORWARDED	(1<<8)
#define LUCY_ANSWERED	(1<<9)
#define LUCY_POSTED	(1<<10)
#define LUCY_REPLIED	(1<<11)
#define LUCY_WANT_FORWARD (1<<12)
#define LUCY_WANT_ANSWER  (1<<13)
#define LUCY_WANT_POST    (1<<14)
#define LUCY_WANT_REPLY   (1<<15)

/* strings common to clients, library */
#define LUCY_REPLY "SEND PERSONAL REPLY: "
#define LUCY_POST "PUBLISH QUESTION/ANSWER IN BROWSER: "
#define LUCY_ARCHIVE "SUMMARY OF ARCHIVED TRANSACTIONS:"
#define LUCY_HINTS "lucymail-hints: "

/* RPC parameters */
#define LUCY_RPC_PROG (0x20000000)
#define LUCY_RPC_VERS (1)
#define LUCY_RPC_PARSE (1)	/* parse-transaction procedure number */
#define LUCY_RPC_UPTIME (2)	/* get-lucyd-uptime procedure number */

struct lmeeting {
  mtg_info info;
  name_blk nb;			/* for discuss */
  char *dir;			/* directory to cache trn text */
  int ntrn;			/* number of cached ltrn structs */
  ltrn **trn;			/* array of cached ltrns */
};

#define LMEETING struct lmeeting

typedef struct _lacl_entry {
  char *principal;
  int level;
} lacl_entry;

/* macro to see if emacs editor should be run in background */
#define luc_shouldfork() getenv("DISPLAY")

/* Global variables */
extern char *luv_host, *luv_qdirname, *luv_bdirname, *luv_adirname,
  *luv_email, *luv_editor, *luv_topdir, luv_context[];
extern LMEETING luv_qmtg, luv_bmtg, luv_amtg, *luv_curmtgp;
extern long luv_prog;

/* prototypes or function declarations */
#include <lucy/liblucy-ptypes.h>

/* Things that really should be declared outside lucy but aren't */
char *getenv();
tfile unix_tfile();             /* XXX should be in discuss .h file */
