#ifndef _PTTFIND_H
#define _PTTFIND_H
#endif

#ifdef __cplusplus
extern "C" {
#endif

#include <stdio.h>
#include <windows.h>
#include <windowsx.h>
#include <ctype.h>
#include <string.h>
#include <time.h>
#include <stdarg.h>
#include <io.h>
#include <direct.h>
#include "..\cporc110\pborca.h"
#include "..\cphst110\cphstr.h"

#ifdef __cplusplus
}
#endif

// TypeDefs First
typedef char *HPSTR ;
typedef PBINT (WINAPI *LPRULE)(HPSTR, LPSTR, long, LPSTR, LPSTR) ;
typedef PBINT (WINAPI *LPREPLACERULE)(HPSTR, long, LPSTR, LPSTR, LPSTR, LPSTR) ;

/* ========================================================================	*/
/* Typedef of PB Structure Object
/* ========================================================================	*/
typedef struct strPBObjectInfo
	{
		LPSTR lpLibName ;
		int iObjType ;
		LPSTR lpObjName ;
		LPSTR lpDateTimeModified ;
		LPSTR lpComments ;
	} PBObjectInfo ;

typedef PBObjectInfo *HPPBObjectInfo ;
typedef PBObjectInfo *LPPBObjectInfo ;

#define	MAX_CONTEXT_LENGTH	256
#define	ACCEPT_PHRASE		0
#define	REJECT_PHRASE		1
#define	ERROR_PHRASE		-1
#define MAX_TOKENS			25

/*  Declare global variable to hold Handle to DLL  */
#ifdef _CPFND01_C
	HANDLE *hDLL ;
	char szMsg[1024] ;
	HPSTR lpHStrStr ;
#else
	extern HANDLE *hDLL ;
	extern char szMsg[1024] ;
	extern HPSTR lpHStrStr ;
#endif

#ifdef __cplusplus
extern "C" {
#endif

/*  Cross Platform specifics */
#ifndef PBINT          
	#ifndef WIN32
		#define PBINT int
	#else
		#define PBINT short
	#endif
#endif

#ifdef __cplusplus
}
#endif

#ifdef __cplusplus
extern "C" {
#endif

PBINT __stdcall		LoadCPFind(PBINT iDummy) ;
long __stdcall		GetSourceSize(DWORD hpdObjBuf) ;
PBINT __stdcall		DisplayMessage ( LPSTR lpMessage, LPSTR lpTitle ) ;
long WINAPI			PBGetLine(HPSTR hpObjBuf, long lStart, LPSTR lpLine, long lSize) ;
long WINAPI			PBGetDWLine(HPSTR hpObjBuf, long lStart, LPSTR lpLine, long lSize) ;
long WINAPI			PBGetClassName(DWORD hpdObjBuf, LPSTR lpObject, LPSTR lpClass, long ll_StartOffSet)	;
DWORD FAR PASCAL	ReplaceName(DWORD hpdObjBuf, long lStartPos, PBINT iNoReplaceChar, LPSTR lpReplaceWith)	;
long __stdcall		FindGeneric(DWORD hpdObjBuf, long ll_startpos, LPSTR lpName, long lsize, PBINT iCase) ;
PBINT WINAPI		IsIdentifierChar(char chCur) ;
DWORD __stdcall		StripComments(DWORD hpdObjBuf) ;
void __stdcall		GetSource(DWORD hpdObjBuf, LPSTR lpString) ;
long WINAPI			GetSourceContext(DWORD hpdObjBuf, PBINT iStart, long lStart, LPSTR lpSearch, LPSTR lpLine, LPSTR lpContext, long lSize, PBINT iCase, PBINT iDW)	;
long WINAPI			ParseSource(HPSTR hpObjBuf, PBINT iStart, long lOffSet, LPSTR lpSearch, LPSTR lpLine, LPSTR lpContext, long lSize, PBINT iDW ) ;

#ifdef __cplusplus
}
#endif

