summaryrefslogtreecommitdiffstats
path: root/src/defs.inc
blob: b0a38bfe2d0a2a7fd452c447521e262ad0574903 (plain)
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
84
85
86
87
88
89
90
91
#ifndef CEPIS_DEFS_INC
#define CEPIS_DEFS_INC

#define CEPIS_OK                    0
#define CEPIS_ERR_INVALID_CEP       1
#define CEPIS_ERR_NOT_FOUND         2
#define CEPIS_ERR_RATE_LIMITED      3
#define CEPIS_ERR_SERVER            4
#define CEPIS_ERR_NETWORK           5
#define CEPIS_ERR_INVALID_RESPONSE  6
#define CEPIS_ERR_NOMEM             7
#define CEPIS_ERR_USAGE             8

#define GEO_LAT         0
#define GEO_LON         8
#define GEO_RAIO_M      16
#define GEO_PRECISAO    24
#define GEO_SIZE        32

#define A_CEP           0
#define A_LOGRADOURO    8
#define A_COMPLEMENTO   16
#define A_UNIDADE       24
#define A_BAIRRO        32
#define A_LOCALIDADE    40
#define A_UF            48
#define A_ESTADO        56
#define A_REGIAO        64
#define A_IBGE          72
#define A_GIA           80
#define A_DDD           88
#define A_SIAFI         96
#define A_GEO           104
#define A_RAW           112
#define A_SIZE          120
#define A_NFIELDS       13

#define H_STATUS        0
#define H_DNE           8
#define H_CEPS          16
#define H_GEO           24
#define H_BASE_GERADA   32
#define H_RAW           40
#define H_SIZE          48

#define F_PRESENT       0
#define F_LOCALIDADE    4
#define F_LOCALIDADE_MAX 72
#define F_UF            76
#define F_UF_MAX        3
#define F_CEP_INI       79
#define F_CEP_FIM       88
#define F_CEP_MAX       9
#define F_CEPS          104
#define F_SIZE          112

#define E_STATUS        0
#define E_HTTP_STATUS   4
#define E_RETRY_AFTER   8
#define E_MESSAGE       16
#define E_MSGLEN        256
#define E_FAIXA         272
#define E_SIZE          384

#define C_BASE_URL      0
#define C_TIMEOUT       8
#define C_MAX_ATTEMPTS  16
#define C_BACKOFF_BASE  24
#define C_BACKOFF_MAX   32
#define C_TOTAL_TIMEOUT 40
#define C_USER_AGENT    48
#define C_SIZE          56

#define CL_BASE_URL     0
#define CL_USER_AGENT   8
#define CL_TIMEOUT      16
#define CL_BACKOFF_BASE 24
#define CL_BACKOFF_MAX  32
#define CL_TOTAL_TIMEOUT 40
#define CL_MAX_ATTEMPTS 48
#define CL_RNG          56
#define CL_SIZE         64

#define B_DATA          0
#define B_LEN           8
#define B_CAP           16
#define B_SIZE          24

#define CEPIS_MAX_BATCH 500

#endif