-
Notifications
You must be signed in to change notification settings - Fork 0
/
employee.h
83 lines (65 loc) · 1.89 KB
/
employee.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
74
75
76
77
78
79
80
81
82
83
#ifndef Employee
#define Employee
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
struct tEEmployee {
char *nombre;
char *apellidos;
char *puesto;
char *anho;
int idEmpleado;
};
typedef struct tEEmployee *tEmployee;
struct tSNodeEmployee {
tEmployee tEmployee;
struct tSNodeEmployee *sig;
};
typedef struct tSNodeEmployee *tNodeEmployee;
struct tEEmployeeList {
tNodeEmployee head;
tNodeEmployee tail;
};
typedef struct tEEmployeeList *tEmployeeList;
/*
* Crea un estado a partir de su nombre y si es estado final. Si esto no se indica se considerara que no es final.
*/
tEmployee createEmployee (char *nombre,char *apellidos,char *puesto, char *anho, int idEmpleado);
/*
* Crea una lista de estados y la inicializa a lista vacia.
* Devuelve NULL si hubo algun error
*/
tEmployeeList createEmployeeList ();
/*
* Devuelve true (!= 0) si la lista esta vacia. Flase (== 0) en caso contrario.
* La lista es valida
*/
int isEmptyEmployeeList (tEmployeeList EmployeeList);
/*
* Elimina la estructura (no los datos) de la lista dejandola en NULL
* PreCD: la lista es valida
*/
void deleteEmployeeList (tEmployeeList *EmployeeList);
/*
* Elimina todos los datos de la lista dejandola en NULL
* PreCD: la lista es valida
*/
int addEmployeeToList (tEmployeeList EmployeeList, tEmployee Employee);
/*
* Elimina de la lista el estado de la posicion index de la lista. La lista empieza en 0.
* No borra el estado.
* PreCD: la lista es valida y el indice apunta a un elemento
*/
void removeFromEmployeeListIndex (tEmployeeList EmployeeList, int index);
/*
* Devuelve la longitud total de la lista
* PreCD: la lista es valida
*/
int lengthEmployeeList (tEmployeeList EmployeeList);
/*
* Devuelve el estado de la posicion index de la lista. La lista empieza en 0.
* NULL en caso de no existir
* PreCD: la lista es valida
*/
tEmployee getEmployeeFromListByIndex (tEmployeeList EmployeeList, int index);
#endif