head	1.87;
access;
symbols
	V0-99-8:1.80
	V0-99-7:1.78
	V0-99-6:1.76
	V0-99-5:1.75
	V0-99-4:1.74
	V0-99-2:1.69
	V0-99-1:1.69
	V0-93-14:1.69
	V0-93-13:1.69
	V0-93-12:1.68
	V0-93-11:1.66
	V0-93-10:1.66
	V0-93-9:1.65
	V0-93-8:1.65
	V0-93-7:1.63
	V0-93-5:1.62
	V80:1.13
	V76d:1.2;
locks; strict;
comment	@ * @;


1.87
date	97.04.05.00.18.04;	author dumoulin;	state Exp;
branches;
next	1.86;

1.86
date	97.03.14.21.58.45;	author dumoulin;	state Exp;
branches;
next	1.85;

1.85
date	97.03.07.01.51.08;	author dumoulin;	state Exp;
branches;
next	1.84;

1.84
date	97.02.28.19.23.31;	author dumoulin;	state Exp;
branches;
next	1.83;

1.83
date	97.02.14.20.12.31;	author dumoulin;	state Exp;
branches;
next	1.82;

1.82
date	97.02.08.11.07.37;	author dumoulin;	state Exp;
branches;
next	1.81;

1.81
date	97.02.06.21.26.15;	author dumoulin;	state Exp;
branches;
next	1.80;

1.80
date	96.08.31.06.52.50;	author dumoulin;	state Exp;
branches;
next	1.79;

1.79
date	96.08.13.03.49.20;	author shimomai;	state Exp;
branches;
next	1.78;

1.78
date	95.11.09.00.09.37;	author dumoulin;	state Exp;
branches;
next	1.77;

1.77
date	95.11.07.21.40.24;	author dumoulin;	state Exp;
branches;
next	1.76;

1.76
date	95.08.16.22.33.43;	author shimomai;	state Exp;
branches;
next	1.75;

1.75
date	95.06.06.03.37.57;	author jcooper;	state Exp;
branches;
next	1.74;

1.74
date	95.05.19.22.49.17;	author dumoulin;	state Exp;
branches;
next	1.73;

1.73
date	95.04.22.00.05.51;	author dumoulin;	state Exp;
branches;
next	1.72;

1.72
date	95.04.21.21.47.11;	author dumoulin;	state Exp;
branches;
next	1.71;

1.71
date	95.04.17.23.28.29;	author dumoulin;	state Exp;
branches;
next	1.70;

1.70
date	95.04.12.20.52.27;	author dumoulin;	state Exp;
branches;
next	1.69;

1.69
date	95.02.02.23.21.55;	author rushing;	state Exp;
branches;
next	1.68;

1.68
date	95.01.19.02.47.25;	author jglasser;	state Exp;
branches;
next	1.67;

1.67
date	95.01.03.20.45.35;	author brydon;	state Exp;
branches;
next	1.66;

1.66
date	94.12.12.19.39.13;	author jcooper;	state Exp;
branches;
next	1.65;

1.65
date	94.11.30.02.55.55;	author jpiraino;	state Exp;
branches;
next	1.64;

1.64
date	94.11.28.22.01.06;	author jcooper;	state Exp;
branches;
next	1.63;

1.63
date	94.11.21.21.20.46;	author jcooper;	state Exp;
branches;
next	1.62;

1.62
date	94.11.10.01.27.46;	author rushing;	state Exp;
branches;
next	;


desc
@winvn version 0.76 placed into RCS
@


1.87
log
@increased size of MAXGROUPNAME, MAXNNTPSIZE, MAXTZONESIZE and str buffer
@
text
@/********************************************************************
 *                                                                  *
 *  MODULE    :  WVGLOB.H                                           *
 *                                                                  *
 *  PURPOSE   :  Contains all the global types and variables for    *
 *               WinVN.  Stylistically, this should probably be     *
 *               separated into several header files, but this is   *
 *               what you've got for now. WVDOC.C describes         *
 *               some of these structures.                          *
 *                                                                  *
 *******************************************************************/

/*
 * $Id: wvglob.h 1.86 1997/03/14 21:58:45 dumoulin Exp $
 */

#ifndef __WVGLOB__
#define __WVGLOB__

#ifdef _WIN32
#ifndef WIN32
#define WIN32
#endif
#endif

#ifdef WIN32
#ifndef _WIN32
#define _WIN32
#endif
#endif

/* these are supposed be defined in windowsx.h, but they aren't in mine! */
#ifndef GET_WM_COMMAND_CMD
#ifdef WIN32
#define GET_WM_COMMAND_CMD(wp, lp)  HIWORD(wp)
#define GET_WM_COMMAND_ID(wp, lp)   LOWORD(wp)
#define GET_WM_COMMAND_HWND(wp, lp) (HWND)(lp)
#else
#define GET_WM_COMMAND_CMD(wp, lp)  HIWORD(lp)
#define GET_WM_COMMAND_ID(wp, lp)   (wp)
#define GET_WM_COMMAND_HWND(wp, lp) ((HWND)LOWORD(lp))
#endif
#endif

#ifdef WIN32
#define huge far
#define LOPEN_READ	OF_READ
#define LOPEN_WRITE	OF_WRITE
#else
/*#define _int16 int */ /* (not defined in any 16 bit MSVC or MSVCNT 1.10) */
#define LOPEN_READ	READ
#define LOPEN_WRITE	WRITE
#endif

#ifndef _int16
#define _int16 short int
#endif

#ifndef _int32
#define _int32 long int
#endif

#define int16 _int16
#define int32 _int32
#define uint16 unsigned _int16
#define uint32 unsigned _int32

#define USE_3D_CONTROLS			/* define this to use 3d controls (ctl3d.dll) */

#define COMM_TIMER_INTERVAL 250	/* in milliseconds */

#define BUFSIZE			1024
#define TEMPBUFSIZE		1240
#define MAXHEADERLINE		800
#define MAXFINDSTRING		80
#define MAXDIALOGSTRING		255
#define MAXFILENAME		255
#define MAXENVVAR       40
#define MAXGROUPFILTERSIZE 1500
#define MAXFILTERS      1000

#ifndef WIN32
#define MAX_PATH			1024
#endif

/* this has been increased for XOVER - some lines are *very* long */
#define MAXCOMMLINE		1536
#define MAXINTERNALLINE		180
#define BIGMAXINTERNALLINE  1024
#define MAXOUTLINE		255
#define MAXPOSTLENGTH		60000	/* max length for a posting/mail edit window */
#define MAXBOUNDARYLEN		70	/* max length for MIME boundary  */
#define MAXNEWGROUPSASK		200	/* limit of groups in newgroups dialog box */
#define MAXENCODINGTYPELEN	24	/* max len for encoding type - i.e. Base-64 */
#define MAXCONTENTTYPELEN	48	/* max len for content type - i.e. Application/Postscript */
#define MAXBOUNDARYLINE		70	/* max len for MIME boundary */
#define TOOLBARHEIGHT		27	/* height of toolbar */
#define MAXSTATBARTEXT		60	/* maximum number of chars in status bar text  */
#define MAXTBBUTTONS		20	/* maximum number of tool bar buttons */

