MCPcopy Index your code
hub / github.com/NetHack/NetHack / restoptvals

Function restoptvals

src/options.c:822–842  ·  view source on GitHub ↗

get roleoptvals[][] from save file */

Source from the content-addressed store, hash-verified

820
821/* get roleoptvals[][] from save file */
822void
823restoptvals(NHFILE *nhfp)
824{
825 char *val;
826 unsigned len;
827 int i, j;
828
829 if (nhfp->structlevel) {
830 for (i = 0; i < 4; ++i)
831 for (j = 0; j < num_opt_phases; ++j) {
832 /* len includes terminating '\0' for non-Null values */
833 Sfi_unsigned(nhfp, &len, "optvals-len");
834 if (len) {
835 val = roleoptvals[i][j] = (char *) alloc(len);
836 Sfi_char(nhfp, val, "opvals-val", (int) len);
837 } else {
838 roleoptvals[i][j] = NULL;
839 }
840 }
841 }
842}
843
844#endif /* 0 */
845

Callers

nothing calls this directly

Calls 1

allocFunction · 0.70

Tested by

no test coverage detected