2014-03-15 16:59:03 +00:00
|
|
|
/// \file
|
|
|
|
/// \brief Support to find files
|
|
|
|
|
|
|
|
#ifndef __FILESRCH_H__
|
|
|
|
#define __FILESRCH_H__
|
|
|
|
|
|
|
|
#include "doomdef.h"
|
|
|
|
#include "d_netfil.h"
|
2017-04-29 15:40:07 +00:00
|
|
|
#include "m_menu.h" // MAXSTRINGLENGTH
|
2014-03-15 16:59:03 +00:00
|
|
|
|
2017-05-09 13:09:09 +00:00
|
|
|
extern consvar_t cv_addons_option, cv_addons_folder, cv_addons_md5, cv_addons_showall, cv_addons_search_case, cv_addons_search_type;
|
2017-04-29 15:40:07 +00:00
|
|
|
|
2014-03-15 16:59:03 +00:00
|
|
|
/** \brief The filesearch function
|
|
|
|
|
|
|
|
This function search files, manly WADs and return back the status of the file
|
|
|
|
|
|
|
|
\param filename the file to look for
|
|
|
|
\param startpath where to start look from
|
|
|
|
\param wantedmd5sum want to check with MD5
|
|
|
|
\param completepath want to return the complete path of the file?
|
|
|
|
\param maxsearchdepth the max depth to search for the file
|
|
|
|
|
|
|
|
\return filestatus_t
|
|
|
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
filestatus_t filesearch(char *filename, const char *startpath, const UINT8 *wantedmd5sum,
|
|
|
|
boolean completepath, int maxsearchdepth);
|
|
|
|
|
2017-04-29 15:40:07 +00:00
|
|
|
#define menudepth 20
|
|
|
|
|
2017-04-29 15:40:07 +00:00
|
|
|
extern char menupath[1024];
|
2017-04-29 15:40:07 +00:00
|
|
|
extern size_t menupathindex[menudepth];
|
2017-04-29 15:40:07 +00:00
|
|
|
extern size_t menudepthleft;
|
|
|
|
|
2017-04-29 15:40:07 +00:00
|
|
|
extern char menusearch[MAXSTRINGLENGTH+1];
|
|
|
|
|
2017-04-29 15:40:07 +00:00
|
|
|
extern char **dirmenu;
|
|
|
|
extern size_t sizedirmenu;
|
2017-04-29 15:40:07 +00:00
|
|
|
extern size_t dir_on[menudepth];
|
2017-04-29 15:40:07 +00:00
|
|
|
extern UINT8 refreshdirmenu;
|
|
|
|
|
|
|
|
extern size_t packetsizetally;
|
2017-04-29 15:40:07 +00:00
|
|
|
extern size_t mainwadstally;
|
2017-04-29 15:40:07 +00:00
|
|
|
|
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
EXT_FOLDER = 0,
|
|
|
|
EXT_UP,
|
2017-04-29 15:40:07 +00:00
|
|
|
EXT_NORESULTS,
|
2017-04-29 15:40:07 +00:00
|
|
|
EXT_START,
|
|
|
|
EXT_TXT = EXT_START,
|
|
|
|
EXT_CFG,
|
2017-04-29 15:40:07 +00:00
|
|
|
EXT_LOADSTART,
|
2017-04-29 15:40:07 +00:00
|
|
|
EXT_WAD = EXT_LOADSTART,
|
2017-10-07 19:48:49 +00:00
|
|
|
EXT_PK3,
|
2017-04-29 15:40:07 +00:00
|
|
|
EXT_SOC,
|
|
|
|
EXT_LUA, // allowed even if not HAVE_BLUA so that we can yell on load attempt
|
|
|
|
NUM_EXT,
|
2017-04-29 15:40:07 +00:00
|
|
|
NUM_EXT_TABLE = NUM_EXT-EXT_START,
|
|
|
|
EXT_LOADED = 0x80
|
|
|
|
/*
|
|
|
|
obviously there can only be 0x7F supported extensions in
|
|
|
|
addons menu because we're cramming this into a char out of
|
|
|
|
laziness/easy memory allocation (what's the difference?)
|
|
|
|
and have stolen a bit to show whether it's loaded or not
|
|
|
|
in practice the size of the data type is probably overkill
|
|
|
|
toast 02/05/17
|
|
|
|
*/
|
2017-04-29 15:40:07 +00:00
|
|
|
} ext_enum;
|
2017-04-29 15:40:07 +00:00
|
|
|
|
2017-04-29 15:40:07 +00:00
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
DIR_TYPE = 0,
|
|
|
|
DIR_LEN,
|
|
|
|
DIR_STRING
|
|
|
|
} dirname_enum;
|
|
|
|
|
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
REFRESHDIR_NORMAL = 1,
|
|
|
|
REFRESHDIR_ADDFILE = 2,
|
|
|
|
REFRESHDIR_WARNING = 4,
|
|
|
|
REFRESHDIR_ERROR = 8,
|
2017-05-08 16:28:48 +00:00
|
|
|
REFRESHDIR_NOTLOADED = 16,
|
|
|
|
REFRESHDIR_MAX = 32
|
2017-04-29 15:40:07 +00:00
|
|
|
} refreshdir_enum;
|
|
|
|
|
2017-04-29 15:40:07 +00:00
|
|
|
boolean preparefilemenu(boolean samedepth);
|
2017-04-29 15:40:07 +00:00
|
|
|
|
2014-03-15 16:59:03 +00:00
|
|
|
#endif // __FILESRCH_H__
|