global
{
  int File_Type_Override "!FILE_TYPE_OVERRIDE";
  int File_Type_Brl "!FILE_TYPE_BRL";  // binary record length
  int Oem_Type_Override  "!OEM_TYPE_OVERRIDE";
  int File_Prompt_Flags  "!FILE_PROMPT_FLAGS";
  str Fprompt_Last_Path;
  str Fprompt_Work_Dir;
	int Fprompt_Mode "!FPROMPT_MODE";
}

#DEFINE _FPM_EXPLORER				 0x0001
#DEFINE _FPM_LASTMASK        0x0002
#DEFINE _FPM_CLEARMASKSTART  0x0004
#DEFINE _FPM_LASTPATH        0x0008

#DEFINE _FP_FLAG_NOHISTORY   0x0001 //No history add
#DEFINE _FP_FLAG_FTO         0x0002 //Filetype override with default
#DEFINE _FP_FLAG_FTO_ND      0x0004 //Filetype override without default
																		//  If file type override, then the
																		//  the type is stored in global int
																		//  file_type_override
#DEFINE _FP_FLAG_SETFT       0x0008 //Set file type radio buttons to
																		//current value of  file_type_override

#DEFINE _FP_FLAG_RO          0x0010 // Allow read-only box
#DEFINE _FP_FLAG_CD          0x0020 // Allow change-dir box
#DEFINE _FP_FLAG_DEF_DIR     0x0040 // If file does not exist, return
																		// filename without directory
#DEFINE _FP_FLAG_TAG_FILES   0x0080 // Allow multiple selections


#DEFINE _FP_FLAG_RET_CD      0x0200 // Returns the change dir checkbox
#DEFINE _FP_FLAG_TAGS        0x0400 // If set, then multiple files were
																		// selected.  The result of the

																		// function will contain the window_id
																		// of the buffer containing the
																		// file list.

#DEFINE _FP_FLAG_NOINCREMENT 0x0800 // Disable incremental search
#DEFINE _FP_FLAG_OEM         0x2000 // Allow OEm Box
#DEFINE _FP_FLAG_SETOEM      0x4000 // Set value of OEM override to
                                    // current value of Oem_Type_Override
#DEFINE _FP_FLAG_SAVEAS			 0x8000 // Use Save As instead of open (explorer)

#DEFINE _FP_FLAG_RO_VALID    0x00010000 // Set if the read-only value is valid
#DEFINE _FP_FLAG_RET_RO      0x00100000 // Returns the read-only checkbox


#DEFINE _DS_FLAG_CD          0x0001 // If set, then the dir select dialog
																		// will change the working dir.


prototype fprompt
{
	int FileNamePrompt( str &fn,			// The variable to store the filename
											str title, 		// [80] the title of the dialog
											str history,	// [20] the name of the history list
											str help,			// [80] help index
											int &flags    // Misc flags(see defines)
											);
	int SelectDirectory( int parent,
											 str &fn,
											 str title,
											 str help,
											 int flags
											 );

				// Replaces space seperators with semicolans, AND quotes from around
				// filenames with spaces, leaving the spaces intact
	int FixFileList( str &fn, int remove_quote );
}