texinfo-commits
[Top][All Lists]
Advanced

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

[6011] reintroduce TAG type


From: Gavin D. Smith
Subject: [6011] reintroduce TAG type
Date: Tue, 30 Dec 2014 21:54:03 +0000

Revision: 6011
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=6011
Author:   gavin
Date:     2014-12-30 21:54:02 +0000 (Tue, 30 Dec 2014)
Log Message:
-----------
reintroduce TAG type

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/info/dir.c
    trunk/info/indices.c
    trunk/info/info-utils.c
    trunk/info/info-utils.h
    trunk/info/man.c
    trunk/info/nodemenu.c
    trunk/info/nodes.c
    trunk/info/nodes.h
    trunk/info/session.c

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog     2014-12-30 18:58:57 UTC (rev 6010)
+++ trunk/ChangeLog     2014-12-30 21:54:02 UTC (rev 6011)
@@ -1,3 +1,18 @@
+2014-12-30  Gavin Smith  <address@hidden>
+
+       * info/nodes.h (TAG): Struct type reintroduced (removed on
+       2014-04-16).  Use to represent an entry in a file's tag table.
+       All uses updated.
+       * info/info-utils.c (scan_node_contents): Prototype changed.  
+       All callers updated.
+
+       * info/nodes.c (info_create_tag): New function.
+       (info_node_of_tag): Set body_start on returned NODE.
+
+       * info/man.c (manpage_file_buffer, manpage_nodes): Keep list of 
+       manpage nodes in a list of pointers.
+       (create_manpage_file_buffer): Removed.
+
 2014-12-29  Patrice Dumas  <address@hidden>
 
        * tp/texi2any.pl: force conversion of stringyfied object

Modified: trunk/info/dir.c
===================================================================
--- trunk/info/dir.c    2014-12-30 18:58:57 UTC (rev 6010)
+++ trunk/info/dir.c    2014-12-30 21:54:02 UTC (rev 6011)
@@ -145,7 +145,7 @@
 
   {
     node->flags |= (N_IsDir | N_IsInternal);
-    scan_node_contents (0, &node);
+    scan_node_contents (node, 0, 0);
   }
   return node;
 }

Modified: trunk/info/indices.c
===================================================================
--- trunk/info/indices.c        2014-12-30 18:58:57 UTC (rev 6010)
+++ trunk/info/indices.c        2014-12-30 21:54:02 UTC (rev 6011)
@@ -139,7 +139,7 @@
   /* Grovel the names of the nodes found in this file. */
   if (file_buffer->tags)
     {
-      NODE *tag;
+      TAG *tag;
 
       for (i = 0; (tag = file_buffer->tags[i]); i++)
         {
@@ -685,7 +685,7 @@
         }
 
       apropos_node = text_buffer_to_node (&message);
-      scan_node_contents (0, &apropos_node);
+      scan_node_contents (apropos_node, 0, 0);
 
       name_internal_node (apropos_node, xstrdup (apropos_list_nodename));
       apropos_node->flags |= N_WasRewritten;
@@ -845,6 +845,6 @@
   node->body_start = strcspn (node->contents, "\n");
   node->flags |= N_IsInternal | N_WasRewritten;
 
-  scan_node_contents (0, &node);
+  scan_node_contents (node, 0, 0);
   info_set_node_of_window (window, node);
 }

Modified: trunk/info/info-utils.c
===================================================================
--- trunk/info/info-utils.c     2014-12-30 18:58:57 UTC (rev 6010)
+++ trunk/info/info-utils.c     2014-12-30 21:54:02 UTC (rev 6011)
@@ -615,7 +615,7 @@
 /* Pointer into a tags table for the file to the anchor we need to adjust as
    a result of byte counts changing due to character encoding conversion or
    inserted/deleted text. */