#ifdef __cplusplus
extern "C" {

class WVSeenDB;
class WVString;
class WVArticleAction;
#endif

#include <time.h>
#include <commdlg.h>

/* Profile section headings */
#define OLD				"Winvn"
#define ADMIN			"Admin"
#define COMM 			"Communications"
#define AUTH 			"Authorization"
#define INTERFACE		"Interface"
#define PERSONAL 		"Personal"
#define CONFIRM 		"Confirmation"
#define LOGGING 		"Logging"
#define MAIL_ADDRESSES	"Mail Addresses"
#define SMARTFILER 		"Smart Filer"
#define SEARCHES 		"Searches"
#define GROUPLIST   	"Group List"
#define ARTLIST			"Article List"
#define ARTICLE			"Article"
#define COMPOSE			"Compose"
#define CODING 			"Coding"
#define ATTACH			"Attachments"
#define INTERNATIONAL 	"intl"
#define EXECUTE         "URL Execute" 

/* Group sort choices */
#define STR_SORT_DATE      "Date"
#define STR_SORT_SUBJECT   "Subject"
#define STR_SORT_LINES     "Lines"
#define STR_SORT_THREADS   "Threads (strict)"
#define STR_SORT_THREADSUB "Thread/Subject"
#define STR_SORT_ARTNUM    "Article Number"
#define STR_SORT_FROM      "Author"


typedef long TypLineID;

typedef struct structtextselect {
  long LineNum;					/* Line number when selecting text -- Line Ord  */
  int CharNum;					/* Character number when selecting text         */
  /* The 1st LineNum in the Doc and the 1st CharNum in the line are 0   */
} TextSelect;

typedef struct structdoc {
  HANDLE hFirstBlock;			/* handle to first textblock in doc.        */
  HANDLE hLastBlock;			/* unused.                                  */
  unsigned long TotalLines;		/* total # of lines in doc.                 */
  unsigned long LongestLine;		/* # of bytes in the longest line of doc    */
  unsigned long HeaderLines;		/* total number of lines in header of doc
								   (incl. blank line) */
  unsigned long ActiveLines;		/* # of selected or otherwise active lines  */
  unsigned long CountedLines;	/* # of counted lines, as in subscr. groups */
  unsigned long BlockSize;		/* # of bytes in a textblock                */
  unsigned long SplitSize;		/* textblock split point in bytes           */
  HANDLE hCurAddBlock;			/* hBlock to point at which to add lines.   */
  unsigned int AddOffset;		/* offset in bytes for point to add lines   */
  TypLineID AddLineID;			/* LineID of place to add lines.            */
  HANDLE hCurTopScBlock;		/* hBlock of current top line of window     */
  unsigned int TopScOffset;
  TypLineID TopScLineID;
  unsigned long TopLineOrd;		/* ordinal in doc of top line in window     */
  HANDLE hLastSeenBlock;
  unsigned int LastSeenOffset;
  TypLineID LastSeenLineID;
  HANDLE hFindBlock;			/* location of place to start next search   */
  unsigned int FindOffset;		/* for "SearchStr"                          */
  TypLineID FindLineID;
  unsigned int FindTextOffset;
  char SearchStr[MAXFINDSTRING];	/* Search string for current search    */
  unsigned int ScXOffset;		/* # of chars offset for horizontal scroll  */
  unsigned int ScXChars;		/* # of chars/line for current window size  */
  unsigned int ScYLines;		/* # of lines that fit in current window    */
  unsigned int ScXWidth;		/* current size of client area of window    */
  unsigned int ScYHeight;
  HWND hDocWnd;
  struct structdoc *ParentDoc;	/* pointer to parent document            */
  HANDLE hParentBlock;			/* points to line in parent doc          */
  unsigned int ParentOffset;	/* that corresponds to/describes this    */
  TypLineID ParentLineID;		/* document                              */
  unsigned int OffsetToText;
  BOOL InUse;					/* TRUE if this TypDoc in use.           */
  int DocType;					/* DOCTYPE_xxx                           */
  BOOL TextSelected;			/* Indicates text selected               */
  TextSelect BeginSelect;		/* Line and Char where selection began   */
  TextSelect EndSelect;			/* Line and Char where selection ended   */
  HWND hWndTB;					/* Handle of the toolbar child window  (jlg)  */
  HWND hWndFrame;				/* Handle of the parent frame window     */
  char szStatBarText[MAXSTATBARTEXT];	/* status bar text string        */
  int  StatBarPercent;			/* 0 - 100 for thermometer in status bar */
  TypLineID ActiveLineID;		/* Line ID of "active" line in multi-select list (jlg)  */
  TypLineID AnchorLineID;		/* Line ID of "anchor" line in multi-select list        */
  unsigned int SelectedLines;	/* num lines selected (jsc) */
  char ThumbTracking;			/* = TRUE if currently thumb tracking (jsc) */
  int numArtsSaved;				/* used when saving selected articles */
  int savingArtIndex;           /* used when saving/decoding selected articles */

  unsigned long NextTopLine;		/* > 0 if page feed by CTRL-L (shimomai) */

} TypDoc;

typedef struct structblock {
  HANDLE hPrevBlock;			/* handle of previous block, or 0               */
  HANDLE hNextBlock;			/* handle of next block in document, or 0       */
  HANDLE hCurBlock;				/* handle of this block                         */
  long LWAp1;					/* # of used data bytes in block, inc header    */
  long NumLines;				/* # of lines in this block                     */
  long NumActiveLines;			/* # of active lines in this block.             */
  TypDoc *OwnerDoc;				/* pointer to document this block is in.        */
  int eob;						/* end-of-block; must be just before 1st line.  */
  /* Text lines */
  /* Another EOB marker */
} TypBlock;

typedef struct structline {
  int length;					/* Total # of bytes in line, all-inclusive    */
  TypLineID LineID;				/* Unique identifier for this line.           */
  int active;					/* =1 if line should be displayed, else 0     */
  /* Bytes of text */
  /* Another copy of length */
} TypLine;

typedef struct structtext {
  int NameLen;					/* # of bytes of text                          */
} TypText;

typedef struct structgroup {
  char Subscribed;				/* =TRUE if subscribed to this group.   */
  char Selected;				/* =TRUE if selected                    */
  char Determined;				/* =TRUE if group info has been retrieved */
  char Threaded;				/* =TRUE if has thread references */
  int NameLen;					/* # of bytes in group name             */
  TypDoc *SubjDoc;				/* points to doc containing subjs       */
  unsigned long ServerEstNum;	/* est # of arts in server              */
  unsigned long ServerFirst;	/* # of first art that server has.      */
  unsigned long ServerLast;		/* # of last art that server has.       */
  unsigned long uLoadFirst;     /* # of first art loaded from server    */
  unsigned long uLoadLast;      /* # of last art loaded from server     */
  unsigned long HighestPrevSeen;	/* # of highest art server had in last  */
  /* session, from "s<num>" newsrc field  */
  HANDLE header_handle;			/* handle to global block of header array mem */
  HANDLE thread_handle;			/* handle to global block of thread ind. pointers */
  long total_headers;		/* total # of headers in array */
  unsigned long NumUnread;		/* num unseen arts (jsc) */
#ifdef __cplusplus
  //WVString*pGrpName;
  WVArticleAction*pAA;
  WVSeenDB*pSeendb;
#else
  //unsigned int nRanges;			/* # of TypRanges describing seen arts  */
  //unsigned int nSpareRanges;    /* # of extra ranges to overflow before a forced regrow */
  //void*pTmp1;
  void*pTmp2;
  void*pTmp3;
  /* Name of group *//* name of group, zero-terminated       */
  /* Ranges of articles seen *//* array of TypRanges, of seen articles */
  /* Spare Range area so nRanges array can grow if necessary */ 
#endif
} TypGroup;

typedef struct structarticle {
  unsigned long Number;			/* Server's number for this article    */
  char Seen;					/* =TRUE if article seen               */
  char Selected;				/* =TRUE if article selected           */
  TypDoc *ArtDoc;				/* points to doc with actual article   */
  int NameLen;					/* # of bytes in subject line */
  /* Subject line of article */
} TypArticle;

#define HEADER_MESSAGE_ID_LENGTH 100

typedef long huge *thread_array;

typedef thread_array huge *thread_array_p;

typedef char huge *char_p;

typedef struct structrange {
  unsigned long int First;
  unsigned long int Last;
} TypRange;

/* TypMRRFile is used to describe a file; I use it because Windows */
/* doesn't provide much in the way of disk I/O support.  */

typedef struct structMRRfile {
  HFILE hFile;					/* handle to file                            */
  OFSTRUCT of;
  char buf[BUFSIZE];			/* my I/O buffer.                            */
  int bufidx;					/* Index to next place in buf                */
  int bytesread;				/* for reads, # of bytes read in last read   */
  int mode;						/* mode in which to open file.               */
  int eofflag;					/* whether we have reached EOF (read)        */
} TypMRRFile;

#define CtoX(c) (c*CharWidth + SideSpace)
#define LtoY(l) (l*LineHeight + TopSpace)
#define EDITID   1				/* ID of edit box, to identify for return values */
#define MAXMEMONAME 15			/* Number of chars in memo name */
#define MEMONAMECHARS (MAXMEMONAME+2)
#define MAXVIEWS 10
#define END_OF_BLOCK (-1)
#define BLOCK_SIZE  4096
/*  RangeOffset gives the number of bytes from the beginning of
 *  a Group structure to the first Range field, given the length
 *  of the name entry.
 */

// Modified by Holger Liebig (Holger.Liebig@@mch.sni.de) to support WinVN compiling
// on MIPS platform.  was: #define RangeOffset(nlen) (((nlen+2)/2)*2 + sizeof(TypGroup))

//#define RangeOffset(nlen) (((nlen+sizeof(int))/sizeof(int))*sizeof(int)+sizeof(TypGroup))
#define GetGroup(LinePtr) (TypGroup far *) (((char far *) LinePtr) + sizeof (TypLine))
#define GetGroupName(LinePtr) (char far *) (((char far *) LinePtr) + sizeof (TypLine) + sizeof (TypGroup))
//#define GetRangePtr(Group) (TypRange far *) ((char far *) Group + RangeOffset (Group->NameLen))
//#define GetSpareRangePtr(Group) (TypRange far *) ((char far *) Group + RangeOffset (Group->NameLen) + sizeof (TypRange) * (Group->nRanges))
//#define CalcGroupLen(Group) (sizeof (TypLine) + RangeOffset (Group->NameLen) + sizeof (TypRange) * (Group->nRanges) + sizeof (TypRange) * (Group->nSpareRanges) + sizeof (int))
#define GroupLenPtr(LinePtr) (*(int *) ((char *) LinePtr + LinePtr->length - sizeof (int)))
#define GetTextPtr(LinePtr) (char far *) ((char far *) (LinePtr) + sizeof (TypLine) + sizeof (TypText))
#define GetTextLen(LinePtr) ((TypText far *) ((char far *) (LinePtr) + sizeof (TypLine)))->NameLen

#ifdef WINMAIN
#define DEF
#else
#define DEF extern
#endif

DEF TypDoc NetDoc;

#define MRR_SCROLL_LINEUP    0
#define MRR_SCROLL_LINEDOWN  1
#define MRR_SCROLL_PAGEUP    2
#define MRR_SCROLL_PAGEDOWN  3

/* This structure maps between keystrokes and mouse events.
 * From an idea on p. 137 of Charles Petzold's book.
 * If you change the definition, be sure to update NUMKEYS.
 */
#define NUMKEYS 6
#ifndef MAC
DEF struct {
  WORD wVirtKey;
  int CtlState;
  int iMessage;
  WPARAM wRequest;
} key2scroll[NUMKEYS]

#ifdef WINMAIN
=
{
  VK_PRIOR, 0, WM_VSCROLL, SB_PAGEUP,
	VK_NEXT, 0, WM_VSCROLL, SB_PAGEDOWN,
	VK_UP, 0, WM_VSCROLL, SB_LINEUP,
	VK_DOWN, 0, WM_VSCROLL, SB_LINEDOWN,
	VK_LEFT, 0, WM_HSCROLL, SB_LINEUP,
	VK_RIGHT, 0, WM_HSCROLL, SB_LINEDOWN
}

#endif
;
#endif

DEF BOOL Initializing;
#define INIT_DONE                0
#define INIT_READING_NEWSRC      1
#define INIT_ESTAB_CONN          2
#define INIT_SCANNING_NETDOC     3
#define INIT_GETTING_LIST        4
#define INIT_NOT_CONNECTED       5
#define INIT_READY               6

#define MAXGROUPWNDS   4
#define MAXARTICLEWNDS 4
#define MAXPOSTWNDS    4
#define MAXMAILWNDS    4

DEF TypDoc GroupDocs[MAXGROUPWNDS];
DEF TypDoc ArticleDocs[MAXARTICLEWNDS];
DEF int NumGroupWnds;
DEF int NumArticleWnds;

typedef struct textBlockStruct {
  HWND hTextWnd;
  BOOL IsBusy;
  unsigned long numLines;
  unsigned long maxLines;
  unsigned long numBytes;
  unsigned long maxBytes;
  unsigned int maxLineLen;
  char huge *text;				/* big text of all lines */
  unsigned long huge *offset;	/* array of offsets into text array */
} TypTextBlock;

typedef struct _attachmentStruct {
  char fileName[MAXFILENAME];
  char contentType[32];
  char encodingType[16];
  unsigned long numBytes;		/* this is size of fileName */
  BOOL attachInNewArt;
} TypAttachment;

#define HDR_NUM_CONTROLS 12
/* these are indexes into the UI control array */
#define HDR_TO			0		/* has a browse button */
#define HDR_GROUPS		1
#define HDR_SUBJECT		2
#define HDR_FROM		3
#define HDR_ORG			4
#define HDR_REPLYTO		5
#define HDR_CC			6		/* has a browse button */
#define HDR_KEYWORDS	7
#define HDR_SUMMARY		8
#define HDR_DIST		9
#define HDR_FOLLOWTO	10
#define HDR_ATTACH	 	11

#define HDR_NUM_BUTTONS	2
/* these are indexes into the button control array */
#define BTN_TO			0
#define BTN_CC			1

typedef struct _HeaderControlStruct {
  HWND title[HDR_NUM_CONTROLS];
  HWND UI[HDR_NUM_CONTROLS];
  HWND button[HDR_NUM_BUTTONS];
  int yEdge;					/* y-coordinate of bottom of last control */
} TypHeaderControls;

DEF BOOL PrefillCcAddress;
DEF BOOL ShowFromHdr;
DEF BOOL ShowOrgHdr;
DEF BOOL ShowReplyToHdr;
DEF BOOL ShowKeywordsHdr;
DEF BOOL ShowSummaryHdr;
DEF BOOL ShowDistributionHdr;
DEF BOOL ShowFollowupToHdr;

#define MAX_NUM_ATTACHMENTS 10
typedef struct WndEditStruct {
  HWND hWnd;
  HWND hWndEdit;
  int composeType;				/* a doctype.  lets us tell if it's MAIL or FORWARD */
  char dirty;
  char busy;					/* TRUE if busy sending */
  unsigned long bodyOffset;		/* # bytes to skip in body for extra headers */
  TypDoc *Doc;
  TypHeaderControls *headerControls;
  TypAttachment *attachment[MAX_NUM_ATTACHMENTS];
  TypTextBlock *extraHeaders;
  HWND hLastFocusWnd;
  int numAttachments;
  int nextBatchIndex;	    /* for batch post/mails */
} WndEdit;

#define DT_CLEAN 0
#define DT_DIRTY 1

DEF WndEdit WndPosts[MAXPOSTWNDS];
DEF WndEdit WndMails[MAXMAILWNDS];
DEF int NumPostWnds;
DEF int NumMailWnds;

#define DOCTYPE_UNKNOWN  0
#define DOCTYPE_NET      1
#define DOCTYPE_GROUP    2
#define DOCTYPE_ARTICLE  4
#define DOCTYPE_POSTING  8
#define DOCTYPE_MAIL     16
#define DOCTYPE_FORWARD  32
#define DOCTYPE_CANCEL   64

/* Temp buffer for trace info */
#ifdef _DEBUG
DEF char szDebugBuffer[120];
#endif

/* Variables and constants for handling the FSA used to deal with    */
/* talking to the NNTP server.                                       */

DEF int CommState;				/* current state in comm FSA */
DEF BOOL CommBusy;				/* =TRUE if comm line busy interacting w/ server */
DEF BOOL CommDecoding;			/* =TRUE if comm line busy decoding lines from server */
DEF TypDoc *CommDoc;			/* Document currently receiving lines from server   */
DEF HWND hVerDlgList;			/* Handle to info in the Version Dialog Box */

DEF char CommLineIn[MAXCOMMLINE];	/* current input line being built by FSA   */
DEF char *CommLinePtr;			/* pointer to next place to put char in CommLineIn  */
DEF char *CommLineLWAp1;		/* if we get this far, we're at end of buffer       */
DEF char IgnoreCommCh;			/* char to ignore when reading from server          */
DEF char EOLCommCh;				/* char that indicates end of line upon input       */
DEF TypDoc *ActiveGroupDoc;
DEF TypDoc *ActiveArticleDoc;
DEF WndEdit *ComposeWnd;		/* active compose window */

DEF BOOL SendingMail, SendingPost;

#define MAXGROUPNAME 120
DEF char CurrentGroup[MAXGROUPNAME];	/* name of group currently selected on
										   server */
DEF int iSortOption;            /* Article sorting option */

DEF BOOL UsingSocket;			/* =TRUE if using PC/TCP rather than serial I/O     */

DEF BOOL threadp;
DEF BOOL xoverp;


#define HDR_XHDR    1			/* Use XHDR to talk to news server */
#define HDR_XOVER   2			/* Use XOVER to talk to news server */
#define HDR_AUTO    0           /* Try XOVER and if fails use XHDR */
DEF unsigned int force_xhdr;

#define MAXNNTPSIZE 120
#define MAXPREFIXSIZE 40
#define MAXTZONESIZE 60
DEF char NNTPHost[MAXNNTPSIZE];
DEF char NNTPService[MAXNNTPSIZE];
DEF char SMTPHost[MAXNNTPSIZE];
DEF char NNTPUserName[MAXNNTPSIZE];
DEF char NNTPPasswordEncrypted[2 * MAXNNTPSIZE];
DEF char TimeZone[MAXTZONESIZE];
DEF char MAPIPrefix[MAXPREFIXSIZE];
DEF BOOL NNTPSavePassword;
DEF BOOL AuthReqPost;			/* TRUE if we may not post at all unless authenticated */
DEF BOOL AuthReqMail;			/* TRUE if we may not send mail unless authenticated */
DEF BOOL Authenticated			/* TRUE if we've been authenticated by NNTP server */
#ifdef WINMAIN
= FALSE
#endif
 ;
/* This is the name that was successfully authenticated by the NNTP server.
 * It might not be the same as NNTPUserName, if the user has changed the
 * username since the beginning of the session.
 */
DEF char AuthenticatedName[MAXNNTPSIZE];

#define MAILLEN 256
DEF char MailAddress[MAILLEN];
DEF char ReplyTo[MAILLEN];
DEF char UserName[MAILLEN];
DEF char Organization[MAILLEN];

DEF char GenSockDLL[MAXFILENAME];
DEF int ConnectAtStartup;

DEF BOOL EnableGroupFilter;
DEF char *GroupFilter;

/* moved state defns to a separate include file to associate stringtable (jlg) */
#include "wvstates.h"

#define LFN_HELP "WINVN.HLP"

/* variables used in an ad hoc attempt to optimize updating of windows
 * by the input cracking FSA. */

#define UPDATE_TITLE_FREQ	10
#define UPDATE_ART_FREQ		12
#define MAX_IMMEDIATE_UPDATE	2
#define STATUS_UPDATE_FREQ	20

//DEF unsigned int RcvLineCount;
DEF long RcvLineCount;

DEF TypLineID NextLineID		/* LineID to assign to next created line */
#ifdef WINMAIN
= 10664L
#endif
 ;

DEF HINSTANCE hInst;
DEF HWND hWndConf;
//DEF HWND hWndSk;
//DEF HWND hDosWnd;
//DEF HWND hWndDebugComm;       /* handle to Debug Comm window */
//DEF int CommDevice;       /* comm device ID, if using serial I/O */

DEF HANDLE hAccel;				/* handle to main accelerator table */
DEF MSG MainMsg;				/* message returned from GetMessage */


DEF char str[MAXHEADERLINE];	/* general-purpose string buffer */


DEF HCURSOR hSaveCursor;		/* handle to current cursor      */
DEF HCURSOR hHourGlass;			/* handle to hourglass cursor    */


//DEF int X, Y;         /* last cursor position          */
DEF int DragMouseAction;		/* mouse action for dragging      */

#define DRAG_NONE                  0
#define DRAG_SELECT                1
#define DRAG_DESELECT              2
#define SEEN_SELECT                3
#define SEEN_DESELECT              4

DEF POINT ptCursor;				/* x and y coordinates of cursor */

DEF int ViewNew;
DEF int NewArticleWindow;
DEF int SelectAll;
DEF int DoList;
DEF int did_list;
DEF unsigned long article_threshold;
DEF unsigned long min_to_retrieve;
DEF unsigned long est_num_unread;
DEF unsigned long arts_to_retrieve;

// DEF int savingArtIndex; 		/* get rid of global to stop GPF's when multi-tasking */
// DEF int numArtsSaved;        /* now in TypeDoc structure JD 10/30/95 */
// DEF int nextBatchIndex;	    /* for batch post/mails */

DEF BOOL FullNameFrom;
DEF BOOL TrimHeaders;
DEF BOOL ScrollPastHeaders;
DEF BOOL ItalicizeQuotes;
DEF BOOL WrapIncomingArticleText;
DEF int WrapIncomingArticleTextLength;
DEF BOOL WordWrap;
DEF BOOL ConfirmBatchOps;
DEF BOOL ConfirmSaveOnExit;
DEF BOOL ConfirmReplyTo;
DEF BOOL ConfirmDisconnect;
DEF BOOL ShowUnsubscribed;
DEF BOOL SortGroupList;
//DEF BOOL ShowReadArticles;
DEF BOOL DebugComm;
DEF BOOL ShowUnreadOnly;
DEF BOOL SaveNewsrc;
DEF BOOL NewsrcDirty;
DEF BOOL SaveConfig;
DEF BOOL bEnableArticleAction;
DEF char LastArticleTextFind[MAXFINDSTRING];
DEF char LastArticleHeaderFind[MAXFINDSTRING];
DEF char LastGroupNameFind[MAXFINDSTRING];

#define THREAD_COMPLETE    1
#define THREAD_INCOMPLETE  2

/* AskComm says whether to put up the communications dialog box
 * upon starting up.  Options are never, always, and yes, because
 * this is the first time the program has been run.
 #define ASK_COMM_NEVER    0
 #define ASK_COMM_ALWAYS   1
 #define ASK_COMM_INITIAL  2
 DEF int AskComm;
 */
DEF BOOL ArticleFixedFont;

DEF int xScreen, yScreen;
DEF int CaptionHeight;
DEF HFONT hWinVnFont;			/* handle to font for WinVN status bar/etc */
DEF HFONT hCompositionFont;		/* handle to font for Composition body text */
DEF HFONT hListFont;			/* handle to font used in group/art lists */
DEF HFONT hFontArtNormal;		/* handle to font used in Article window - normal
								   text mode. */
DEF HFONT hFontArtQuote;		/* handle to font used in Article window - 
								   comments == Italics. */
DEF HFONT hFontPrint;			/* handle to font used for printing. */
DEF HFONT hFontPrintB;			/* handle to font used for bold printing. */
DEF HFONT hFontPrintS;			/* handle to font used for printing Subject line. */
DEF HFONT hFontPrintI;			/* handle to font used for printing Quoted lines. */
DEF HFONT hStatusFont;			/* handle to font used in status windows */

DEF int WinVnFontSize;
DEF char WinVnFontFace[32];
DEF char WinVnFontStyle[32];
DEF int WinVnLineHeight, WinVnCharWidth;	/* # of windows units for WinVn font */

DEF int CompositionFontSize;
DEF char CompositionFontFace[32];
DEF char CompositionFontStyle[32];
DEF int CompositionLineHeight, CompositionCharWidth;

DEF int ListFontSize;
DEF char ListFontFace[32];
DEF char ListFontStyle[32];
DEF int LineHeight, CharWidth;	/* # of window units for list font */
DEF int TopSpace, SideSpace;	/* # of window units to leave at top and side  */
							   /* of window (for aesthetic purposes)          */

DEF int ArticleFontSize;
DEF char ArticleFontFace[32];
DEF char ArticleFontStyle[32];
DEF unsigned int ArtLineHeight, ArtCharWidth;	/* # of windows units for article font */
DEF unsigned int ArtTopSpace, ArtSideSpace;	/* # of window units to leave at top and side  */

DEF int PrintFontSize;
DEF char PrintFontFace[32];

DEF int StatusFontSize;
DEF char StatusFontFace[32];
DEF char StatusFontStyle[32];
DEF int StatusLineHeight, StatusCharWidth;	/* # of window units for status font */

DEF int StartPen;				/* Similar to TopSpace; where to start pen 1st row */
DEF int ScreenYPixels;			/* used in converting points to logical units */
DEF int PrinterYPixels;			/* used in converting points to logical units */
DEF COLORREF OldTextColor, OldBkColor;
DEF COLORREF NetUnSubscribedColor;	/* color to use for unsubscribed groups  */
DEF COLORREF NetSubscribedColor;	/* color to use for subscribed groups  */
DEF COLORREF ArticleSeenColor;	/* color to use for articles that have been seen */
DEF COLORREF ArticleKilledColor;	/* color for unseen articles that have been marked seen */
DEF COLORREF ArticleUnSeenColor;	/* color to use for articles that have not been seen */
DEF COLORREF ArticleTextColor;	/* color to use for article/post text */
DEF COLORREF StatusTextColor;	/* Color to use for status text */
DEF COLORREF ListBackgroundColor;	/* background color for group/article listings */
DEF COLORREF ArticleBackgroundColor;	/* background color for article/post windows */
DEF COLORREF StatusBackgroundColor;		/* background color for status windows */
DEF COLORREF CustomColors[16];	/* Custom colors definable by user in ChooseColor */
DEF HBRUSH hListBackgroundBrush;
DEF HBRUSH hArticleBackgroundBrush;
DEF HBRUSH hStatusBackgroundBrush;
DEF BOOL LimitedColor;
DEF BOOL UseInverseSelections;
DEF BOOL ShowSplashScreen;

DEF int ReverseVideo;
DEF BOOL ThumbTrack;

DEF BOOL MailDemandLogon;		/* FALSE = permanent logon
								   TRUE  = logon on send mail */
DEF int MailForceType;			/*  Force Mail Type to valid value where
								   Less then zero means
								   default negotiation */
DEF int MailLog;				/* True means append to log files */
DEF int PostLog;				/* where XXXXLogFile is file name */


DEF char MailLogFile[MAXFILENAME];
DEF char PostLogFile[MAXFILENAME];

DEF int fmtDaysB4Mth;
DEF char fmtDateDelim[2];


#define QuoteLineInd  '>'

DEF DLGPROC lpfnWinVnArticleActionDlg;
DEF DLGPROC lpfnWinVnSaveArtDlg;
DEF DLGPROC lpfnWinVnSaveArtsDlg;
DEF DLGPROC lpfnWinVnFindDlg;
DEF DLGPROC lpfnWinVnGenericDlg;
DEF DLGPROC lpfnWinVnSubjectDlg;
DEF DLGPROC lpfnWinVnCommDlg;
DEF DLGPROC lpfnWinVnAuthDlg;
DEF DLGPROC lpfnWinVnDoListDlg;
DEF DLGPROC lpfnWinVnPersonalInfoDlg;
DEF DLGPROC lpfnWinVnExecuteInfoDlg;
DEF DLGPROC lpfnWinVnConfirmationDlg;
DEF DLGPROC lpfnWinVnAppearanceDlg;
DEF DLGPROC lpfnWinVnControlSubclass;
DEF DLGPROC lpfnWinVnThresholdDlg;
DEF DLGPROC lpfnWinVnLogOptDlg;
DEF DLGPROC lpfnWinVnDecodeArtsDlg;
DEF DLGPROC lpfnWinVnAttachDlg;
DEF DLGPROC lpfnWinVnComposePrefsDlg;
DEF DLGPROC lpfnWinVnAttachPrefsDlg;
DEF DLGPROC lpfnWinVnEncodeDlg;
DEF DLGPROC lpfnWinVnExitDlg;
DEF DLGPROC lpfnWinVnMailDlg;
DEF DLGPROC lpfnWinVnSmartFilerDlg;
DEF DLGPROC lpfnWinVnSelectPathDlg;
DEF DLGPROC lpfnWinVnVersionListDlg;
DEF DLGPROC lpfnWinVnArticleDlg;
DEF DLGPROC lpfnWinVnCodingPrefsDlg;
DEF DLGPROC lpfnWinVnArtListDlg;
DEF DLGPROC lpfnWinVnGroupListDlg;
DEF DLGPROC lpfnWinVnHeadersDlg;	// shimomai

DEF char *szAppName;
DEF char szAppProFile[MAXFILENAME];
DEF char szNewsSrc[MAXFILENAME];

DEF char SaveArtFileName[MAXFILENAME];
DEF char DecodePathName[MAXFILENAME];
DEF char DialogString[MAXDIALOGSTRING];
DEF char AddressString[MAXDIALOGSTRING];
DEF char NameString[MAXDIALOGSTRING];
DEF char CcAddress[MAXDIALOGSTRING];
DEF BOOL CcByMail;
DEF int SaveArtAppend;
DEF BOOL SaveNewsrcOnClose;
DEF int ThreadFullSubject;
DEF char ThreadDepthIndicator[2];
DEF BOOL GroupListMultiSelect;
DEF BOOL ArtListMultiSelect;
DEF int SpareRanges;
DEF BOOL TrackSubscribedCrossposts;
DEF BOOL TrackUnsubscribedCrossposts;

DEF TypDoc *FindDoc;
DEF char *NewsgroupsPtr;		/* Used to pass pointer to newsgroup of new posting. */

/* For each new group detected, we create an entry in the following
 * array, NewGroupTable.  Each entry contains a far pointer to a
 * dynamically-allocated global data structure containing a line
 * containing information on this group, in the exact same format
 * as used in the NetDoc.
 */
DEF void huge *huge * NewGroupTable;	/* array of pointers to new group lines */
DEF HANDLE hNewGroupTable;		/* Handle to the above array */
DEF unsigned long nNewGroups;
DEF HANDLE hNewGroupData;
DEF void huge *NewGroupData;
DEF unsigned long HashTableSize;
DEF unsigned long LinesInRC;

typedef struct structHier {
  HANDLE hName;
  long Start;
  unsigned long NumGroups;
  HANDLE hNext;
} TypHier;

#define ADD_SUBSCRIBED_END_OF_SUB	0
#define ADD_SUBSCRIBED_TOP_OF_DOC	1
#define ADD_FIRST_SELECTED       	2

#define LINE_FLAG_SET			0

#define GROUP_ACTION_SUBSCRIBE		0
#define GROUP_ACTION_UNSUBSCRIBE	1
#define GROUP_ACTION_CHECK_ACTIVE	2
#define GROUP_ACTION_GET_GROUPNAMES 3
#define GROUP_ACTION_SELECTED       4	
#define GROUP_ACTION_CATCHUP        5

#define ARTICLE_ACTION_SAVE		0
#define EXTEND				2
#define COMPARE				1
#define NO_COMPARE			0
#define SHOW				1
#define NO_SHOW				0
#define NO_ID				NULL
#define REUSE				1
#define NO_REUSE			0
#define SELECT				1
#define DESELECT			0
#define ENABLE				1
#define DISABLE				0
#define BLOCK_ACTION_SET_ACTIVE		0

DEF int il, ic;
DEF int irow;
DEF int imemo;
DEF int ih;

#if 0
#define MAXCOMMSPEEDCHARS 7
DEF int CommPortID;				/* IDD_COM1 or IDD_COM2 */
DEF int CommParityID;			/* IDD_7EVEN or IDD_8NONE  */
DEF char pszCommSpeed[MAXCOMMSPEEDCHARS];	/* character version of comm speed */
#endif

DEF int idTimer;				/* timer ID            */

#define IncPtr(ptr,byint) (char far *) ptr += byint

/* the MailCtrl global variable is scoped globally after the main window is
   created and is only modified at creation during MailInit in wvmail.c */
DEF struct MailCtrlStruct {
  int MailType;
  int enableMail;
  int enableLogout;
  int enableForward;
  int (*fnMlInit) (HWND hWnd);
  int (*fnMlLogout) (HWND hWnd);
  int (*fnMlClose) (HWND hWnd);
  int (*fnMlWinCreate) (HWND hWnd, TypDoc * Doc, int DocType);
} MailCtrl;

#define MT_NONE 0
#define MT_MAPI 1
#define MT_SMTP 2

#define INACTIVE		0		/* values for CodingState      */
#define DECODE_ACTIVE		1	/* values for Decoding must be */
#define DECODE_SKIPPING		2	/* a contiguous range          */
#define DECODE_PROCESSING	3
#define DECODE_GET_TABLE	4
#define ATTACH_PROCESSING	10	/* Encodes must be > decodes   */
#define ATTACH_SENDING		11
#define ATTACH_READFILE		12
#define ATTACH_WAITING      13

#define CODINGTABLESIZE		64

#define BASE_BLOCK_SIZE		16384	/* base size for the huge data */
typedef struct structcoded {
  char name[MAXFILENAME];		/* original file name from begin line */
  char ident[MAXINTERNALLINE];	/* based on article subject line + author */
  BOOL beginFlag;				/* =TRUE this block is begin of the complete binary */
  BOOL endFlag;					/* =TRUE this block is end of the complete binary */
  int sequence;					/* =-1 if unknown, or # in mult-part file */
  int seqConfidence;			/* confidence of sequence info */
  long estNumLines;				/* info obtained from Lines: header during decode */
  unsigned long numLines;		/* num lines read so far (for status window */
  unsigned long numBytes;		/* # of bytes used in this coded data block */
  unsigned long maxBytes;		/* max # of bytes in this coded data block */
  char huge *data;				/* the huge data array */
  HWND hParentWnd;				/* handle to group wnd that started this */
} TypCoded;

#define MAX_DECODE_BLOCKS  256	/* max # of parts for a decode file */
#define MAX_DECODE_THREADS 75	/* max # of files in one batch decode */
typedef struct decodeThreadStruct {
  char name[MAXFILENAME];		/* original file name from begin line */
  char ident[MAXINTERNALLINE];	/* thread ID based on article subject line */
  char dosFileName[MAXFILENAME];	/* workable DOS file name */
  char contentType[MAXCONTENTTYPELEN];	/* MIME content type */
  char contentDesc[80];			/* MIME content description */
  char customTable[100];		/* custom coding table (if CODE_CUSTOM) */
  int contentEncoding;			/* MIME content-transfer-encoding */
  int numBlocksWritten;			/* number of blocks written to disk, so far */
  int mode;						/* 2nd field of begin header, don't use in DOS */
  int numBlocks;				/* number of coded blocks used in list */
  int expectedNumBlocks;		/* 0 if unknown, or a # if found in headers */
  unsigned long totalBytes;		/* total # of bytes for entire file */
  TypCoded *codedBlockList[MAX_DECODE_BLOCKS];	/* list of ptrs to decode
												   objects */
  TypTextBlock *statusText;		/* buffers for thread status text window */
} TypDecodeThread;

#define CODE_BASE64   1
#define CODE_UU       2
#define CODE_XX       3
#define CODE_CUSTOM   4
#define CODE_QP       5
#define CODE_UNKNOWN  6
#define CODE_NONE     0

#define ENCODE_LINE_LEN  45

/* these correspond to the # members in the static arrays of strings */
/* defined in wvattach.c */
#define NUM_CONTENT_TYPES 10
DEF char *ContentTypes[NUM_CONTENT_TYPES]
#ifdef WINMAIN
 = {
 "Text/Plain",
 "Text/Richtext",
 "Video/MPEG",
 "Video/AVI",
 "Image/JPEG",
 "Image/GIF",
 "Audio/Basic",
 "Application/Zip",
 "Application/PostScript",
 "Other"}
#endif
;

#define NUM_ENCODING_TYPES 5
DEF char *EncodingTypes[NUM_ENCODING_TYPES]
#ifdef WINMAIN
 = {"Base-64", "UU", "XX", "Custom", "None"}
#endif
;

/* coding and attachment globals  */
/* use 256 for arrays to support 2-byte charsets from Japan and Russia */
DEF char xxMap[256], uuMap[256], base64Map[256], customMap[256];
DEF char *CodingMap[7];			/* N+1 for N coding types */
DEF int CodingState;
DEF TypCoded *currentCoded;
DEF TypTextBlock *CodingStatusText[MAX_DECODE_THREADS];
DEF int NumStatusTexts;
DEF char uuTable[CODINGTABLESIZE+1]
#ifdef WINMAIN
  = "`!\"#$%&'()*+,-./0123456789:;<=>?@@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_"
#endif
;
DEF char xxTable[CODINGTABLESIZE+1]
#ifdef WINMAIN
  = "+-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
#endif
;
DEF char base64Table[CODINGTABLESIZE+1]
#ifdef WINMAIN
  = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
#endif
;

DEF BOOL CodingStatusVerbose;
DEF BOOL BlockCodingStatusAlwaysOnTop;
DEF BOOL MinimizeStatusWindows;
DEF BOOL DumbDecode;
DEF BOOL ExecuteDecodedFiles;
DEF BOOL KeepArticleHeaderVisible;
DEF BOOL AlsoDecodeOpenArticles;
DEF BOOL UseSmartFiler;
DEF HWND hCodedBlockWnd;		/* the block coding status window (top center of screen) */
DEF char UserCodingTable[CODINGTABLESIZE + 1];
#define STATUSWIDTH (85*StatusCharWidth)
#define STATUSHEIGHT (8*StatusLineHeight)

DEF char DefaultEncodingType[MAXENCODINGTYPELEN];
DEF int DefaultAttachInNewArt;
DEF char DefaultContentType[MAXCONTENTTYPELEN];
DEF char SubjectTemplate[MAXINTERNALLINE];

DEF char FollowupSaysTemplate[MAXINTERNALLINE];
DEF char ReplySaysTemplate[MAXINTERNALLINE];

DEF long ArticleSplitLength;
DEF char MIMEUUType[MAXENCODINGTYPELEN];		/* experimental types used in MIME header gen */
DEF char MIMEXXType[MAXENCODINGTYPELEN];
DEF char MIMECustomType[MAXENCODINGTYPELEN];

DEF char MIMECharset[80];

DEF BOOL GenerateMIME;
DEF BOOL MIMEUsageSuggestions;
DEF BOOL ReviewAttach;
DEF char* MIMEBoundary;

DEF BOOL UsingMIME;					/* = TRUE if found MIME Version header in incoming art */

#define CUT_HERE_TEXT  "BEGIN --- CUT HERE --- Cut Here --- cut here ---"

#define FAIL  -1
#define SUCCESS   0
#define ABORT 2
#define CONTINUE 3

#define MIME_VERSION "1.0"
#define ADD_TO_EDIT 1			/* used for AddEndedLineToBlock  */
#define ADD_TO_POST 2
#define ADD_TO_FILE 3
#define ADD_PLAIN   0

/* Signature File globals */
DEF int EnableSig;
DEF char SigFileName[MAXFILENAME];
DEF TypTextBlock *Signature;
#define BIG_SIG_FILE 40			/* warning if sig file > this many lines */
#define SIG_DELIMITER "-- "		/* delimiter as defined in Spencer rfc1036++ */

/* Mail List globals  */
DEF TypTextBlock *MailList;
DEF int MailListOrigNum;

/* Smart Filer globals */
DEF TypTextBlock *ExtMapSourceList;
DEF TypTextBlock *ExtMapDosList;
DEF int ExtListOrigNum;
DEF BOOL EnableExtensionConversion;
DEF unsigned int MaxFileNameLen;
DEF unsigned int MaxFileExtLen;
DEF int OnDupeName;
DEF int OnNameTooLong;

#define DUPE_AVOID_NONE			0	/* dupe avoidance list.  these numbers */
#define DUPE_AVOID_NUMBER_EXT	1	/* correspond with posn in droplist */
#define DUPE_AVOID_PREPEND_NUM	2
#define DUPE_AVOID_APPEND_NUM	3

#define SHORTEN_NONE			0	/* name shotrening list.  these numbers */
#define SHORTEN_TRUNCATE		1	/* correspond with posn in droplist */
#define SHORTEN_SKIP_VOWELS		2

/* bitmaps */
DEF HBITMAP DiskBitmaps[5];
DEF HBITMAP FolderBitmaps[3];

/* Printing Globals  */
DEF PRINTDLG pd;				/* Global structure to hold printer defaults */

/* globals for status bar */
typedef struct {
  int dyBorder;					/* System Border Width/Height       */
  int dyBorderx2;				/* System Border Width/Height * 2   */
  int dyBorderx3;				/* System Border Width/Height * 3   */
  int dyBorderx4;				/* System Border Width/Height * 4   */
  int dyBorderx8;				/* System Border Width/Height * 8   */
  int dyBorderx9;				/* System Border Width/Height * 9   */
  int dyBorderx10;				/* System Border Width/Height * 10  */
  int dyStatbar;				/* Status Bar height                */
  int dxStates;					/* Width reserved for State Info    */
  HFONT hFontStatbar;			/* Font used in status bar */
} STATUSPAINT;
DEF STATUSPAINT StatbarPntData;	/* dimensions used in status bar */

/* macros added by jsc */
/* why is there no uitoa!? */
#define uitoa(x,s,b) ultoa((unsigned long)(x),(s),(b))
#define atoui(s) (unsigned int)atol((s))
#define Decoding (CodingState >= DECODE_ACTIVE && CodingState <= DECODE_GET_TABLE)
#define TextBlockLine(b, n) &(b->text[b->offset[n]])
#define IsBright(c) (GetRValue(c) > 180 && GetGValue(c) > 180 && GetBValue(c) > 180)
#define IsDark(c) (GetRValue(c) < 40 && GetGValue(c) < 40 && GetBValue(c) < 40)
#define RectWidth(r) (r.right - r.left)
#define RectHeight(r) (r.bottom - r.top)

#define ENABLE_MENU   MF_BYCOMMAND|MF_ENABLED
#define DISABLE_MENU  MF_BYCOMMAND|MF_DISABLED|MF_GRAYED

/* this is the static system color for light gray (C0,C0,C0) */
#define GRAY_COLOR RGB(192,192,192)
#define BLACK_COLOR RGB(0,0,0)

/* Spoiler by shimomai */
#define SpoilChar 0x0c

/* Group/Article list seperator */
DEF int GroupListSeparator;	//shimomai
DEF int ArtListSeparator1;	//shimomai
DEF int ArtListSeparator2;	//shimomai
DEF int ArtListSeparator3;	//shimomai

/* WWW Client & FTP Client */
DEF char HttpClient[MAXFILENAME];    //shimomai
DEF char FtpClient[MAXFILENAME];     //shimomai
DEF char GopherClient[MAXFILENAME];  //dumoulin
DEF char WaisClient[MAXFILENAME];    //dumoulin
DEF BOOL UsingDDE;			         //shimomai
DEF int DdeServID;			         //shimomai
DEF char DdeServName[MAXFILENAME];   //dumoulin

#define DDECLIENT_NO_DIRECTIVE	0
#define DDECLIENT_USR_SPECIFIED 1
#define DDECLIENT_NETSCAPE	2
#define DDECLIENT_IEXPLORE	3
#define DDECLIENT_MOSAIC    4

/* Table of mappings between value and string */
struct ValStrTable
{
  int value;
  char *text;
};

#include <string.h>
#include <stdio.h>				/* sprintf, etc... */

#ifdef __cplusplus
}
#endif

