Annotation of parser3/src/lib/sdbm/pa-include/pa_file_info.h, revision 1.2
1.2 ! moko 1: /* Licensed to the Apache Software Foundation (ASF) under one or more
! 2: * contributor license agreements. See the NOTICE file distributed with
! 3: * this work for additional information regarding copyright ownership.
! 4: * The ASF licenses this file to You under the Apache License, Version 2.0
! 5: * (the "License"); you may not use this file except in compliance with
! 6: * the License. You may obtain a copy of the License at
! 7: *
! 8: * http://www.apache.org/licenses/LICENSE-2.0
! 9: *
! 10: * Unless required by applicable law or agreed to in writing, software
! 11: * distributed under the License is distributed on an "AS IS" BASIS,
! 12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
! 13: * See the License for the specific language governing permissions and
! 14: * limitations under the License.
1.1 moko 15: */
16:
17: #ifndef PA_FILE_INFO_H
18: #define PA_FILE_INFO_H
19:
20: #include "pa_apr.h"
21:
22: #ifdef __cplusplus
23: extern "C" {
24: #endif /* __cplusplus */
25: /**
26: * @file pa_file_info.h
27: * @brief APR File handling
28: */
29:
30: /**
31: * Structure for determining file permissions.
32: * @defvar pa_fileperms_t
33: */
34: typedef pa_int32_t pa_fileperms_t;
35:
36: /**
37: * @defgroup PA_File_Info Stat Functions
38: * @{
39: */
40: #ifdef LATER
41: #define PA_FINFO_LINK 0x00000001 /**< Stat the link not the file itself if it is a link */
42: #define PA_FINFO_MTIME 0x00000010 /**< Modification Time */
43: #define PA_FINFO_CTIME 0x00000020 /**< Creation Time */
44: #define PA_FINFO_ATIME 0x00000040 /**< Access Time */
45: #endif
46: #define PA_FINFO_SIZE 0x00000100 /**< Size of the file */
47: #ifdef LATER
48: #define PA_FINFO_CSIZE 0x00000200 /**< Storage size consumed by the file */
49: #define PA_FINFO_DEV 0x00001000
50: #define PA_FINFO_INODE 0x00002000
51: #define PA_FINFO_NLINK 0x00004000
52: #define PA_FINFO_TYPE 0x00008000
53: #define PA_FINFO_USER 0x00010000
54: #define PA_FINFO_GROUP 0x00020000
55: #define PA_FINFO_UPROT 0x00100000
56: #define PA_FINFO_GPROT 0x00200000
57: #define PA_FINFO_WPROT 0x00400000
58: #define PA_FINFO_ICASE 0x01000000 /**< if dev is case insensitive */
59: #define PA_FINFO_NAME 0x02000000 /**< ->name in proper case */
60:
61: #define PA_FINFO_MIN 0x00008170 /**< type, mtime, ctime, atime, size */
62: #define PA_FINFO_IDENT 0x00003000 /**< dev and inode */
63: #define PA_FINFO_OWNER 0x00030000 /**< user and group */
64: #define PA_FINFO_PROT 0x00700000 /**< all protections */
65: #define PA_FINFO_NORM 0x0073b170 /**< an atomic unix pa_stat() */
66: #define PA_FINFO_DIRENT 0x02000000 /**< an atomic unix pa_dir_read() */
67: #endif
68:
69: /**
70: * The file information structure. This is analogous to the POSIX
71: * stat structure.
72: */
73: typedef struct pa_finfo_t pa_finfo_t;
74:
75: struct pa_finfo_t {
76: #ifdef LATER
77: /** Allocates memory and closes lingering handles in the specified pool */
78: pa_pool_t *pool;
79: /** The bitmask describing valid fields of this pa_finfo_t structure
80: * including all available 'wanted' fields and potentially more */
81: pa_int32_t valid;
82: /** The access permissions of the file. Mimics Unix access rights. */
83: pa_fileperms_t protection;
84: /** The type of file. One of PA_NOFILE, PA_REG, PA_DIR, PA_CHR,
85: * PA_BLK, PA_PIPE, PA_LNK, PA_SOCK
86: */
87: pa_filetype_e filetype;
88: /** The user id that owns the file */
89: pa_uid_t user;
90: /** The group id that owns the file */
91: pa_gid_t group;
92: /** The inode of the file. */
93: pa_ino_t inode;
94: /** The id of the device the file is on. */
95: pa_dev_t device;
96: /** The number of hard links to the file. */
97: pa_int32_t nlink;
98: #endif
99: /** The size of the file */
100: pa_off_t size;
101: #ifdef LATER
102: /** The storage size consumed by the file */
103: pa_off_t csize;
104: /** The time the file was last accessed */
105: pa_time_t atime;
106: /** The time the file was last modified */
107: pa_time_t mtime;
108: /** The time the file was last changed */
109: pa_time_t ctime;
110: /** The full pathname of the file */
111: const char *fname;
112: /** The file's name (no path) in filesystem case */
113: const char *name;
114: /** The file's handle, if accessed (can be submitted to pa_duphandle) */
115: struct pa_file_t *filehand;
116: #endif
117: };
118:
119: /** @} */
120:
121:
122:
123: #ifdef __cplusplus
124: }
125: #endif
126:
127: #endif /* ! PA_FILE_INFO_H */
E-mail: