projects
/
cascardo
/
declara.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Funções para lista de pagamentos ordenados.
[cascardo/declara.git]
/
lib
/
declaracao.c
diff --git
a/lib/declaracao.c
b/lib/declaracao.c
index
53ff1e4
..
7eef34c
100644
(file)
--- a/
lib/declaracao.c
+++ b/
lib/declaracao.c
@@
-20,8
+20,13
@@
#include <stdlib.h>
#include <string.h>
#include "list.h"
#include <stdlib.h>
#include <string.h>
#include "list.h"
+#include "conjuge.h"
+#include "sistema.h"
#include "rendimento.h"
#include "rendimento.h"
+#include "isento.h"
#include "pagamento.h"
#include "pagamento.h"
+#include "bem.h"
+#include "dependente.h"
#include "pmhash.h"
struct declaracao * declaracao_new(int ano)
#include "pmhash.h"
struct declaracao * declaracao_new(int ano)
@@
-35,9
+40,18
@@
struct declaracao * declaracao_new(int ano)
dec->rendimento = list_new();
if (!dec->rendimento)
goto out_rendimento;
dec->rendimento = list_new();
if (!dec->rendimento)
goto out_rendimento;
+ dec->isentos = list_new();
+ if (!dec->isentos)
+ goto out_isentos;
dec->pagamentos = list_new();
if (!dec->pagamentos)
goto out_pagamentos;
dec->pagamentos = list_new();
if (!dec->pagamentos)
goto out_pagamentos;
+ dec->bens = list_new();
+ if (!dec->bens)
+ goto out_bens;
+ dec->dependentes = list_new();
+ if (!dec->dependentes)
+ goto out_dependentes;
dec->totais = pmhash_new();
if (!dec->totais)
goto out_totais;
dec->totais = pmhash_new();
if (!dec->totais)
goto out_totais;
@@
-47,8
+61,14
@@
struct declaracao * declaracao_new(int ano)
dec->tipo = SIMPLES;
return dec;
out_totais:
dec->tipo = SIMPLES;
return dec;
out_totais:
+ list_free(dec->dependentes, dependente_free);
+out_dependentes:
+ list_free(dec->bens, bem_free);
+out_bens:
list_free(dec->pagamentos, pagamento_free);
out_pagamentos:
list_free(dec->pagamentos, pagamento_free);
out_pagamentos:
+ list_free(dec->isentos, isento_free);
+out_isentos:
list_free(dec->rendimento, rendimento_free);
out_rendimento:
free(dec);
list_free(dec->rendimento, rendimento_free);
out_rendimento:
free(dec);
@@
-74,7
+94,12
@@
void declaracao_free(struct declaracao *dec)
if (dec->dvconta)
free(dec->dvconta);
list_free(dec->rendimento, rendimento_free);
if (dec->dvconta)
free(dec->dvconta);
list_free(dec->rendimento, rendimento_free);
+ list_free(dec->isentos, isento_free);
list_free(dec->pagamentos, pagamento_free);
list_free(dec->pagamentos, pagamento_free);
+ list_free(dec->bens, bem_free);
+ list_free(dec->dependentes, dependente_free);
pmhash_del(dec->totais);
pmhash_del(dec->totais);
+ conjuge_free(dec);
+ sistema_free(dec);
free(dec);
}
free(dec);
}