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