+/* Default file handle for DATA LIST, REREAD, REPEATING DATA
+ commands. */
+static struct file_handle *default_handle;
+
+/* The "file" that reads from BEGIN DATA...END DATA. */
+static struct file_handle *inline_file;
+
+static struct file_handle *create_handle (const char *name, enum fh_referent);
+
+/* File handle initialization routine. */
+void
+fh_init (void)
+{
+ inline_file = create_handle ("INLINE", FH_REF_INLINE);
+ inline_file->record_width = 80;
+ inline_file->tab_width = 8;
+}
+
+/* Free HANDLE and remove it from the global list. */
+static void
+free_handle (struct file_handle *handle)
+{
+ /* Remove handle from global list. */
+ if (file_handles == handle)
+ file_handles = handle->next;
+ else
+ {
+ struct file_handle *iter = file_handles;
+ while (iter->next != handle)
+ iter = iter->next;
+ iter->next = handle->next;
+ }
+
+ /* Free data. */
+ free (handle->name);
+ free (handle->filename);
+ fn_free_identity (handle->identity);
+ scratch_handle_destroy (handle->sh);
+ free (handle);
+}
+
+/* Frees all the file handles. */
+void
+fh_done (void)
+{
+ while (file_handles != NULL)
+ free_handle (file_handles);
+}