/*
 * $Header: WELMAT:src/RCS/logproc.h,v 1.4 92/06/27 12:51:31 rwm Exp Locker: rwm $
 *  New log process structures
 */

#ifndef _LOGPROC_H_

#ifndef EXEC_LISTS_H
#include <exec/nodes.h>
#include <exec/lists.h>
#endif

#ifndef EXEC_PORTS_H
#include <exec/ports.h>
#endif


#define LPNAMELEN    20
#define MAXLOGENTRY 220
#define NUMLOGS      20
#define SCRATCHLEN  256

struct LogProc {
  struct MsgPort *PublicPort;
  struct List     logHandles;
  struct List    logSessions;
  BOOL              aborting;             
  char  session[LPNAMELEN+1];  /* Session name  */
  char scratch[SCRATCHLEN+1]; /* scratch space */
};

struct LogEntry {
  struct Node le_Node;
  char buf[MAXLOGENTRY];
  long zerome; /*debugging */
};

struct logHandle {
  struct Node lplh;
  char        name[LPNAMELEN+1]; /* log handle name */
  long        length;            /* type is always 0 */
};

struct logHandleW {
  struct logHandle lh;
  BPTR       myFile;
};

struct logHandleF {
  struct logHandle lh;
  struct List logs;
  struct List freelogs;
  struct LogEntry logentries[NUMLOGS];
  char        filename[2]; /* filename goes from here */
};

struct logSession {
  struct Node lpls;
  struct List logSesNodes;  /* a list of lpSesNode structures */
  char     name[LPNAMELEN+1]; /* log handle name */
};

struct lpSesNode {
   struct Node lpsn;
   struct logHandle *handle;
};

#define _LOGPROC_H_
#endif