-static NODE **anchor_to_adjust;
+static TAG **anchor_to_adjust;
 static int node_offset; /* Offset within file buffer of first byte of node. */
 
 /* Difference between the number of bytes input in the file and
@@ -1628,33 +1628,28 @@
   return 0;
 }
 
-/* Scan (*NODE_PTR)->contents and record location and contents of
-   cross-references and menu items.  Convert character encoding of
-   node contents to that of the user if the two are known to be
-   different.  If preprocess_nodes_p == 1, remove Info syntax in contents.
+/* Scan contents of NODE, recording cross-references and similar.
 
-   If FB is non-null, it is the file containing the node, and NODE_PTR is an 
-   offset into FB->tags.  Return a new node.
-  
-   If the node has not come from a file, FB is a null pointer.  Update
-   **NODE_PTR and return null. */
-NODE *
-scan_node_contents (FILE_BUFFER *fb, NODE **node_ptr)
+   Convert character encoding of node contents to that of the user if the two 
+   are known to be different.  If PREPROCESS_NODES_P == 1, remove Info syntax 
+   in contents.
+
+   If FB is non-null, it is the file containing the node, and TAG_PTR is an 
+   offset into FB->tags.  If the node contents are rewritten, adjust anchors
+   that occur in the node. */
+
+void
+scan_node_contents (NODE *node, FILE_BUFFER *fb, TAG **tag_ptr)
 {
   int in_menu = 0;
   char *match;
 
-  NODE *node; /* Return value */
-
   REFERENCE **refs = NULL;
   size_t refs_index = 0, refs_slots = 0;
 
   /* Whether an index tag was seen. */
   int in_index = 0;
 
-  node = xmalloc (sizeof (NODE));
-  *node = **node_ptr;
-
   rewrite_p = preprocess_nodes_p;
 
   init_output_stream (fb);
@@ -1664,7 +1659,7 @@
       char *file_contents;
 
       /* Set anchor_to_adjust to first anchor in node, if any. */
-      anchor_to_adjust = node_ptr + 1;
+      anchor_to_adjust = tag_ptr + 1;
       if (!*anchor_to_adjust)
         anchor_to_adjust = 0;
       else if (*anchor_to_adjust && (*anchor_to_adjust)->nodelen != 0)
@@ -1676,10 +1671,10 @@
         {
           FILE_BUFFER *f = info_find_subfile (node->subfile);
           if (!f)
-            return 0; /* This shouldn't happen. */
+            return; /* This shouldn't happen. */
           file_contents = f->contents;
         }
-      node_offset = node->nodestart
+      node_offset = (*tag_ptr)->nodestart
         + skip_node_separator (file_contents + node->nodestart);
     }
   else
@@ -1777,25 +1772,7 @@
          written.  Subtracting 1 gives the offset of our terminating
          null, that is, the length. */
       node->nodelen = text_buffer_off (&output_buf) - 1;
-
-      /* Node header was deleted. */
-      if (preprocess_nodes_p)
-        node->body_start = 0;
     }
-
-  if (!fb)
-    {
-      if (node->flags & N_WasRewritten)
-        free ((*node_ptr)->contents);
-      **node_ptr = *node;
-      free (node);
-      return 0;
-    }
-  else
-    {
-      (*node_ptr)->contents = 0;
-      return node;
-    }
 }
 
 

Modified: trunk/info/info-utils.h
===================================================================
--- trunk/info/info-utils.h     2014-12-30 18:58:57 UTC (rev 6010)
+++ trunk/info/info-utils.h     2014-12-30 21:54:02 UTC (rev 6011)
@@ -48,7 +48,7 @@
 long read_quoted_string (char *start, char *terminator, int lines,
                          char **output);
 
-NODE *scan_node_contents (FILE_BUFFER *fb, NODE **node_ptr);
+void scan_node_contents (NODE *node, FILE_BUFFER *fb, TAG **tag_ptr);
 
 /* Get the menu entry associated with LABEL in NODE.  Return a
    pointer to the reference if found, or NULL.  If SLOPPY, accept

Modified: trunk/info/man.c
===================================================================
--- trunk/info/man.c    2014-12-30 18:58:57 UTC (rev 6010)
+++ trunk/info/man.c    2014-12-30 21:54:02 UTC (rev 6011)
@@ -56,41 +56,39 @@
 static REFERENCE **xrefs_of_manpage (NODE *node);
 static char *read_from_fd (int fd);
 static char *get_manpage_contents (char *pagename);
-static void create_manpage_file_buffer (void);
 
 /* We store the contents of retrieved man pages in here. */
