#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
-#include "message.h"
+#include <libpspp/assertion.h>
+#include <libpspp/message.h>
#include "file-handle-def.h"
-#include "filename.h"
+#include "file-name.h"
#include "por-file-reader.h"
#include "sys-file-reader.h"
-#include "str.h"
+#include <libpspp/str.h>
#include "scratch-reader.h"
#include "xalloc.h"
FILE *file;
bool is_type;
- file = fn_open (fh_get_filename (handle), "rb");
+ file = fn_open (fh_get_file_name (handle), "rb");
if (file == NULL)
{
msg (ME, _("An error occurred while opening \"%s\": %s."),
- fh_get_filename (handle), strerror (errno));
+ fh_get_file_name (handle), strerror (errno));
return IO_ERROR;
}
is_type = detect (file);
- fn_close (fh_get_filename (handle), file);
+ fn_close (fh_get_file_name (handle), file);
return is_type ? YES : NO;
}
pfm_open_reader (handle, dict, NULL));
msg (SE, _("\"%s\" is not a system or portable file."),
- fh_get_filename (handle));
+ fh_get_file_name (handle));
return NULL;
}
return make_any_reader (SCRATCH_FILE,
scratch_reader_open (handle, dict));
}
- abort ();
+ NOT_REACHED ();
}
/* Reads a single case from READER into C.
case SCRATCH_FILE:
return scratch_reader_read_case (reader->private, c);
}
- abort ();
+ NOT_REACHED ();
}
/* Returns true if an I/O error has occurred on READER, false
case SCRATCH_FILE:
return scratch_reader_error (reader->private);
}
- abort ();
+ NOT_REACHED ();
}
/* Closes READER. */
break;
default:
- abort ();
+ NOT_REACHED ();
}
+
+ free (reader);
}