X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=dialog.c;h=31a9627be1c86f1e9fbe63883c7213b105c7a14a;hb=89da2ddf564a93414ee9ab2df3f053608094e417;hp=cc1987751e0ef32aa507f3b4e641b13127c87d99;hpb=fb4fbe11588d3e53be99909f57dd179d1105aaf5;p=PuTTY.git diff --git a/dialog.c b/dialog.c index cc198775..31a9627b 100644 --- a/dialog.c +++ b/dialog.c @@ -13,7 +13,7 @@ #include "putty.h" #include "dialog.h" -int ctrl_path_elements(char *path) +int ctrl_path_elements(const char *path) { int i = 1; while (*path) { @@ -25,7 +25,7 @@ int ctrl_path_elements(char *path) /* Return the number of matching path elements at the starts of p1 and p2, * or INT_MAX if the paths are identical. */ -int ctrl_path_compare(char *p1, char *p2) +int ctrl_path_compare(const char *p1, const char *p2) { int i = 0; while (*p1 || *p2) { @@ -86,7 +86,7 @@ void ctrl_free_set(struct controlset *s) * path. If that path doesn't exist, return the index where it * should be inserted. */ -static int ctrl_find_set(struct controlbox *b, char *path, int start) +static int ctrl_find_set(struct controlbox *b, const char *path, int start) { int i, last, thisone; @@ -112,7 +112,7 @@ static int ctrl_find_set(struct controlbox *b, char *path, int start) * path, or -1 if no such controlset exists. If -1 is passed as * input, finds the first. */ -int ctrl_find_path(struct controlbox *b, char *path, int index) +int ctrl_find_path(struct controlbox *b, const char *path, int index) { if (index < 0) index = ctrl_find_set(b, path, 1); @@ -127,7 +127,7 @@ int ctrl_find_path(struct controlbox *b, char *path, int index) /* Set up a panel title. */ struct controlset *ctrl_settitle(struct controlbox *b, - char *path, char *title) + const char *path, const char *title) { struct controlset *s = snew(struct controlset); @@ -151,8 +151,8 @@ struct controlset *ctrl_settitle(struct controlbox *b, } /* Retrieve a pointer to a controlset, creating it if absent. */ -struct controlset *ctrl_getset(struct controlbox *b, - char *path, char *name, char *boxtitle) +struct controlset *ctrl_getset(struct controlbox *b, const char *path, + const char *name, const char *boxtitle) { struct controlset *s; int index = ctrl_find_set(b, path, 1); @@ -257,8 +257,8 @@ union control *ctrl_columns(struct controlset *s, int ncolumns, ...) return c; } -union control *ctrl_editbox(struct controlset *s, char *label, char shortcut, - int percentage, +union control *ctrl_editbox(struct controlset *s, const char *label, + char shortcut, int percentage, intorptr helpctx, handler_fn handler, intorptr context, intorptr context2) { @@ -272,8 +272,8 @@ union control *ctrl_editbox(struct controlset *s, char *label, char shortcut, return c; } -union control *ctrl_combobox(struct controlset *s, char *label, char shortcut, - int percentage, +union control *ctrl_combobox(struct controlset *s, const char *label, + char shortcut, int percentage, intorptr helpctx, handler_fn handler, intorptr context, intorptr context2) { @@ -293,7 +293,7 @@ union control *ctrl_combobox(struct controlset *s, char *label, char shortcut, * title is expected to be followed by a shortcut _iff_ `shortcut' * is NO_SHORTCUT. */ -union control *ctrl_radiobuttons(struct controlset *s, char *label, +union control *ctrl_radiobuttons(struct controlset *s, const char *label, char shortcut, int ncolumns, intorptr helpctx, handler_fn handler, intorptr context, ...) { @@ -339,9 +339,9 @@ union control *ctrl_radiobuttons(struct controlset *s, char *label, return c; } -union control *ctrl_pushbutton(struct controlset *s,char *label,char shortcut, - intorptr helpctx, handler_fn handler, - intorptr context) +union control *ctrl_pushbutton(struct controlset *s, const char *label, + char shortcut, intorptr helpctx, + handler_fn handler, intorptr context) { union control *c = ctrl_new(s, CTRL_BUTTON, helpctx, handler, context); c->button.label = label ? dupstr(label) : NULL; @@ -351,9 +351,9 @@ union control *ctrl_pushbutton(struct controlset *s,char *label,char shortcut, return c; } -union control *ctrl_listbox(struct controlset *s,char *label,char shortcut, - intorptr helpctx, handler_fn handler, - intorptr context) +union control *ctrl_listbox(struct controlset *s, const char *label, + char shortcut, intorptr helpctx, + handler_fn handler, intorptr context) { union control *c = ctrl_new(s, CTRL_LISTBOX, helpctx, handler, context); c->listbox.label = label ? dupstr(label) : NULL; @@ -368,8 +368,8 @@ union control *ctrl_listbox(struct controlset *s,char *label,char shortcut, return c; } -union control *ctrl_droplist(struct controlset *s, char *label, char shortcut, - int percentage, intorptr helpctx, +union control *ctrl_droplist(struct controlset *s, const char *label, + char shortcut, int percentage, intorptr helpctx, handler_fn handler, intorptr context) { union control *c = ctrl_new(s, CTRL_LISTBOX, helpctx, handler, context); @@ -385,9 +385,9 @@ union control *ctrl_droplist(struct controlset *s, char *label, char shortcut, return c; } -union control *ctrl_draglist(struct controlset *s,char *label,char shortcut, - intorptr helpctx, handler_fn handler, - intorptr context) +union control *ctrl_draglist(struct controlset *s, const char *label, + char shortcut, intorptr helpctx, + handler_fn handler, intorptr context) { union control *c = ctrl_new(s, CTRL_LISTBOX, helpctx, handler, context); c->listbox.label = label ? dupstr(label) : NULL; @@ -402,10 +402,10 @@ union control *ctrl_draglist(struct controlset *s,char *label,char shortcut, return c; } -union control *ctrl_filesel(struct controlset *s,char *label,char shortcut, - char const *filter, int write, char *title, - intorptr helpctx, handler_fn handler, - intorptr context) +union control *ctrl_filesel(struct controlset *s, const char *label, + char shortcut, const char *filter, int write, + const char *title, intorptr helpctx, + handler_fn handler, intorptr context) { union control *c = ctrl_new(s, CTRL_FILESELECT, helpctx, handler, context); c->fileselect.label = label ? dupstr(label) : NULL; @@ -416,9 +416,9 @@ union control *ctrl_filesel(struct controlset *s,char *label,char shortcut, return c; } -union control *ctrl_fontsel(struct controlset *s,char *label,char shortcut, - intorptr helpctx, handler_fn handler, - intorptr context) +union control *ctrl_fontsel(struct controlset *s, const char *label, + char shortcut, intorptr helpctx, + handler_fn handler, intorptr context) { union control *c = ctrl_new(s, CTRL_FONTSELECT, helpctx, handler, context); c->fontselect.label = label ? dupstr(label) : NULL; @@ -433,16 +433,17 @@ union control *ctrl_tabdelay(struct controlset *s, union control *ctrl) return c; } -union control *ctrl_text(struct controlset *s, char *text, intorptr helpctx) +union control *ctrl_text(struct controlset *s, const char *text, + intorptr helpctx) { union control *c = ctrl_new(s, CTRL_TEXT, helpctx, NULL, P(NULL)); c->text.label = dupstr(text); return c; } -union control *ctrl_checkbox(struct controlset *s, char *label, char shortcut, - intorptr helpctx, handler_fn handler, - intorptr context) +union control *ctrl_checkbox(struct controlset *s, const char *label, + char shortcut, intorptr helpctx, + handler_fn handler, intorptr context) { union control *c = ctrl_new(s, CTRL_CHECKBOX, helpctx, handler, context); c->checkbox.label = label ? dupstr(label) : NULL;