[AD] Grabber help patch

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


As reported by Nick Tarleton on [AL], the help sections in the grabber are 
shifted in the 4.1.x series because of the addition of a new help section in 
the text file tools/grabber.txt by Laurence for dat2c. It turns out that the 
grabber code must be updated accordingly, because it parses the text file.

Patch commited.

-- 
Eric Botcazou
--- /home/eric/cvs/allegro/tools/grabber.c	Fri Dec 20 09:30:07 2002
+++ allegro/tools/grabber.c	Mon Jan 13 08:33:30 2003
@@ -2480,10 +2480,11 @@
 
 
 /* help system by Doug Eleveld */
+#define N_HELP_TEXT_SECTIONS  9
 
 static char *grabber_last_help = NULL;
 static char *grabber_help_text = NULL;
-static char *grabber_help_text_section[8];
+static char *grabber_help_text_section[N_HELP_TEXT_SECTIONS];
 
 
 static int set_grabber_help_main(void)
@@ -2521,27 +2522,34 @@
 }
 
 
-static int set_grabber_help_compiling_datafiles(void)
+static int set_grabber_help_compiling_datafiles_to_asm(void)
 {
    grabber_help_text = grabber_help_text_section[5];
    return D_O_K;
 }
 
 
-static int set_grabber_help_custom_objects(void)
+static int set_grabber_help_compiling_datafiles_to_c(void)
 {
    grabber_help_text = grabber_help_text_section[6];
    return D_O_K;
 }
 
 
-static int set_grabber_help_file_format(void)
+static int set_grabber_help_custom_objects(void)
 {
    grabber_help_text = grabber_help_text_section[7];
    return D_O_K;
 }
 
 
+static int set_grabber_help_file_format(void)
+{
+   grabber_help_text = grabber_help_text_section[8];
+   return D_O_K;
+}
+
+
 static int do_grabber_help_exit(void)
 {
    return D_CLOSE;
@@ -2551,9 +2559,10 @@
 
 static MENU grabber_help_datafiles[] =
 {
-   { "&Accessing",      set_grabber_help_accessing_datafiles,  NULL, 0, NULL },
-   { "&Compiling",      set_grabber_help_compiling_datafiles,  NULL, 0, NULL },
-   { NULL,              NULL,                                  NULL, 0, NULL }
+   { "&Accessing",        set_grabber_help_accessing_datafiles,        NULL, 0, NULL },
+   { "&Compiling to asm", set_grabber_help_compiling_datafiles_to_asm, NULL, 0, NULL },
+   { "&Compiling to C",   set_grabber_help_compiling_datafiles_to_c,   NULL, 0, NULL },
+   { NULL,                NULL,                                        NULL, 0, NULL }
 };
 
 
@@ -2664,7 +2673,7 @@
 
    last = grabber_help_text;
 
-   for (i=1; i<8; i++) {
+   for (i=1; i<N_HELP_TEXT_SECTIONS; i++) {
       s = strstr(last , (cr ? "\r\n\r\n====" : "\n\n===="));
 
       if (s) {


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/