Rendimentos isentos e de tributação exclusiva.
[cascardo/declara.git] / lib / declaracao.c
index 4c5f188..9d36937 100644 (file)
@@ -21,6 +21,7 @@
 #include <string.h>
 #include "list.h"
 #include "rendimento.h"
+#include "isento.h"
 #include "pagamento.h"
 #include "bem.h"
 #include "pmhash.h"
@@ -36,6 +37,9 @@ struct declaracao * declaracao_new(int ano)
        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;
@@ -55,6 +59,8 @@ out_totais:
 out_bens:
        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);
@@ -80,6 +86,7 @@ void declaracao_free(struct declaracao *dec)
        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->bens, bem_free);
        pmhash_del(dec->totais);