-static FILE_BUFFER *manpage_file_buffer = 0;
+static NODE **manpage_nodes = 0;
+size_t manpage_node_index = 0;
+size_t manpage_node_slots = 0;
 
 NODE *
 get_manpage_node (char *pagename)
 {
-  int i;
-  NODE *tag, *node = 0;
+  NODE *node = 0, **n, *node2 = 0;
   char *page;
 
-  if (!manpage_file_buffer)
-    create_manpage_file_buffer ();
+  if (manpage_node_index > 0)
+    for (n = manpage_nodes; (node = *n); n++)
+      if (!strcmp (node->nodename, pagename))
+        break;
 
-  for (i = 0; (tag = manpage_file_buffer->tags[i]); i++)
-    if (!strcmp (tag->nodename, pagename))
-      break;
-
   /* Node was not found, so we have to create it. */
-  if (!tag)
+  if (!node)
     {
-      tag = info_create_node ();
-      tag->fullpath = MANPAGE_FILE_BUFFER_NAME;
-      tag->nodename = xstrdup (pagename);
-      tag->flags |= (N_HasTagsTable | N_IsManPage | N_IsInternal);
+      node = info_create_node ();
+      node->fullpath = MANPAGE_FILE_BUFFER_NAME;
+      node->nodename = xstrdup (pagename);
+      node->flags |= (N_HasTagsTable | N_IsManPage | N_IsInternal);
 
       /* Save this node. */
-      add_pointer_to_array (tag, i,
-                            manpage_file_buffer->tags,
-                            manpage_file_buffer->tags_slots, 100);
+      add_pointer_to_array (node, manpage_node_index,
+                            manpage_nodes,
+                            manpage_node_slots, 100);
     } 
 
   /* Node wasn't found, or its contents were freed since last time. */
-  if (!tag->contents)
+  if (!node->contents)
     {
       char header[1024];
       int hlen, plen;
@@ -108,49 +106,33 @@
                    INFO_UP_LABEL);
           hlen = strlen (header);
 
-          tag->contents = xcalloc (1, hlen + plen + 1);
-          memcpy (tag->contents, header, hlen);
-          memcpy (tag->contents + hlen, page, plen);
+          node->contents = xcalloc (1, hlen + plen + 1);
+          memcpy (node->contents, header, hlen);
+          memcpy (node->contents + hlen, page, plen);
 
           /* Set nodelen. */
-          tag->nodelen = hlen + plen;
+          node->nodelen = hlen + plen;
 
           /* FIXME: Don't allocate page just to immediately free it. */
           free (page);
         }
       else
         {
-          tag->contents = page;
-          tag->nodelen = plen;
+          node->contents = page;
+          node->nodelen = plen;
         }
 
-      tag->body_start = strcspn (tag->contents, "\n");
+      node->body_start = strcspn (node->contents, "\n");
     }
 
-  node = xmalloc (sizeof (NODE));
-  *node = *tag;
-  node->references = xrefs_of_manpage (node);
-  node->nodename = xstrdup (pagename);
-  node->up = xstrdup ("(dir)");
-  return node;
+  node2 = xmalloc (sizeof (NODE));
+  *node2 = *node;
+  node2->references = xrefs_of_manpage (node2);
+  node2->nodename = xstrdup (pagename);
+  node2->up = xstrdup ("(dir)");
+  return node2;
 }
 
