Revision 5fafdf24 block-dmg.c

b/block-dmg.c
1 1
/*
2 2
 * QEMU Block driver for DMG images
3
 * 
3
 *
4 4
 * Copyright (c) 2004 Johannes E. Schindelin
5
 * 
5
 *
6 6
 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 7
 * of this software and associated documentation files (the "Software"), to deal
8 8
 * in the Software without restriction, including without limitation the rights
......
28 28

  
29 29
typedef struct BDRVDMGState {
30 30
    int fd;
31
    
31
   
32 32
    /* each chunk contains a certain number of sectors,
33 33
     * offsets[i] is the offset in the .dmg file,
34 34
     * lengths[i] is the length of the compressed chunk,
......
86 86
    bs->read_only = 1;
87 87
    s->n_chunks = 0;
88 88
    s->offsets = s->lengths = s->sectors = s->sectorcounts = 0;
89
    
89
   
90 90
    /* read offset of info blocks */
91 91
    if(lseek(s->fd,-0x1d8,SEEK_END)<0) {
92 92
dmg_close:
......
167 167
	goto dmg_close;
168 168

  
169 169
    s->current_chunk = s->n_chunks;
170
    
170
   
171 171
    return 0;
172 172
}
173 173

  
......
227 227

  
228 228
	    if (ret != s->lengths[chunk])
229 229
		return -1;
230
	
230

  
231 231
	    s->zstream.next_in = s->compressed_chunk;
232 232
	    s->zstream.avail_in = s->lengths[chunk];
233 233
	    s->zstream.next_out = s->uncompressed_chunk;
......
253 253
    return 0;
254 254
}
255 255

  
256
static int dmg_read(BlockDriverState *bs, int64_t sector_num, 
256
static int dmg_read(BlockDriverState *bs, int64_t sector_num,
257 257
                    uint8_t *buf, int nb_sectors)
258 258
{
259 259
    BDRVDMGState *s = bs->opaque;

Also available in: Unified diff