MCPcopy Create free account
hub / github.com/crawl/crawl / get_macro_file

Function get_macro_file

crawl-ref/source/macro.cc:211–235  ·  view source on GitHub ↗

Returns the name of the file that contains macros.

Source from the content-addressed store, hash-verified

209
210// Returns the name of the file that contains macros.
211static string get_macro_file()
212{
213 string dir = !Options.macro_dir.empty() ? Options.macro_dir :
214 !SysEnv.crawl_dir.empty() ? SysEnv.crawl_dir : "";
215
216 if (!dir.empty())
217 {
218#ifndef DGL_MACRO_ABSOLUTE_PATH
219 if (dir[dir.length() - 1] != FILE_SEPARATOR)
220 dir += FILE_SEPARATOR;
221#endif
222 }
223
224#if defined(DGL_MACRO_ABSOLUTE_PATH)
225 return dir.empty()? "macro.txt" : dir;
226#endif
227
228 check_mkdir("Macro directory", &dir, true);
229
230#if defined(DGL_NAMED_MACRO_FILE)
231 return dir + strip_filename_unsafe_chars(you.your_name) + "-macro.txt";
232#else
233 return dir + "macro.txt";
234#endif
235}
236
237static void buf2keyseq(const char *buff, keyseq &k)
238{

Callers 2

macro_saveFunction · 0.85
macro_initFunction · 0.85

Calls 3

check_mkdirFunction · 0.85
emptyMethod · 0.45

Tested by

no test coverage detected