1275680Strasz/*-
2275680Strasz * Copyright (c) 2014 The FreeBSD Foundation
3275680Strasz * All rights reserved.
4275680Strasz *
5275680Strasz * This software was developed by Edward Tomasz Napierala under sponsorship
6275680Strasz * from the FreeBSD Foundation.
7275680Strasz *
8275680Strasz * Redistribution and use in source and binary forms, with or without
9275680Strasz * modification, are permitted provided that the following conditions
10275680Strasz * are met:
11275680Strasz * 1. Redistributions of source code must retain the above copyright
12275680Strasz *    notice, this list of conditions and the following disclaimer.
13275680Strasz * 2. Redistributions in binary form must reproduce the above copyright
14275680Strasz *    notice, this list of conditions and the following disclaimer in the
15275680Strasz *    documentation and/or other materials provided with the distribution.
16275680Strasz *
17275680Strasz * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
18275680Strasz * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19275680Strasz * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20275680Strasz * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
21275680Strasz * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22275680Strasz * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23275680Strasz * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24275680Strasz * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25275680Strasz * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26275680Strasz * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27275680Strasz * SUCH DAMAGE.
28275680Strasz *
29275680Strasz * $FreeBSD: stable/11/usr.sbin/fstyp/fstyp.h 316470 2017-04-03 21:04:14Z trasz $
30275680Strasz */
31275680Strasz
32275680Strasz#ifndef FSTYP_H
33275680Strasz#define	FSTYP_H
34275680Strasz
35275680Strasz#define	MIN(a,b) (((a)<(b))?(a):(b))
36275680Strasz
37275680Straszvoid	*read_buf(FILE *fp, off_t off, size_t len);
38275680Straszchar	*checked_strdup(const char *s);
39284582Straszvoid	rtrim(char *label, size_t size);
40275680Strasz
41275680Straszint	fstyp_cd9660(FILE *fp, char *label, size_t size);
42316470Straszint	fstyp_exfat(FILE *fp, char *label, size_t size);
43275680Straszint	fstyp_ext2fs(FILE *fp, char *label, size_t size);
44284589Sallanjudeint	fstyp_geli(FILE *fp, char *label, size_t size);
45275680Straszint	fstyp_msdosfs(FILE *fp, char *label, size_t size);
46275680Straszint	fstyp_ntfs(FILE *fp, char *label, size_t size);
47275680Straszint	fstyp_ufs(FILE *fp, char *label, size_t size);
48284728Sallanjude#ifdef HAVE_ZFS
49284589Sallanjudeint	fstyp_zfs(FILE *fp, char *label, size_t size);
50284589Sallanjude#endif
51275680Strasz
52275680Strasz#endif /* !FSTYP_H */
53