Lines Matching refs: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;
33 char h_opened; /* Has this ifile been opened? */
41 #define int_ifile(h) ((struct ifile *)(h))
47 static struct ifile anchor = { &anchor, &anchor, NULL, NULL, 0, 0, '\0',
53 register struct ifile *p;
61 * Link an ifile into the ifile list.
65 struct ifile *p;
66 struct ifile *prev;
87 * Unlink an ifile from the ifile list.
91 struct ifile *p;
100 * Allocate a new ifile structure and stick a filename in it.
103 * Return a pointer to the new ifile structure.
105 static struct ifile *
108 struct ifile *prev;
110 register struct ifile *p;
115 p = (struct ifile *) ecalloc(1, sizeof(struct ifile));
126 * Delete an existing ifile structure.
132 register struct ifile *p;
137 * If the ifile we're deleting is the currently open ifile,
150 * Get the ifile after a given one in the list.
156 register struct ifile *p;
165 * Get the ifile before a given one in the list.
171 register struct ifile *p;
180 * Return a different ifile from the given one.
183 getoff_ifile(ifile)
184 IFILE ifile;
188 if ((newifile = prev_ifile(ifile)) != NULL_IFILE)
190 if ((newifile = next_ifile(ifile)) != NULL_IFILE)
205 * Find an ifile structure, given a filename.
207 static struct ifile *
211 register struct ifile *p;
220 * Get the ifile associated with a filename.
222 * insert the new ifile after "prev" in the list.
229 register struct ifile *p;
237 * Get the filename associated with a ifile.
240 get_filename(ifile)
241 IFILE ifile;
243 if (ifile == NULL)
245 return (int_ifile(ifile)->h_filename);
249 * Get the index of the file associated with a ifile.
252 get_index(ifile)
253 IFILE ifile;
255 return (int_ifile(ifile)->h_index);
262 store_pos(ifile, scrpos)
263 IFILE ifile;
266 int_ifile(ifile)->h_scrpos = *scrpos;
274 get_pos(ifile, scrpos)
275 IFILE ifile;
278 *scrpos = int_ifile(ifile)->h_scrpos;
282 * Mark the ifile as "opened".
285 set_open(ifile)
286 IFILE ifile;
288 int_ifile(ifile)->h_opened = 1;
292 * Return whether the ifile has been opened previously.
295 opened(ifile)
296 IFILE ifile;
298 return (int_ifile(ifile)->h_opened);
302 hold_ifile(ifile, incr)
303 IFILE ifile;
306 int_ifile(ifile)->h_hold += incr;
310 held_ifile(ifile)
311 IFILE ifile;
313 return (int_ifile(ifile)->h_hold);
317 get_filestate(ifile)
318 IFILE ifile;
320 return (int_ifile(ifile)->h_filestate);
324 set_filestate(ifile, filestate)
325 IFILE ifile;
328 int_ifile(ifile)->h_filestate = filestate;
335 register struct ifile *p;