global
{
	int file_type_override "!FILE_TYPE_OVERRIDE";
  int file_prompt_flags  "!FILE_PROMPT_FLAGS";
  str fprompt_last_path;
  str fprompt_work_dir;
}


#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_ACCEPT_WILD 0x1000 // Dialog will accept wildcards in the file name

#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
                       );
}