Plan 9 from Bell Labs’s /usr/web/sources/contrib/lejatorn/btfs/torrentfile.h

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.




typedef struct Bestring Bestring;
static struct Bestring {
	long length;
	Rune *value;
};

/*
typedef struct belistel belistel;
struct belistel {
	uint type;
	bestring *astring;
	beint *anint;
	bedictel *adict;
	belistel *alist;
	belistel *next;	
};

typedef struct bedictel bedictel;
struct bedictel {
	uint valtype;
	bestring *key;
	bestring *astring;
	beint *anint;
	belistel *alist;
	bedictel *adict;
	bedictel *next;	
};
*/

static enum Btfilekeys {
	BTannounceurl,
	BTannouncelist,
	BTinfo,
	BTcreationdate,
	BTcomment,
	BTcreatedby,
	BTencoding,
	BTpieces,
	BTpiecelength,
	BTprivate,
	BTname, BTutf8name,
	BTlength,
	BTmd5sum,
	BTfiles,
	BTpath, BTutf8path,
	BTcodepage,
	BTpublisher, BTutf8publisher, BTpublisherurl, BTutf8publisherurl,
	BTnodes,
	BTunknown,
};

static Bestring * getbestr(long toread, Biobuf *bin);
static uvlong readbignumber(Biobuf *bin, Rune stop);
static long readnumber(Biobuf *bin, Rune stop);
static int getkey(Biobuf *bin);
uchar *getinfohash(char *file, int toread);
static int getelement(int keytype, Biobuf *bin, Torrent *tor);
void parsebtfile(char *file, Torrent *tor);


Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].