Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop support for MacFS #432

Merged
merged 3 commits into from
Sep 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion hdf/src/hdfi.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
/* I/O library constants */
#define UNIXUNBUFIO 1
#define UNIXBUFIO 2
#define MACIO 3

/* The library always uses UNIXBUFIO */
#define FILELIB UNIXBUFIO
Expand Down
17 changes: 1 addition & 16 deletions hdf/src/hfile.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@

#ifndef FILELIB
#define FILELIB UNIXBUFIO /* UNIX buffered I/O is the default */
#endif /* FILELIB */
#endif

#if (FILELIB == UNIXBUFIO)
/* using C buffered file I/O routines to access files */
Expand Down Expand Up @@ -104,21 +104,6 @@ typedef int hdf_file_t;
#define OPENERR(f) (f < 0)
#endif /* FILELIB == UNIXUNBUFIO */

#if (FILELIB == MACIO)
/* using special routines to redirect to Mac Toolkit I/O */
typedef short hdf_file_t;
#define HI_OPEN(x, y) mopen(x, y)
#define HI_CREATE(name) mopen(name, DFACC_CREATE)
#define HI_CLOSE(x) (((x = ((mclose(x) == 0) ? NULL : x)) == NULL) ? SUCCEED : FAIL)
#define HI_FLUSH(a) (SUCCEED)
#define HI_READ(a, b, c) mread(a, (char *)b, (int32)c)
#define HI_WRITE(a, b, c) mwrite(a, (char *)b, (int32)c)
#define HI_SEEK(x, y) mlseek(x, (int32)y, 0)
#define HI_SEEKEND(x) mlseek(x, 0L, 2)
#define HI_TELL(x) mlseek(x, 0L, 1)
#define OPENERR(f) (f < 0)
#endif /* FILELIB == MACIO */

/* ----------------------- Internal Data Structures ----------------------- */
/* The internal structure used to keep track of the files opened: an
array of filerec_t structures, each has a linked list of ddblock_t.
Expand Down
22 changes: 22 additions & 0 deletions release_notes/RELEASE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,28 @@ New features and changes
* dfi.h - Declared private, unused, undocumented in UG/RM/DG, has been
removed from the library entirely.

- Dropped support for MacFS I/O

MacFS was an obscure I/O system from the late 90s used to access HFS
volumes on MacOS 9 and earlier (publication CMU-CS-98-145 can be
found via an internet search).

HDF4 allows a library builder to manually specify the FILELIB symbol
found in hdfi.h to use C standard library buffered I/O (fopen, etc.),
POSIX unbuffered I/O (open, etc.), or MacFS I/O (mopen, etc.). The
library default is to use C buffered I/O and there is no obvious
build-time or run-time option to change that. The FILELIB value is
then used to map HI_OPEN, etc. to appropriate I/O calls.

The "alternative" I/O schemes (POSIX unbuffered and MacFS) are not
tested. Due to its age and obscurity, MacFS support is being dropped.
The POSIX unbuffered I/O scheme will remain in place for now since it
might be interesting to profile that vs C stdio.h calls.

This change will have *NO IMPACT* on modern Macs. Files created using
MacFS in the 90s and early 2000s can be accessed using C standard
library I/O.

Support for new platforms and compilers
=======================================

Expand Down