+static FILE *
+tryopen (char *name, char *mode)
+{
+ FILE *ptr;
+
+ ptr = fopen (name, mode);
+ if (!ptr)
+ error (2, errno, _("cannot open file `%s'"), name);
+
+ return ptr;
+}
+
+/*-------------------------------------------------------------.
+| Try to close file PTR, and print an error message if fails. |
+`-------------------------------------------------------------*/
+
+static int
+tryclose (FILE *ptr)
+{
+ int result;
+
+ if (ptr == NULL)
+ return 0;
+
+ result = fclose (ptr);
+ if (result == EOF)
+ error (2, errno, _("cannot close file"));
+
+ return result;
+}
+\f