ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/src/vendor/less/dist/ifile.c
(Generate patch)

Comparing vendor/less/dist/ifile.c (file contents):
Revision 11359 by laffer1, Sun Dec 1 02:26:57 2013 UTC vs.
Revision 11360 by laffer1, Fri Jul 6 12:43:09 2018 UTC

# Line 1 | Line 1
1   /*
2 < * Copyright (C) 1984-2012  Mark Nudelman
2 > * Copyright (C) 1984-2017  Mark Nudelman
3   *
4   * You may distribute under the terms of either the GNU General Public
5   * License or the Less License, as specified in the README file.
# Line 24 | Line 24
24   extern IFILE    curr_ifile;
25  
26   struct ifile {
27 <        struct ifile *h_next;           /* Links for command line list */
27 >        struct ifile *h_next;           /* Links for command line list */
28          struct ifile *h_prev;
29 <        char *h_filename;               /* Name of the file */
30 <        void *h_filestate;              /* File state (used in ch.c) */
31 <        int h_index;                    /* Index within command line list */
32 <        int h_hold;                     /* Hold count */
33 <        char h_opened;                  /* Has this ifile been opened? */
34 <        struct scrpos h_scrpos;         /* Saved position within the file */
29 >        char *h_filename;               /* Name of the file */
30 >        void *h_filestate;              /* File state (used in ch.c) */
31 >        int h_index;                    /* Index within command line list */
32 >        int h_hold;                     /* Hold count */
33 >        char h_opened;                  /* Has this ifile been opened? */
34 >        struct scrpos h_scrpos;         /* Saved position within the file */
35 >        void *h_altpipe;                /* Alt pipe */
36 >        char *h_altfilename;            /* Alt filename */
37   };
38  
39   /*
# Line 50 | Line 52 | static int ifiles = 0;
52  
53          static void
54   incr_index(p, incr)
55 <        register struct ifile *p;
55 >        struct ifile *p;
56          int incr;
57   {
58          for (;  p != &anchor;  p = p->h_next)
# Line 107 | Line 109 | new_ifile(filename, prev)
109          char *filename;
110          struct ifile *prev;
111   {
112 <        register struct ifile *p;
112 >        struct ifile *p;
113  
114          /*
115           * Allocate and initialize structure.
# Line 129 | Line 131 | new_ifile(filename, prev)
131   del_ifile(h)
132          IFILE h;
133   {
134 <        register struct ifile *p;
134 >        struct ifile *p;
135  
136          if (h == NULL_IFILE)
137                  return;
# Line 153 | Line 155 | del_ifile(h)
155   next_ifile(h)
156          IFILE h;
157   {
158 <        register struct ifile *p;
158 >        struct ifile *p;
159  
160          p = (h == NULL_IFILE) ? &anchor : int_ifile(h);
161          if (p->h_next == &anchor)
# Line 168 | Line 170 | next_ifile(h)
170   prev_ifile(h)
171          IFILE h;
172   {
173 <        register struct ifile *p;
173 >        struct ifile *p;
174  
175          p = (h == NULL_IFILE) ? &anchor : int_ifile(h);
176          if (p->h_prev == &anchor)
# Line 208 | Line 210 | nifile()
210   find_ifile(filename)
211          char *filename;
212   {
213 <        register struct ifile *p;
213 >        struct ifile *p;
214  
215          for (p = anchor.h_next;  p != &anchor;  p = p->h_next)
216                  if (strcmp(filename, p->h_filename) == 0)
# Line 226 | Line 228 | get_ifile(filename, prev)
228          char *filename;
229          IFILE prev;
230   {
231 <        register struct ifile *p;
231 >        struct ifile *p;
232  
233          if ((p = find_ifile(filename)) == NULL)
234                  p = new_ifile(filename, int_ifile(prev));
# Line 328 | Line 330 | set_filestate(ifile, filestate)
330          int_ifile(ifile)->h_filestate = filestate;
331   }
332  
333 +        public void
334 + set_altpipe(ifile, p)
335 +        IFILE ifile;
336 +        void *p;
337 + {
338 +        int_ifile(ifile)->h_altpipe = p;
339 + }
340 +
341 +        public void *
342 + get_altpipe(ifile)
343 +        IFILE ifile;
344 + {
345 +        return (int_ifile(ifile)->h_altpipe);
346 + }
347 +
348 +        public void
349 + set_altfilename(ifile, altfilename)
350 +        IFILE ifile;
351 +        char *altfilename;
352 + {
353 +        struct ifile *p = int_ifile(ifile);
354 +        if (p->h_altfilename != NULL)
355 +                free(p->h_altfilename);
356 +        p->h_altfilename = altfilename;
357 + }
358 +
359 +        public char *
360 + get_altfilename(ifile)
361 +        IFILE ifile;
362 + {
363 +        return (int_ifile(ifile)->h_altfilename);
364 + }
365 +
366   #if 0
367          public void
368   if_dump()
369   {
370 <        register struct ifile *p;
370 >        struct ifile *p;
371  
372          for (p = anchor.h_next;  p != &anchor;  p = p->h_next)
373          {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines