Plan 9 from Bell Labs’s /usr/web/sources/contrib/nemo/sys/src/cmd/repl/repl.h

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


typedef struct Db	Db;
typedef struct Dbent	Dbent;
typedef struct Meta	Meta;


enum {
	Uidlen	= 10,
	Uidslen	= 2 * Uidlen,
	Incr	= 16,

};

enum {
	// cmpfile and syncfile values
	Eq = 0,
	Metachg,
	Datachg,
};


struct Meta {
	char*	uid;
	char*	gid;
	ulong	mode;
	ulong	mtime;
	vlong	length;
	ulong	vers;	// of qid
};

struct Dbent {
	Avl	a;
	Dbent*	next;		// to link while outside the avl
	char*	fname;		// stored in disk
	char*	hist;		// stored in disk
	int	hlen;
	int	visited;
	int	pruned;
	Meta;			// stored in disk
};

struct Db {
	Avltree*tree;
	char	id;
	char*	dir;
	Dbent*	new;		// waiting for insert into tee.
	ulong	mtime;		// for last scan
	int	changed;
};

Db*	newdb(char id);
Db*	readdb(Biobufhdr* bp);
void	writedb(Biobufhdr* bp, Db* db);
void	insertdb(Db* db, Dbent* dp);
Db*	readdbfile(char* file);
void	writedbfile(char* file, Db* db);
void	rename(char* to, char*frompath);


Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.