/*--- Last line of WVGLOB.H -------------------------------------------- */

#endif

/*
 * Local Variables:
 * tab-width: 2
 * end:
 */
@


1.86
log
@added a define for MAXFILTERS
@
text
@d14 1
a14 1
 * $Id: wvglob.h 1.85 1997/03/07 01:51:08 dumoulin Exp dumoulin $
d503 1
a503 1
#define MAXGROUPNAME 80
d519 1
a519 1
#define MAXNNTPSIZE 60
d521 1
a521 1
#define MAXTZONESIZE 20
d588 1
a588 1
DEF char str[255];				/* general-purpose string buffer */
@


1.85
log
@Added support for storing and saving user defined DDE Server ID string
@
text
@d14 1
a14 1
 * $Id: wvglob.h 1.85 1997/03/4 19:23:31 dumoulin Exp $
d80 1
@


1.84
log
@added support to save DDE settings
@
text
@d14 1
a14 1
 * $Id: wvglob.h 1.83 1997/02/14 20:12:31 dumoulin Exp $
d1131 1
@


1.83
log
@Add patches for WinVN .99-9 Beta 2
@
text
@d14 1
a14 1
 * $Id: wvglob.h 1.82 1997/02/08 11:07:37 dumoulin Exp dumoulin $
d1123 8
a1130 2
DEF BOOL UsingDDE;			//shimomai
DEF int DdeServID;			//shimomai
@


