usrFdiskPartLib.h
上传用户:luoyougen
上传日期:2008-05-12
资源大小:23136k
文件大小:3k
源码类别:

VxWorks

开发平台:

C/C++

  1. /* usrFdiskPartLib.h - FDISK partition support header */
  2. /* Copyright 2002 Wind River Systems, Inc. */
  3. /*
  4. modification history
  5. --------------------
  6. 01a,20sep01,jkf   written
  7. */
  8. #ifndef __INCusrFdiskPartLibh
  9. #define __INCusrFdiskPartLibh
  10. #ifdef __cplusplus
  11. extern "C" {
  12. #endif
  13. #include "cbioLib.h"       /* for CBIO_DEV_ID */
  14. #include "dpartCbio.h"     /* for PART_TABLE_ENTRY */
  15. /* function declarations */
  16. #if defined(__STDC__) || defined(__cplusplus)
  17. extern STATUS usrFdiskPartRead
  18.     (
  19.     CBIO_DEV_ID cDev,            /* device from which to read blocks */
  20.     PART_TABLE_ENTRY *pPartTab,  /* table where to fill results */
  21.     int nPart                    /* # of entries in <pPartTable> */
  22.     );
  23. extern STATUS usrFdiskPartCreate
  24.     (
  25.     CBIO_DEV_ID cDev,  /* device representing the entire disk */
  26.     int nPart, /* how many partitions needed, default=1, max=4 */
  27.     int size1, /* space percentage for second partition */
  28.     int size2, /* space percentage for third partition */
  29.     int size3 /* space percentage for fourth partition */
  30.     );
  31. #else
  32. STATUS usrFdiskPartRead ();
  33. STATUS usrFdiskPartCreate ();
  34. #endif /* __STDC__ */
  35. /* macro's */
  36. /* partition table structure offsets */
  37. #define PART_SIG_ADRS           0x1fe   /* dos partition signature  */
  38. #define PART_SIG_MSB            0x55    /* msb of the partition sig */
  39. #define PART_SIG_LSB            0xaa    /* lsb of the partition sig */
  40. #define PART_IS_BOOTABLE        0x80    /* a dos bootable partition */
  41. #define PART_NOT_BOOTABLE       0x00    /* not a bootable partition */
  42. #define PART_TYPE_DOS4          0x06    /* dos 16b FAT, 32b secnum  */
  43. #define PART_TYPE_DOSEXT        0x05    /* msdos extended partition */
  44. #define PART_TYPE_DOS3          0x04    /* dos 16b FAT, 16b secnum  */
  45. #define PART_TYPE_DOS12         0x01    /* dos 12b FAT, 32b secnum  */
  46. #define PART_TYPE_DOS32         0x0b    /* dos 32b FAT, 32b secnum  */
  47. #define PART_TYPE_DOS32X        0x0c    /* dos 32b FAT, 32b secnum  */
  48. #define PART_TYPE_WIN95_D4      0x0e    /* Win95 dosfs  16bf 32bs   */
  49. #define PART_TYPE_WIN95_EXT     0x0f    /* Win95 extended partition */
  50. #define BOOT_TYPE_OFFSET    0x0   /* boot type                      */
  51. #define STARTSEC_HD_OFFSET  0x1   /* beginning sector head value    */
  52. #define STARTSEC_SEC_OFFSET 0x2   /* beginning sector               */
  53. #define STARTSEC_CYL_OFFSET 0x3   /* beginning cylinder             */
  54. #define SYSTYPE_OFFSET      0x4   /* system indicator               */
  55. #define ENDSEC_HD_OFFSET    0x5   /* ending sector head value       */
  56. #define ENDSEC_SEC_OFFSET   0x6   /* ending sector                  */
  57. #define ENDSEC_CYL_OFFSET   0x7   /* ending cylinder                */
  58. #define NSECTORS_OFFSET     0x8   /* sector offset from reference   */
  59. #define NSECTORS_TOTAL      0xc   /* number of sectors in part      */
  60. #ifdef __cplusplus
  61. }
  62. #endif
  63. #endif /* __INCusrFdiskPartLibh */