physfs.h
changeset 322 597af607e7d3
parent 265 6187d310b2c0
child 397 12ff23d3d716
equal deleted inserted replaced
321:50986060bee8 322:597af607e7d3
   310 } PHYSFS_Version;
   310 } PHYSFS_Version;
   311 
   311 
   312 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
   312 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
   313 #define PHYSFS_VER_MAJOR 0
   313 #define PHYSFS_VER_MAJOR 0
   314 #define PHYSFS_VER_MINOR 1
   314 #define PHYSFS_VER_MINOR 1
   315 #define PHYSFS_VER_PATCH 6
   315 #define PHYSFS_VER_PATCH 7
   316 #endif  /* DOXYGEN_SHOULD_IGNORE_THIS */
   316 #endif  /* DOXYGEN_SHOULD_IGNORE_THIS */
   317 
   317 
   318 /**
   318 /**
   319  * \def PHYSFS_VERSION(x)
   319  * \def PHYSFS_VERSION(x)
   320  * \brief Macro to determine PhysicsFS version program was compiled against.
   320  * \brief Macro to determine PhysicsFS version program was compiled against.
  1336  * \warning Remember, PHYSFS_uint64 is only 32 bits on platforms without
  1336  * \warning Remember, PHYSFS_uint64 is only 32 bits on platforms without
  1337  *          any sort of 64-bit support.
  1337  *          any sort of 64-bit support.
  1338  */
  1338  */
  1339 __EXPORT__ PHYSFS_uint64 PHYSFS_swapUBE64(PHYSFS_uint64 val);
  1339 __EXPORT__ PHYSFS_uint64 PHYSFS_swapUBE64(PHYSFS_uint64 val);
  1340 
  1340 
       
  1341 
       
  1342 /**
       
  1343  * \fn int PHYSFS_readSLE16(PHYSFS_file *file, PHYSFS_sint16 *val)
       
  1344  * \brief Read and convert a signed 16-bit littleendian value.
       
  1345  *
       
  1346  * Convenience function. Read a signed 16-bit littleendian value from a
       
  1347  *  file and convert it to the platform's native byte order.
       
  1348  *
       
  1349  *    \param file PhysicsFS file handle from which to read.
       
  1350  *    \param val pointer to where value should be stored.
       
  1351  *   \return zero on failure, non-zero on success. If successful, (*val) will
       
  1352  *           store the result. On failure, you can find out what went wrong
       
  1353  *           from PHYSFS_GetLastError().
       
  1354  */
       
  1355 __EXPORT__ int PHYSFS_readSLE16(PHYSFS_file *file, PHYSFS_sint16 *val);
       
  1356 
       
  1357 
       
  1358 /**
       
  1359  * \fn int PHYSFS_readULE16(PHYSFS_file *file, PHYSFS_uint16 *val)
       
  1360  * \brief Read and convert an unsigned 16-bit littleendian value.
       
  1361  *
       
  1362  * Convenience function. Read an unsigned 16-bit littleendian value from a
       
  1363  *  file and convert it to the platform's native byte order.
       
  1364  *
       
  1365  *    \param file PhysicsFS file handle from which to read.
       
  1366  *    \param val pointer to where value should be stored.
       
  1367  *   \return zero on failure, non-zero on success. If successful, (*val) will
       
  1368  *           store the result. On failure, you can find out what went wrong
       
  1369  *           from PHYSFS_GetLastError().
       
  1370  *
       
  1371  */
       
  1372 __EXPORT__ int PHYSFS_readULE16(PHYSFS_file *file, PHYSFS_uint16 *val);
       
  1373 
       
  1374 
       
  1375 /**
       
  1376  * \fn int PHYSFS_readSBE16(PHYSFS_file *file, PHYSFS_sint16 *val)
       
  1377  * \brief Read and convert a signed 16-bit bigendian value.
       
  1378  *
       
  1379  * Convenience function. Read a signed 16-bit bigendian value from a
       
  1380  *  file and convert it to the platform's native byte order.
       
  1381  *
       
  1382  *    \param file PhysicsFS file handle from which to read.
       
  1383  *    \param val pointer to where value should be stored.
       
  1384  *   \return zero on failure, non-zero on success. If successful, (*val) will
       
  1385  *           store the result. On failure, you can find out what went wrong
       
  1386  *           from PHYSFS_GetLastError().
       
  1387  */
       
  1388 __EXPORT__ int PHYSFS_readSBE16(PHYSFS_file *file, PHYSFS_sint16 *val);
       
  1389 
       
  1390 
       
  1391 /**
       
  1392  * \fn int PHYSFS_readUBE16(PHYSFS_file *file, PHYSFS_uint16 *val)
       
  1393  * \brief Read and convert an unsigned 16-bit bigendian value.
       
  1394  *
       
  1395  * Convenience function. Read an unsigned 16-bit bigendian value from a
       
  1396  *  file and convert it to the platform's native byte order.
       
  1397  *
       
  1398  *    \param file PhysicsFS file handle from which to read.
       
  1399  *    \param val pointer to where value should be stored.
       
  1400  *   \return zero on failure, non-zero on success. If successful, (*val) will
       
  1401  *           store the result. On failure, you can find out what went wrong
       
  1402  *           from PHYSFS_GetLastError().
       
  1403  *
       
  1404  */
       
  1405 __EXPORT__ int PHYSFS_readUBE16(PHYSFS_file *file, PHYSFS_uint16 *val);
       
  1406 
       
  1407 
       
  1408 /**
       
  1409  * \fn int PHYSFS_readSLE32(PHYSFS_file *file, PHYSFS_sint32 *val)
       
  1410  * \brief Read and convert a signed 32-bit littleendian value.
       
  1411  *
       
  1412  * Convenience function. Read a signed 32-bit littleendian value from a
       
  1413  *  file and convert it to the platform's native byte order.
       
  1414  *
       
  1415  *    \param file PhysicsFS file handle from which to read.
       
  1416  *    \param val pointer to where value should be stored.
       
  1417  *   \return zero on failure, non-zero on success. If successful, (*val) will
       
  1418  *           store the result. On failure, you can find out what went wrong
       
  1419  *           from PHYSFS_GetLastError().
       
  1420  */
       
  1421 __EXPORT__ int PHYSFS_readSLE32(PHYSFS_file *file, PHYSFS_sint32 *val);
       
  1422 
       
  1423 
       
  1424 /**
       
  1425  * \fn int PHYSFS_readULE32(PHYSFS_file *file, PHYSFS_uint32 *val)
       
  1426  * \brief Read and convert an unsigned 32-bit littleendian value.
       
  1427  *
       
  1428  * Convenience function. Read an unsigned 32-bit littleendian value from a
       
  1429  *  file and convert it to the platform's native byte order.
       
  1430  *
       
  1431  *    \param file PhysicsFS file handle from which to read.
       
  1432  *    \param val pointer to where value should be stored.
       
  1433  *   \return zero on failure, non-zero on success. If successful, (*val) will
       
  1434  *           store the result. On failure, you can find out what went wrong
       
  1435  *           from PHYSFS_GetLastError().
       
  1436  *
       
  1437  */
       
  1438 __EXPORT__ int PHYSFS_readULE32(PHYSFS_file *file, PHYSFS_uint32 *val);
       
  1439 
       
  1440 
       
  1441 /**
       
  1442  * \fn int PHYSFS_readSBE32(PHYSFS_file *file, PHYSFS_sint32 *val)
       
  1443  * \brief Read and convert a signed 32-bit bigendian value.
       
  1444  *
       
  1445  * Convenience function. Read a signed 32-bit bigendian value from a
       
  1446  *  file and convert it to the platform's native byte order.
       
  1447  *
       
  1448  *    \param file PhysicsFS file handle from which to read.
       
  1449  *    \param val pointer to where value should be stored.
       
  1450  *   \return zero on failure, non-zero on success. If successful, (*val) will
       
  1451  *           store the result. On failure, you can find out what went wrong
       
  1452  *           from PHYSFS_GetLastError().
       
  1453  */
       
  1454 __EXPORT__ int PHYSFS_readSBE32(PHYSFS_file *file, PHYSFS_sint32 *val);
       
  1455 
       
  1456 
       
  1457 /**
       
  1458  * \fn int PHYSFS_readUBE32(PHYSFS_file *file, PHYSFS_uint32 *val)
       
  1459  * \brief Read and convert an unsigned 32-bit bigendian value.
       
  1460  *
       
  1461  * Convenience function. Read an unsigned 32-bit bigendian value from a
       
  1462  *  file and convert it to the platform's native byte order.
       
  1463  *
       
  1464  *    \param file PhysicsFS file handle from which to read.
       
  1465  *    \param val pointer to where value should be stored.
       
  1466  *   \return zero on failure, non-zero on success. If successful, (*val) will
       
  1467  *           store the result. On failure, you can find out what went wrong
       
  1468  *           from PHYSFS_GetLastError().
       
  1469  *
       
  1470  */
       
  1471 __EXPORT__ int PHYSFS_readUBE32(PHYSFS_file *file, PHYSFS_uint32 *val);
       
  1472 
       
  1473 
       
  1474 /**
       
  1475  * \fn int PHYSFS_readSLE64(PHYSFS_file *file, PHYSFS_sint64 *val)
       
  1476  * \brief Read and convert a signed 64-bit littleendian value.
       
  1477  *
       
  1478  * Convenience function. Read a signed 64-bit littleendian value from a
       
  1479  *  file and convert it to the platform's native byte order.
       
  1480  *
       
  1481  *    \param file PhysicsFS file handle from which to read.
       
  1482  *    \param val pointer to where value should be stored.
       
  1483  *   \return zero on failure, non-zero on success. If successful, (*val) will
       
  1484  *           store the result. On failure, you can find out what went wrong
       
  1485  *           from PHYSFS_GetLastError().
       
  1486  *
       
  1487  * \warning Remember, PHYSFS_sint64 is only 32 bits on platforms without
       
  1488  *          any sort of 64-bit support.
       
  1489  */
       
  1490 __EXPORT__ int PHYSFS_readSLE64(PHYSFS_file *file, PHYSFS_sint64 *val);
       
  1491 
       
  1492 
       
  1493 /**
       
  1494  * \fn int PHYSFS_readULE64(PHYSFS_file *file, PHYSFS_uint64 *val)
       
  1495  * \brief Read and convert an unsigned 64-bit littleendian value.
       
  1496  *
       
  1497  * Convenience function. Read an unsigned 64-bit littleendian value from a
       
  1498  *  file and convert it to the platform's native byte order.
       
  1499  *
       
  1500  *    \param file PhysicsFS file handle from which to read.
       
  1501  *    \param val pointer to where value should be stored.
       
  1502  *   \return zero on failure, non-zero on success. If successful, (*val) will
       
  1503  *           store the result. On failure, you can find out what went wrong
       
  1504  *           from PHYSFS_GetLastError().
       
  1505  *
       
  1506  * \warning Remember, PHYSFS_uint64 is only 32 bits on platforms without
       
  1507  *          any sort of 64-bit support.
       
  1508  */
       
  1509 __EXPORT__ int PHYSFS_readULE64(PHYSFS_file *file, PHYSFS_uint64 *val);
       
  1510 
       
  1511 
       
  1512 /**
       
  1513  * \fn int PHYSFS_readSBE64(PHYSFS_file *file, PHYSFS_sint64 *val)
       
  1514  * \brief Read and convert a signed 64-bit bigendian value.
       
  1515  *
       
  1516  * Convenience function. Read a signed 64-bit bigendian value from a
       
  1517  *  file and convert it to the platform's native byte order.
       
  1518  *
       
  1519  *    \param file PhysicsFS file handle from which to read.
       
  1520  *    \param val pointer to where value should be stored.
       
  1521  *   \return zero on failure, non-zero on success. If successful, (*val) will
       
  1522  *           store the result. On failure, you can find out what went wrong
       
  1523  *           from PHYSFS_GetLastError().
       
  1524  *
       
  1525  * \warning Remember, PHYSFS_sint64 is only 32 bits on platforms without
       
  1526  *          any sort of 64-bit support.
       
  1527  */
       
  1528 __EXPORT__ int PHYSFS_readSBE64(PHYSFS_file *file, PHYSFS_sint64 *val);
       
  1529 
       
  1530 
       
  1531 /**
       
  1532  * \fn int PHYSFS_readUBE64(PHYSFS_file *file, PHYSFS_uint64 *val)
       
  1533  * \brief Read and convert an unsigned 64-bit bigendian value.
       
  1534  *
       
  1535  * Convenience function. Read an unsigned 64-bit bigendian value from a
       
  1536  *  file and convert it to the platform's native byte order.
       
  1537  *
       
  1538  *    \param file PhysicsFS file handle from which to read.
       
  1539  *    \param val pointer to where value should be stored.
       
  1540  *   \return zero on failure, non-zero on success. If successful, (*val) will
       
  1541  *           store the result. On failure, you can find out what went wrong
       
  1542  *           from PHYSFS_GetLastError().
       
  1543  *
       
  1544  * \warning Remember, PHYSFS_uint64 is only 32 bits on platforms without
       
  1545  *          any sort of 64-bit support.
       
  1546  */
       
  1547 __EXPORT__ int PHYSFS_readUBE64(PHYSFS_file *file, PHYSFS_uint64 *val);
       
  1548 
       
  1549 
       
  1550 /**
       
  1551  * \fn int PHYSFS_writeSLE16(PHYSFS_file *file, PHYSFS_sint16 val)
       
  1552  * \brief Convert and write a signed 16-bit littleendian value.
       
  1553  *
       
  1554  * Convenience function. Convert a signed 16-bit value from the platform's
       
  1555  *  native byte order to littleendian and write it to a file.
       
  1556  *
       
  1557  *    \param file PhysicsFS file handle to which to write.
       
  1558  *    \param val Value to convert and write.
       
  1559  *   \return zero on failure, non-zero on success. On failure, you can
       
  1560  *           find out what went wrong from PHYSFS_GetLastError().
       
  1561  */
       
  1562 __EXPORT__ int PHYSFS_writeSLE16(PHYSFS_file *file, PHYSFS_sint16 val);
       
  1563 
       
  1564 
       
  1565 /**
       
  1566  * \fn int PHYSFS_writeULE16(PHYSFS_file *file, PHYSFS_uint16 val)
       
  1567  * \brief Convert and write an unsigned 16-bit littleendian value.
       
  1568  *
       
  1569  * Convenience function. Convert an unsigned 16-bit value from the platform's
       
  1570  *  native byte order to littleendian and write it to a file.
       
  1571  *
       
  1572  *    \param file PhysicsFS file handle to which to write.
       
  1573  *    \param val Value to convert and write.
       
  1574  *   \return zero on failure, non-zero on success. On failure, you can
       
  1575  *           find out what went wrong from PHYSFS_GetLastError().
       
  1576  */
       
  1577 __EXPORT__ int PHYSFS_writeULE16(PHYSFS_file *file, PHYSFS_uint16 val);
       
  1578 
       
  1579 
       
  1580 /**
       
  1581  * \fn int PHYSFS_writeSBE16(PHYSFS_file *file, PHYSFS_sint16 val)
       
  1582  * \brief Convert and write a signed 16-bit bigendian value.
       
  1583  *
       
  1584  * Convenience function. Convert a signed 16-bit value from the platform's
       
  1585  *  native byte order to bigendian and write it to a file.
       
  1586  *
       
  1587  *    \param file PhysicsFS file handle to which to write.
       
  1588  *    \param val Value to convert and write.
       
  1589  *   \return zero on failure, non-zero on success. On failure, you can
       
  1590  *           find out what went wrong from PHYSFS_GetLastError().
       
  1591  */
       
  1592 __EXPORT__ int PHYSFS_writeSBE16(PHYSFS_file *file, PHYSFS_sint16 val);
       
  1593 
       
  1594 
       
  1595 /**
       
  1596  * \fn int PHYSFS_writeUBE16(PHYSFS_file *file, PHYSFS_uint16 val)
       
  1597  * \brief Convert and write an unsigned 16-bit bigendian value.
       
  1598  *
       
  1599  * Convenience function. Convert an unsigned 16-bit value from the platform's
       
  1600  *  native byte order to bigendian and write it to a file.
       
  1601  *
       
  1602  *    \param file PhysicsFS file handle to which to write.
       
  1603  *    \param val Value to convert and write.
       
  1604  *   \return zero on failure, non-zero on success. On failure, you can
       
  1605  *           find out what went wrong from PHYSFS_GetLastError().
       
  1606  */
       
  1607 __EXPORT__ int PHYSFS_writeUBE16(PHYSFS_file *file, PHYSFS_uint16 val);
       
  1608 
       
  1609 
       
  1610 /**
       
  1611  * \fn int PHYSFS_writeSLE32(PHYSFS_file *file, PHYSFS_sint32 val)
       
  1612  * \brief Convert and write a signed 32-bit littleendian value.
       
  1613  *
       
  1614  * Convenience function. Convert a signed 32-bit value from the platform's
       
  1615  *  native byte order to littleendian and write it to a file.
       
  1616  *
       
  1617  *    \param file PhysicsFS file handle to which to write.
       
  1618  *    \param val Value to convert and write.
       
  1619  *   \return zero on failure, non-zero on success. On failure, you can
       
  1620  *           find out what went wrong from PHYSFS_GetLastError().
       
  1621  */
       
  1622 __EXPORT__ int PHYSFS_writeSLE32(PHYSFS_file *file, PHYSFS_sint32 val);
       
  1623 
       
  1624 
       
  1625 /**
       
  1626  * \fn int PHYSFS_writeULE32(PHYSFS_file *file, PHYSFS_uint32 val)
       
  1627  * \brief Convert and write an unsigned 32-bit littleendian value.
       
  1628  *
       
  1629  * Convenience function. Convert an unsigned 32-bit value from the platform's
       
  1630  *  native byte order to littleendian and write it to a file.
       
  1631  *
       
  1632  *    \param file PhysicsFS file handle to which to write.
       
  1633  *    \param val Value to convert and write.
       
  1634  *   \return zero on failure, non-zero on success. On failure, you can
       
  1635  *           find out what went wrong from PHYSFS_GetLastError().
       
  1636  */
       
  1637 __EXPORT__ int PHYSFS_writeULE32(PHYSFS_file *file, PHYSFS_uint32 val);
       
  1638 
       
  1639 
       
  1640 /**
       
  1641  * \fn int PHYSFS_writeSBE32(PHYSFS_file *file, PHYSFS_sint32 val)
       
  1642  * \brief Convert and write a signed 32-bit bigendian value.
       
  1643  *
       
  1644  * Convenience function. Convert a signed 32-bit value from the platform's
       
  1645  *  native byte order to bigendian and write it to a file.
       
  1646  *
       
  1647  *    \param file PhysicsFS file handle to which to write.
       
  1648  *    \param val Value to convert and write.
       
  1649  *   \return zero on failure, non-zero on success. On failure, you can
       
  1650  *           find out what went wrong from PHYSFS_GetLastError().
       
  1651  */
       
  1652 __EXPORT__ int PHYSFS_writeSBE32(PHYSFS_file *file, PHYSFS_sint32 val);
       
  1653 
       
  1654 
       
  1655 /**
       
  1656  * \fn int PHYSFS_writeUBE32(PHYSFS_file *file, PHYSFS_uint32 val)
       
  1657  * \brief Convert and write an unsigned 32-bit bigendian value.
       
  1658  *
       
  1659  * Convenience function. Convert an unsigned 32-bit value from the platform's
       
  1660  *  native byte order to bigendian and write it to a file.
       
  1661  *
       
  1662  *    \param file PhysicsFS file handle to which to write.
       
  1663  *    \param val Value to convert and write.
       
  1664  *   \return zero on failure, non-zero on success. On failure, you can
       
  1665  *           find out what went wrong from PHYSFS_GetLastError().
       
  1666  */
       
  1667 __EXPORT__ int PHYSFS_writeUBE32(PHYSFS_file *file, PHYSFS_uint32 val);
       
  1668 
       
  1669 
       
  1670 /**
       
  1671  * \fn int PHYSFS_writeSLE64(PHYSFS_file *file, PHYSFS_sint64 val)
       
  1672  * \brief Convert and write a signed 64-bit littleendian value.
       
  1673  *
       
  1674  * Convenience function. Convert a signed 64-bit value from the platform's
       
  1675  *  native byte order to littleendian and write it to a file.
       
  1676  *
       
  1677  *    \param file PhysicsFS file handle to which to write.
       
  1678  *    \param val Value to convert and write.
       
  1679  *   \return zero on failure, non-zero on success. On failure, you can
       
  1680  *           find out what went wrong from PHYSFS_GetLastError().
       
  1681  *
       
  1682  * \warning Remember, PHYSFS_uint64 is only 32 bits on platforms without
       
  1683  *          any sort of 64-bit support.
       
  1684  */
       
  1685 __EXPORT__ int PHYSFS_writeSLE64(PHYSFS_file *file, PHYSFS_sint64 val);
       
  1686 
       
  1687 
       
  1688 /**
       
  1689  * \fn int PHYSFS_writeULE64(PHYSFS_file *file, PHYSFS_uint64 val)
       
  1690  * \brief Convert and write an unsigned 64-bit littleendian value.
       
  1691  *
       
  1692  * Convenience function. Convert an unsigned 64-bit value from the platform's
       
  1693  *  native byte order to littleendian and write it to a file.
       
  1694  *
       
  1695  *    \param file PhysicsFS file handle to which to write.
       
  1696  *    \param val Value to convert and write.
       
  1697  *   \return zero on failure, non-zero on success. On failure, you can
       
  1698  *           find out what went wrong from PHYSFS_GetLastError().
       
  1699  *
       
  1700  * \warning Remember, PHYSFS_uint64 is only 32 bits on platforms without
       
  1701  *          any sort of 64-bit support.
       
  1702  */
       
  1703 __EXPORT__ int PHYSFS_writeULE64(PHYSFS_file *file, PHYSFS_uint64 val);
       
  1704 
       
  1705 
       
  1706 /**
       
  1707  * \fn int PHYSFS_writeSBE64(PHYSFS_file *file, PHYSFS_sint64 val)
       
  1708  * \brief Convert and write a signed 64-bit bigending value.
       
  1709  *
       
  1710  * Convenience function. Convert a signed 64-bit value from the platform's
       
  1711  *  native byte order to bigendian and write it to a file.
       
  1712  *
       
  1713  *    \param file PhysicsFS file handle to which to write.
       
  1714  *    \param val Value to convert and write.
       
  1715  *   \return zero on failure, non-zero on success. On failure, you can
       
  1716  *           find out what went wrong from PHYSFS_GetLastError().
       
  1717  *
       
  1718  * \warning Remember, PHYSFS_uint64 is only 32 bits on platforms without
       
  1719  *          any sort of 64-bit support.
       
  1720  */
       
  1721 __EXPORT__ int PHYSFS_writeSBE64(PHYSFS_file *file, PHYSFS_sint64 val);
       
  1722 
       
  1723 
       
  1724 /**
       
  1725  * \fn int PHYSFS_writeUBE64(PHYSFS_file *file, PHYSFS_uint64 val)
       
  1726  * \brief Convert and write an unsigned 64-bit bigendian value.
       
  1727  *
       
  1728  * Convenience function. Convert an unsigned 64-bit value from the platform's
       
  1729  *  native byte order to bigendian and write it to a file.
       
  1730  *
       
  1731  *    \param file PhysicsFS file handle to which to write.
       
  1732  *    \param val Value to convert and write.
       
  1733  *   \return zero on failure, non-zero on success. On failure, you can
       
  1734  *           find out what went wrong from PHYSFS_GetLastError().
       
  1735  *
       
  1736  * \warning Remember, PHYSFS_uint64 is only 32 bits on platforms without
       
  1737  *          any sort of 64-bit support.
       
  1738  */
       
  1739 __EXPORT__ int PHYSFS_writeUBE64(PHYSFS_file *file, PHYSFS_uint64 val);
       
  1740 
       
  1741 
  1341 #ifdef __cplusplus
  1742 #ifdef __cplusplus
  1342 }
  1743 }
  1343 #endif
  1744 #endif
  1344 
  1745 
  1345 #endif  /* !defined _INCLUDE_PHYSFS_H_ */
  1746 #endif  /* !defined _INCLUDE_PHYSFS_H_ */