-
Notifications
You must be signed in to change notification settings - Fork 0
/
plantilla2_201114717.h
74 lines (63 loc) · 2.45 KB
/
plantilla2_201114717.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/*
* File: plantilla2_201114717.h
* Author: clnx
*
* Created on 4 de septiembre de 2015, 12:34 PM
*/
#ifndef PLANTILLA2_201114717_H
#define PLANTILLA2_201114717_H
#include "plantilla3_201114717.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct{
char nombre[16]; //nombre del archivo
int tamanio; //tamaño del archivo en bytes
char extension[5]; //extension del archivo
int idInicio; //id del bloque en el que inicia el archivo
char fecha[20]; //fecha en la que el archivo fue creado
int idFinal; //id del ultimo bloque del archivo
char estado; //1 creado, 0 eliminado, 2 disponible
}fatRootFolder;
typedef struct{
int id; //es el numero de bloque segun en la particion en que este
char estado; //1 ocupado, 0 libre
int anterior; //id del bloq anterior del q se compone el archivo, si es el primer bloq del archivo sera -1
int siguiente; //id del siguiente bloq del q se compone el archivo, si es el ultimo bloq del archivo tendra el valor de -1
}bloque;
//--------------------------------METODOS---------------------------------------
disco existeDiscoIndex(char id[]);
void crearParticion();
void actualizarDiscoIndex(disco aux1);
void EliminarParticion();
int crearFAT(infoPart particion, char nomDisco[]);
int crearENLAZADO(infoPart particion, char nomDisco[]);
int crearEXT3(infoPart particion, char nomDisco[]);
mbr recuperarMBR(char nom[]);
infoPart buscarInfoPart(mbr datosDisco,char nomPart[]);
void FormatearParticion();
void ActualizarMBR(char nomDisco[],mbr actual,infoPart act);
inodo nuevoInodo();
bloquEXT nuevobloqEXT3();
log nuevaBitacora();
/*while(i<cantidad && limite<particion.cantBloques){
byte temp;
fread(&temp,sizeof(byte),1,discoActual);
if(temp.a=='0'){
if(i==cantidad-1){
i=cantidad;
}else{
i++;
}
}else{
i=0;
}
limite++;
}
if(i==cantidad){
inicio=limite-cantidad;
}*/
#ifdef __cplusplus
}
#endif
#endif /* PLANTILLA2_201114717_H */