aboutsummaryrefslogtreecommitdiff
path: root/devel.but
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2017-10-01 13:53:24 +0100
committerSimon Tatham <anakin@pobox.com>2017-10-01 16:34:41 +0100
commitb3243d75043cf1d70beb88d2a36eaebfe85c2c3f (patch)
treeab6151e321465c172582ca064910665f055ceec9 /devel.but
parentde67801b0fd3dfa11777c1ef86cd617baf376b7b (diff)
downloadpuzzles-b3243d75043cf1d70beb88d2a36eaebfe85c2c3f.zip
puzzles-b3243d75043cf1d70beb88d2a36eaebfe85c2c3f.tar.gz
puzzles-b3243d75043cf1d70beb88d2a36eaebfe85c2c3f.tar.bz2
puzzles-b3243d75043cf1d70beb88d2a36eaebfe85c2c3f.tar.xz
Return error messages as 'const char *', not 'char *'.
They're never dynamically allocated, and are almost always string literals, so const is more appropriate.
Diffstat (limited to 'devel.but')
-rw-r--r--devel.but26
1 files changed, 13 insertions, 13 deletions
diff --git a/devel.but b/devel.but
index 98724b3..c7112bb 100644
--- a/devel.but
+++ b/devel.but
@@ -664,7 +664,8 @@ function is never called and need not do anything at all.
\S{backend-validate-params} \cw{validate_params()}
-\c char *(*validate_params)(const game_params *params, int full);
+\c const char *(*validate_params)(const game_params *params,
+\c int full);
This function takes a \c{game_params} structure as input, and checks
that the parameters described in it fall within sensible limits. (At
@@ -749,7 +750,8 @@ again in the game description.
\S{backend-validate-desc} \cw{validate_desc()}
-\c char *(*validate_desc)(const game_params *params, const char *desc);
+\c const char *(*validate_desc)(const game_params *params,
+\c const char *desc);
This function is given a game description, and its job is to
validate that it describes a puzzle which makes sense.
@@ -1053,7 +1055,7 @@ not even offer the \q{Solve} menu option.
\S{backend-solve} \cw{solve()}
\c char *(*solve)(const game_state *orig, const game_state *curr,
-\c const char *aux, char **error);
+\c const char *aux, const char **error);
This function is called when the user selects the \q{Solve} option
from the menu.
@@ -3154,8 +3156,8 @@ will probably need to pass it to \cw{midend_set_config}.)
\H{midend-set-config} \cw{midend_set_config()}
-\c char *midend_set_config(midend *me, int which,
-\c config_item *cfg);
+\c const char *midend_set_config(midend *me, int which,
+\c config_item *cfg);
Passes the mid-end the results of a configuration dialog box.
\c{which} should have the same value which it had when
@@ -3176,7 +3178,7 @@ using \cw{midend_size()} and eventually perform a refresh using
\H{midend-game-id} \cw{midend_game_id()}
-\c char *midend_game_id(midend *me, char *id);
+\c const char *midend_game_id(midend *me, char *id);
Passes the mid-end a string game ID (of any of the valid forms
\cq{params}, \cq{params:description} or \cq{params#seed}) which the
@@ -3244,7 +3246,7 @@ conversion.
\H{midend-solve} \cw{midend_solve()}
-\c char *midend_solve(midend *me);
+\c const char *midend_solve(midend *me);
Requests the mid-end to perform a Solve operation.
@@ -3316,9 +3318,8 @@ output string.
\H{midend-deserialise} \cw{midend_deserialise()}
-\c char *midend_deserialise(midend *me,
-\c int (*read)(void *ctx, void *buf, int len),
-\c void *rctx);
+\c const char *midend_deserialise(midend *me,
+\c int (*read)(void *ctx, void *buf, int len), void *rctx);
This function is the counterpart to \cw{midend_serialise()}. It
calls the supplied \cw{read} function repeatedly to read a quantity
@@ -3355,9 +3356,8 @@ place.
\H{identify-game} \cw{identify_game()}
-\c char *identify_game(char **name,
-\c int (*read)(void *ctx, void *buf, int len),
-\c void *rctx);
+\c const char *identify_game(char **name,
+\c int (*read)(void *ctx, void *buf, int len), void *rctx);
This function examines a serialised midend stream, of the same kind
used by \cw{midend_serialise()} and \cw{midend_deserialise()}, and