head	1.18;
access;
symbols
	V0-99-8:1.15
	V0-99-7:1.14
	V0-99-6:1.14
	V0-99-5:1.14
	V0-99-4:1.14
	V0-99-2:1.14
	V0-99-1:1.13
	V0-93-14:1.13
	V0-93-13:1.13
	V0-93-12:1.13
	V0-93-11:1.12
	V0-93-10:1.11
	V0-93-9:1.11
	V0-93-8:1.11
	V0-93-7:1.10
	V0-93-5:1.9
	V80:1.1
	V76d:1.1;
locks; strict;
comment	@ * @;


1.18
date	97.04.05.00.26.27;	author dumoulin;	state Exp;
branches;
next	1.17;

1.17
date	97.02.08.11.08.48;	author dumoulin;	state Exp;
branches;
next	1.16;

1.16
date	97.02.06.21.19.25;	author dumoulin;	state Exp;
branches;
next	1.15;

1.15
date	96.08.13.04.26.40;	author brydon;	state Exp;
branches;
next	1.14;

1.14
date	95.03.29.00.36.04;	author dumoulin;	state Exp;
branches;
next	1.13;

1.13
date	95.01.03.20.34.25;	author brydon;	state Exp;
branches;
next	1.12;

1.12
date	94.12.22.17.54.28;	author rushing;	state Exp;
branches;
next	1.11;

1.11
date	94.11.28.22.01.06;	author jcooper;	state Exp;
branches;
next	1.10;

1.10
date	94.11.21.21.20.46;	author jcooper;	state Exp;
branches;
next	1.9;

1.9
date	94.11.10.01.57.17;	author rushing;	state Exp;
branches;
next	;


desc
@winvn version 0.76 placed into RCS
@


1.18
log
@cosmetic formatting changes
@
text
@/* -*- C++ -*-
/*
 * $Id: ini_news.cpp 1.17 1997/02/08 11:08:48 dumoulin Exp $
 */

/******************************************************************** */
/* Filename: Ini-News.cpp */

#include <windows.h>
#include <windowsx.h>
#include "wvglob.h"
#include "winvn.h"
#pragma hdrstop
#include "wvclass.h"
#include <stdlib.h>
#include <direct.h>
#include <time.h>
#include <commdlg.h>

/*************************************************************************
  This function looks for the .Ini file and the NewsSrc file.  Each file
  is searched for separately and they need not be in the same directory.
  If neither file can be found, the user is asked to locate the files with
  an OPENFILENAME dialog box.  Once the location of the NewSrc file is
  known, it is saved in the WinVN.ini file.

  The search order is:
    Command Line (one or two entries)
    Environment variable "WINVN" or "winvn" (case sensitive in Win16)
    Current Working directory (set by "Properties" dialog)
    Application Directory
    Windows Directory (eg. C:\WINDOWS)
    Windows System Directory (eg. C:\WINDOWS\SYSTEM, \System32)
    the path
    result of an "Open File" dialog box (WinVN.ini only)
    the .INI file (NewSrc only)
    result of an "Open File" dialog box (NewSrc only)


  If the Function is sucessful, the szAppProFile variable contains the path and
  filename of the .Ini file and the szNewsSrc variable contains the path and
  filename of the NewSrc file.  If either file does not exist, the "Open
  File" dialog creates each file.  In all cases, the name of the NewSrc
  file is written to the .INI file for future accesses.

  RETURNS:  zero if sucessful
            -1 if one or both files could not be found

  NOTE: The command line allows for the use of unique names for the standard
        WinVn.ini and NewSrc files. The entry order is .Ini and then NewSrc.

 Command line examples are as follows:

  1.  c:\WinVn\My.Ini<sp>c:\Tom\NewsSrc.Tom  => both unique names

  2.  c:\Tom<sp>c:\Tom\NewsSrc.Tom        => standard .Ini, unique NewSrc
  2a. c:\Tom\<sp>c:\Tom\NewsSrc.Tom          (same, less ambiguous)

  3.  c:\Tom\TomVn.ini                    => unique .Ini, Standard NewSrc

  4.  c:\Tom                              => standard .Ini, Standard NewSrc
  4a. c:\Tom\                                (same, less ambiguous)

  In the first example, if both files exist, szAppProFile = "c:\WinVn\My.Ini",
  szNewsSrc = "c:\Tom\NewsSrc.Tom" and the function returns Zero.

 For all specification types other than the Command line:
 1. Only one entry may be made.
 2. The "Working directory" spec doesn't allow trailing "\".
 3. Syntax and algorithm are otherwise the same as for Command Line.

**************************************************************************/

static struct ValStrTable SortOptionTable[] =
{
  IDM_SORT_DATE,      STR_SORT_DATE,
  IDM_SORT_SUBJECT,   STR_SORT_SUBJECT,
  IDM_SORT_LINES,     STR_SORT_LINES,
  IDM_SORT_THREADS,   STR_SORT_THREADS,
  IDM_SORT_THREADSUB, STR_SORT_THREADSUB,
  IDM_SORT_ARTNUM,    STR_SORT_ARTNUM,
  IDM_SORT_FROM,      STR_SORT_FROM
};

#define SORTOPTIONTABLESIZE (sizeof(SortOptionTable) / sizeof(SortOptionTable[0]))

#define CHECK_DIR 1
#define CHECK_FILE 2

/*  Routine to test existence of filename on path choice */
BOOL 
ProbeFilePath (char *szFileSrc, const char *szPath, const char *szFname, int iChk)
{
  DWORD stat;
  OFSTRUCT ofb;

  /* Check for path in the form of "x:\dir\...\dir[\]" */
  if (iChk & CHECK_DIR) {
	int i;
	lstrcpy (szFileSrc, szPath);
	i = lstrlen (szFileSrc);
	if (i) {
	  if (szFileSrc[i - 1] == '\\') {	/* Trailing '\', it must be a directory */
		lstrcat (szFileSrc, szFname);
		if (OpenFile (szFileSrc, &ofb, OF_EXIST) != HFILE_ERROR) {
		  lstrcpy (szFileSrc, ofb.szPathName);
		  return (TRUE);
		}
		else
		  return (FALSE);
	  }
	}
#ifdef GetFileAttributes		/*  32 bit  */
	stat = GetFileAttributes (szFileSrc);
	if ((stat != 0xFFFFFFFF) && (stat & FILE_ATTRIBUTE_DIRECTORY))
#else /*  16 bit  */
	stat = 0;					/* avoid 'unreferenced' warning */
	if (TRUE)
#endif
	{
	  lstrcat (szFileSrc, "\\");
	  lstrcat (szFileSrc, szFname);
	  if (OpenFile (szFileSrc, &ofb, OF_EXIST) != HFILE_ERROR) {
		lstrcpy (szFileSrc, ofb.szPathName);
		return TRUE;
	  }
	}
  }

  /* Check for non-directory file in the form of "x:\dir\...\dir\file.ext" */
  if (iChk & CHECK_FILE) {
	lstrcpy (szFileSrc, szPath);

#ifdef GetFileAttributes
	if (GetFileAttributes (szFileSrc) & FILE_ATTRIBUTE_DIRECTORY)
	  return (FALSE);
#endif

	if (OpenFile (szFileSrc, &ofb, OF_EXIST) != HFILE_ERROR) {
	  lstrcpy (szFileSrc, ofb.szPathName);
	  return TRUE;
	}
  }
  return FALSE;
}



/*  See if we can find the WinVN.ini and NewSrc files... */
int 
LocIniSrc (HINSTANCE hInstance, LPSTR lpCmdLine)
{
  char szWPath[MAX_PATH];

  const char szIniDef[] = "WinVN.ini";	/* ' .ini' default filename */
  const char szNewsDefault[] = "newsrc";	/* 'newsrc' default filename  */

  BOOL fProfileFound = FALSE;
  BOOL fNewsFound = FALSE;

  int iRvalue;

  LPSTR lpEnvStr;
  //OFSTRUCT ofOpenBuffer;

  //ofOpenBuffer.cBytes = sizeof (OFSTRUCT);


  if (*lpCmdLine != '\0') {		/* Look at the Command Line - path | path and file */
	lstrcpy (szWPath, lpCmdLine);
//	TRACE1 ("Checking Command Line: %s\n", szWPath);
	iRvalue = lstrlen (szWPath);

	while (iRvalue--) {			/* check for two arguments */
	  if (szWPath[iRvalue] == ' ') {
		szWPath[iRvalue] = 0;
		break;
	  }
	}

	if (iRvalue > 0) {			/* two entries on command line - check for path and/or path\file */
	  fProfileFound = ProbeFilePath (szAppProFile, szWPath,
									 szIniDef, CHECK_DIR | CHECK_FILE);
	  fNewsFound = ProbeFilePath (szNewsSrc, &szWPath[iRvalue + 1],
								  szNewsDefault, CHECK_FILE);
	}

	else {						/* single command line entry - path and/or path\file */
	  fProfileFound = ProbeFilePath (szAppProFile, szWPath,
									 szIniDef, CHECK_DIR | CHECK_FILE);
	  fNewsFound = ProbeFilePath (szNewsSrc, szWPath,
								  szNewsDefault, CHECK_DIR);
	}
	if (fProfileFound && fNewsFound)
	  return 0;
  }



  /* Look in the Environment for a path */
  if ((lpEnvStr = getenv ("winvn")) == NULL) {
	lpEnvStr = getenv ("WINVN");
  }

  if (lpEnvStr && (iRvalue = lstrlen (lpEnvStr))) {
	/* found environment varible, check it out */
	lstrcpy (szWPath, lpEnvStr);

//	TRACE1 ("Checking environment var: %s\n", szWPath);
	if (!fProfileFound)
	  fProfileFound = ProbeFilePath (szAppProFile, szWPath,
									 szIniDef, CHECK_DIR | CHECK_FILE);

//	TRACE1 ("Checking for newsrc in %s\n", szWPath);
	if (!fNewsFound)
	  fNewsFound = ProbeFilePath (szNewsSrc, szWPath,
								  szNewsDefault, CHECK_DIR);
	if (fProfileFound && fNewsFound)
	  return 0;
  }



  /* Look in the current working Directory */
  if (_getcwd (szWPath, sizeof (szWPath))) {
//	TRACE1 ("Checking current working directory: %s\n", szWPath);
	if (!fProfileFound)
	  fProfileFound = ProbeFilePath (szAppProFile, szWPath,
									 szIniDef, CHECK_DIR);

	if (!fNewsFound)
	  fNewsFound = ProbeFilePath (szNewsSrc, szWPath,
								  szNewsDefault, CHECK_DIR);

	if (fProfileFound && fNewsFound)
	  return 0;
  }



  /* Look in WinVn's Directory */
  if (iRvalue = GetModuleFileName (hInstance, szWPath, sizeof (szWPath))) {
	while (iRvalue--) {			/* remove the module name */
	  if (szWPath[iRvalue] == '\\') {
		szWPath[++iRvalue] = 0;
		break;
	  }
	}

//	TRACE1 ("Checking WinVN directory: %s\n", szWPath);
	if (!fProfileFound)
	  fProfileFound = ProbeFilePath (szAppProFile, szWPath,
									 szIniDef, CHECK_DIR);

	if (!fNewsFound)
	  fNewsFound = ProbeFilePath (szNewsSrc, szWPath,
								  szNewsDefault, CHECK_DIR);

	if (fProfileFound && fNewsFound)
	  return 0;
  }



  /* Look in the Windows Directory */
  if (GetWindowsDirectory (szWPath, sizeof (szWPath))) {
//	TRACE1 ("Checking Windows directory: %s\n", szWPath);
	if (!fProfileFound)
	  fProfileFound = ProbeFilePath (szAppProFile, szWPath,
									 szIniDef, CHECK_DIR);

	if (!fNewsFound)
	  fNewsFound = ProbeFilePath (szNewsSrc, szWPath,
								  szNewsDefault, CHECK_DIR);

	if (fProfileFound && fNewsFound)
	  return 0;
  }



  /* Look in the Windows System Directory */
  if (GetSystemDirectory (szWPath, sizeof (szWPath))) {
//	TRACE1 ("Checking Windows System directory: %s\n", szWPath);
	if (!fProfileFound)
	  fProfileFound = ProbeFilePath (szAppProFile, szWPath,
									 szIniDef, CHECK_DIR);

	if (!fNewsFound)
	  fNewsFound = ProbeFilePath (szNewsSrc, szWPath,
								  szNewsDefault, CHECK_DIR);

	if (fProfileFound && fNewsFound)
	  return 0;
  }



  /* Try the current path */
  szWPath[0] = '\0';
//  TRACE0("Checking path\n");
  if (!fProfileFound)
	fProfileFound = ProbeFilePath (szAppProFile, szWPath,
								   szIniDef, CHECK_DIR);

  if (!fNewsFound)
	fNewsFound = ProbeFilePath (szNewsSrc, szWPath,
								szNewsDefault, CHECK_DIR);

  if (fProfileFound && fNewsFound)
	return 0;
  else {						/* Ask the user if he wants to create the files */
	static OPENFILENAME ofn;

	memset (&ofn, 0, sizeof (ofn));
    ofn.lStructSize = sizeof (OPENFILENAME);
	//ofn.hwndOwner = NULL;
	//ofn.hInstance = NULL;
	/* ofn.lpstrFilter       = (Filled in below)  */
	//ofn.lpstrCustomFilter = NULL;
	//ofn.nMaxCustFilter = 0;
	//ofn.nFilterIndex = 0;
	/* ofn.lpstrFile         = (Filled in below)  */
	/* ofn.nMaxFile          = (Filled in below)  */
	//ofn.lpstrFileTitle = NULL;
	//ofn.nMaxFileTitle = 0;
	ofn.lpstrInitialDir = szWPath;
	ofn.lpstrTitle = "Please identify existing or new filename";
	ofn.Flags =
	  OFN_CREATEPROMPT | OFN_HIDEREADONLY
#ifdef OFN_NONETWORKBUTTON
	  | OFN_NONETWORKBUTTON
#endif
	  | OFN_NOREADONLYRETURN;
	//ofn.nFileOffset = 0;
	//ofn.nFileExtension = 0;
	/* ofn.lpstrDefExt       = (Filled in below)  */
	//ofn.lCustData = 0L;
	//ofn.lpfnHook = NULL;
	//ofn.lpTemplateName = NULL;

	if (!fProfileFound) {
	  char szCreated[32];

	  ofn.lpstrFilter =
		"Init Files (*.INI)\0*.ini\0All Files (*.*)\0*.*\0";
	  lstrcpy (szAppProFile, szIniDef);
	  ofn.lpstrFile = szAppProFile;
	  ofn.nMaxFile = sizeof (szAppProFile);
	  ofn.lpstrDefExt = "INI";

//	  TRACE0("Checking user-specified filename\n");
	  fProfileFound = GetOpenFileName (&ofn);
	  if (fProfileFound) {
		char dbuffer[9];
		char tbuffer[9];
		OFSTRUCT ofs;

		/* ofn.lpstrInitialDir = ...  */

		if (OpenFile (szAppProFile, &ofs, OF_EXIST) == HFILE_ERROR) {
		  _strdate (dbuffer);
		  _strtime (tbuffer);

//		  TRACE1 ("Writing new WinVN.INI file to %s\n", szAppProFile);
		  lstrcpy (szCreated, dbuffer);
		  lstrcat (szCreated, " ");
		  lstrcat (szCreated, tbuffer);

		  WritePrivateProfileString (ADMIN, "Created",
									 szCreated, szAppProFile);
		}
	  }
	}


	/* Look for NewSrc spec in WinVN.INI */
	if (fProfileFound && !fNewsFound) {
//	  TRACE1 ("Checking %s for NewSrc file", szAppProFile);
	  if (GetPrivateProfileString (ADMIN, "Newsrc", "",
							 szNewsSrc, sizeof (szNewsSrc), szAppProFile)) {
		OFSTRUCT ofs;
        memset (&ofs, 0, sizeof (ofs));
        ofs.cBytes = sizeof(ofs);
		fNewsFound = (OpenFile (szNewsSrc, &ofs, OF_EXIST) != HFILE_ERROR);
	  }
	}


	/* Give up?  Ask the user where the file is... */
	if (fProfileFound && !fNewsFound) {
	  ofn.lpstrFilter =
		"No-ext Files (*.)\0*.\0All Files (*.*)\0*.*\0";
	  ofn.nFilterIndex = 0;
	  lstrcpy (szNewsSrc, szNewsDefault);
	  ofn.lpstrFile = szNewsSrc;
	  ofn.nMaxFile = sizeof (szNewsSrc);
	  ofn.lpstrDefExt = "";

	  fNewsFound = GetOpenFileName (&ofn);
	  if (fNewsFound) {
		HFILE hf;
		OFSTRUCT ofs;
		if (OpenFile (szNewsSrc, &ofs, OF_EXIST) == HFILE_ERROR) {
		  hf = OpenFile (szNewsSrc, &ofs, OF_CREATE);
		  /* write some default newsgroups... */
		  _lwrite (hf, "news.announce.newusers: s0\r\n", 28);
		  _lwrite (hf, "news.newusers.questions: s0\r\n", 29);
		  _lclose (hf);
		}
	  }
	}
  }

  if (fProfileFound && fNewsFound)
	return 0;
  return (-1);
}


