-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathqueries.h
More file actions
51 lines (43 loc) · 1.28 KB
/
queries.h
File metadata and controls
51 lines (43 loc) · 1.28 KB
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
#ifndef __QUERIES_H__
#define __QUERIES_H__
#include <string.h>
#include <strings.h>
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <math.h>
#define STR_BLOCK 5
typedef char * String;
// add corresponding error codes when time is correct
typedef enum
{
NO_ERROR = 0,
MEM_ERROR,
ARG_ERROR,
FILE_ERROR
} ERROR_CODE;
/*
titleType: si corresponde a una película, serie de televisión, etc
primaryTitle: Título original
startYear: si es una película, el año. Si es una serie, en qué año comenzó a emitirse
endYear: si es una serie de televisión, en qué año finalizó.
genres: Lista de géneros separados por coma
averageRating: un número entre 0 y 10, con un decimal
numVotes: cantidad de votos que obtuvo
runtimeMinutes: número entero, indica la duración en minutos.
*/
typedef struct
{
String titleType;
String primaryTitle;
size_t startYear;
size_t endYear; // 0 si no tiene año de finalizacion
String * genres; // Vector de Strings finalizado con NULL
float averageRating;
size_t numVotes;
size_t runtimeMinutes;
} Entry;
// if return value is NULL its because malloc and realloc failed
// dont pass NULL to from
String copyStr(const String from);
#endif