1.82
log
@changes for bitmap range support
@
text
@d14 1
a14 1
 * $Id: wvglob.h 1.81 1997/02/06 21:26:15 dumoulin Exp root $
d81 4
@


1.81
log
@mods to support changes from ints to longs
@
text
@d14 1
a14 1
 * $Id: wvglob.h 1.80 1996/08/31 06:52:50 dumoulin Exp $
d563 2
a564 1
DEF unsigned int RcvLineCount;
d829 1
d939 17
d957 5
a961 1
#define NUM_CONTENT_TYPES 10
a970 2
DEF char *ContentTypes[NUM_CONTENT_TYPES];
DEF char *EncodingTypes[NUM_ENCODING_TYPES];
d972 1
a972 1
#ifdef WVCODING
d977 1
a977 1
#ifdef WVCODING
d982 1
a982 1
#ifdef WVCODING
d1119 2
@


1.80
log
@add support for selecting between XOVER and XHDR
@
text
@d1 12
a12 5
/*---- Module WVGLOB.H  -------------------------------------------- */
/* WVGLOB.H contains all the global types and variables for WinVN.   */
/* Stylistically, this should probably be separated into several     */
/* header files, but this is what you've got for now.                */
/* cf WVDOC.C -- it describes some of these structures.              */
d14 2
a16 2
 * $Id: wvglob.h 1.79 1996/08/13 03:49:20 shimomai Exp $
 */