/*  Locate the WinVN.ini and NewSrc files... */
int 
fnLocateFiles (HINSTANCE hInstance, LPSTR lpCmdLine)
{
  int result;
  result = LocIniSrc (hInstance, lpCmdLine);
  if (!result) {
//	TRACE1 ("WinVN.INI file located: %s\n", szAppProFile);
//	TRACE1 ("NewSrc file located:    %s\n", szNewsSrc);
	WritePrivateProfileString (ADMIN, "Newsrc",
							   szNewsSrc, szAppProFile);
  }
  return (result);
}


// Read the group sort option from the .ini file
int ReadSortOption(const char* sDefSort, const char* sGrp)
{
  int retval;
  int i;
  char szTmp[MAXGROUPNAME+4];
  char mybuf[32];
  static char sGlobDefSort[32];

  if(!sGlobDefSort[0])
  {
    lstrcpy(szTmp, "N: ");
    lstrcat(szTmp, NNTPHost);
    GetPrivateProfileString(szTmp, "DefaultArtSort", sDefSort, sGlobDefSort, sizeof(sGlobDefSort), szAppProFile);
  }

  lstrcpy(szTmp,"G: ");
  lstrcat(szTmp, sGrp);
  GetPrivateProfileString(szTmp, "SortOption", sGlobDefSort, mybuf, sizeof(mybuf), szAppProFile);
  retval = atoi(mybuf);
  if(!retval)
  {
    for(i = 0; i < SORTOPTIONTABLESIZE; i++)
    {
      if(!strcmp(mybuf, SortOptionTable[i].text))
      {
        return SortOptionTable[i].value;
      }
    }
    retval = IDM_SORT_ARTNUM; // gotta return something valid...
  }
  return retval;
}


// Write the group sort option to the .ini file
void WriteSortOption(int iOpt, const char* sGrp)
{
  char szTmp[MAXGROUPNAME+4];
  lstrcpy(szTmp,"G: ");
  lstrcat(szTmp, sGrp);
  for(int i = 0; i < SORTOPTIONTABLESIZE; i++)
  {
    if(iOpt == SortOptionTable[i].value)
    {
      WritePrivateProfileString(szTmp, "SortOption", SortOptionTable[i].text, szAppProFile);
      return;
    }
  }
  WritePrivateProfileString(szTmp, "SortOption", STR_SORT_ARTNUM, szAppProFile); // write something valid
}


// The following persistent classes get default values from the WinVN.ini file, work as
//  their builtin type/base class members do, then write values back to the .ini file
//  (if the data has changed) when the object is destructed.


// Persistent BOOL class


WMemPool WVPersBOOL::m_ClassPool(sizeof(WVPersBOOL), POOLBLOCKSIZE / sizeof(WVPersBOOL));


WVPersBOOL::WVPersBOOL(const char*sSection, const char*sKey, BOOL bDefault)
: m_bModified(FALSE), m_sSection(sSection), m_sKey(sKey)
{
  m_bValue = GetPrivateProfileInt(sSection, sKey, bDefault, szAppProFile);
}


WVPersBOOL::~WVPersBOOL()
{
  if(m_bModified)  // only need to rewrite info if data is modified...
  {
    WritePrivateProfileInt(m_sSection, m_sKey, m_bValue, szAppProFile);
  }
}


WVPersBOOL& WVPersBOOL::operator=(const WVPersBOOL& rhs)
{
  m_bModified = TRUE;
  
  m_bValue = rhs.m_bValue;
  return *this;
}


WVPersBOOL& WVPersBOOL::operator=(const BOOL rhs)
{
  m_bModified = TRUE;

  m_bValue = rhs;
  return *this;
}


WVPersBOOL& WVPersBOOL::operator|=(const BOOL rhs)
{
  m_bModified = TRUE;

  m_bValue |= rhs;
  return *this;
}


WVPersBOOL& WVPersBOOL::operator&=(const BOOL rhs)
{
  m_bModified = TRUE;

  m_bValue &= rhs;
  return *this;
}



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


1.17
log
@persistent class support in ini file
@
text
@d3 1
a3 1
 * $Id: ini_news.cpp 1.16 1997/02/06 21:19:25 dumoulin Exp dumoulin $
a10 3

//extern "C"
//{
a12 2
//}

a13 1

@


1.16
log
@add persistent class to support reading and writing winvn.ini file
@
text
@d3 1
a3 1
 * $Id: ini_news.cpp 1.15 1996/08/13 04:26:40 brydon Exp $
d7 1
a7 1
/* Filename: Ini-News.c */
d159 1
a159 1
  char szWPath[256];
d170 1
a170 1
  OFSTRUCT ofOpenBuffer;
d172 1
a172 1
  ofOpenBuffer.cBytes = sizeof (OFSTRUCT);
d321 4
a324 3
	ofn.lStructSize = sizeof (OPENFILENAME);
	ofn.hwndOwner = NULL;
	ofn.hInstance = NULL;
d326 3
a328 3
	ofn.lpstrCustomFilter = NULL;
	ofn.nMaxCustFilter = 0;
	ofn.nFilterIndex = 0;
d331 2
a332 2
	ofn.lpstrFileTitle = NULL;
	ofn.nMaxFileTitle = 0;
d341 2
a342 2
	ofn.nFileOffset = 0;
	ofn.nFileExtension = 0;
d344 3
a346 3
	ofn.lCustData = 0L;
	ofn.lpfnHook = NULL;
	ofn.lpTemplateName = NULL;
d389 2
d559 1
@


1.15
log
@add support to save Sort Options between sessions
@
text
@d3 1
a3 1
 * $Id: ini_news.cpp 1.14 1995/03/29 00:36:04 dumoulin Exp $
d20 1
d493 63
@


1.14
log
@Comment out all Trace options in preparation of WinVN 1.0 Release
@
text
@d3 1
a3 1
 * $Id: ini_news.cpp 1.13 1995/01/03 20:34:25 brydon Exp $
d12 2
a13 2
extern "C"
{
d16 1
a16 1
}
d79 13
d438 54
@


1.13
log
@environment variable pointer fix
made ANSI C++
@
text
@d3 1
a3 1
 * $Id: $
d163 1
a163 1
	TRACE1 ("Checking Command Line: %s\n", szWPath);
d201 1
a201 1
	TRACE1 ("Checking environment var: %s\n", szWPath);
d206 1
a206 1
	TRACE1 ("Checking for newsrc in %s\n", szWPath);
d218 1
a218 1
	TRACE1 ("Checking current working directory: %s\n", szWPath);
d242 1
a242 1
	TRACE1 ("Checking WinVN directory: %s\n", szWPath);
d259 1
a259 1
	TRACE1 ("Checking Windows directory: %s\n", szWPath);
d276 1
a276 1
	TRACE1 ("Checking Windows System directory: %s\n", szWPath);
d293 1
a293 1
  TRACE0("Checking path\n");
