]> git.ipfire.org Git - thirdparty/newt.git/commitdiff
Nix
authorlaroche <laroche>
Wed, 16 Feb 2000 11:34:40 +0000 (11:34 +0000)
committerlaroche <laroche>
Wed, 16 Feb 2000 11:34:40 +0000 (11:34 +0000)
dialogboxes.c
dialogboxes.h
whiptail.c
whiptcl.c

index 3bf87de58332fdd447634a560cb2f719ee85f89c..ac5453da2dd683b40cb28f37d6fb50f2278adb83 100644 (file)
@@ -30,12 +30,13 @@ static void addButtons(int height, int width, newtComponent form,
     }
 }
 
-static newtComponent textbox(int maxHeight, int width, char * text, int flags, 
-                            int * height) {
+static newtComponent textbox(int maxHeight, int width, const char * text,
+                       int flags, int * height) {
     newtComponent tb;
     int sFlag = (flags & FLAG_SCROLL_TEXT) ? NEWT_FLAG_SCROLL : 0;
     int i;
-    char * buf, * src, * dst;
+    char * buf, * dst;
+    const char * src;
 
     dst = buf = alloca(strlen(text) + 1);
     src = text; 
@@ -62,11 +63,12 @@ static newtComponent textbox(int maxHeight, int width, char * text, int flags,
     return tb;
 }
 
-int gauge(char * text, int height, int width, poptContext optCon, int fd, 
+int gauge(const char * text, int height, int width, poptContext optCon, int fd, 
                int flags) {
     newtComponent form, scale, tb;
     int top;
-    char * arg, * end;
+    const char * arg;
+    char * end;
     int val;
     FILE * f = fdopen(fd, "r");
     char buf[3000];
@@ -125,7 +127,7 @@ int gauge(char * text, int height, int width, poptContext optCon, int fd,
     return DLG_OKAY;
 }
 
-int inputBox(char * text, int height, int width, poptContext optCon, 
+int inputBox(const char * text, int height, int width, poptContext optCon, 
                int flags, char ** result) {
     newtComponent form, entry, okay, cancel, answer, tb;
     char * val;
@@ -153,11 +155,12 @@ int inputBox(char * text, int height, int width, poptContext optCon,
     return rc;
 }
 
-int listBox(char * text, int height, int width, poptContext optCon,
+int listBox(const char * text, int height, int width, poptContext optCon,
                int flags, char ** result) {
     newtComponent form, okay, tb, answer, listBox;
     newtComponent cancel = NULL;
-    char * arg, * end;
+    const char * arg;
+    char * end;
     int listHeight;
     int numItems = 0;
     int allocedItems = 5;
@@ -168,8 +171,8 @@ int listBox(char * text, int height, int width, poptContext optCon,
     int maxTextWidth = 0;
     int scrollFlag;
     struct {
-       char * text;
-       char * tag;
+       const char * text;
+       const char * tag;
     } * itemInfo = malloc(allocedItems * sizeof(*itemInfo));
 
     if (!(arg = poptGetArg(optCon))) return DLG_ERROR;
@@ -236,11 +239,12 @@ int listBox(char * text, int height, int width, poptContext optCon,
     return rc;
 }
 
-int checkList(char * text, int height, int width, poptContext optCon,
+int checkList(const char * text, int height, int width, poptContext optCon,
                int useRadio, int flags, char *** selections) {
     newtComponent form, okay, tb, subform, answer;
     newtComponent sb = NULL, cancel = NULL;
-    char * arg, * end;
+    const char * arg;
+    char * end;
     int listHeight;
     int numBoxes = 0;
     int allocedBoxes = 5;
@@ -251,8 +255,8 @@ int checkList(char * text, int height, int width, poptContext optCon,
     int maxWidth = 0;
     int top;
     struct {
-       char * text;
-       char * tag;
+       const char * text;
+       const char * tag;
        newtComponent comp;
     } * cbInfo = malloc(allocedBoxes * sizeof(*cbInfo));
     char * cbStates = malloc(allocedBoxes * sizeof(cbStates));
@@ -359,7 +363,7 @@ int checkList(char * text, int height, int width, poptContext optCon,
     return rc;
 }
 
-int messageBox(char * text, int height, int width, int type, int flags) {
+int messageBox(const char * text, int height, int width, int type, int flags) {
     newtComponent form, yes, tb, answer;
     newtComponent no = NULL;
     int tFlag = (flags & FLAG_SCROLL_TEXT) ? NEWT_FLAG_SCROLL : 0;
index b9ae1278d4faacae168fcc681c76b0048a107c2f..29dab12c731e087da317adbf87d52bbf19e90087 100644 (file)
 #define DLG_OKAY               0
 #define DLG_CANCEL             1
 
-int messageBox(char * text, int height, int width, int type, int flags);
-int checkList(char * text, int height, int width, poptContext optCon,
+int messageBox(const char * text, int height, int width, int type, int flags);
+int checkList(const char * text, int height, int width, poptContext optCon,
                int useRadio, int flags, char *** selections);
-int listBox(char * text, int height, int width, poptContext optCon,
+int listBox(const char * text, int height, int width, poptContext optCon,
                int flags, char ** result);
-int inputBox(char * text, int height, int width, poptContext optCon, 
+int inputBox(const char * text, int height, int width, poptContext optCon, 
                int flags, char ** result);
-int gauge(char * text, int height, int width, poptContext optCon, int fd, 
+int gauge(const char * text, int height, int width, poptContext optCon, int fd, 
                int flags);
 void useFullButtons(int state);
 
index 9b52caafc70310ca236f19be5c74ccc24bf7a0ed..7a7bda280219db11c2e70a3ac5b28423720d17f9 100644 (file)
@@ -28,13 +28,13 @@ static void usage(void) {
     exit(1);
 }
 
-int main(int argc, char ** argv) {
+int main(int argc, const char ** argv) {
     enum mode mode = MODE_NONE;
     poptContext optCon;
     int arg;
-    char * optArg;
-    char * text;
-    char * nextArg;
+    const char * optArg;
+    const char * text;
+    const char * nextArg;
     char * end;
     int height;
     int width;
index a7c66222592e2c86fba5623f4937ac53f262c947..f137d791c073dbb687b8adb19cad8facff4a037f 100644 (file)
--- a/whiptcl.c
+++ b/whiptcl.c
@@ -57,9 +57,9 @@ static int wtCmd(ClientData clientData, Tcl_Interp * interp, int argc,
     enum mode mode = MODE_NONE;
     poptContext optCon;
     int arg;
-    char * optArg;
-    char * text;
-    char * nextArg;
+    const char * optArg;
+    const char * text;
+    const char * nextArg;
     char * end;
     int height;
     int width;