diff options
author | Igor Pavlov <87184205+ip7z@users.noreply.github.com> | 2022-06-20 00:00:00 +0000 |
---|---|---|
committer | Igor Pavlov <87184205+ip7z@users.noreply.github.com> | 2023-12-17 13:35:20 +0500 |
commit | a3e1d227377188734b82f023f96f8e25dc40f3e6 (patch) | |
tree | 23cad8d47eb23d26ea727b4f7f4a65124f724065 /CPP/Common/MyLinux.h | |
parent | f19f813537c7aea1c20749c914e756b54a9c3cf5 (diff) | |
download | 7zip-22.00.tar.gz 7zip-22.00.tar.bz2 7zip-22.00.zip |
22.0022.00
Diffstat (limited to 'CPP/Common/MyLinux.h')
-rw-r--r-- | CPP/Common/MyLinux.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/CPP/Common/MyLinux.h b/CPP/Common/MyLinux.h index 1a91899..98b453c 100644 --- a/CPP/Common/MyLinux.h +++ b/CPP/Common/MyLinux.h | |||
@@ -3,6 +3,18 @@ | |||
3 | #ifndef __MY_LIN_LINUX_H | 3 | #ifndef __MY_LIN_LINUX_H |
4 | #define __MY_LIN_LINUX_H | 4 | #define __MY_LIN_LINUX_H |
5 | 5 | ||
6 | // #include "../../C/7zTypes.h" | ||
7 | |||
8 | #define MY_LIN_DT_UNKNOWN 0 | ||
9 | #define MY_LIN_DT_FIFO 1 | ||
10 | #define MY_LIN_DT_CHR 2 | ||
11 | #define MY_LIN_DT_DIR 4 | ||
12 | #define MY_LIN_DT_BLK 6 | ||
13 | #define MY_LIN_DT_REG 8 | ||
14 | #define MY_LIN_DT_LNK 10 | ||
15 | #define MY_LIN_DT_SOCK 12 | ||
16 | #define MY_LIN_DT_WHT 14 | ||
17 | |||
6 | #define MY_LIN_S_IFMT 00170000 | 18 | #define MY_LIN_S_IFMT 00170000 |
7 | #define MY_LIN_S_IFSOCK 0140000 | 19 | #define MY_LIN_S_IFSOCK 0140000 |
8 | #define MY_LIN_S_IFLNK 0120000 | 20 | #define MY_LIN_S_IFLNK 0120000 |
@@ -39,4 +51,25 @@ | |||
39 | #define MY_LIN_S_IWOTH 00002 | 51 | #define MY_LIN_S_IWOTH 00002 |
40 | #define MY_LIN_S_IXOTH 00001 | 52 | #define MY_LIN_S_IXOTH 00001 |
41 | 53 | ||
54 | /* | ||
55 | // major/minor encoding for makedev(): MMMMMmmmmmmMMMmm: | ||
56 | |||
57 | inline UInt32 MY_dev_major(UInt64 dev) | ||
58 | { | ||
59 | return ((UInt32)(dev >> 8) & (UInt32)0xfff) | ((UInt32)(dev >> 32) & ~(UInt32)0xfff); | ||
60 | } | ||
61 | |||
62 | inline UInt32 MY_dev_minor(UInt64 dev) | ||
63 | { | ||
64 | return ((UInt32)(dev) & 0xff) | ((UInt32)(dev >> 12) & ~0xff); | ||
65 | } | ||
66 | |||
67 | inline UInt64 MY_dev_makedev(UInt32 __major, UInt32 __minor) | ||
68 | { | ||
69 | return (__minor & 0xff) | ((__major & 0xfff) << 8) | ||
70 | | ((UInt64) (__minor & ~0xff) << 12) | ||
71 | | ((UInt64) (__major & ~0xfff) << 32); | ||
72 | } | ||
73 | */ | ||
74 | |||
42 | #endif | 75 | #endif |