summaryrefslogtreecommitdiff
path: root/src/main.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.zig')
-rw-r--r--src/main.zig28
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});
//}