"Fossies" - the Fresh Open Source Software Archive

Member "dmd2/src/druntime/import/core/sys/windows/stat.d" (20 Nov 2020, 1138 Bytes) of package /linux/misc/dmd.2.094.2.linux.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) D source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 
    2 /// $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
    3 /// Author: Walter Bright
    4 
    5 module core.sys.windows.stat;
    6 version (Windows):
    7 
    8 extern (C) nothrow @nogc:
    9 @system:
   10 
   11 // Posix version is in core.sys.posix.sys.stat
   12 
   13 enum S_IFMT   = 0xF000;
   14 enum S_IFDIR  = 0x4000;
   15 enum S_IFCHR  = 0x2000;
   16 enum S_IFIFO  = 0x1000;
   17 enum S_IFREG  = 0x8000;
   18 enum S_IREAD  = 0x0100;
   19 enum S_IWRITE = 0x0080;
   20 enum S_IEXEC  = 0x0040;
   21 enum S_IFBLK  = 0x6000;
   22 enum S_IFNAM  = 0x5000;
   23 
   24 @safe pure
   25 {
   26 int S_ISREG(int m)  { return (m & S_IFMT) == S_IFREG; }
   27 int S_ISBLK(int m)  { return (m & S_IFMT) == S_IFBLK; }
   28 int S_ISNAM(int m)  { return (m & S_IFMT) == S_IFNAM; }
   29 int S_ISDIR(int m)  { return (m & S_IFMT) == S_IFDIR; }
   30 int S_ISCHR(int m)  { return (m & S_IFMT) == S_IFCHR; }
   31 }
   32 
   33 struct struct_stat
   34 {
   35     short st_dev;
   36     ushort st_ino;
   37     ushort st_mode;
   38     short st_nlink;
   39     ushort st_uid;
   40     ushort st_gid;
   41     short st_rdev;
   42     short dummy;
   43     int st_size;
   44     int st_atime;
   45     int st_mtime;
   46     int st_ctime;
   47 }
   48 
   49 int  stat(const(char)*, struct_stat *);
   50 int  fstat(int, struct_stat *) @trusted;
   51 int  _wstat(const(wchar)*, struct_stat *);