/*
 ===========================================================================
 =                                                                         =
 =  (C) Copyright 1991 The Trustees of Indiana University                  =
 =                                                                         =
 =  Permission to use, copy, modify, and distribute this program for       =
 =  any purpose and without fee is hereby granted, provided that this      =
 =  copyright and permission notice appear on all copies and supporting    =
 =  documentation, the name of Indiana University not be used in           =
 =  advertising or publicity pertaining to distribution of the program     =
 =  without specific prior permission, and notice be given in supporting   =
 =  documentation that copying and distribution is by permission of        =
 =  Indiana University.                                                    =
 =                                                                         =
 =  Indiana University makes no representations about the suitability of   =
 =  this software for any purpose. It is provided "as is" without express  =
 =  or implied warranty.                                                   =
 =                                                                         =
 ===========================================================================
 =                                                                         =
 = File:                                                                   =
 =   IUPOP3_GENERAL.H                                                      =
 =                                                                         =
 = Authors:                                                                =
 =   Jacob Levanon & Larry Hughes                                          =
 =   Indiana University                                                    =
 =   University Computing Services, Network Applications                   =
 =                                                                         =
 = Credits:                                                                =
 =   This software is based on the Post Office Protocol version 3,         =
 =   as implemented by the University of California at Berkeley.           =
 =                                                                         =
 ===========================================================================
*/

/* ======================================================================== */
/* Defines/Types */
/* ======================================================================== */
#define vms_error(status) (!(status & 1))

#define ASTON  sys$setast(1)
#define ASTOFF sys$setast(0)

#define MAIL$_MESSAGE_HEADER    2132
#define MAIL$_MESSAGE_TEXT      2133
#define MAIL$_NOTEXIST       8290522
#define MAIL$_NOMOREREC      8314792
#define MAIL$V_MARKED        7

#define NO_CONTEXT 0

#define itemopen(ptr,itm) ptr = itm
#define itemadd(p,a,b,c,d) p->buffer_length = a; p->item_code = b; \
                           p->buffer_address = c; p->return_length_address = d; \
                           p++;
#define itemclose(ptr) itemadd(ptr,0,0,0,0);

#define vms_error(status) (!(status & 1))

#define MAX_ITEMS 10

typedef struct
{
  short buffer_length;
  short item_code;
  long  buffer_address;
  long return_length_address;
} ITEMLIST;

typedef struct  {
    short       cnt;
    char        name[12];
    int         (*function) ();
}   mailer;

#define FROM_LINE       1
#define TO_LINE         2
#define CC_LINE         3
#define SUBJECT_LINE    4
#define DEBUG 1
char    debug[256];

/* ======================================================================== */
/* Global Variables */
/* ======================================================================== */
ITEMLIST nullist[] = { {0,0,0,0} };
ITEMLIST inlist[MAX_ITEMS];
ITEMLIST *inlist_ptr;
ITEMLIST outlist[MAX_ITEMS];
ITEMLIST *outlist_ptr;

char newmail_folder[] = "NEWMAIL";