d343 1
a343 1
	  TRACE0("Checking user-specified filename\n");
d356 1
a356 1
		  TRACE1 ("Writing new WinVN.INI file to %s\n", szAppProFile);
d370 1
a370 1
	  TRACE1 ("Checking %s for NewSrc file", szAppProFile);
d417 2
a418 2
	TRACE1 ("WinVN.INI file located: %s\n", szAppProFile);
	TRACE1 ("NewSrc file located:    %s\n", szNewsSrc);
@


1.12
log
@newsrc not being found via environment variable.
@
text
@d1 1
a1 1

d3 1
a3 1
 * $Id: ini_news.c 1.11 1994/11/28 22:01:06 jcooper Exp rushing $
d11 3
d16 2
a24 19
#ifdef WIN32					/* Looks like SDK defines "WIN32", MSVCNT defines "_WIN32" */
#ifndef _WIN32
#define _WIN32
#endif
#endif

#ifndef TRACE
#ifdef _DEBUG
char szDebugBuffer[80];
#define TRACE(parm1,parm2) {\
    wsprintf(szDebugBuffer,parm1,parm2);\
    OutputDebugString(szDebugBuffer);}
#else
#define TRACE(parm1,parm2)
#endif
#endif

#define ADMIN "Admin"

d84 1
a84 1
ProbeFilePath (char *szFileSrc, char *szPath, char *szFname, int iChk)
d147 2
a148 2
  char szIniDef[] = "WinVN.ini";	/* ' .ini' default filename */
  char szNewsDefault[] = "newsrc";	/* 'newsrc' default filename  */
d161 1
a161 1
  if (*lpCmdLine != '\0') {		/* Look at the Command Line *//* path | path and file */
d163 1
a163 1
	TRACE ("Checking Command Line: %s\n", szWPath);
d197 2
a198 1
  if (lpEnvStr && (iRvalue = lstrlen (lpEnvStr))) {		/* found environment varible, check it out */
d201 1
a201 1
	TRACE ("Checking environment var: %s\n", szWPath);
d206 1
a206 1
	TRACE ("Checking for newsrc in %s\n", szWPath);
a207 4
#if 0 /* why the _end_ of szWPath ? SMR 941222 */
	  fNewsFound = ProbeFilePath (szNewsSrc, &szWPath[iRvalue + 1],
				      szNewsDefault, CHECK_DIR | CHECK_FILE);
#endif
d209 1
a209 2
				      szNewsDefault, CHECK_DIR | CHECK_FILE);

d218 1
a218 1
	TRACE ("Checking current working directory: %s\n", szWPath);
d242 1
a242 1
	TRACE ("Checking WinVN directory: %s\n", szWPath);
d259 1
a259 1
	TRACE ("Checking Windows directory: %s\n", szWPath);
d276 1
a276 1
	TRACE ("Checking Windows System directory: %s\n", szWPath);
d293 1
a293 1
  TRACE ("Checking path\n", "");
d343 1
a343 1
	  TRACE ("Checking user-specified filename\n", "");
d356 1
a356 1
		  TRACE ("Writing new WinVN.INI file to %s\n", szAppProFile);
d370 1
a370 1
	  TRACE ("Checking %s for NewSrc file", szAppProFile);
d417 2
a418 2
	TRACE ("WinVN.INI file located: %s\n", szAppProFile);
	TRACE ("NewSrc file located:    %s\n", szNewsSrc);
d424 6
@


1.11
log
@93.8 update from jcooper
@
text
@d3 1
a3 1
 * $Id: ini_news.c 1.10 1994/11/21 21:20:46 jcooper Exp $
d219 1
d221 1
d223 4
a226 1
								  szNewsDefault, CHECK_DIR | CHECK_FILE);
@


1.10
log
@93.7 update
@
text
@d3 1
a3 1
 * $Id: ini_news.c 1.9 1994/11/10 01:57:17 rushing Exp $
d334 1
a334 1
	  OFN_CREATEPROMPT
@


1.9
log
@restart
@
text
@d6 1
a6 1
/*#*xx******************************************************************* */
d10 5
a16 1
#include "WvGlob.h"
@
