Main Page   Modules   Data Structures   File List   Data Fields   Globals   Related Pages  

lib/cpio.h

Go to the documentation of this file.
00001 #ifndef H_CPIO
00002 #define H_CPIO
00003 
00015 #include <zlib.h>
00016 #include <sys/types.h>
00017 
00018 #include <rpmio_internal.h>
00019 
00023 #define CPIOERR_CHECK_ERRNO     0x00008000
00024 
00027 enum cpioErrorReturns {
00028         CPIOERR_BAD_MAGIC       = (2                    ),
00029         CPIOERR_BAD_HEADER      = (3                    ),
00030         CPIOERR_OPEN_FAILED     = (4    | CPIOERR_CHECK_ERRNO),
00031         CPIOERR_CHMOD_FAILED    = (5    | CPIOERR_CHECK_ERRNO),
00032         CPIOERR_CHOWN_FAILED    = (6    | CPIOERR_CHECK_ERRNO),
00033         CPIOERR_WRITE_FAILED    = (7    | CPIOERR_CHECK_ERRNO),
00034         CPIOERR_UTIME_FAILED    = (8    | CPIOERR_CHECK_ERRNO),
00035         CPIOERR_UNLINK_FAILED   = (9    | CPIOERR_CHECK_ERRNO),
00036 
00037         CPIOERR_RENAME_FAILED   = (10   | CPIOERR_CHECK_ERRNO),
00038         CPIOERR_SYMLINK_FAILED  = (11   | CPIOERR_CHECK_ERRNO),
00039         CPIOERR_STAT_FAILED     = (12   | CPIOERR_CHECK_ERRNO),
00040         CPIOERR_LSTAT_FAILED    = (13   | CPIOERR_CHECK_ERRNO),
00041         CPIOERR_MKDIR_FAILED    = (14   | CPIOERR_CHECK_ERRNO),
00042         CPIOERR_RMDIR_FAILED    = (15   | CPIOERR_CHECK_ERRNO),
00043         CPIOERR_MKNOD_FAILED    = (16   | CPIOERR_CHECK_ERRNO),
00044         CPIOERR_MKFIFO_FAILED   = (17   | CPIOERR_CHECK_ERRNO),
00045         CPIOERR_LINK_FAILED     = (18   | CPIOERR_CHECK_ERRNO),
00046         CPIOERR_READLINK_FAILED = (19   | CPIOERR_CHECK_ERRNO),
00047         CPIOERR_READ_FAILED     = (20   | CPIOERR_CHECK_ERRNO),
00048         CPIOERR_COPY_FAILED     = (21   | CPIOERR_CHECK_ERRNO),
00049         CPIOERR_HDR_SIZE        = (22                   ),
00050         CPIOERR_HDR_TRAILER     = (23                   ),
00051         CPIOERR_UNKNOWN_FILETYPE= (24                   ),
00052         CPIOERR_MISSING_HARDLINK= (25                   ),
00053         CPIOERR_MD5SUM_MISMATCH = (26                   ),
00054         CPIOERR_INTERNAL        = (27                   )
00055 };
00056 
00059 typedef enum cpioMapFlags_e {
00060     CPIO_MAP_PATH       = (1 << 0),
00061     CPIO_MAP_MODE       = (1 << 1),
00062     CPIO_MAP_UID        = (1 << 2),
00063     CPIO_MAP_GID        = (1 << 3),
00064     CPIO_FOLLOW_SYMLINKS= (1 << 4), /* only for building. */
00065     CPIO_MAP_ABSOLUTE   = (1 << 5),
00066     CPIO_MAP_ADDDOT     = (1 << 6),
00067     CPIO_MULTILIB       = (1 << 31) /* internal, only for building. */
00068 } cpioMapFlags;
00069 
00070 #define CPIO_NEWC_MAGIC "070701"
00071 #define CPIO_CRC_MAGIC  "070702"
00072 #define CPIO_TRAILER    "TRAILER!!!"
00073 
00077 struct cpioCrcPhysicalHeader {
00078     char magic[6];
00079     char inode[8];
00080     char mode[8];
00081     char uid[8];
00082     char gid[8];
00083     char nlink[8];
00084     char mtime[8];
00085     char filesize[8];
00086     char devMajor[8];
00087     char devMinor[8];
00088     char rdevMajor[8];
00089     char rdevMinor[8];
00090     char namesize[8];
00091     char checksum[8];                   /* ignored !! */
00092 };
00093 
00094 #define PHYS_HDR_SIZE   110             
00096 #ifdef __cplusplus
00097 extern "C" {
00098 #endif
00099 
00105 int cpioTrailerWrite(FSM_t fsm);
00106 
00112 int cpioHeaderWrite(FSM_t fsm, struct stat * st);
00113 
00119 int cpioHeaderRead(FSM_t fsm, struct stat * st)
00120         /*@modifies fsm, *st @*/;
00121 
00127 /*@observer@*/ const char *const cpioStrerror(int rc)           /*@*/;
00128 
00129 #ifdef __cplusplus
00130 }
00131 #endif
00132 
00133 #endif  /* H_CPIO */

Generated at Thu Apr 19 15:29:42 2001 for rpm by doxygen1.2.6-20010408 written by Dimitri van Heesch, © 1997-2001