-// really simple JSON helpers
-#define JSON_START() printf("{\n")
-#define JSON_NUM(NAME) printf("\"" #NAME "\": %d", NAME)
-#define JSON_NEXT() printf(",\n")
-#define JSON_STR(NAME) printf("\"" #NAME "\": \"%s\"", NAME)
-#define JSON_END() printf("\n}\n")
+// connect to the reader, add self to loop and make it write to fd
+// return 0 on success, negative number otherwise
+int mt_rfid_init(mt_rfid_t *self, struct ev_loop *loop, int fd);
+
+// disconnect from reader
+void mt_rfid_deinit(mt_rfid_t *self);
+
+#else
+
+#define mt_rfid_init(self, loop, fd) 0
+#define mt_rfid_deinit(self) 0