src/platform_unix.c
changeset 990 c25717b5c165
parent 987 ae7b616e7d0e
child 995 de210c7e2b09
equal deleted inserted replaced
989:70132355a297 990:c25717b5c165
    38 
    38 
    39 #ifdef PHYSFS_HAVE_MNTENT_H
    39 #ifdef PHYSFS_HAVE_MNTENT_H
    40 #include <mntent.h>
    40 #include <mntent.h>
    41 #endif
    41 #endif
    42 
    42 
       
    43 #ifdef PHYSFS_HAVE_SYS_MNTTAB_H
       
    44 #include <sys/mnttab.h>
       
    45 #endif
       
    46 
    43 #include "physfs_internal.h"
    47 #include "physfs_internal.h"
    44 
    48 
    45 
    49 
    46 int __PHYSFS_platformInit(void)
    50 int __PHYSFS_platformInit(void)
    47 {
    51 {
    99         if (add_it)
   103         if (add_it)
   100             cb(data, ent->mnt_dir);
   104             cb(data, ent->mnt_dir);
   101     } /* while */
   105     } /* while */
   102 
   106 
   103     endmntent(mounts);
   107     endmntent(mounts);
       
   108 
       
   109 #elif (defined PHYSFS_HAVE_SYS_MNTTAB_H)
       
   110     FILE *mounts = fopen(MNTTAB, "r");
       
   111     struct mnttab ent;
       
   112 
       
   113     BAIL_IF_MACRO(mounts == NULL, ERR_IO_ERROR, /*return void*/);
       
   114     while (getmntent(mounts, &ent) == 0)
       
   115     {
       
   116         int add_it = 0;
       
   117         if (strcmp(ent.mnt_fstype, "hsfs") == 0)
       
   118             add_it = 1;
       
   119 
       
   120         /* add other mount types here */
       
   121 
       
   122         if (add_it)
       
   123             cb(data, ent.mnt_mountp);
       
   124     } /* while */
       
   125 
       
   126     fclose(mounts);
       
   127 
       
   128 #else
       
   129 #error Unknown platform. Should have defined PHYSFS_NO_CDROM_SUPPORT, perhaps.
   104 #endif
   130 #endif
   105 } /* __PHYSFS_platformDetectAvailableCDs */
   131 } /* __PHYSFS_platformDetectAvailableCDs */
   106 
   132 
   107 
   133 
   108 /* this is in posix.c ... */
   134 /* this is in posix.c ... */