summaryrefslogtreecommitdiff
path: root/include/linux/parser.h
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2003-10-01 10:58:08 -0700
committerLinus Torvalds <torvalds@home.osdl.org>2003-10-01 10:58:08 -0700
commit5221f633a04ed0edf7edc10c07d0e5934abc038c (patch)
tree3d1f11531410e3617070610ed5b78e0b3c44604d /include/linux/parser.h
parentb2dd867477c080de713e366809b71fd500a6b300 (diff)
[PATCH] table-driven filesystems option parsing
From: "Randy.Dunlap" <rddunlap@osdl.org>, Will Dyson <will_dyson@pobox.com>, me Add generic filesystem options parser (infrastructure) and use it to parse mount options in several filesystems (adfs, affs, autofs, autofs4, ext2, ext3, fat, hfs, hpfs, isofs, jfs, procfs, udf, and ufs). It saves between 128 and 512 bytes per filesystem.
Diffstat (limited to 'include/linux/parser.h')
-rw-r--r--include/linux/parser.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/include/linux/parser.h b/include/linux/parser.h
new file mode 100644
index 000000000000..5f982a1a2600
--- /dev/null
+++ b/include/linux/parser.h
@@ -0,0 +1,21 @@
+struct match_token {
+ int token;
+ char *pattern;
+};
+
+typedef struct match_token match_table_t[];
+
+enum {MAX_OPT_ARGS = 3};
+
+typedef struct {
+ char *from;
+ char *to;
+} substring_t;
+
+int match_token(char *s, match_table_t table, substring_t args[]);
+
+int match_int(substring_t *, int *result);
+int match_octal(substring_t *, int *result);
+int match_hex(substring_t *, int *result);
+void match_strcpy(char *, substring_t *);
+char *match_strdup(substring_t *);