POK(kernelpart)
/home/jaouen/pok_official/pok/trunk/kernel/include/core/cpio.h
Go to the documentation of this file.
00001 /*
00002  *                               POK header
00003  * 
00004  * The following file is a part of the POK project. Any modification should
00005  * made according to the POK licence. You CANNOT use this file or a part of
00006  * this file is this part of a file for your own project
00007  *
00008  * For more information on the POK licence, please see our LICENCE FILE
00009  *
00010  * Please follow the coding guidelines described in doc/CODING_GUIDELINES
00011  *
00012  *                                      Copyright (c) 2007-2009 POK team 
00013  *
00014  * Created by julien on Thu Jan 15 23:34:13 2009 
00015  */
00016 
00017 
00018 #ifndef __POK_KERNEL_CPIO_H__
00019 #define __POK_KERNEL_CPIO_H__
00020 
00021 enum cpio_format
00022 {
00023    CPIO_BIN_FMT,
00024    CPIO_ODC_FMT,
00025    CPIO_NEWC_FMT,
00026    CPIO_CRC_FMT,
00027    CPIO_TAR_FMT,
00028    CPIO_USTAR_FMT,
00029    CPIO_HPBIN_FMT,
00030    CPIO_HPODC_FMT
00031 };
00032 
00033 struct cpio_bin_header
00034 {
00035   unsigned short        c_magic;
00036   unsigned short        c_dev;
00037   unsigned short        c_ino;
00038   unsigned short        c_mode;
00039   unsigned short        c_uid;
00040   unsigned short        c_gid;
00041   unsigned short        c_nlink;
00042   unsigned short        c_rdev;
00043   unsigned short        c_mtime[2];
00044   unsigned short        c_namesize;
00045   unsigned short        c_filesize[2];
00046 };
00047 
00048 struct cpio_file
00049 {
00050   int                         cpio_fmt;
00051   void                     *cpio_addr;
00052   void                     *curr_header;
00053   void                     *curr_fileaddr;
00054   unsigned int          curr_filesz;
00055   char                     *curr_filename;
00056   unsigned int          curr_filename_len;
00057   int             (*next_header)(struct cpio_file *cpio);
00058 };
00059 
00060 int   cpio_open (struct cpio_file *cpio, void *file);
00061 char  *cpio_get_filename(struct cpio_file *cpio);
00062 int   cpio_next_file(struct cpio_file *cpio);
00063 void  *cpio_get_fileaddr(struct cpio_file *cpio);
00064 
00065 #endif /* __POK_KERNEL_CPIO_H__ */
00066