-
Notifications
You must be signed in to change notification settings - Fork 1
/
tuple.h
31 lines (26 loc) · 843 Bytes
/
tuple.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
#ifndef _DATA_H
#define _DATA_H
/* Estrutura que define um tuplo.
*/
struct tuple_t {
int tuple_dimension; /* Número de elementos no tuplo */
char **tuple; /* Conteúdo arbitrário */
};
/* Função que cria um novo tuplo (isto é, que inicializa
* a estrutura e aloca a memória necessária).
*/
struct tuple_t *tuple_create(int tuple_dim);
/*
* Função idêntica à anterior, mas com uma assinatura diferente.
*/
struct tuple_t *tuple_create2(int tuple_dim, char **tuple);
/*
* Função que destrói um bloco de dados e liberta toda a memoria.
*/
void tuple_destroy(struct tuple_t *tuple);
/* Função que duplica um tuplo. Quando se criam duplicados
* é necessário efetuar uma CÓPIA dos dados (e não somente alocar a
* memória necessária).
*/
struct tuple_t *tuple_dup(struct tuple_t *tuple);
#endif