texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[5501] minor tidy-up


From: Gavin D. Smith
Subject: [5501] minor tidy-up
Date: Thu, 01 May 2014 18:37:59 +0000

Revision: 5501
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=5501
Author:   gavin
Date:     2014-05-01 18:37:58 +0000 (Thu, 01 May 2014)
Log Message:
-----------
minor tidy-up

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/info/info.c
    trunk/info/nodes.c
    trunk/info/nodes.h
    trunk/info/session.c
    trunk/info/session.h

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog     2014-05-01 18:22:24 UTC (rev 5500)
+++ trunk/ChangeLog     2014-05-01 18:37:58 UTC (rev 5501)
@@ -1,5 +1,15 @@
 2014-05-01  Gavin Smith  <address@hidden>
 
+       * info/nodes.c (info_get_node_of_file_buffer): Order of arguments
+       reversed.
+       (info_node_of_file_buffer_tags): Merged into
+       info_get_node_of_file_buffer.
+
+       * info/session.c (initialize_info_session): Argument 'clear_screen'
+       removed.
+
+2014-05-01  Gavin Smith  <address@hidden>
+
        * info/filesys.c (info_absolute_file, info_add_extension):
        Function renamed.
        (info_find_fullpath): Call info_add_extension.
@@ -39,7 +49,7 @@
        name of node.  Callers updated.
        (dump_nodes_to_file): Arguments changed.
 
-       * info/t/Init-intera.inc: Redirect stdout as well as stdin.
+       * info/t/Init-intera.inc: Redirect stderr as well as stdin.
 
 2014-05-01  Karl Berry  <address@hidden>
 

Modified: trunk/info/info.c
===================================================================
--- trunk/info/info.c   2014-05-01 18:22:24 UTC (rev 5500)
+++ trunk/info/info.c   2014-05-01 18:37:58 UTC (rev 5501)
@@ -291,7 +291,7 @@
       else
         program = xstrdup ("");
       
-      top_node = info_get_node_of_file_buffer ("Top", initial_file);
+      top_node = info_get_node_of_file_buffer (initial_file, "Top");
       invoc_node = info_intuit_options_node (top_node, program);
       if (invoc_node)
         add_pointer_to_array (invoc_node, user_nodenames_index,
@@ -305,7 +305,7 @@
     {
       NODE *initial_node;
 
-      initial_node = info_get_node_of_file_buffer ("Top", initial_file);
+      initial_node = info_get_node_of_file_buffer (initial_file, "Top");
       node_via_menus = info_follow_menus (initial_node, argv, error_node, 1);
       if (node_via_menus)
         add_pointer_to_array (node_via_menus, user_nodenames_index,
@@ -343,7 +343,7 @@
     {
       NODE *initial_node;
 
-      initial_node = info_get_node_of_file_buffer ("Top", initial_file);
+      initial_node = info_get_node_of_file_buffer (initial_file, "Top");
       node_via_menus = info_follow_menus (initial_node, argv, error_node, 0);
       if (node_via_menus)
         add_pointer_to_array (node_via_menus, user_nodenames_index,
@@ -513,7 +513,7 @@
     }
 #endif
   
-  initialize_info_session (1);
+  initialize_info_session ();
   info_set_node_of_window (0, active_window, allfiles_create_node (argc ? 
argv[0] : fname, fref));;
   display_startup_message ();
   info_session ();
@@ -799,7 +799,7 @@
       initial_fb = info_load_file (initial_file, 1);
       if (initial_fb && index_entry_exists (initial_fb, index_search_string))
         {
-          initialize_info_session (1);
+          initialize_info_session ();
           initial_node = info_get_node (initial_file, "Top", PARSE_NODE_DFLT);
           info_set_node_of_window (0, active_window, initial_node);
           do_info_index_search (windows, 0, index_search_string);
@@ -825,7 +825,7 @@
 
   if (!user_output_filename
       && !(user_filename && error_node))
-    initialize_info_session (1);
+    initialize_info_session ();
 
   if (error_node)
     show_error_node (error_node);

Modified: trunk/info/nodes.c
===================================================================
--- trunk/info/nodes.c  2014-05-01 18:22:24 UTC (rev 5500)
+++ trunk/info/nodes.c  2014-05-01 18:37:58 UTC (rev 5501)
@@ -904,8 +904,6 @@
                                       char *filename_in, char *nodename_in);
 static void node_set_body_start (NODE *node);
 static int adjust_nodestart (FILE_BUFFER *file_buffer, NODE *tag);
-static NODE *info_node_of_file_buffer_tags (FILE_BUFFER *file_buffer,
-    char *nodename);
 
 /* Return a pointer to a newly allocated NODE structure, with
    fields filled in. */
@@ -990,7 +988,7 @@
   if (file_buffer)
     {
       /* Look for the node.  */
-      node = info_get_node_of_file_buffer (nodename, file_buffer);
+      node = info_get_node_of_file_buffer (file_buffer, nodename);
     }
 
   if (!file_buffer)
@@ -1008,11 +1006,11 @@
   /* If the node not found was "Top", try again with different case. */
   if (!node && (nodename && mbscasecmp (nodename, "Top") == 0))
     {
-      node = info_get_node_of_file_buffer ("Top", file_buffer);
+      node = info_get_node_of_file_buffer (file_buffer, "Top");
       if (!node)
-        node = info_get_node_of_file_buffer ("top", file_buffer);
+        node = info_get_node_of_file_buffer (file_buffer, "top");
       if (!node)
-        node = info_get_node_of_file_buffer ("TOP", file_buffer);
+        node = info_get_node_of_file_buffer (file_buffer, "TOP");
     }
 
 cleanup_and_exit:
@@ -1076,7 +1074,7 @@
    nodename of "Top" is used.  If the node cannot be found, return a
    NULL pointer. */
 NODE *
-info_get_node_of_file_buffer (char *nodename, FILE_BUFFER *file_buffer)
+info_get_node_of_file_buffer (FILE_BUFFER *file_buffer, char *nodename)
 {
   NODE *node = NULL;
 
@@ -1107,7 +1105,19 @@
      bother building a node list for it. */
   else if (file_buffer->tags)
     {
-      node = info_node_of_file_buffer_tags (file_buffer, nodename);
+      NODE *tag;
+      int i;
+
+      /* If no tags at all (possibly a misformatted info file), quit.  */
+      if (!file_buffer->tags)
+        return NULL;
+
+      for (i = 0; (tag = file_buffer->tags[i]); i++)
+        if (strcmp (nodename, tag->nodename) == 0)
+          {
+            node = info_node_of_tag (file_buffer, &file_buffer->tags[i]);
+            break;
+          }
     }
 
   /* Return the results of our node search. */
@@ -1318,20 +1328,4 @@
 static NODE *
 info_node_of_file_buffer_tags (FILE_BUFFER *file_buffer, char *nodename)
 {
-  NODE *tag;
-  int i;
-
-  /* If no tags at all (possibly a misformatted info file), quit.  */
-  if (!file_buffer->tags)
-    return NULL;
-
-  for (i = 0; (tag = file_buffer->tags[i]); i++)
-    if (strcmp (nodename, tag->nodename) == 0)
-      {
-        return info_node_of_tag (file_buffer, &file_buffer->tags[i]);
-      }
-
-  /* There was a tag table for this file, and the node wasn't found.
-     Return NULL, since this file doesn't contain the desired node. */
-  return NULL;
 }

Modified: trunk/info/nodes.h
===================================================================
--- trunk/info/nodes.h  2014-05-01 18:22:24 UTC (rev 5500)
+++ trunk/info/nodes.h  2014-05-01 18:37:58 UTC (rev 5501)
@@ -179,8 +179,8 @@
    FILE_BUFFER.  NODENAME can be passed as NULL, in which case the
    nodename of "Top" is used.  If the node cannot be found, return a
    NULL pointer. */
-extern NODE *info_get_node_of_file_buffer (char *nodename,
-    FILE_BUFFER *file_buffer);
+extern NODE *info_get_node_of_file_buffer (FILE_BUFFER *file_buffer,
+                                           char *nodename);
 
 /* Grovel FILE_BUFFER->contents finding tags and nodes, and filling in the
    various slots.  This can also be used to rebuild a tag or node table. */

Modified: trunk/info/session.c
===================================================================
--- trunk/info/session.c        2014-05-01 18:22:24 UTC (rev 5500)
+++ trunk/info/session.c        2014-05-01 18:37:58 UTC (rev 5501)
@@ -124,7 +124,7 @@
     {
       NODE *node;
 
-      node = info_get_node_of_file_buffer (nodenames[i], fb);
+      node = info_get_node_of_file_buffer (fb, nodenames[i]);
 
       if (!node)
         break;
@@ -287,15 +287,12 @@
 }
 
 /* Initialize the first info session by starting the terminal, window,
-   and display systems.  If CLEAR_SCREEN is 0, don't clear the screen.  */
+   and display systems.  */
 void
-initialize_info_session (int clear_screen)
+initialize_info_session (void)
 {
-  if (clear_screen)
-    {
-      terminal_prep_terminal ();
-      terminal_clear_screen ();
-    }
+  terminal_prep_terminal ();
+  terminal_clear_screen ();
 
   window_initialize_windows (screenwidth, screenheight);
   initialize_info_signal_handler ();

Modified: trunk/info/session.h
===================================================================
--- trunk/info/session.h        2014-05-01 18:22:24 UTC (rev 5500)
+++ trunk/info/session.h        2014-05-01 18:37:58 UTC (rev 5501)
@@ -127,7 +127,7 @@
     char **nodenames);
 extern void info_session (void);
 extern void initialize_terminal_and_keymaps (char *init_file);
-extern void initialize_info_session (int clear_screen);
+extern void initialize_info_session (void);
 extern void info_read_and_dispatch (void);
 extern char *info_intuit_options_node (NODE *initial_node, char *program);
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]