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

Function _write_map_index

crawl-ref/source/maps.cc:1445–1467  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1443}
1444
1445static void _write_map_index(const string &filebase, size_t vs, size_t ve,
1446 time_t mtime)
1447{
1448 const string cfile = filebase + ".idx";
1449 FILE *fp = fopen_u(cfile.c_str(), "wb");
1450 if (!fp)
1451 end(1, true, "Unable to open %s for writing", cfile.c_str());
1452
1453 writer outf(cfile, fp);
1454 write_save_version(outf, save_version::current());
1455 marshallByte(outf, WORD_LEN);
1456 marshallSigned(outf, mtime);
1457 marshallShort(outf, ve > vs? ve - vs : 0);
1458 for (size_t i = vs; i < ve; ++i)
1459 {
1460 vdefs[i].write_index(outf);
1461 marshallString(outf, vdefs[i].description);
1462 marshallInt(outf, vdefs[i].order);
1463 vdefs[i].place_loaded_from.clear();
1464 vdefs[i].strip();
1465 }
1466 fclose(fp);
1467}
1468
1469static void _write_map_cache(const string &filename, size_t vs, size_t ve,
1470 time_t mtime)

Callers 1

_write_map_cacheFunction · 0.85

Calls 11

fopen_uFunction · 0.85
endFunction · 0.85
write_save_versionFunction · 0.85
marshallByteFunction · 0.85
marshallSignedFunction · 0.85
marshallShortFunction · 0.85
marshallStringFunction · 0.85
marshallIntFunction · 0.85
write_indexMethod · 0.80
stripMethod · 0.80
clearMethod · 0.45

Tested by

no test coverage detected