diff options
author | Christian Segundo | 2023-06-17 11:17:31 +0200 |
---|---|---|
committer | Christian Segundo | 2023-06-17 11:17:31 +0200 |
commit | b02b7f71978a172848322f0671d580e425634916 (patch) | |
tree | 057fba90b084b82a200ca76b424a9dd9fa204d2f /src/main.zig | |
parent | c7412022c3c607c809f774db2459f9259ba95038 (diff) | |
download | zmission-b02b7f71978a172848322f0671d580e425634916.tar.gz |
one step closer
Diffstat (limited to 'src/main.zig')
-rw-r--r-- | src/main.zig | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/main.zig b/src/main.zig index b01188b..a88bf8a 100644 --- a/src/main.zig +++ b/src/main.zig @@ -14,24 +14,13 @@ export fn add(a: i32, b: i32) i32 { var client = transmission.Client.init(allocator, clientOptions); defer client.deinit(); - //{ - //const body = transmission.session_get_raw(&client, null) catch |err| { - //std.debug.print("error: {any}\n", .{err}); - //unreachable; - //}; - //defer allocator.free(body); - //std.debug.print("body: {s}\n", .{body}); - //} - { - const body = transmission.torrent_get_(&client, null) catch |err| { + const body = transmission.session_get_raw(&client, null) catch |err| { std.debug.print("error: {any}\n", .{err}); unreachable; }; - //defer allocator.free(body); - for (body.arguments.torrent_get.torrents.?) |t| { - std.debug.print("name: {any}\n", .{t}); - } + defer allocator.free(body); + std.debug.print("body: {s}\n", .{body}); } //{ @@ -40,6 +29,17 @@ export fn add(a: i32, b: i32) i32 { //unreachable; //}; ////defer allocator.free(body); + //for (body.arguments.torrent_get.torrents.?) |t| { + //std.debug.print("name: {any}\n", .{t}); + //} + //} + + //{ + //const body = transmission.torrent_get_(&client, null) catch |err| { + //std.debug.print("error: {any}\n", .{err}); + //unreachable; + //}; + ////defer allocator.free(body); //std.debug.print("body: {any}\n", .{body}); //} |