~ubuntu-branches/ubuntu/quantal/libarchive/quantal

« back to all changes in this revision

Viewing changes to libarchive/archive_entry_private.h

  • Committer: Package Import Robot
  • Author(s): Andres Mejia
  • Date: 2012-02-23 19:29:24 UTC
  • mfrom: (8.1.10 sid)
  • Revision ID: package-import@ubuntu.com-20120223192924-73n4iedok5fwgsyr
Tags: 3.0.3-5
* Detect if locales or locales-all is installed for use with test suite.
* Bump Standards-Version to 3.9.3.

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
#ifndef ARCHIVE_ENTRY_PRIVATE_H_INCLUDED
33
33
#define ARCHIVE_ENTRY_PRIVATE_H_INCLUDED
34
34
 
 
35
#include "archive_acl_private.h"
35
36
#include "archive_string.h"
36
37
 
37
 
/*
38
 
 * Handle wide character (i.e., Unicode) and non-wide character
39
 
 * strings transparently.
40
 
 */
41
 
 
42
 
struct aes {
43
 
        struct archive_string aes_mbs;
44
 
        struct archive_string aes_utf8;
45
 
        const wchar_t *aes_wcs;
46
 
        /* Bitmap of which of the above are valid.  Because we're lazy
47
 
         * about malloc-ing and reusing the underlying storage, we
48
 
         * can't rely on NULL pointers to indicate whether a string
49
 
         * has been set. */
50
 
        int aes_set;
51
 
#define AES_SET_MBS 1
52
 
#define AES_SET_UTF8 2
53
 
#define AES_SET_WCS 4
54
 
};
55
 
 
56
 
struct ae_acl {
57
 
        struct ae_acl *next;
58
 
        int     type;                   /* E.g., access or default */
59
 
        int     tag;                    /* E.g., user/group/other/mask */
60
 
        int     permset;                /* r/w/x bits */
61
 
        int     id;                     /* uid/gid for user/group */
62
 
        struct aes name;                /* uname/gname */
63
 
};
64
 
 
65
38
struct ae_xattr {
66
39
        struct ae_xattr *next;
67
40
 
70
43
        size_t  size;
71
44
};
72
45
 
 
46
struct ae_sparse {
 
47
        struct ae_sparse *next;
 
48
 
 
49
        int64_t  offset;
 
50
        int64_t  length;
 
51
};
 
52
 
73
53
/*
74
54
 * Description of an archive entry.
75
55
 *
91
71
 * TODO: Design a good API for handling sparse files.
92
72
 */
93
73
struct archive_entry {
 
74
        struct archive *archive;
 
75
 
94
76
        /*
95
77
         * Note that ae_stat.st_mode & AE_IFMT  can be  0!
96
78
         *
101
83
         */
102
84
 
103
85
        /*
104
 
         * Read archive_entry_copy_stat.c for an explanation of why I
105
 
         * don't just use "struct stat" instead of "struct aest" here
106
 
         * and why I have this odd pointer to a separately-allocated
107
 
         * struct stat.
 
86
         * We have a "struct aest" for holding file metadata rather than just
 
87
         * a "struct stat" because on some platforms the "struct stat" has
 
88
         * fields which are too narrow to hold the range of possible values;
 
89
         * we don't want to lose information if we read an archive and write
 
90
         * out another (e.g., in "tar -cf new.tar @old.tar").
 
91
         *
 
92
         * The "stat" pointer points to some form of platform-specific struct
 
93
         * stat; it is declared as a void * rather than a struct stat * as
 
94
         * some platforms have multiple varieties of stat structures.
108
95
         */
109
96
        void *stat;
110
97
        int  stat_valid; /* Set to 0 whenever a field in aest changes. */
118
105
                uint32_t        aest_mtime_nsec;
119
106
                int64_t         aest_birthtime;
120
107
                uint32_t        aest_birthtime_nsec;
121
 
                gid_t           aest_gid;
 
108
                int64_t         aest_gid;
122
109
                int64_t         aest_ino;
123
 
                mode_t          aest_mode;
124
110
                uint32_t        aest_nlink;
125
111
                uint64_t        aest_size;
126
 
                uid_t           aest_uid;
 
112
                int64_t         aest_uid;
127
113
                /*
128
114
                 * Because converting between device codes and
129
115
                 * major/minor values is platform-specific and
150
136
#define AE_SET_MTIME    16
151
137
#define AE_SET_BIRTHTIME 32
152
138
#define AE_SET_SIZE     64
 
139
#define AE_SET_INO      128
 
140
#define AE_SET_DEV      256
153
141
 
154
142
        /*
155
143
         * Use aes here so that we get transparent mbs<->wcs conversions.
156
144
         */
157
 
        struct aes ae_fflags_text;      /* Text fflags per fflagstostr(3) */
 
145
        struct archive_mstring ae_fflags_text;  /* Text fflags per fflagstostr(3) */
158
146
        unsigned long ae_fflags_set;            /* Bitmap fflags */
159
147
        unsigned long ae_fflags_clear;
160
 
        struct aes ae_gname;            /* Name of owning group */
161
 
        struct aes ae_hardlink; /* Name of target for hardlink */
162
 
        struct aes ae_pathname; /* Name of entry */
163
 
        struct aes ae_symlink;          /* symlink contents */
164
 
        struct aes ae_uname;            /* Name of owner */
 
148
        struct archive_mstring ae_gname;                /* Name of owning group */
 
149
        struct archive_mstring ae_hardlink;     /* Name of target for hardlink */
 
150
        struct archive_mstring ae_pathname;     /* Name of entry */
 
151
        struct archive_mstring ae_symlink;              /* symlink contents */
 
152
        struct archive_mstring ae_uname;                /* Name of owner */
165
153
 
166
154
        /* Not used within libarchive; useful for some clients. */
167
 
        struct aes ae_sourcepath;       /* Path this entry is sourced from. */
 
155
        struct archive_mstring ae_sourcepath;   /* Path this entry is sourced from. */
 
156
 
 
157
        void *mac_metadata;
 
158
        size_t mac_metadata_size;
168
159
 
169
160
        /* ACL support. */
170
 
        struct ae_acl   *acl_head;
171
 
        struct ae_acl   *acl_p;
172
 
        int              acl_state;     /* See acl_next for details. */
173
 
        wchar_t         *acl_text_w;
 
161
        struct archive_acl    acl;
174
162
 
175
163
        /* extattr support. */
176
164
        struct ae_xattr *xattr_head;
177
165
        struct ae_xattr *xattr_p;
178
166
 
 
167
        /* sparse support. */
 
168
        struct ae_sparse *sparse_head;
 
169
        struct ae_sparse *sparse_tail;
 
170
        struct ae_sparse *sparse_p;
 
171
 
179
172
        /* Miscellaneous. */
180
173
        char             strmode[12];
181
174
};
182
175
 
183
 
 
184
176
#endif /* ARCHIVE_ENTRY_PRIVATE_H_INCLUDED */