a19 1

d37 1
a37 1
#define GET_WM_COMMAND_HWND(wp, lp) (HWND)lp)
d84 1
d98 4
d141 1
a141 1
  int LineNum;					/* Line number when selecting text -- Line Ord  */
d149 3
a151 3
  unsigned int TotalLines;		/* total # of lines in doc.                 */
  unsigned int LongestLine;		/* # of bytes in the longest line of doc    */
  unsigned int HeaderLines;		/* total number of lines in header of doc
d153 4
a156 4
  unsigned int ActiveLines;		/* # of selected or otherwise active lines  */
  unsigned int CountedLines;	/* # of counted lines, as in subscr. groups */
  unsigned int BlockSize;		/* # of bytes in a textblock                */
  unsigned int SplitSize;		/* textblock split point in bytes           */
d163 1
a163 1
  unsigned int TopLineOrd;		/* ordinal in doc of top line in window     */
d188 1
a188 2
  /*  jlg - toolbar support  */
  HWND hWndTB;					/* Handle of the toolbar child window    */
a189 1
  /* add status bar text string here */
d191 3
a193 4
  int  StatBarPercent;			/* 0 - 100 for thermometer in status bar */		
  /*  jlg - active line in multi-select list box */
  TypLineID ActiveLineID;		/* Line ID of the "active" line in list  */
  TypLineID AnchorLineID;		/* Line ID of the "anchor" line in list  */
d199 1
a199 1
  unsigned int NextTopLine;		/* > 0 if page feed by CTRL-L (shimomai) */
d207 3
a209 3
  int LWAp1;					/* # of used data bytes in block, inc header    */
  int NumLines;					/* # of lines in this block                     */
  int NumActiveLines;			/* # of active lines in this block.             */
d235 6
a240 4
  long ServerEstNum;			/* est # of arts in server              */
  long ServerFirst;				/* # of first art that server has.      */
  long ServerLast;				/* # of last art that server has.       */
  long HighestPrevSeen;			/* # of highest art server had in last  */
d244 12
a255 4
  long total_headers;			/* total # of headers in array */
  long NumUnread;				/* num unseen arts (jsc) */
  unsigned int nRanges;			/* # of TypRanges describing seen arts  */
  unsigned int nSpareRanges;    /* # of extra ranges to overflow before a forced regrow */
d259 1
d263 1
a263 1
  long Number;					/* Server's number for this article    */
a270 9
/* the size of this struct *must* be a power of two for win16.  'huge' */
/* arrays require this. */
/* (+ 1 1 1 105 4 2 4 74 74 100 100 277 277 4) => 1024 */
/* (+ 1 1 1 4 2 4 105 74 30 30 4) => 256 */

#define HEADER_SUBJECT_LENGTH	105
#define HEADER_FROM_LENGTH	74
#define HEADER_EMAIL_LENGTH	74