-static void
-create_manpage_file_buffer (void)
-{
-  manpage_file_buffer = make_file_buffer ();
-  manpage_file_buffer->filename = xstrdup (MANPAGE_FILE_BUFFER_NAME);
-  manpage_file_buffer->fullpath = xstrdup (MANPAGE_FILE_BUFFER_NAME);
-  manpage_file_buffer->finfo.st_size = 0;
-  manpage_file_buffer->filesize = 0;
-  manpage_file_buffer->contents = NULL;
-  manpage_file_buffer->flags = (N_IsInternal | N_CannotGC | N_IsManPage);
-
-  /* Initialize empty tags table. */
-  manpage_file_buffer->tags = xmalloc (sizeof (NODE *));
-  manpage_file_buffer->tags[0] = 0;
-}
-
 /* Scan the list of directories in PATH looking for FILENAME.  If we find
    one that is an executable file, return it as a new string.  Otherwise,
    return a NULL pointer. */

Modified: trunk/info/nodemenu.c
===================================================================
--- trunk/info/nodemenu.c       2014-12-30 18:58:57 UTC (rev 6010)
+++ trunk/info/nodemenu.c       2014-12-30 21:54:02 UTC (rev 6011)
@@ -197,7 +197,7 @@
     free (lines);
 
   node = text_buffer_to_node (&message);
-  scan_node_contents (0, &node);
+  scan_node_contents (node, 0, 0);
 
   return node;
 }

Modified: trunk/info/nodes.c
===================================================================
--- trunk/info/nodes.c  2014-12-30 18:58:57 UTC (rev 6010)
+++ trunk/info/nodes.c  2014-12-30 21:54:02 UTC (rev 6011)
@@ -27,6 +27,7 @@
 #include "info-utils.h"
 #include "tag.h"
 #include "man.h"
+#include "variables.h"
 
 
 /* Global variables.  */
@@ -51,7 +52,7 @@
 static void get_tags_of_indirect_tags_table (FILE_BUFFER *file_buffer,
     SEARCH_BINDING *indirect_binding, SEARCH_BINDING *tags_binding);
 static void free_file_buffer_tags (FILE_BUFFER *file_buffer);
-static void free_info_tag (NODE *tag);
+static void free_info_tag (TAG *tag);
 
 /* 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. */
@@ -145,12 +146,12 @@
 
 /* Set fields on new tag table entry. */
 static void
