Merge all the Unix __PHYSFS_platformDetectAvailableCDs() funcs into one.
This commit is contained in:
parent
07e97a0166
commit
d8d296e8c6
|
@ -55,17 +55,13 @@ int __PHYSFS_platformDeinit(void)
|
||||||
} /* __PHYSFS_platformDeinit */
|
} /* __PHYSFS_platformDeinit */
|
||||||
|
|
||||||
|
|
||||||
#ifdef PHYSFS_NO_CDROM_SUPPORT
|
|
||||||
|
|
||||||
/* Stub version for platforms without CD-ROM support. */
|
/* Stub version for platforms without CD-ROM support. */
|
||||||
void __PHYSFS_platformDetectAvailableCDs(PHYSFS_StringCallback cb, void *data)
|
void __PHYSFS_platformDetectAvailableCDs(PHYSFS_StringCallback cb, void *data)
|
||||||
{
|
{
|
||||||
} /* __PHYSFS_platformDetectAvailableCDs */
|
#if (defined PHYSFS_NO_CDROM_SUPPORT)
|
||||||
|
/* no-op. */
|
||||||
|
|
||||||
#elif (defined PHYSFS_HAVE_SYS_UCRED_H)
|
#elif (defined PHYSFS_HAVE_SYS_UCRED_H)
|
||||||
|
|
||||||
void __PHYSFS_platformDetectAvailableCDs(PHYSFS_StringCallback cb, void *data)
|
|
||||||
{
|
|
||||||
int i;
|
int i;
|
||||||
struct statfs *mntbufp = NULL;
|
struct statfs *mntbufp = NULL;
|
||||||
int mounts = getmntinfo(&mntbufp, MNT_WAIT);
|
int mounts = getmntinfo(&mntbufp, MNT_WAIT);
|
||||||
|
@ -84,12 +80,8 @@ void __PHYSFS_platformDetectAvailableCDs(PHYSFS_StringCallback cb, void *data)
|
||||||
if (add_it)
|
if (add_it)
|
||||||
cb(data, mntbufp[i].f_mntonname);
|
cb(data, mntbufp[i].f_mntonname);
|
||||||
} /* for */
|
} /* for */
|
||||||
} /* __PHYSFS_platformDetectAvailableCDs */
|
|
||||||
|
|
||||||
#elif (defined PHYSFS_HAVE_MNTENT_H)
|
#elif (defined PHYSFS_HAVE_MNTENT_H)
|
||||||
|
|
||||||
void __PHYSFS_platformDetectAvailableCDs(PHYSFS_StringCallback cb, void *data)
|
|
||||||
{
|
|
||||||
FILE *mounts = NULL;
|
FILE *mounts = NULL;
|
||||||
struct mntent *ent = NULL;
|
struct mntent *ent = NULL;
|
||||||
|
|
||||||
|
@ -109,10 +101,8 @@ void __PHYSFS_platformDetectAvailableCDs(PHYSFS_StringCallback cb, void *data)
|
||||||
} /* while */
|
} /* while */
|
||||||
|
|
||||||
endmntent(mounts);
|
endmntent(mounts);
|
||||||
|
|
||||||
} /* __PHYSFS_platformDetectAvailableCDs */
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
} /* __PHYSFS_platformDetectAvailableCDs */
|
||||||
|
|
||||||
|
|
||||||
/* this is in posix.c ... */
|
/* this is in posix.c ... */
|
||||||
|
|
Loading…
Reference in New Issue