cmogstored.git  about / heads / tags
alternative mogstored implementation for MogileFS
blob e403607eae5dce473c4c0bcfe40d02ae5e83af23 438 bytes (raw)
$ git show st-wip-broken:path_parser.rl	# shows this blob on the CLI

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
 
/*
 * Copyright (C) 2013, Eric Wong <normalperson@yhbt.net>
 * License: GPLv3 or later (see COPYING for details)
 */

/*
 * caller needs to setup: uint32_t *mog_devid = ...
 */
%%{
	machine path_parser;

	devid = "dev"
		(digit+) $ {
			/* no overflow checking here, we do it in mog_dev_new */
			*mog_devid *= 10;
			*mog_devid += fc - '0';
		}
		'/';
	# only stuff MogileFS will use
	mog_path = '/' (devid)? [a-zA-Z0-9/\.\-]{0,36};
}%%

git clone https://yhbt.net/cmogstored.git