-init_file_buffer_tag (FILE_BUFFER *fb, NODE *entry)
+init_file_buffer_tag (FILE_BUFFER *fb, TAG *entry)
 {
   if (fb->flags & N_HasTagsTable)
     {
       entry->flags |= N_HasTagsTable;
-      entry->fullpath = fb->fullpath;
+      entry->filename = fb->fullpath;
 
       if (fb->flags & N_TagsIndirect)
         entry->flags |= N_TagsIndirect;
@@ -177,7 +178,7 @@
     {
       int start;
       char *nodeline;
-      NODE *entry;
+      TAG *entry;
       int anchor = 0;
 
       /* Skip past the characters just found. */
@@ -205,7 +206,7 @@
       start += skip_whitespace (nodeline + start);
 
       /* Record nodename and nodestart. */
-      entry = info_create_node ();
+      entry = info_create_tag ();
       read_quoted_string (nodeline + start, ",\n\r\t", 0, &entry->nodename);
       entry->nodestart = nodestart;
 
@@ -217,7 +218,7 @@
         /* Record that the length is unknown. */
         entry->nodelen = -1;
 
-      entry->fullpath = file_buffer->fullpath;
+      entry->filename = file_buffer->fullpath;
 
       /* Add this tag to the array of tag structures in this FILE_BUFFER. */
       add_pointer_to_array (entry, tags_index, file_buffer->tags,
@@ -255,7 +256,7 @@
      Do each line until we find one that doesn't contain a node name. */
   while (search_forward ("\n", tmp_search, &position) == search_success)
     {
-      NODE *entry;
+      TAG *entry;
       char *nodedef;
       unsigned p;
       int anchor = 0;
@@ -286,7 +287,7 @@
       if (name_offset == -1)
         break;
 
-      entry = info_create_node ();
+      entry = info_create_tag ();
 
       init_file_buffer_tag (file_buffer, entry);
 
@@ -313,7 +314,7 @@
 
       /* The filename of this node is currently known as the same as the
          name of this file. */
-      entry->fullpath = file_buffer->fullpath;
+      entry->filename = file_buffer->fullpath;
 
       /* Add this node structure to the array of node structures in this
          FILE_BUFFER. */
@@ -341,7 +342,7 @@
 
   SUBFILE **subfiles = NULL;
   size_t subfiles_index = 0, subfiles_slots = 0;
-  NODE *entry;
+  TAG *entry;
 
   /* Remember that tags table was indirect. */
   file_buffer->flags |= N_TagsIndirect;
@@ -480,7 +481,7 @@
              starting position.  This means that the subfile directly
              preceding this one is the one containing the node. */
 
-          entry->subfile = file_buffer->subfiles[i - 1];
+          entry->filename = file_buffer->subfiles[i - 1];
           entry->nodestart -= subfiles[i - 1]->first_byte;
           entry->nodestart += header_length;
         }
@@ -504,7 +505,7 @@
 
   if (file_buffer->tags)
     {
-      NODE *tag;
+      TAG *tag;
 
       for (i = 0; (tag = file_buffer->tags[i]); i++)
         free_info_tag (tag);
@@ -526,12 +527,8 @@
 
 /* Free the data associated with TAG, as well as TAG itself. */
 static void
-free_info_tag (NODE *tag)
+free_info_tag (TAG *tag)
 {
-  if (tag->flags & N_WasRewritten)
-    free (tag->contents);
-
-  if (tag->references) info_free_references (tag->references);
   free (tag->nodename);
   
   /* We don't free tag->filename, because that filename is part of the
@@ -867,6 +864,22 @@
                                       char *filename_in, char *nodename_in);
 static void node_set_body_start (NODE *node);
 
+/* Return a pointer to a newly allocated TAG structure, with
+   fields filled in. */
+TAG *
+info_create_tag (void)
+{
+  TAG *t = xmalloc (sizeof (TAG));
+
+  t->filename = 0;
+  t->nodename = 0;
+  t->nodestart = -1;
+  t->orig_nodestart = -1;
+  t->nodelen = -1;
+  t->flags = 0;
+
+  return t;
+}
 /* Return a pointer to a newly allocated NODE structure, with
    fields filled in. */
 NODE *
@@ -1062,7 +1075,7 @@
      bother building a node list for it. */
   else if (file_buffer->tags)
     {
-      NODE *tag;
+      TAG *tag;
       int i;
 
       /* If no tags at all (possibly a misformatted info file), quit.  */
@@ -1121,7 +1134,7 @@
    Set NODE->nodestart directly on the separator that precedes this node.
    If the node could not be found, return 0. */
 static int
-adjust_nodestart (FILE_BUFFER *fb, NODE *node, int slack)
+adjust_nodestart (FILE_BUFFER *fb, TAG *node, int slack)
 {
   long position = -1;
   SEARCH_BINDING s;
@@ -1179,7 +1192,7 @@
    If we have to update the contents of the file, *PARENT and *FB_PTR can be 
    changed to a different FILE_BUFFER. */
 static int
-find_node_from_tag (FILE_BUFFER **parent, FILE_BUFFER **fb_ptr, NODE *tag)
+find_node_from_tag (FILE_BUFFER **parent, FILE_BUFFER **fb_ptr, TAG *tag)
 {
   int success;
 
@@ -1257,7 +1270,7 @@
 
 /* Calculate the length of the node. */
 static void
-set_tag_nodelen (FILE_BUFFER *subfile, NODE *tag)
+set_tag_nodelen (FILE_BUFFER *subfile, TAG *tag)
 {
   SEARCH_BINDING node_body;
 
@@ -1272,23 +1285,24 @@
 /* Return the node described by *TAG_PTR, retrieving contents from subfile
    if the file is split.  Return 0 on failure. */
 NODE *
-info_node_of_tag (FILE_BUFFER *fb, NODE **tag_ptr)
+info_node_of_tag (FILE_BUFFER *fb, TAG **tag_ptr)
 {
-  NODE *tag = *tag_ptr;
+  TAG *tag = *tag_ptr;
   NODE *node;
   int is_anchor;
-  NODE *anchor_tag;
+  TAG *anchor_tag;
   int node_pos, anchor_pos;
 
   FILE_BUFFER *parent; /* File containing tag table. */
   FILE_BUFFER *subfile; /* File containing node. */
  
-  if (!tag->subfile)
+  if (!strcmp (fb->fullpath, tag->filename))
     parent = subfile = fb;
   else
     {
+      /* This is a split file. */
       parent = fb;
-      subfile = info_find_subfile (tag->subfile);
+      subfile = info_find_subfile (tag->filename);
     }
 
   if (!subfile)
@@ -1347,16 +1361,29 @@
       set_tag_nodelen (subfile, tag);
     }
 
-  tag->contents = subfile->contents + tag->nodestart;
-  tag->contents += skip_node_separator (tag->contents);
-  node_set_body_start (tag);
 
+  /* Initialize the node from the tag. */
+  node = info_create_node ();
+
+  node->nodename = xstrdup (tag->nodename);
+  node->nodestart = tag->nodestart;
+  node->nodelen = tag->nodelen;
+  node->flags = tag->flags;
+  node->fullpath = fb->fullpath;
+  if (parent != subfile)
+    node->subfile = tag->filename;
+
+  node->contents = subfile->contents + tag->nodestart;
+  node->contents += skip_node_separator (node->contents);
+
   /* Read locations of references in node and similar.  Strip Info file
      syntax from node if preprocess_nodes=On.  Adjust the offsets of
      anchors that occur within the node.*/
-  node = scan_node_contents (parent, tag_ptr);
-  node->nodename = xstrdup (node->nodename);
+  scan_node_contents (node, parent, tag_ptr);
 
+  if (!preprocess_nodes_p)
+    node_set_body_start (node);
+
   /* We can't set this when tag table is built, because
      if file is split, we don't know which of the sub-files
      are compressed. */

Modified: trunk/info/nodes.h
===================================================================
--- trunk/info/nodes.h  2014-12-30 18:58:57 UTC (rev 6010)
+++ trunk/info/nodes.h  2014-12-30 21:54:02 UTC (rev 6011)
@@ -44,10 +44,7 @@
   char *subfile;                /* File containing node for split files. */
   char *nodename;               /* The name of this node. */
   char *contents;               /* Characters appearing in this node. */
-  long nodelen;                 /* The length of the CONTENTS member.
-                                   nodelen == -1 if length is unknown
-                                   because node hasn't been read yet.
-                                   nodelen == 0 if it is an anchor. */
+  long nodelen;                 /* The length of the CONTENTS member. */
   unsigned long display_pos;    /* Where to display at, if nonzero.  */
   long body_start;              /* Offset of the actual node body */
   int flags;                    /* See immediately below. */
@@ -95,6 +92,25 @@
 #define INFO_FF     '\014'
 #define INFO_TAGSEP '\177'
 
+/* For each logical file that we have loaded, we keep a list of
+   the names of the nodes that are found in that file.  A pointer to
+   a node in an info file is called a "tag".  For split files, the
+   tag pointer is "indirect"; that is, the pointer also contains the
+   name of the split file where the node can be found.  For non-split
+   files, the filename member simply contains the name of the
+   current file. */
+typedef struct {
+  char *filename;               /* The file where this node can be found. */
+  char *nodename;               /* The node pointed to by this tag. */
+  long nodestart;               /* The offset of the start of this node. */
+  long orig_nodestart;          /* The value read from the tag table. */
+  size_t nodelen;               /* The length of this node.
+                                   nodelen == -1 if length is unknown
+                                   because node hasn't been read yet.
+                                   nodelen == 0 if it is an anchor. */
+  int flags;                    /* Same as NODE.flags. */
+} TAG;
+
 /* The following structure is used to remember information about the contents
    of Info files that we have loaded at least once before.  The FINFO member
    is present so that we can reload the file if it has been modified since
@@ -109,14 +125,7 @@
   char *contents;               /* The contents of this particular file. */
   size_t filesize;              /* The number of bytes this file expands to. */
   char **subfiles;              /* If non-null, the list of subfiles. */
-  NODE **tags;                  /* If non-null, the tags table. 
-           For each logical file that we have loaded, we keep a list of
-           the names of the nodes that are found in that file.  A pointer to
-           a node in an info file is called a "tag".  For split files, the
-           tag pointer is "indirect"; that is, the pointer also contains the
-           name of the split file where the node can be found.  For non-split
-           files, the filename member simply contains the name of the
-           current file. */
+  TAG **tags;                   /* If non-null, the tags table. */
   size_t tags_slots;            /* Number of slots allocated for TAGS. */
   int flags;                    /* Various flags.  Mimics of N_* flags. */
   char *encoding;               /* Name of character encoding of file. */
@@ -136,6 +145,8 @@
 
 FILE_BUFFER *info_find_subfile (char *filename);
 
+TAG *info_create_tag (void);
+
 /* Return a pointer to a new NODE structure. */
 extern NODE *info_create_node (void);
 
@@ -149,7 +160,7 @@
 extern NODE *info_get_node_with_defaults (char *filename, char *nodename,
                                           NODE *defaults);
 
-extern NODE *info_node_of_tag (FILE_BUFFER *fb, NODE **tag_ptr);
+extern NODE *info_node_of_tag (FILE_BUFFER *fb, TAG **tag_ptr);
 
 /* Return a pointer to a NODE structure for the Info node NODENAME in
    FILE_BUFFER.  NODENAME can be passed as NULL, in which case the

Modified: trunk/info/session.c
===================================================================
--- trunk/info/session.c        2014-12-30 18:58:57 UTC (rev 6010)
+++ trunk/info/session.c        2014-12-30 21:54:02 UTC (rev 6011)
@@ -104,7 +104,7 @@
   allfiles_node->nodelen = text_buffer_off (&text);
   allfiles_node->body_start = strcspn (allfiles_node->contents, "\n");
 
-  scan_node_contents (0, &allfiles_node);
+  scan_node_contents (allfiles_node, 0, 0);
 }
 
 /* Begin an info session finding the nodes specified by REFERENCES.  For
@@ -3211,7 +3211,7 @@
 find_invocation_node_by_nodename (FILE_BUFFER *fb, char *program)
 {
   NODE *node = 0;
-  NODE **n;
+  TAG **n;
   char *try1, *try2;
   n = fb->tags;
   if (!n)
@@ -3921,7 +3921,7 @@
   int number_of_tags, starting_tag, current_tag = -1;
   NODE *node = window->node; /* Node to search in. */
   char *subfile_name = 0;
-  NODE *tag;
+  TAG *tag;
   char *msg = 0;
   
   /* If this node isn't part of a larger file, search this node only. */
@@ -3939,7 +3939,7 @@
         if (strcmp (initial_nodename, file_buffer->tags[i]->nodename) == 0)
           {
             starting_tag = i;
-            subfile_name = file_buffer->tags[i]->subfile;
+            subfile_name = file_buffer->tags[i]->filename;
           }
 
       number_of_tags = i;
@@ -4008,13 +4008,13 @@
       current_tag = i;
 
       /* Display message when searching a new subfile. */
-      if (!echo_area_is_active && tag->subfile != subfile_name)
+      if (!echo_area_is_active && tag->filename != subfile_name)
         {
+          subfile_name = tag->filename;
+
           window_message_in_echo_area
             (_("Searching subfile %s ..."),
-             filename_non_directory (tag->subfile));
-
-          subfile_name = tag->subfile;
+             filename_non_directory (subfile_name));
         }
 
       /* Get a new node to search in. */




reply via email to

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