! ZSTD_isFrame() : * Tells if the content of `buffer` starts with a valid Frame Identifier. * Note : Frame Identifier is 4 bytes. If `size < 4`, @return will always be 0. * Note 2 : Legacy Frame Identifiers are considered valid only if Legacy Support is enabled. * Note 3 : Skippable Frame Identifiers are considered valid. */
| 24699 | * Note 2 : Legacy Frame Identifiers are considered valid only if Legacy Support is enabled. |
| 24700 | * Note 3 : Skippable Frame Identifiers are considered valid. */ |
| 24701 | unsigned ZSTD_isFrame(const void* buffer, size_t size) |
| 24702 | { |
| 24703 | if (size < ZSTD_FRAMEIDSIZE) return 0; |
| 24704 | { U32 const magic = MEM_readLE32(buffer); |
| 24705 | if (magic == ZSTD_MAGICNUMBER) return 1; |
| 24706 | if ((magic & ZSTD_MAGIC_SKIPPABLE_MASK) == ZSTD_MAGIC_SKIPPABLE_START) return 1; |
| 24707 | } |
| 24708 | #if defined(ZSTD_LEGACY_SUPPORT) && (ZSTD_LEGACY_SUPPORT >= 1) |
| 24709 | if (ZSTD_isLegacy(buffer, size)) return 1; |
| 24710 | #endif |
| 24711 | return 0; |
| 24712 | } |
| 24713 | |
| 24714 | /** ZSTD_frameHeaderSize_internal() : |
| 24715 | * srcSize must be large enough to reach header size fields. |
nothing calls this directly
no test coverage detected