epoc32/include/libc/sys/stat.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:27:01 +0100
branchSymbian2
changeset 3 e1b950c65cb4
parent 0 061f57f2323e
child 4 837f303aceeb
permissions -rw-r--r--
Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
williamr@2
     1
/*
williamr@2
     2
* Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
williamr@2
     3
* All rights reserved.
williamr@2
     4
* This component and the accompanying materials are made available
williamr@2
     5
* 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
williamr@2
     6
* which accompanies this distribution, and is available
williamr@2
     7
* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
williamr@2
     8
*
williamr@2
     9
* Initial Contributors:
williamr@2
    10
* Nokia Corporation - initial contribution.
williamr@2
    11
*
williamr@2
    12
* Contributors:
williamr@2
    13
*
williamr@2
    14
* Description:
williamr@2
    15
*
williamr@2
    16
*/
williamr@2
    17
williamr@2
    18
williamr@2
    19
williamr@2
    20
williamr@2
    21
williamr@2
    22
williamr@2
    23
/**
williamr@2
    24
 @file
williamr@2
    25
 @publishedAll
williamr@2
    26
 @released
williamr@2
    27
*/
williamr@2
    28
williamr@2
    29
#ifndef	_SYS_STAT_H
williamr@2
    30
#define	_SYS_STAT_H
williamr@2
    31
williamr@2
    32
#ifdef __cplusplus
williamr@2
    33
