Com os comandos salva e resumo, o comando dump é desnecessário.
SET_STRING(nome);
SET_STRING(recibo);
-static int run_dump(struct declaracao *dec, char **args, int argc)
-{
- printf("ano: %d\n", dec->ano);
- printf("cpf: %s\n", dec->cpf);
- printf("nome: %s\n", dec->nome);
- printf("recibo: %s\n", dec->recibo);
- rendimento_dump(dec);
- printf("pago: %lld.%02d\n", dec->pago / 100, dec->pago % 100);
- printf("devido: %lld.%02d\n", dec->devido / 100, dec->devido % 100);
- printf("restituicao: %lld.%02d\n", dec->restituicao / 100, dec->restituicao % 100);
- return 0;
-}
-
static int run_resumo(struct declaracao *dec, char **args, int argc)
{
printf("pago: %lld.%02d\n", dec->pago / 100, dec->pago % 100);
return 0;
}
-static struct cmd cmd_dump = {
- .name = "dump",
- .run = run_dump,
-};
-
static struct cmd cmd_salva = {
.name = "salva",
.run = run_salva,
int base_cmd_init(void)
{
- cmd_add(&cmd_dump);
cmd_add(&cmd_salva);
cmd_add(&cmd_resumo);
cmd_add(&cmd_ano);
SALVA_INT(ocupacao_principal);
}
-void contribuinte_dump(struct declaracao *dec)
-{
-}
-
int contribuinte_cmd_init(void)
{
cmd_add(&cmd_uf);
int ocupacao_principal;
};
-void contribuinte_dump(struct declaracao *dec);
void contribuinte_salva(struct declaracao *dec, FILE *f);
int contribuinte_cmd_init(void);
j->decimoterceiro, j->imposto, j->saida);
}
-void rendimento_dump(struct declaracao *dec)
-{
- int i;
- struct rendimento *j;
- for (i = 0; j = list_get(dec->rendimento, i); i++)
- printf("rendimento: %s %s %013lld %013lld %013lld %013lld %s\n",
- j->cnpj, j->nome, j->rendimento, j->previdencia,
- j->decimoterceiro, j->imposto, j->saida);
-}
-
static struct cmd cmd_rendimento = {
.name = "rendimento",
.run = run_rendimento,
char *saida;
};
-void rendimento_dump(struct declaracao *dec);
void rendimento_salva(struct declaracao *dec, FILE *f);
void rendimento_free(void *pointer);