texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: * info/nodes.c, info/nodes.h, info/session.c: sep


From: Patrice Dumas
Subject: branch master updated: * info/nodes.c, info/nodes.h, info/session.c: separate flags for nodes and tags from flags for file buffers. Use a leading F_ for file buffer flags.
Date: Sat, 12 Oct 2024 08:46:33 -0400

This is an automated email from the git hooks/post-receive script.

pertusus pushed a commit to branch master
in repository texinfo.

The following commit(s) were added to refs/heads/master by this push:
     new 086a3dabd8 * info/nodes.c, info/nodes.h, info/session.c: separate 
flags for nodes and tags from flags for file buffers.  Use a leading F_ for 
file buffer flags.
086a3dabd8 is described below

commit 086a3dabd876757ea3dda56c1bf9e41a4dfe2f19
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sat Oct 12 14:46:24 2024 +0200

    * info/nodes.c, info/nodes.h, info/session.c: separate flags for nodes
    and tags from flags for file buffers.  Use a leading F_ for file
    buffer flags.
---
 ChangeLog      |  6 ++++++
 info/nodes.c   | 18 +++++++++---------
 info/nodes.h   | 28 +++++++++++++++-------------
 info/session.c | 10 +++++-----
 4 files changed, 35 insertions(+), 27 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 8dafb0aefc..d625b878a9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2024-10-12  Patrice Dumas  <pertusus@free.fr>
+
+       * info/nodes.c, info/nodes.h, info/session.c: separate flags for nodes
+       and tags from flags for file buffers.  Use a leading F_ for file
+       buffer flags.
+
 2024-10-12  Patrice Dumas  <pertusus@free.fr>
 
        * info/nodes.c (info_node_of_tag_ext): do not set N_IsCompressed on
diff --git a/info/nodes.c b/info/nodes.c
index 4cfed800a9..cb68dfb8d1 100644
--- a/info/nodes.c
+++ b/info/nodes.c
@@ -65,7 +65,7 @@ build_tags_and_nodes (FILE_BUFFER *file_buffer)
   size_t tags_table_begin, tags_table_end;
 
   free_file_buffer_tags (file_buffer);
-  file_buffer->flags &= ~N_HasTagsTable;
+  file_buffer->flags &= ~F_HasTagsTable;
 
   /* See if there is a tags table in this info file. */
   binding.buffer = file_buffer->contents;
@@ -98,7 +98,7 @@ build_tags_and_nodes (FILE_BUFFER *file_buffer)
 
   /* The file contains a valid tags table.  Fill the FILE_BUFFER's
      tags member. */
-  file_buffer->flags |= N_HasTagsTable;
+  file_buffer->flags |= F_HasTagsTable;
   tags_table_begin = position;
 
   position += skip_node_separator (file_buffer->contents + position);
@@ -152,7 +152,7 @@ no_tags_table:
 static void
 init_file_buffer_tag (FILE_BUFFER *fb, TAG *entry)
 {
-  if (fb->flags & N_HasTagsTable)
+  if (fb->flags & F_HasTagsTable)
     {
       entry->filename = fb->fullpath;
     }
@@ -360,7 +360,7 @@ get_tags_of_indirect_tags_table (FILE_BUFFER *file_buffer,
   TAG *entry;
 
   /* Remember that tags table was indirect. */
-  file_buffer->flags |= N_TagsIndirect;
+  file_buffer->flags |= F_TagsIndirect;
 
   /* First get the list of tags from the tags table.  Then lookup the
      associated file in the indirect list for each tag, and update it. */
@@ -743,7 +743,7 @@ info_load_file (char *fullpath, int is_subfile)
   file_buffer->filesize = filesize;
   file_buffer->contents = contents;
   if (compressed)
-    file_buffer->flags |= N_IsCompressed;
+    file_buffer->flags |= F_IsCompressed;
   
   /* Find encoding of file, if set */
   get_file_character_encoding (file_buffer);
@@ -762,7 +762,7 @@ info_load_file (char *fullpath, int is_subfile)
         }
     }
   else
-    file_buffer->flags |= N_Subfile;
+    file_buffer->flags |= F_Subfile;
 
   /* If the file was loaded, remember the name under which it was found. */
   if (file_buffer)
@@ -839,7 +839,7 @@ make_file_buffer (void)
 static void
 forget_info_file (FILE_BUFFER *file_buffer)
 {
-  file_buffer->flags |= N_Gone;
+  file_buffer->flags |= F_Gone;
   file_buffer->filename[0] = '\0';
   file_buffer->fullpath = "";
   memset (&file_buffer->finfo, 0, sizeof (struct stat));
@@ -856,7 +856,7 @@ info_reload_file_buffer_contents (FILE_BUFFER *fb)
   int is_compressed;
   size_t filesize;
 
-  fb->flags &= ~N_IsCompressed;
+  fb->flags &= ~F_IsCompressed;
 
   /* Let the filesystem do all the work for us. */
   fb->contents =
@@ -867,7 +867,7 @@ info_reload_file_buffer_contents (FILE_BUFFER *fb)
   fb->filesize = filesize;
 
   if (is_compressed)
-    fb->flags |= N_IsCompressed;
+    fb->flags |= F_IsCompressed;
 }
 
 
diff --git a/info/nodes.h b/info/nodes.h
index ba3ac231df..e4b13ea69e 100644
--- a/info/nodes.h
+++ b/info/nodes.h
@@ -53,19 +53,21 @@ typedef struct {
   int active_menu;              /* Used for subnodes search. */
 } NODE;
 
-/* Values for NODE.flags or FILE_BUFFER.flags. */
-#define N_HasTagsTable 0x01     /* This node was found through a tags table. */
-#define N_TagsIndirect 0x02     /* The tags table was an indirect one. */
-#define N_IsCompressed 0x08     /* The file is compressed on disk. */
-#define N_IsInternal   0x10     /* This node was made by Info. */
-#define N_IsManPage    0x40     /* This node is a manpage. */
-#define N_WasRewritten 0x100    /* NODE->contents can be passed to free(). */ 
-#define N_IsIndex      0x200    /* An index node. */
-#define N_IsDir        0x400    /* A dir node. */
-#define N_Subfile      0x800    /* File buffer is a subfile of a split file. */
-#define N_Gone         0x1000   /* File is no more. */
-#define N_Simple       0x2000   /* Data about cross-references is missing. */
-#define N_SeenBySearch 0x4000   /* Node has already been seen in a search. */
+/* Values for FILE_BUFFER.flags. */
+#define F_HasTagsTable 0x01     /* This file has a tags table. */
+#define F_TagsIndirect 0x02     /* The tags table was an indirect one. */
+#define F_IsCompressed 0x04     /* The file is compressed on disk. */
+#define F_Subfile      0x08     /* File buffer is a subfile of a split file. */
+#define F_Gone         0x10     /* File is no more. */
+
+/* Values for NODE.flags */
+#define N_IsInternal   0x01     /* This node was made by Info. */
+#define N_IsManPage    0x02     /* This node is a manpage. */
+#define N_WasRewritten 0x04     /* NODE->contents can be passed to free(). */
+#define N_IsIndex      0x08     /* An index node. */
+#define N_IsDir        0x10     /* A dir node. */
+#define N_Simple       0x20     /* Data about cross-references is missing. */
+#define N_SeenBySearch 0x40     /* Node has already been seen in a search. */
 
 /* String constants. */
 #define INFO_FILE_LABEL                 "File:"
diff --git a/info/session.c b/info/session.c
index 20b33dee44..dc35832d05 100644
--- a/info/session.c
+++ b/info/session.c
@@ -1745,7 +1745,7 @@ gc_file_buffers_and_nodes (void)
 
               /* Each node should match at most one file, either a subfile or 
a 
                  non-split file. */
-              if (fb->flags & N_Subfile)
+              if (fb->flags & F_Subfile)
                 {
                   if (n->subfile && !FILENAME_CMP (fb->fullpath, n->subfile))
                     {
@@ -1753,7 +1753,7 @@ gc_file_buffers_and_nodes (void)
                       break;
                     }
                 }
-              else if (!(fb->flags & N_TagsIndirect))
+              else if (!(fb->flags & F_TagsIndirect))
                 {
                   if (n->fullpath && !FILENAME_CMP (fb->fullpath, n->fullpath))
                     {
@@ -1773,7 +1773,7 @@ gc_file_buffers_and_nodes (void)
           FILE_BUFFER *fb = info_loaded_files[i];
           TAG **t;
 
-          if (fb->flags & N_TagsIndirect)
+          if (fb->flags & F_TagsIndirect)
             continue;
 
           /* If already gc-ed, do nothing. */
@@ -1783,12 +1783,12 @@ gc_file_buffers_and_nodes (void)
           /* If this file had to be uncompressed, check to see if we should
              gc it.  This means that the user-variable "gc-compressed-files"
              is non-zero. */
-          if ((fb->flags & N_IsCompressed) && !gc_compressed_files)
+          if ((fb->flags & F_IsCompressed) && !gc_compressed_files)
             continue;
 
           /* Don't free file buffers corresponding to files that aren't there 
              any more, because a node may still refer to them. */
-          if (fb->flags & N_Gone)
+          if (fb->flags & F_Gone)
             continue;
 
           free (fb->contents);



reply via email to

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