cmogstored.git  about / heads / tags
alternative mogstored implementation for MogileFS
blob bf57b9ff22be3fb2e985ac3b2d9a8163eb41c932 458 bytes (raw)
$ git show gl-env: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) 2012-2016 all contributors <cmogstored-public@bogomips.org>
 * 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