]> git.saurik.com Git - apple/xnu.git/blob - libsa/libsa/vers_rsrc.h
fb49018676ee7bc11b12e4421b84ad9a46978327
[apple/xnu.git] / libsa / libsa / vers_rsrc.h
1 #ifndef _LIBSA_VERS_H_
2 #define _LIBSA_VERS_H_
3
4 #include <libkern/OSTypes.h>
5
6 typedef union {
7 UInt32 vnum;
8 UInt8 bytes[4];
9 } VERS_version;
10
11 typedef enum {
12 VERS_development = 0x20,
13 VERS_alpha = 0x40,
14 VERS_beta = 0x60,
15 VERS_candidate = 0x70, // for interim usage only!
16 VERS_release = 0x80,
17 VERS_invalid = 0xff
18 } VERS_revision;
19
20 #define BCD_combine(l, r) ( (((l) & 0xf) << 4) | ((r) & 0xf) )
21 #define BCD_get_left(p) ( ((p) >> 4) & 0xf )
22 #define BCD_get_right(p) ( (p) & 0xf )
23
24 #define BCD_illegal (0xff) // full byte, 11111111
25
26 int VERS_parse_string(const char * vers_string, UInt32 * version_num);
27 int VERS_string(char * buffer, UInt32 length, UInt32 vers);
28
29 #endif _LIBSA_VERS_H_