Przeglądaj źródła

Sync PhysicsFS3 wiki -> header

[ci skip]
SDL Wiki Bot 3 miesięcy temu
rodzic
commit
ba1b719255
1 zmienionych plików z 26 dodań i 25 usunięć
  1. 26 25
      src/physfs.h

+ 26 - 25
src/physfs.h

@@ -602,31 +602,32 @@ typedef struct PHYSFS_AndroidInit
  * This should be called prior to any attempts to change your process's
  * current working directory.
  *
- * **WARNING**: On Android, argv0 should be a non-NULL pointer to a
- * PHYSFS_AndroidInit struct. This struct must hold a valid JNIEnv * and a JNI
- * jobject of a Context (either the application context or the current
- * Activity is fine). Both are cast to a void * so we don't need jni.h
- * included wherever physfs.h is. PhysicsFS uses these objects to query some
- * system details. PhysicsFS does not hold a reference to the JNIEnv or
- * Context past the call to PHYSFS_init(). If you pass a NULL here,
- * PHYSFS_init can still succeed, but PHYSFS_getBaseDir() and
- * PHYSFS_getPrefDir() will be incorrect.
- *
- * **WARNING**: On Playdate, argv0 should be a non-NULL pointer to a
- * PlaydateAPI struct. PhysicsFS uses this object for system-level access and
- * will hold it until PHYSFS_deinit is called. If you pass a NULL here,
- * PhysicsFS will crash.
- *
- * **WARNING**: On libretro, argv0 should be a non-NULL pointer to the
- * retro_environment_t callback. PhysicsFS will use this callback to get
- * libretro's virtual file system interface, along with any other related
- * directory paths.
- *
- * \param argv0 the argv[0] string passed to your program's mainline. This may
- *              be NULL on most platforms (such as ones without a standard
- *              main() function), but you should always try to pass something
- *              in here. Many Unix-like systems _need_ to pass argv[0] from
- *              main() in here. See warning about Android, too!
+ * `argv0` may be NULL on most platforms (such as ones without a standard
+ * main() function), but you should always try to pass something in here when
+ * reasonable. Many Unix-like systems _need_ to pass argv[0] from main() in
+ * here. However several platforms have special needs:
+ *
+ * - On Android, argv0 should be a non-NULL pointer to a PHYSFS_AndroidInit
+ *   struct. This struct must hold a valid JNIEnv * and a JNI jobject of a
+ *   Context (either the application context or the current Activity is fine).
+ *   Both are cast to a void * so we don't need jni.h included wherever
+ *   physfs.h is. PhysicsFS uses these objects to query some system details.
+ *   PhysicsFS does not hold a reference to the JNIEnv or Context past the
+ *   call to PHYSFS_init(). If you pass a NULL here, PHYSFS_init can still
+ *   succeed, but PHYSFS_getBaseDir() and PHYSFS_getPrefDir() will be
+ *   incorrect.
+ * - On Playdate, argv0 should be a non-NULL pointer to a PlaydateAPI struct.
+ *   PhysicsFS uses this object for system-level access and will hold it until
+ *   PHYSFS_deinit is called. If you pass a NULL here, PhysicsFS will crash.
+ * - On libretro, argv0 should be a non-NULL pointer to the
+ *   retro_environment_t callback. PhysicsFS will use this callback to get
+ *   libretro's virtual file system interface, along with any other related
+ *   directory paths.
+ *
+ * If `argv0` is NULL, PhysicsFS will attempt to work without it, if possible.
+ *
+ * \param argv0 the argv[0] string passed to your program's mainline, or some
+ *              other system-specific values.
  * \returns nonzero on success, zero on error. Specifics of the error can be
  *          gleaned from PHYSFS_getLastError().
  *