lex_source_destroy (struct lex_source *src)
{
char *file_name = src->reader->file_name;
- if (src->reader->class->close != NULL)
- src->reader->class->close (src->reader);
+ if (src->reader->class->destroy != NULL)
+ src->reader->class->destroy (src->reader);
free (file_name);
free (src->buffer);
while (!deque_is_empty (&src->deque))
#include <stdbool.h>
#include <stddef.h>
-/* The following #include avoids a potential problem when Gnulib substitutes
- * for close() by putting "#define close rpl_close" into <unistd.h>, by
- * ensuring that every source file that includes this one sees the #define.
- * (It would probably be better to rename the 'close' member of struct
- * lex_reader_class.) */
-#include <unistd.h>
-
#include "data/identifier.h"
#include "data/variable.h"
#include "libpspp/compiler.h"
The caller will free the 'file_name' member of READER, so the
implementation should not do so. */
- void (*close) (struct lex_reader *reader);
+ void (*destroy) (struct lex_reader *reader);
};
/* Helper functions for lex_reader. */