shithub: fsgen

ref: 447faea42c09161a13f57523a3726dfee294d0e8
dir: /preamble.inc/

View raw version
#include <u.h>
#include <libc.h>
#include <thread.h>
#include <fcall.h>
#include <9p.h>

typedef struct Fchildren Fchildren;
struct Fchildren {
	int *children;
};

typedef struct Filedata Filedata;
struct Filedata {
	void *read;
	void *write;
	void *stat;
	
	Dir dir;
};

int SHIFT = 3;
int qidtype = -1;

static uvlong
makeqid(uvlong id)
{
	return (id << SHIFT) | qidtype;
}

static uvlong
getqidid(uvlong qid)
{
	return (qid >> SHIFT);
}

static uvlong
breakqid(uvlong qid)
{
	return (qid & (0x1<<(SHIFT+1) - 1));
}