]> git.ipfire.org Git - thirdparty/util-linux.git/blob - include/iso9660.h
dmesg: add --follow-new
[thirdparty/util-linux.git] / include / iso9660.h
1 #ifndef UTIL_LINUX_ISO_H
2 #define UTIL_LINUX_ISO_H
3
4 #include <stdbool.h>
5
6 #include "c.h"
7
8 static inline int isonum_721(unsigned char *p)
9 {
10 return ((p[0] & 0xff)
11 | ((p[1] & 0xff) << 8));
12 }
13
14 static inline int isonum_722(unsigned char *p)
15 {
16 return ((p[1] & 0xff)
17 | ((p[0] & 0xff) << 8));
18 }
19
20 static inline int isonum_723(unsigned char *p, bool check_match)
21 {
22 int le = isonum_721(p);
23 int be = isonum_722(p + 2);
24
25 if (check_match && le != be)
26 /* translation is useless */
27 warnx("723error: le=%d be=%d", le, be);
28 return (le);
29 }
30
31 static inline int isonum_731(unsigned char *p)
32 {
33 return ((p[0] & 0xff)
34 | ((p[1] & 0xff) << 8)
35 | ((p[2] & 0xff) << 16)
36 | ((p[3] & 0xff) << 24));
37 }
38
39 static inline int isonum_732(unsigned char *p)
40 {
41 return ((p[3] & 0xff)
42 | ((p[2] & 0xff) << 8)
43 | ((p[1] & 0xff) << 16)
44 | ((p[0] & 0xff) << 24));
45 }
46
47 static inline int isonum_733(unsigned char *p, bool check_match)
48 {
49 int le = isonum_731(p);
50 int be = isonum_732(p + 4);
51
52 if (check_match && le != be)
53 /* translation is useless */
54 warnx("733error: le=%d be=%d", le, be);
55 return(le);
56 }
57
58 #endif