Lines Matching defs:ifile
14 * It is actually a pointer to an ifile structure,
26 struct ifile {
27 struct ifile *h_next; /* Links for command line list */
28 struct ifile *h_prev;
34 char h_opened; /* Has this ifile been opened? */
44 #define int_ifile(h) ((struct ifile *)(h))
50 static struct ifile anchor = { &anchor, &anchor, NULL, NULL, NULL, 0, 0, '\0',
54 static void incr_index(struct ifile *p, int incr)
61 * Link an ifile into the ifile list.
63 static void link_ifile(struct ifile *p, struct ifile *prev)
84 * Unlink an ifile from the ifile list.
86 static void unlink_ifile(struct ifile *p)
95 * Allocate a new ifile structure and stick a filename in it.
98 * Return a pointer to the new ifile structure.
100 static struct ifile * new_ifile(constant char *filename, struct ifile *prev)
102 struct ifile *p;
107 p = (struct ifile *) ecalloc(1, sizeof(struct ifile));
127 * Delete an existing ifile structure.
131 struct ifile *p;
136 * If the ifile we're deleting is the currently open ifile,
150 * Get the ifile after a given one in the list.
154 struct ifile *p;
163 * Get the ifile before a given one in the list.
167 struct ifile *p;
176 * Return a different ifile from the given one.
178 public IFILE getoff_ifile(IFILE ifile)
182 if ((newifile = prev_ifile(ifile)) != NULL_IFILE)
184 if ((newifile = next_ifile(ifile)) != NULL_IFILE)
198 * Find an ifile structure, given a filename.
200 static struct ifile * find_ifile(constant char *filename)
202 struct ifile *p;
228 * Get the ifile associated with a filename.
230 * insert the new ifile after "prev" in the list.
234 struct ifile *p;
242 * Get the display filename associated with a ifile.
244 public constant char * get_filename(IFILE ifile)
246 if (ifile == NULL)
248 return (int_ifile(ifile)->h_filename);
252 * Get the canonical filename associated with a ifile.
254 public constant char * get_real_filename(IFILE ifile)
256 if (ifile == NULL)
258 return (int_ifile(ifile)->h_rfilename);
262 * Get the index of the file associated with a ifile.
264 public int get_index(IFILE ifile)
266 return (int_ifile(ifile)->h_index);
272 public void store_pos(IFILE ifile, struct scrpos *scrpos)
274 int_ifile(ifile)->h_scrpos = *scrpos;
281 public void get_pos(IFILE ifile, struct scrpos *scrpos)
283 *scrpos = int_ifile(ifile)->h_scrpos;
287 * Mark the ifile as "opened".
289 public void set_open(IFILE ifile)
291 int_ifile(ifile)->h_opened = 1;
295 * Return whether the ifile has been opened previously.
297 public int opened(IFILE ifile)
299 return (int_ifile(ifile)->h_opened);
302 public void hold_ifile(IFILE ifile, int incr)
304 int_ifile(ifile)->h_hold += incr;
307 public int held_ifile(IFILE ifile)
309 return (int_ifile(ifile)->h_hold);
312 public void * get_filestate(IFILE ifile)
314 return (int_ifile(ifile)->h_filestate);
317 public void set_filestate(IFILE ifile, void *filestate)
319 int_ifile(ifile)->h_filestate = filestate;
322 public void set_altpipe(IFILE ifile, void *p)
324 int_ifile(ifile)->h_altpipe = p;
327 public void *get_altpipe(IFILE ifile)
329 return (int_ifile(ifile)->h_altpipe);
332 public void set_altfilename(IFILE ifile, char *altfilename)
334 struct ifile *p = int_ifile(ifile);
344 public char * get_altfilename(IFILE ifile)
346 return (int_ifile(ifile)->h_altfilename);
352 struct ifile *p;