Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .cirrus.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
freebsd_instance:
image_family: freebsd-14-2
image_family: freebsd-14-3
cpu: 1
memory: 1G

Expand Down
15 changes: 10 additions & 5 deletions src/mtd-cli-icgi.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
* mtd-cli-icgi.c - Make Tax Digital - Individuals Capital Gains Income
*
* Copyright (C) 2025 Andrew Clayton <ac@sigsegv.uk>
* Copyright (C) 2025 - 2026 Andrew Clayton <ac@sigsegv.uk>
*/

#include <stdbool.h>
Expand All @@ -17,17 +17,17 @@
#define API_NAME "Individuals Capital Gains Income"
#define CMDS \
"Residential Property Disposals\n\n"\
"rpd-get non-ppd-amend non-ppd-delete ppd-amend ppd-delete\n\n"\
"non-ppd-get non-ppd-amend non-ppd-delete ppd-get ppd-amend ppd-delete\n\n"\
"Other Capital Gains and Disposals\n\n"\
"o-get o-amend o-delete"

static const struct endpoint endpoints[] = {
/* Residential Property Disposals */
{
.name = "rpd-get",
.api_ep = MTD_API_EP_ICGI_RPD_GET,
.name = "non-ppd-get",
.api_ep = MTD_API_EP_ICGI_RPD_N_PPD_GET,
.nr_req_args = 1,
.args = "taxYear [source={user,hmrc-held,latest}]"
.args = "taxYear"
}, {
.name = "non-ppd-amend",
.api_ep = MTD_API_EP_ICGI_RPD_N_PPD_AMEND,
Expand All @@ -39,6 +39,11 @@ static const struct endpoint endpoints[] = {
.api_ep = MTD_API_EP_ICGI_RPD_N_PPD_DELETE,
.nr_req_args = 1,
.args = "taxYear"
}, {
.name = "ppd-get",
.api_ep = MTD_API_EP_ICGI_RPD_PPD_GET,
.nr_req_args = 1,
.args = "taxYear [source={user,hmrc-held,latest}]"
}, {
.name = "ppd-amend",
.api_ep = MTD_API_EP_ICGI_RPD_PPD_AMEND,
Expand Down
15 changes: 12 additions & 3 deletions src/mtd-cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -387,17 +387,23 @@ static const char *conf_dir(char *path)

static const FILE *set_log_fp(const char *log_level)
{
FILE *fp;
char *ll;
char *ptr;
char *ptrm;
const char *mode = "we";

if (!log_level || !strchr(log_level, ':'))
return NULL;

ptr = strchr(log_level, ':');
ll = strdup(log_level);
if (!ll)
return NULL;

ptr = strchr(ll, ':');
ptr++;

ptrm = strchr(log_level, '+');
ptrm = strchr(ll, '+');
if (!ptrm)
goto out;

Expand All @@ -407,7 +413,10 @@ static const FILE *set_log_fp(const char *log_level)
mode = "ae";

out:
return fopen(ptr, mode);
fp = fopen(ptr, mode);
free(ll);

return fp;
}
Comment thread
ac000 marked this conversation as resolved.

int main(int argc, char *argv[])
Expand Down
Loading