1.1 --- a/epoc32/include/libc/sys/stat.h Tue Nov 24 13:55:44 2009 +0000
1.2 +++ b/epoc32/include/libc/sys/stat.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -1,1 +1,136 @@
1.4 -stat.h
1.5 +/*
1.6 +* Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
1.7 +* All rights reserved.
1.8 +* This component and the accompanying materials are made available
1.9 +* under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
1.10 +* which accompanies this distribution, and is available
1.11 +* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.12 +*
1.13 +* Initial Contributors:
1.14 +* Nokia Corporation - initial contribution.
1.15 +*
1.16 +* Contributors:
1.17 +*
1.18 +* Description:
1.19 +*
1.20 +*/
1.21 +
1.22 +
1.23 +
1.24 +
1.25 +
1.26 +
1.27 +/**
1.28 + @file
1.29 + @publishedAll
1.30 + @released
1.31 +*/
1.32 +
1.33 +#ifndef _SYS_STAT_H
1.34 +#define _SYS_STAT_H
1.35 +
1.36 +#ifdef __cplusplus
1.37 +extern "C" {
1.38 +#endif
1.39 +
1.40 +#include <_ansi.h>
1.41 +#include <time.h>
1.42 +#include <sys/types.h>
1.43 +
1.44 +struct stat
1.45 +{
1.46 + dev_t st_dev;
1.47 + ino_t st_ino;
1.48 + mode_t st_mode;
1.49 + short st_nlink;
1.50 + uid_t st_uid;
1.51 + gid_t st_gid;
1.52 + dev_t st_rdev;
1.53 + off_t st_size;
1.54 + /* SysV/sco doesn't have the rest... */
1.55 +#ifdef __svr4__
1.56 + time_t st_atime;
1.57 + time_t st_mtime;
1.58 + time_t st_ctime;
1.59 +#else
1.60 + time_t st_atime;
1.61 + int st_spare1;
1.62 + time_t st_mtime;
1.63 + int st_spare2;
1.64 + time_t st_ctime;
1.65 + int st_spare3;
1.66 + long st_blksize;
1.67 + long st_blocks;
1.68 + long st_spare4[2];
1.69 +#endif
1.70 +};
1.71 +
1.72 +#define _IFMT 0170000 /* type of file */
1.73 +#define _IFDIR 0040000 /* directory */
1.74 +#define _IFCHR 0020000 /* character special */
1.75 +#define _IFBLK 0060000 /* block special */
1.76 +#define _IFREG 0100000 /* regular */
1.77 +#define _IFLNK 0120000 /* symbolic link */
1.78 +#define _IFSOCK 0140000 /* socket */
1.79 +#define _IFIFO 0010000 /* fifo */
1.80 +
1.81 +#define S_BLKSIZE 1024 /* size of a block */
1.82 +
1.83 +#define S_ISUID 0004000 /* set user id on execution */
1.84 +#define S_ISGID 0002000 /* set group id on execution */
1.85 +#ifndef _POSIX_SOURCE
1.86 +#define S_ISVTX 0001000 /* save swapped text even after use */
1.87 +#define S_IREAD 0000400 /* read permission, owner */
1.88 +#define S_IWRITE 0000200 /* write permission, owner */
1.89 +#define S_IEXEC 0000100 /* execute/search permission, owner */
1.90 +
1.91 +#define S_ENFMT 0002000 /* enforcement-mode locking */
1.92 +
1.93 +#define S_IFMT _IFMT
1.94 +#define S_IFDIR _IFDIR
1.95 +#define S_IFCHR _IFCHR
1.96 +#define S_IFBLK _IFBLK
1.97 +#define S_IFREG _IFREG
1.98 +#define S_IFLNK _IFLNK
1.99 +#define S_IFSOCK _IFSOCK
1.100 +#define S_IFIFO _IFIFO
1.101 +#endif /* !_POSIX_SOURCE */
1.102 +
1.103 +#define S_IRWXU 0000700 /* rwx, owner */
1.104 +#define S_IRUSR 0000400 /* read permission, owner */
1.105 +#define S_IWUSR 0000200 /* write permission, owner */
1.106 +#define S_IXUSR 0000100 /* execute/search permission, owner */
1.107 +#define S_IRWXG 0000070 /* rwx, group */
1.108 +#define S_IRGRP 0000040 /* read permission, group */
1.109 +#define S_IWGRP 0000020 /* write permission, grougroup */
1.110 +#define S_IXGRP 0000010 /* execute/search permission, group */
1.111 +#define S_IRWXO 0000007 /* rwx, other */
1.112 +#define S_IROTH 0000004 /* read permission, other */
1.113 +#define S_IWOTH 0000002 /* write permission, other */
1.114 +#define S_IXOTH 0000001 /* execute/search permission, other */
1.115 +
1.116 +#define S_ISBLK(m) (((m)&_IFMT) == _IFBLK)
1.117 +#define S_ISCHR(m) (((m)&_IFMT) == _IFCHR)
1.118 +#define S_ISDIR(m) (((m)&_IFMT) == _IFDIR)
1.119 +#define S_ISFIFO(m) (((m)&_IFMT) == _IFIFO)
1.120 +#define S_ISREG(m) (((m)&_IFMT) == _IFREG)
1.121 +#define S_ISLNK(m) (((m)&_IFMT) == _IFLNK)
1.122 +#define S_ISSOCK(m) (((m)&_IFMT) == _IFSOCK)
1.123 +
1.124 +IMPORT_C int chmod ( const char *_path, mode_t _mode );
1.125 +IMPORT_C int wchmod ( const wchar_t *_path, mode_t _mode );
1.126 +IMPORT_C int fstat ( int _fd, struct stat *_sbuf );
1.127 +IMPORT_C int mkdir ( const char *_path, mode_t _mode );
1.128 +IMPORT_C int wmkdir ( const wchar_t *_path, mode_t _mode );
1.129 +IMPORT_C int stat ( const char *_path, struct stat *_sbuf );
1.130 +IMPORT_C int wstat ( const wchar_t *_path, struct stat *_sbuf );
1.131 +IMPORT_C char* realpath (const char *_path, char *resolved);
1.132 +IMPORT_C wchar_t* wrealpath (const wchar_t * _path, wchar_t * resolved);
1.133 +
1.134 +int mkfifo ( char *_path, mode_t _mode );
1.135 +mode_t umask ( mode_t _mask );
1.136 +
1.137 +#ifdef __cplusplus
1.138 +}
1.139 +#endif
1.140 +#endif /* _SYS_STAT_H */