Skip to content

Instantly share code, notes, and snippets.

View shivanshu3's full-sized avatar

Shivanshu Goyal shivanshu3

View GitHub Profile
@camilleoudot
camilleoudot / be2json.c
Last active May 11, 2023 16:22
Bencode to JSON converter
/* converts Bencoded data on stdin to JSON on stdout */
#include <stdio.h>
#include <ctype.h>
#include <stdlib.h>
int pos = 0;
int c;
char stack[1024], *sp = stack;
//cc -Wextra -o build/dump-header-map dump-header-map.c
// see: https://github.com/llvm-mirror/clang/blob/release_40/include/clang/Lex/HeaderMapTypes.h
// https://github.com/llvm-mirror/clang/blob/release_40/include/clang/Lex/HeaderMap.h// https://github.com/llvm-mirror/clang/blob/release_40/lib/Lex/HeaderMap.cpp
// This is basically dump() from there.
#include <stdio.h>
#include <stdlib.h>
#include <sysexits.h>
#include <err.h>