mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-21 08:01:30 -07:00
Explain what decode_ui() should do with invalid input
It can't signal an error, but it's worth documenting that it can receive invalid input and should do what it can with it. I assume that failing to decode game_ui data from a newer version generally won't be disastrous the way failing to decode a description or move string would be.
This commit is contained in:
@ -891,7 +891,10 @@ source.)
|
|||||||
|
|
||||||
This function parses a string previously output by \cw{encode_ui()},
|
This function parses a string previously output by \cw{encode_ui()},
|
||||||
and writes the decoded data back into the freshly-created \c{game_ui}
|
and writes the decoded data back into the freshly-created \c{game_ui}
|
||||||
structure provided.
|
structure provided. If the string is invalid, the function should do
|
||||||
|
the best it can, which might just mean not changing the \c{game_ui}
|
||||||
|
structure at all. This might happen if a save file is corrupted, or
|
||||||
|
simply from a newer version that encodes more \c{game_ui} data.
|
||||||
|
|
||||||
\S{backend-changed-state} \cw{changed_state()}
|
\S{backend-changed-state} \cw{changed_state()}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user