MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / Start

Method Start

module/module.cpp:531–556  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

529};
530
531bool CModFindFiles::Start(const char *wildcard, char *namebuf) {
532 ASSERT(wildcard);
533 ASSERT(namebuf);
534
535 if (globindex != -1)
536 Close();
537
538 int rc, flags;
539 flags = GLOB_MARK;
540 rc = glob(wildcard, flags, globerrfn, &ffres);
541 if (rc == GLOB_NOSPACE) {
542 mprintf(0, "Out of space during glob\n");
543 globindex = -1;
544 return false;
545 }
546 if (!ffres.gl_pathc) {
547 globindex = -1;
548 return false;
549 }
550
551 globindex = 0;
552 char ext[256];
553 dd_SplitPath(ffres.gl_pathv[0], NULL, namebuf, ext);
554 strcat(namebuf, ext);
555 return true;
556}
557
558bool CModFindFiles::Next(char *namebuf) {
559 ASSERT(namebuf);

Callers 4

D3MusicStartFunction · 0.45
D3MusicToggleFunction · 0.45
D3MusicSetVolumeFunction · 0.45

Calls 1

dd_SplitPathFunction · 0.85

Tested by

no test coverage detected