extern "C" {
williamr@2
    34
#endif
williamr@2
    35
williamr@2
    36
#include <_ansi.h>
williamr@2
    37
#include <time.h>
williamr@2
    38
#include <sys/types.h>
williamr@2
    39
williamr@2
    40
struct	stat 
williamr@2
    41
{
williamr@2
    42
  dev_t		st_dev;
williamr@2
    43
  ino_t		st_ino;
williamr@2
    44
  mode_t	st_mode;
williamr@2
    45
  short		st_nlink;
williamr@2
    46
  uid_t		st_uid;
williamr@2
    47
  gid_t		st_gid;
williamr@2
    48
  dev_t		st_rdev;
williamr@2
    49
  off_t		st_size;
williamr@2
    50
  /* SysV/sco doesn't have the rest... */
williamr@2
    51
#ifdef __svr4__
williamr@2
    52
  time_t	st_atime;
williamr@2
    53
  time_t	st_mtime;
williamr@2
    54
  time_t	st_ctime;
williamr@2
    55
#else
williamr@2
    56
  time_t	st_atime;
williamr@2
    57
  int	st_spare1;
williamr@2
    58
  time_t	st_mtime;
williamr@2
    59
  int	st_spare2;
williamr@2
    60
  time_t	st_ctime;
williamr@2
    61
  int	st_spare3;
williamr@2
    62
  long		st_blksize;
williamr@2
    63
  long		st_blocks;
williamr@2
    64
  long	st_spare4[2];
williamr@2
    65
#endif
williamr@2
    66
};
williamr@2
    67
williamr@2
    68
#define	_IFMT		0170000	/* type of file */
williamr@2
    69
#define		_IFDIR	0040000	/* directory */
williamr@2
    70
#define		_IFCHR	0020000	/* character special */
williamr@2
    71
#define		_IFBLK	0060000	/* block special */
williamr@2
    72
#define		_IFREG	0100000	/* regular */
williamr@2
    73
#define		_IFLNK	0120000	/* symbolic link */
williamr@2
    74
#define		_IFSOCK	0140000	/* socket */
williamr@2
    75
#define		_IFIFO	0010000	/* fifo */
williamr@2
    76
williamr@2
    77
#define 	S_BLKSIZE  1024 /* size of a block */
williamr@2
    78
williamr@2
    79
#define	S_ISUID		0004000	/* set user id on execution */
williamr@2
    80
#define	S_ISGID		0002000	/* set group id on execution */
williamr@2
    81
#ifndef	_POSIX_SOURCE
williamr@2
    82
#define	S_ISVTX		0001000	/* save swapped text even after use */
williamr@2
    83
#define	S_IREAD		0000400	/* read permission, owner */
williamr@2
    84
#define	S_IWRITE 	0000200	/* write permission, owner */
williamr@2
    85
#define	S_IEXEC		0000100	/* execute/search permission, owner */
williamr@2
    86
williamr@2
    87
#define	S_ENFMT 	0002000	/* enforcement-mode locking */
williamr@2
    88
williamr@2
    89
#define	S_IFMT		_IFMT
williamr@2
    90
#define	S_IFDIR		_IFDIR
williamr@2
    91
#define	S_IFCHR		_IFCHR
williamr@2
    92
#define	S_IFBLK		_IFBLK
williamr@2
    93
#define	S_IFREG		_IFREG
williamr@2
    94
#define	S_IFLNK		_IFLNK
williamr@2
    95
#define	S_IFSOCK	_IFSOCK
williamr@2
    96
#define	S_IFIFO		_IFIFO
williamr@2
    97
#endif	/* !_POSIX_SOURCE */
williamr@2
    98
williamr@2
    99
#define	S_IRWXU 	0000700	/* rwx, owner */
williamr@2
   100
#define		S_IRUSR	0000400	/* read permission, owner */
williamr@2
   101
#define		S_IWUSR	0000200	/* write permission, owner */
williamr@2
   102
#define		S_IXUSR	0000100	/* execute/search permission, owner */
williamr@2
   103
#define	S_IRWXG		0000070	/* rwx, group */
williamr@2
   104
#define		S_IRGRP	0000040	/* read permission, group */
williamr@2
   105
#define		S_IWGRP	0000020	/* write permission, grougroup */
williamr@2
   106
#define		S_IXGRP	0000010	/* execute/search permission, group */
williamr@2
   107
#define	S_IRWXO		0000007	/* rwx, other */
williamr@2
   108
#define		S_IROTH	0000004	/* read permission, other */
williamr@2
   109
#define		S_IWOTH	0000002	/* write permission, other */
williamr@2
   110
#define		S_IXOTH	0000001	/* execute/search permission, other */
williamr@2
   111
williamr@2
   112
#define	S_ISBLK(m)	(((m)&_IFMT) == _IFBLK)
williamr@2
   113
#define	S_ISCHR(m)	(((m)&_IFMT) == _IFCHR)
williamr@2
   114
#define	S_ISDIR(m)	(((m)&_IFMT) == _IFDIR)
williamr@2
   115
#define	S_ISFIFO(m)	(((m)&_IFMT) == _IFIFO)
williamr@2
   116
#define	S_ISREG(m)	(((m)&_IFMT) == _IFREG)
williamr@2
   117
#define	S_ISLNK(m)	(((m)&_IFMT) == _IFLNK)
williamr@2
   118
#define	S_ISSOCK(m)	(((m)&_IFMT) == _IFSOCK)
williamr@2
   119
williamr@2
   120
IMPORT_C int	chmod	( const char *_path, mode_t _mode );
williamr@2
   121
IMPORT_C int	wchmod	( const wchar_t *_path, mode_t _mode );
williamr@2
   122
IMPORT_C int	fstat	( int _fd, struct stat *_sbuf );
williamr@2
   123
IMPORT_C int	mkdir	( const char *_path, mode_t _mode );
williamr@2
   124
IMPORT_C int	wmkdir	( const wchar_t *_path, mode_t _mode );
williamr@2
   125
IMPORT_C int	stat	( const char *_path, struct stat *_sbuf );
williamr@2
   126
IMPORT_C int	wstat	( const wchar_t *_path, struct stat *_sbuf );
williamr@2
   127
IMPORT_C char*	realpath (const char *_path, char *resolved);
williamr@2
   128
IMPORT_C wchar_t*	wrealpath (const wchar_t * _path, wchar_t * resolved);
williamr@2
   129
williamr@2
   130
int	mkfifo	( char *_path, mode_t _mode );
williamr@2
   131
mode_t	umask	( mode_t _mask );
williamr@2
   132
williamr@2
   133
#ifdef __cplusplus
williamr@2
   134
}
williamr@2
   135
#endif
williamr@2
   136
#endif /* _SYS_STAT_H */