| 1 | /* |
| 2 | * SPDX-License-Identifier: BSD-4-Clause |
| 3 | * |
| 4 | * Copyright (c) 1991, 1993 The Regents of the University of California. |
| 5 | */ |
| 6 | |
| 7 | #ifndef _BABELTRACE_CRC32_H |
| 8 | #define _BABELTRACE_CRC32_H |
| 9 | |
| 10 | #include <stdint.h> |
| 11 | #include <stdio.h> |
| 12 | #include <unistd.h> |
| 13 | #include "common/macros.h" |
| 14 | |
| 15 | /** |
| 16 | * Compute a 32-bit cyclic redundancy checksum for a given file. |
| 17 | * |
| 18 | * On success, the out parameter crc is set with the computed checksum |
| 19 | * value, |
| 20 | * |
| 21 | * @param fd File descriptor for the file for which to compute the CRC |
| 22 | * @param crc Out parameter, the computed checksum |
| 23 | * @returns 0 on success, -1 on failure. |
| 24 | */ |
| 25 | int crc32(int fd, uint32_t *crc); |
| 26 | |
| 27 | #endif /* _BABELTRACE_CRC32_H */ |