a271 38
//#define HEADER_BEST_REF_LENGTH HEADER_MESSAGE_ID_LENGTH  /* important that these be the same length */

//#define HEADER_FROBREFLIST_LENGTH 554
//#define HEADER_NEWSGROUPS_LENGTH 512
#define HEADER_FROBREFLIST_LENGTH 277
#define HEADER_NEWSGROUPS_LENGTH 277

/* Offset used to calculate offset for LongestLine */
#define ARTICLE_SUBJECT_OFFSET	40
#define GROUP_NAME_OFFSET	10

typedef struct {
  char Seen;
  char Selected;
  char thread_depth;
  char subject[HEADER_SUBJECT_LENGTH];
  long number;
  unsigned int lines;
  time_t date;
  char from[HEADER_FROM_LENGTH];
  char email[HEADER_EMAIL_LENGTH];
  char message_id[HEADER_MESSAGE_ID_LENGTH];
  char best_ref[HEADER_MESSAGE_ID_LENGTH];
  char frob_ref_list[HEADER_FROBREFLIST_LENGTH];
  char newsgroups[HEADER_NEWSGROUPS_LENGTH];
  TypDoc *ArtDoc;
} TypHeader;

typedef struct LATESTSTRUCT {
  unsigned int lines;
  char from[HEADER_FROM_LENGTH];
  char email[HEADER_EMAIL_LENGTH];
  char subject[HEADER_SUBJECT_LENGTH];
  char message_id[HEADER_MESSAGE_ID_LENGTH];
  char newsgroups[HEADER_NEWSGROUPS_LENGTH];
} LATEST;

typedef TypHeader huge *header_p;
d280 2
a281 2
  long int First;
  long int Last;
