/*
 =======================================================================================
  Name        : Tree_Fct.h
 
  Author      : vincent lhullier            Date :04/09/97
 
  Description : header file for tree of project or file functions
 =======================================================================================
 */

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
#ifndef __VSSFUNCT_H__
#define __VSSFUNCT_H__
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

typedef struct tdstFileListConfig_ tdstFileListConfig;

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

/*
 =======================================================================================
	STRUCTURES 
 =======================================================================================
 */

/*
 * structure to store info about project tree
 */
typedef struct tdstFile_
{
	char					*szName;
	BOOL					bGet;
	HTREEITEM				hTreeItem;
} tdstFile;

typedef struct tdstProject_
{
	char					*szName;
	BOOL					bGet;
	BOOL					bRecurse;
	long					lNumberOfSubProjects;
	struct tdstProject_		*d_stSubProject;
	long					lNumberOfFiles;
	tdstFile				*d_stFile;
	HTREEITEM				hTreeItem;
} tdstProject;


/*
 =======================================================================================
	CONSTANT
 =======================================================================================
 */

#define		C_cVssProject	0
#define		C_cLocalProject	1

/*
 =======================================================================================
	GLOBALS 
 =======================================================================================
 */
extern tdstProject		*g_p_stVssRootProject;
extern tdstProject		*g_p_stLocalRootProject;
extern char				**gs_d_szFile;
extern char				**gs_d_szProj;

/*
 =======================================================================================
	FUNCTIONS 
 =======================================================================================
 */


void		fn_Tree_vInitProject					( tdstProject *_p_stProj, char *_szName );
void		fn_Tree_vInitProjectWithPointerName		( tdstProject *_p_stProj, char *_szName );
void		fn_Tree_vInitFile						( tdstFile *_p_stFile, char *_szName );
void		fn_Tree_vInitFileWithPointerName		( tdstFile *_p_stFile, char *_szName );

tdstProject	*fn_Tree_p_stGetProject					( tdstProject *_p_stInProj, char *_szName );
tdstFile	*fn_Tree_p_stGetFile					( tdstProject *_p_stInProj, char *_szName );

void		fn_Tree_vFreeProject					( tdstProject *_p_stProj, BOOL _bDelete );
void		fn_Tree_vFreeProjectTree				( tdstProject *_p_stProj, BOOL _bDelete);
void		fn_Tree_vFreeProjectFileList			( tdstProject *_p_stProj );

void		fn_Tree_vGetNothing						( tdstProject *_p_stProj);
void		fn_Tree_vRefreshWithFileList			( tdstProject *_p_stProj, tdstFileListConfig *_p_stFileList );

void		fn_Tree_vGetNumberOfFilesOrProjectsToGet( tdstProject *_p_stProj, long *_p_lNbFiles );
void		fn_Tree_vGetFilesOrProjectToGet			( tdstProject *_p_stProj, long *_p_lNbFiles, char **_d_szFile );
void		fn_Tree_vGetNumberOfFilesToGet			( tdstProject *_p_stProj, long *_p_lNbFiles, BOOL _bAll );
void		fn_Tree_vGetFilesToGet					( tdstProject *_p_stProj, long *_p_lNbFiles, char **_d_szFile, BOOL _bAll );

long		fn_TREE_lBuildListOfFilesToGet			( tdstProject *_p_stProj, char ***_ppp_szFile );
void		fn_TREE_vFreeListOfFilesToGet			( long _lNumberOfFiles, char **_pp_szFile );

BOOL		fn_TREE_bGetFileList					( tdstProject *_p_stProj, tdstFileListConfig *_p_stFileList, char _cConfig, char *_szFileListName );

//void		fn_vUpdateFilesToObtainList( void );
void		fn_vRefreshVssTreeAndFilesToObtainList( void );


/*
 =======================================================================================
	Function for local tree 
 =======================================================================================
 */

BOOL		fn_Tree_bBuildFromDisk					( tdstProject **_pp_stRootProject, char *_szRootName );

#endif //__VSSFUNCT_H__