-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpilaPrestamosInactivos.h
61 lines (38 loc) · 1.53 KB
/
pilaPrestamosInactivos.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
#ifndef PILAPRESTAMOSINACTIVOS_H_INCLUDED
#define PILAPRESTAMOSINACTIVOS_H_INCLUDED
#define MAX_DIM 26
///Estructura prestamos
typedef struct{
int diaTiempo;
int mesTiempo;
int anioTiempo;
} stFecha;
typedef struct{
int idPrestamo; //id propio
int idLibro; //id del libro prestado
int estado; // 0 inactivo y 1 activo
char generoEstanteria[MAX_DIM]; //el genero de la estanteria
char nombreLibro[50];// El nombre del libro
char dniUsuarioPrestado[MAX_DIM]; //dni del miembro al que le prestamos el libro
char precioPrestamo[MAX_DIM];
stFecha inicioPrestamo;
stFecha vencimientoPrestamo;
} stPrestamo;
typedef struct
{
stPrestamo datoPrestamo;
struct nodoDoble*anterior;
struct nodoDoble*siguiente;
} nodoDoble;
///estructura de pila
typedef struct
{
nodoDoble * prestamoInactivo;//lista doble
} pilaPrestamos;
///funciones de pilas
void inicPila(pilaPrestamos * pila);//inicializa la lista que tiene la pila en null
void archivoAPila(pilaPrestamos * pila);//no pasarle un dato ya que lo agarramos desde el archivo
void mostrarPila(pilaPrestamos pila);//muestra los prestamos inactivos
void apilar(pilaPrestamos * pila,stPrestamo aux);//los prestamos que sean de estado 0 que se encuentren en la fila, los pasamos directamente a la pila.
void cargarPilaAlArchivo(pilaPrestamos * pila);//De la pila lo pasamos a un archivo que sea de prestamos inactivos para tener un registro
#endif // PILAPRESTAMOSINACTIVOS_H_INCLUDED