#include <stdio.h>
#include <sys/time.h>
Include dependency graph for util.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.
Defines | |
| #define | TRUE 1 |
| Verdadeiro. | |
| #define | FALSE 0 |
| Falso. | |
| #define | E 2.718281828459045 |
| Numero de Euler. | |
| #define | PI 3.141592653589793 |
| Pi. | |
| #define | REALLOC_SIZE 10 |
| Não é utilizado. | |
| #define | OK 0 |
| #define | E_NONE 0 |
| #define | E_NOMEM (-1) |
| #define | E_FOPEN (-2) |
| #define | E_FREAD (-3) |
| #define | E_FWRITE (-4) |
| #define | E_OPTION (-5) |
| #define | E_OPTARG (-6) |
| #define | E_FRINEXIST (-7) |
| #define | E_UNKNOWN (-8) |
| #define | E_NOTFOUND (-9) |
| #define | E_PARSEFAIL (-10) |
| #define | ELAPSE(e, n, s) { e.tv_sec+=n.tv_sec-s.tv_sec; e.tv_usec+=n.tv_usec-s.tv_usec; if(e.tv_usec<0){ e.tv_sec--; e.tv_usec+=1000000; } if(e.tv_usec>1000000){ e.tv_sec+=e.tv_usec/1000000; e.tv_usec=e.tv_usec%1000000; }} |
| Retorna a diferença de tempo entre 2 structs timeval. | |
| #define | max(a, b) ((a) > (b) ? (a) : (b)) |
| Retorna o maior entre 2 valores. | |
| #define | min(a, b) ((a) < (b) ? (a) : (b)) |
| Retorna o menor entre 2 valores. | |
| #define | time2double(x) ( (double)(x).tv_sec+0.000001*(double)(x).tv_usec ) |
| Converte uma struct timeval (retornada por getrusage() e gettimeofday() ) em um double. | |
Functions | |
| void | error (int,...) |
| Imprime um erro. | |
| char * | read_line (FILE *) |
| Le uma linha. | |
| char * | elapsed_time (struct timeval, struct timeval) |
| Retorna um string com a diferença de tempo entre 2 structs timeval. | |
Definition in file util.h.
|
|
Numero de Euler.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 28 of file util.h. Referenced by elapsed_time(), and read_line(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 35 of file util.h. Referenced by error(). |
|
|
Retorna a diferença de tempo entre 2 structs timeval.
|
|
|
Falso.
Definition at line 15 of file util.h. Referenced by str_remove_tags(). |
|
|
Retorna o maior entre 2 valores.
|
|
|
Retorna o menor entre 2 valores.
|
|
|
|
|
|
Pi.
|
|
|
Não é utilizado.
|
|
|
Converte uma struct timeval (retornada por getrusage() e gettimeofday() ) em um double.
|
|
|
Verdadeiro.
Definition at line 13 of file util.h. Referenced by str_remove_tags(). |
|
||||||||||||
|
Retorna um string com a diferença de tempo entre 2 structs timeval.
|
|
||||||||||||
|
Imprime um erro. Aponta para argv[0] e é usado na função error() de util.c Definition at line 37 of file util.c. References E_UNKNOWN. |
|
|
Le uma linha. Possui 2 implementações: STR_HASH_CODE1: Implementação original: utiliza getc(), gastando muito processamento. STR_HASH_CODE2: Utiliza fgets, gastando muito (~10x) menos processamento. Definition at line 68 of file util.c. References actual_line_size, E_NOMEM, and error. |
1.4.6