summaryrefslogtreecommitdiffstats
path: root/ext/digest/lib/digest.rb
diff options
context:
space:
mode:
Diffstat (limited to 'ext/digest/lib/digest.rb')
0 files changed, 0 insertions, 0 deletions
4' href='#n74'>74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175
/*
 * (C) Copyright 2002
 * Stäubli Faverges - <www.staubli.com>
 * Pierre AUBERT  p.aubert@staubli.com
 *
 * See file CREDITS for list of people who contributed to this
 * project.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of
 * the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 * MA 02111-1307 USA
 */

#ifndef _DOS_H_
#define _DOS_H_

/* Definitions for Dos diskettes                                             */

/* General definitions                                                       */
#define SZ_STD_SECTOR   512             /* Standard sector size              */
#define MDIR_SIZE	32		/* Direntry size                     */
#define FAT_BITS        12              /* Diskette use 12 bits fat          */

#define MAX_PATH	128		/* Max size of the MSDOS PATH        */
#define MAX_DIR_SECS	64		/* Taille max d'un repertoire (en    */
					/* secteurs)                         */
/* Misc. definitions                                                         */
#define DELMARK         '\xe5'
#define EXTENDED_BOOT   (0x29)
#define MEDIA_STD       (0xf0)
#define JUMP_0_1        (0xe9)
#define JUMP_0_2        (0xeb)

/* Boot size is 256 bytes, but we need to read almost a sector, then
   assume bootsize is 512                                                    */
#define BOOTSIZE        512

/* Fat definitions for 12 bits fat                                           */
#define FAT12_MAX_NB    4086
#define FAT12_LAST      0x0ff6
#define FAT12_END       0x0fff

/* file attributes                                                           */
#define ATTR_READONLY           0x01
#define ATTR_HIDDEN             0x02
#define ATTR_SYSTEM             0x04
#define ATTR_VOLUME             0x08
#define ATTR_DIRECTORY          0x10
#define ATTR_ARCHIVE            0x20
#define ATTR_VSE                0x0f

/* Name format                                                               */
#define EXTCASE                 0x10
#define BASECASE                0x8

/* Definition of the boot sector                                             */
#define BANNER_LG               8
#define LABEL_LG                11

typedef struct bootsector
{
    unsigned char jump [3];	/* 0  Jump to boot code                      */
    char banner [BANNER_LG];	/* 3  OEM name & version                     */
    unsigned short secsiz;	/* 11 Bytes per sector hopefully 512         */
    unsigned char clsiz;	/* 13 Cluster size in sectors                */
    unsigned short nrsvsect;	/* 14 Number of reserved (boot) sectors      */
    unsigned char nfat;		/* 16 Number of FAT tables hopefully 2       */
    unsigned short dirents;	/* 17 Number of directory slots              */
    unsigned short psect;	/* 19 Total sectors on disk                  */
    unsigned char descr;	/* 21 Media descriptor=first byte of FAT     */
    unsigned short fatlen;	/* 22 Sectors in FAT                         */
    unsigned short nsect;	/* 24 Sectors/track                          */
    unsigned short nheads;	/* 26 Heads                                  */
    unsigned int nhs;	        /* 28 number of hidden sectors               */
    unsigned int bigsect;	/* 32 big total sectors                      */
    unsigned char physdrive;	/* 36 physical drive ?                       */
    unsigned char reserved;	/* 37 reserved                               */
    unsigned char dos4;		/* 38 dos > 4.0 diskette                     */
    unsigned int serial;        /* 39 serial number                          */
    char label [LABEL_LG];	/* 43 disk label                             */