+/*****************************************************************************/
+/* struct AFile */
+/*****************************************************************************/
+
+
+
+static AFile* NewAFile (IFile* IF, FILE* F)
+/* Create and return a new AFile */
+{
+ /* Allocate a AFile structure */
+ AFile* AF = (AFile*) xmalloc (sizeof (AFile));
+
+ /* Initialize the fields */
+ AF->Line = 0;
+ AF->F = F;
+ AF->Input = IF;
+
+ /* Increment the usage counter of the corresponding IFile. If this
+ * is the first use, set the file data and output debug info if
+ * requested.
+ */
+ if (IF->Usage++ == 0) {
+
+ /* Get file size and modification time */
+ struct stat Buf;
+ if (fstat (fileno (F), &Buf) != 0) {
+ /* Error */
+ Fatal ("Cannot stat `%s': %s", IF->Name, strerror (errno));
+ }
+ IF->Size = (unsigned long) Buf.st_size;
+ IF->MTime = (unsigned long) Buf.st_mtime;
+
+ /* Set the debug data */
+ g_fileinfo (IF->Name, IF->Size, IF->MTime);
+ }
+
+ /* Insert the new structure into the AFile collection */
+ CollAppend (&AFiles, AF);
+
+ /* Return the new struct */
+ return AF;
+}
+
+
+
+static void FreeAFile (AFile* AF)
+/* Free an AFile structure */
+{
+ xfree (AF);
+}
+
+
+