Procházet zdrojové kódy

Added PHYSFS_symbolicLinksPermitted().

Ryan C. Gordon před 19 roky
rodič
revize
0d45ce01c4
4 změnil soubory, kde provedl 25 přidání a 1 odebrání
  1. 1 1
      CHANGELOG.txt
  2. 1 0
      makeos2.cmd
  3. 6 0
      physfs.c
  4. 17 0
      physfs.h

+ 1 - 1
CHANGELOG.txt

@@ -2,7 +2,7 @@
  * CHANGELOG.
  * CHANGELOG.
  */
  */
 
 
-04012007 - Added PHYSFS_isInit() function.
+04012007 - Added PHYSFS_isInit() and PHYSFS_symbolicLinksPermitted() functions.
 03312007 - Added a quick'n'dirty unpack utility to the extras directory. Moved
 03312007 - Added a quick'n'dirty unpack utility to the extras directory. Moved
            DIR archiver to start of the list, so we don't have to have every
            DIR archiver to start of the list, so we don't have to have every
            other archiver fail to open a directory as a file before mounting
            other archiver fail to open a directory as a file before mounting

+ 1 - 0
makeos2.cmd

@@ -42,6 +42,7 @@ rem goto :dolinking
 @echo "_PHYSFS_getLastError" >> bin\physfs.def
 @echo "_PHYSFS_getLastError" >> bin\physfs.def
 @echo "_PHYSFS_getDirSeparator" >> bin\physfs.def
 @echo "_PHYSFS_getDirSeparator" >> bin\physfs.def
 @echo "_PHYSFS_permitSymbolicLinks" >> bin\physfs.def
 @echo "_PHYSFS_permitSymbolicLinks" >> bin\physfs.def
+@echo "_PHYSFS_symbolicLinksPermitted" >> bin\physfs.def
 @echo "_PHYSFS_getCdRomDirs" >> bin\physfs.def
 @echo "_PHYSFS_getCdRomDirs" >> bin\physfs.def
 @echo "_PHYSFS_getBaseDir" >> bin\physfs.def
 @echo "_PHYSFS_getBaseDir" >> bin\physfs.def
 @echo "_PHYSFS_getUserDir" >> bin\physfs.def
 @echo "_PHYSFS_getUserDir" >> bin\physfs.def

+ 6 - 0
physfs.c

@@ -1173,6 +1173,12 @@ void PHYSFS_permitSymbolicLinks(int allow)
 } /* PHYSFS_permitSymbolicLinks */
 } /* PHYSFS_permitSymbolicLinks */
 
 
 
 
+int PHYSFS_symbolicLinksPermitted(void)
+{
+    return(allowSymLinks);
+} /* PHYSFS_symbolicLinksPermitted */
+
+
 /* string manipulation in C makes my ass itch. */
 /* string manipulation in C makes my ass itch. */
 char *__PHYSFS_convertToDependent(const char *prepend,
 char *__PHYSFS_convertToDependent(const char *prepend,
                                   const char *dirName,
                                   const char *dirName,

+ 17 - 0
physfs.h

@@ -622,6 +622,8 @@ __EXPORT__ const char *PHYSFS_getDirSeparator(void);
  *  you've called PHYSFS_init(), and is disabled by default.
  *  you've called PHYSFS_init(), and is disabled by default.
  *
  *
  *   \param allow nonzero to permit symlinks, zero to deny linking.
  *   \param allow nonzero to permit symlinks, zero to deny linking.
+ *
+ * \sa PHYSFS_symbolicLinksPermitted
  */
  */
 __EXPORT__ void PHYSFS_permitSymbolicLinks(int allow);
 __EXPORT__ void PHYSFS_permitSymbolicLinks(int allow);
 
 
@@ -1930,6 +1932,21 @@ __EXPORT__ int PHYSFS_writeUBE64(PHYSFS_File *file, PHYSFS_uint64 val);
 __EXPORT__ int PHYSFS_isInit(void);
 __EXPORT__ int PHYSFS_isInit(void);
 
 
 
 
+/**
+ * \fn int PHYSFS_symbolicLinksPermitted(void)
+ * \brief Determine if the symbolic links are permitted.
+ *
+ * This reports the setting from the last call to PHYSFS_permitSymbolicLinks().
+ *  If PHYSFS_permitSymbolicLinks() hasn't been called since the library was
+ *  last initialized, symbolic links are implicitly disabled.
+ *
+ *  \return non-zero if symlinks are permitted, zero if not.
+ *
+ * \sa PHYSFS_permitSymbolicLinks
+ */
+__EXPORT__ int PHYSFS_symbolicLinksPermitted(void);
+
+
 /**
 /**
  * \struct PHYSFS_Allocator
  * \struct PHYSFS_Allocator
  * \brief PhysicsFS allocation function pointers.
  * \brief PhysicsFS allocation function pointers.