Blame view

include/linux/parser.h 923 Bytes
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
1
2
3
4
5
6
7
8
9
10
11
12
13
  /*
   * linux/include/linux/parser.h
   *
   * Header for lib/parser.c
   * Intended use of these functions is parsing filesystem argument lists,
   * but could potentially be used anywhere else that simple option=arg
   * parsing is required.
   */
  
  
  /* associates an integer enumerator with a pattern string. */
  struct match_token {
  	int token;
ef4533f8a   David Howells   [AFS]: Make the m...
14
  	const char *pattern;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
15
  };
1a3f7d98e   Linus Torvalds   Revert "UFS: add ...
16
  typedef struct match_token match_table_t[];
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
17
18
19
20
21
22
23
24
25
  
  /* Maximum number of arguments that match_token will find in a pattern */
  enum {MAX_OPT_ARGS = 3};
  
  /* Describe the location within a string of a substring */
  typedef struct {
  	char *from;
  	char *to;
  } substring_t;
a447c0932   Steven Whitehouse   vfs: Use const fo...
26
  int match_token(char *, const match_table_t table, substring_t args[]);
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
27
28
29
  int match_int(substring_t *, int *result);
  int match_octal(substring_t *, int *result);
  int match_hex(substring_t *, int *result);
b32a09db4   Markus Armbruster   add match_strlcpy...
30
  size_t match_strlcpy(char *, const substring_t *, size_t);
ef4533f8a   David Howells   [AFS]: Make the m...
31
  char *match_strdup(const substring_t *);