d313 1
a313 1
#define RangeOffset(nlen) (((nlen+sizeof(int))/sizeof(int))*sizeof(int)+sizeof(TypGroup))
d316 3
a318 3
#define GetRangePtr(Group) (TypRange far *) ((char far *) Group + RangeOffset (Group->NameLen))
#define GetSpareRangePtr(Group) (TypRange far *) ((char far *) Group + RangeOffset (Group->NameLen) + sizeof (TypRange) * (Group->nRanges))
#define CalcGroupLen(Group) (sizeof (TypLine) + RangeOffset (Group->NameLen) + sizeof (TypRange) * (Group->nRanges) + sizeof (TypRange) * (Group->nSpareRanges) + sizeof (int))
a329 1
DEF LATEST Latest;
d605 4
a608 4
DEF long article_threshold;
DEF long min_to_retrieve;
DEF long est_num_unread;
DEF long arts_to_retrieve;
d626 1
d686 2
a687 2
DEF int ArtLineHeight, ArtCharWidth;	/* # of windows units for article font */
DEF int ArtTopSpace, ArtSideSpace;	/* # of window units to leave at top and side  */
d804 1
a804 1
DEF int nNewGroups;
d807 2
a808 2
DEF unsigned int HashTableSize;
DEF unsigned int LinesInRC;
d812 2
a813 2
  int Start;
  int NumGroups;
d1121 1
a1121 1
*/
@


1.79
log
@add fixes to MIME and wide character support
@
text
@d8 1
a8 1
 * $Id: wvglob.h 1.78 1995/11/09 00:09:37 dumoulin Exp $
a535 1
DEF BOOL force_xhdr;
d537 6
@


1.78
log
@Patches to support Harvey Brydons variable MIME boundaries code
@
text
@d8 1
a8 1
 * $Id: wvglob.h 1.77 1995/11/07 21:40:24 dumoulin Exp dumoulin $
d89 4
d117 10
d190 3
d227 4
a230 4
  unsigned long ServerEstNum;	/* est # of arts in server              */
  unsigned long ServerFirst;	/* # of first art that server has.      */
  unsigned long ServerLast;		/* # of last art that server has.       */
  unsigned long HighestPrevSeen;	/* # of highest art server had in last  */
d234 2
a235 2
  long int total_headers;		/* total # of headers in array */
  unsigned long NumUnread;		/* num unread arts (jsc) */
d244 1
a244 1
  unsigned long Number;			/* Server's number for this article    */
d254 1
d259 4
a262 3
/* important that these be the same length */
#define HEADER_MESSAGE_ID_LENGTH 30
#define HEADER_REFERENCES_LENGTH 30
d264 5
d278 1
a278 1
  unsigned long number;
a279 1
  /*   char date[9];     JD 6/25/93  */
d282 1
d284 3
a286 1
  char references[HEADER_REFERENCES_LENGTH];
d290 9
d358 1
d375 1
a375 1
  WORD wRequest;
d504 1
a504 1
DEF char szDebugBuffer[80];
d538 1
a538 1
#define MAXNNTPSIZE 40
d629 4
a632 4
DEF unsigned long article_threshold;
DEF unsigned long min_to_retrieve;
DEF unsigned long est_num_unread;
DEF unsigned long arts_to_retrieve;
d650 1
a650 1
DEF BOOL ShowReadArticles;
d656 1
d727 1
d763 1
d793 1
d881 1
a881 1
#define IncPtr(ptr,byint) (char far *)ptr += byint
d964 2
a965 1
DEF char xxMap[128], uuMap[128], base64Map[128], customMap[128];
d971 17
a1019 1
//DEF char MIMEBoundary[MAXBOUNDARYLINE];
d1107 9
d1122 7
d1132 4
d1139 6
@


1.77
log
@moved some globals into the TypeDoc structure and changed max file
name from 75 chars to 255
@
text
@d8 1
a8 1
 * $Id: wvglob.h 1.76 1995/08/16 22:33:43 shimomai Exp $
d962 3
a964 1
DEF char MIMEBoundary[MAXBOUNDARYLINE];
@


1.76
log
@added support for clicking on URLs
@
text
@d8 1
a8 1
 * $Id: wvglob.h 1.75 1995/06/06 03:37:57 jcooper Exp shimomai $
d71 1
a71 1
#define MAXFILENAME		75
d174 2
d302 5
a306 1
#define RangeOffset(nlen) (((nlen+2)/2)*2 + sizeof(TypGroup))
d446 1
d503 1
d511 1
d597 5
a601 3
DEF int savingArtIndex;
DEF int numArtsSaved;
DEF int nextBatchIndex;			/* for batch post/mails */
@


1.75
log
@support for new INI option MIMECharset which defaults to ISO-8859-1
@
text
@d8 1
a8 1
 * $Id: wvglob.h 1.74 1995/05/19 22:49:17 dumoulin Exp $
d72 1
d111 1
d551 1
a551 1
//DEF HWND hWndConf;
d723 1
d791 1
d799 1
d1037 6
@


1.74
log
@added variables for marking NewsRC as changed, variable to store
TimeZone info and array changes to allow Range Array to grow
dynamically.
@
text
@d8 1
a8 1
 * $Id: wvglob.h 1.73 1995/04/22 00:05:51 dumoulin Exp $
d937 3
a939 3
DEF char MIMEUUType[80];		/* experimental types used in MIME header gen */
DEF char MIMEXXType[80];
DEF char MIMECustomType[80];
d941 2
@


1.73
log
@Fix problem with Followup-to header appearing below attach header window
@
text
@d8 1
a8 1
 * $Id: wvglob.h 1.72 1995/04/21 21:47:11 dumoulin Exp $
d214 1
d216 1
d219 1
a219 2
  unsigned long NumUnread;		/* num unread arts (jsc) */

d299 8
a314 1
//DEF TypDoc DebugCommDoc;
d494 1
d500 1
d605 1
d758 3
@


1.72
log
@Add cancel capability and warning message when posting window is larger
than 78 characters in width.
@
text
@d8 1
a8 1
 * $Id: wvglob.h 1.70 1995/04/12 20:52:27 dumoulin Exp $
d392 2
a393 2
#define HDR_ATTACH	 	10
#define HDR_FOLLOWTO	11
@


1.71
log
@Allow followup-to header to be displayed during posting window
@
text
@d447 1
@


1.70
log
@Make saving newsrc upon closing group an option
@
text
@d8 1
a8 1
 * $Id: wvglob.h 1.69 1995/02/02 23:21:55 rushing Exp $
d380 1
a380 1
#define HDR_NUM_CONTROLS 11
d393 1
d414 1
@


1.69
log
@# warning comment about mid & ref lengths
@
text
@d8 1
a8 1
 * $Id: wvglob.h 1.68 1995/01/19 02:47:25 jglasser Exp $
d739 1
@


1.68
log
@Jody Glasser's changes of 950113
@
text
@d8 1
a8 1
 * $Id: wvglob.h 1.67 1995/01/03 20:45:35 brydon Exp $
d236 1
@


1.67
log
@new declarations, misc fixes on several old declarations
@
text
@d8 1
a8 1
 * $Id: wvglob.h 1.66 1994/12/12 19:39:13 jcooper Exp $
d165 2
a166 1
  char szStatBarText[MAXSTATBARTEXT];
@


1.66
log
@0.9.99 update
@
text
@d8 1
a8 1
 * $Id: wvglob.h 1.65 1994/11/30 02:55:55 jpiraino Exp $
d44 1
a44 1
#define _int16 int
d49 13
d444 5
d467 1
a467 1
BOOL SendingMail, SendingPost;
d472 1
d925 1
a925 1
BOOL UsingMIME;					/* = TRUE if found MIME Version header in incoming art */
@


1.65
log
@MAXTBBUTTONS
@
text
@d8 1
a8 1
 * $Id: wvglob.h 1.64 1994/11/28 22:01:06 jcooper Exp jpiraino $
d55 1
a55 1
#define MAXHEADERLINE		256
d410 1
d592 1
d609 5
d619 1
a619 1
			   /* of window (for aesthetic purposes)          */
d755 1
d980 1
@


1.64
log
@93.8 update from jcooper
@
text
@d8 1
a8 1
 * $Id: wvglob.h 1.63 1994/11/21 21:20:46 jcooper Exp $
d68 6
a73 5
#define MAXENCODINGTYPELEN 24	/* max len for encoding type - i.e. Base-64 */
#define MAXCONTENTTYPELEN 48	/* max len for content type - i.e. Application/Postscript */
#define MAXBOUNDARYLINE 70		/* max len for MIME boundary */
#define TOOLBARHEIGHT 27		/* height of toolbar */
#define MAXSTATBARTEXT 60		/* maximum number of chars in status bar text  */
@


1.63
log
@93.7 update
@
text
@d8 1
a8 1
 * $Id: wvglob.h 1.62 1994/11/10 01:27:46 rushing Exp $
a504 1
DEF unsigned int TimesWndUpdated;
@


1.62
log
@restart
@
text
@d10 3
d156 1
d202 2
d405 1
d647 1
d986 2
@
