File indexing completed on 2024-04-14 04:52:23

0001 /*
0002     SPDX-FileCopyrightText: 2014 Alex Richardson <arichardson.kde@gmail.com>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-only
0005 */
0006 
0007 #ifndef FILENAMESEARCH_P_H
0008 #define FILENAMESEARCH_P_H
0009 
0010 // Copied from kio/src/core/kiogloba_p.h
0011 
0012 #include <qplatformdefs.h>
0013 
0014 #ifdef Q_OS_WIN
0015 // windows just sets the mode_t access rights bits to the same value for user+group+other.
0016 // This means using the Linux values here is fine.
0017 #ifndef S_IRUSR
0018 #define S_IRUSR 0400
0019 #endif
0020 #ifndef S_IRGRP
0021 #define S_IRGRP 0040
0022 #endif
0023 #ifndef S_IROTH
0024 #define S_IROTH 0004
0025 #endif
0026 
0027 #ifndef S_IWUSR
0028 #define S_IWUSR 0200
0029 #endif
0030 #ifndef S_IWGRP
0031 #define S_IWGRP 0020
0032 #endif
0033 #ifndef S_IWOTH
0034 #define S_IWOTH 0002
0035 #endif
0036 
0037 #ifndef S_IXUSR
0038 #define S_IXUSR 0100
0039 #endif
0040 #ifndef S_IXGRP
0041 #define S_IXGRP 0010
0042 #endif
0043 #ifndef S_IXOTH
0044 #define S_IXOTH 0001
0045 #endif
0046 
0047 #ifndef S_IRWXU
0048 #define S_IRWXU S_IRUSR | S_IWUSR | S_IXUSR
0049 #endif
0050 #ifndef S_IRWXG
0051 #define S_IRWXG S_IRGRP | S_IWGRP | S_IXGRP
0052 #endif
0053 #ifndef S_IRWXO
0054 #define S_IRWXO S_IROTH | S_IWOTH | S_IXOTH
0055 #endif
0056 Q_STATIC_ASSERT(S_IRUSR == _S_IREAD && S_IWUSR == _S_IWRITE && S_IXUSR == _S_IEXEC);
0057 
0058 // these three will never be set in st_mode
0059 #ifndef S_ISUID
0060 #define S_ISUID 04000 // SUID bit does not exist on windows
0061 #endif
0062 #ifndef S_ISGID
0063 #define S_ISGID 02000 // SGID bit does not exist on windows
0064 #endif
0065 #ifndef S_ISVTX
0066 #define S_ISVTX 01000 // sticky bit does not exist on windows
0067 #endif
0068 
0069 // Windows does not have S_IFBLK and S_IFSOCK, just use the Linux values, they won't conflict
0070 #ifndef S_IFBLK
0071 #define S_IFBLK 0060000
0072 #endif
0073 #ifndef S_IFSOCK
0074 #define S_IFSOCK 0140000
0075 #endif
0076 
0077 #endif // Q_OS_WIN
0078 
0079 #endif // FILENAMESEARCH_P_H