MCPcopy Create free account
hub / github.com/PlatformLab/NanoLog / readCheckpoint

Function readCheckpoint

runtime/Log.h:586–596  ·  view source on GitHub ↗

* Extracts a checkpoint from a file descriptor. * * \param[out] cp * Checkpoint structure to read the data into * \param fd * Stream to read checkpoint from * * \return * Whether the operation succeeded or failed due to lack of * space/malformed log */

Source from the content-addressed store, hash-verified

584 * space/malformed log
585 */
586 inline bool
587 readCheckpoint(Checkpoint &cp, FILE *fd) {
588 cp.entryType = EntryType::INVALID;
589 long numRead = fread(&cp, sizeof(Checkpoint), 1UL, fd);
590
591 if (!numRead)
592 return false;
593
594 assert(cp.entryType == EntryType::CHECKPOINT);
595 return true;
596 }
597
598 /**
599 * Copies a primitive to a character array and bumps the array pointer.

Callers 2

readDictionaryMethod · 0.85
TEST_FFunction · 0.85

Calls

no outgoing calls

Tested by 1

TEST_FFunction · 0.68