-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathestrutura.h
More file actions
42 lines (34 loc) · 969 Bytes
/
Copy pathestrutura.h
File metadata and controls
42 lines (34 loc) · 969 Bytes
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
#ifndef ESTRUTURA_H
#define ESTRUTURA_H
#include "requisicao.h"
typedef struct estrutura Estrutura;
/**
* Creates a new empty queue structure
* @return Pointer to new queue or NULL if allocation failed
*/
Estrutura* create();
/**
* Inserts a request at the end of the queue
* @param e The queue structure
* @param r The request to insert
* @return 1 on success, 0 on failure
*/
int inserir(Estrutura* e, Requisicao* r);
/**
* Removes and returns the first request from the queue
* @param e The queue structure
* @return Pointer to removed request or NULL if queue is empty
*/
Requisicao* remover(Estrutura* e);
/**
* Returns the current number of requests in the queue
* @param e The queue structure
* @return Number of requests in queue or -1 if e is NULL
*/
int get_size(Estrutura* e);
/**
* Frees all memory used by the queue structure and its elements
* @param e The queue structure to destroy
*/
void destroy_queue(Estrutura* e);
#endif