MCPcopy Create free account
hub / github.com/SimHacker/micropolis / SimCmdDynamicData

Function SimCmdDynamicData

micropolis-activity/src/sim/w_sim.c:936–963  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

934
935
936int SimCmdDynamicData(ARGS)
937{
938 int index, val;
939
940 if ((argc != 3) && (argc != 4)) {
941 return (TCL_ERROR);
942 }
943
944 if ((Tcl_GetInt(interp, argv[2], &index) != TCL_OK) ||
945 (index < 0) ||
946 (index >= 32)) {
947 return (TCL_ERROR);
948 }
949
950 if (argc == 4) {
951 int val;
952
953 if (Tcl_GetInt(interp, argv[3], &val) != TCL_OK) {
954 return (TCL_ERROR);
955 }
956 DynamicData[index] = val;
957 NewMapFlags[DYMAP] = 1;
958 Kick();
959 }
960
961 sprintf(interp->result, "%d", DynamicData[index]);
962 return (TCL_OK);
963}
964
965
966int SimCmdResetDynamic(ARGS)

Callers

nothing calls this directly

Calls 1

Tcl_GetIntFunction · 0.85

Tested by

no test coverage detected