Browse Source

+ added some code skeleton

master
Alex 'AdUser' Z 13 years ago
parent
commit
af2014d6ad
  1. 43
      src/torrent2json.c

43
src/torrent2json.c

@ -0,0 +1,43 @@
#include <fcntl.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
int main(int argc, char **argv)
{
int chr;
int fd = dup(0);
while (true)
{
chr = read(fd, &chr, 1);
switch (chr)
{
case 'd' : /* dictionary */
/* print_dict(fd);*/
break;
case 'i' : /* integer */
break;
case 'l' : /* list */
break;
case '1' :
case '2' :
case '3' :
case '4' :
case '5' :
case '6' :
case '7' :
case '8' :
case '9' : /* string */
break;
default:
fprintf(stderr, "Unknown marker: %u\n", chr);
break;
}
break;
}
exit(0);
}
Loading…
Cancel
Save