Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
parser.c File Reference
#include <linux/ctype.h>
#include <linux/types.h>
#include <linux/export.h>
#include <linux/parser.h>
#include <linux/slab.h>
#include <linux/string.h>

Go to the source code of this file.

Functions

int match_token (char *s, const match_table_t table, substring_t args[])
 
int match_int (substring_t *s, int *result)
 
int match_octal (substring_t *s, int *result)
 
int match_hex (substring_t *s, int *result)
 
size_t match_strlcpy (char *dest, const substring_t *src, size_t size)
 
charmatch_strdup (const substring_t *s)
 
 EXPORT_SYMBOL (match_token)
 
 EXPORT_SYMBOL (match_int)
 
 EXPORT_SYMBOL (match_octal)
 
 EXPORT_SYMBOL (match_hex)
 
 EXPORT_SYMBOL (match_strlcpy)
 
 EXPORT_SYMBOL (match_strdup)
 

Function Documentation

EXPORT_SYMBOL ( match_token  )
EXPORT_SYMBOL ( match_int  )
EXPORT_SYMBOL ( match_octal  )
EXPORT_SYMBOL ( match_hex  )
EXPORT_SYMBOL ( match_strlcpy  )
EXPORT_SYMBOL ( match_strdup  )
int match_hex ( substring_t s,
int result 
)

match_hex: - scan a hex representation of an integer from a substring_t : substring_t to be scanned

Returns
: resulting integer on success

Description: Attempts to parse the &substring_t as a hexadecimal integer. On success, sets

Returns
to the integer represented by the string and returns 0. Returns either -ENOMEM or -EINVAL on failure.

Definition at line 190 of file parser.c.

int match_int ( substring_t s,
int result 
)

match_int: - scan a decimal representation of an integer from a substring_t : substring_t to be scanned

Returns
: resulting integer on success

Description: Attempts to parse the &substring_t as a decimal integer. On success, sets

Returns
to the integer represented by the string and returns 0. Returns either -ENOMEM or -EINVAL on failure.

Definition at line 162 of file parser.c.

int match_octal ( substring_t s,
int result 
)

match_octal: - scan an octal representation of an integer from a substring_t : substring_t to be scanned

Returns
: resulting integer on success

Description: Attempts to parse the &substring_t as an octal integer. On success, sets

Returns
to the integer represented by the string and returns 0. Returns either -ENOMEM or -EINVAL on failure.

Definition at line 176 of file parser.c.

char* match_strdup ( const substring_t s)

match_strdup: - allocate a new string with the contents of a substring_t : &substring_t to copy

Description: Allocates and returns a string filled with the contents of the &substring_t . The caller is responsible for freeing the returned string with kfree().

Definition at line 225 of file parser.c.

size_t match_strlcpy ( char dest,
const substring_t src,
size_t  size 
)

match_strlcpy: - Copy the characters from a substring_t to a sized buffer : where to copy to : &substring_t to copy : size of destination buffer

Description: Copy the characters in &substring_t to the c-style string . Copy no more than - 1 characters, plus the terminating NUL. Return length of .

Definition at line 205 of file parser.c.

int match_token ( char s,
const match_table_t  table,
substring_t  args[] 
)

match_token: - Find a token (and optional args) in a string : the string to examine for token/argument pairs : match_table_t describing the set of allowed option tokens and the arguments that may be associated with them. Must be terminated with a &struct match_token whose pattern is set to the NULL pointer. : array of MAX_OPT_ARGS &substring_t elements. Used to return match locations.

Description: Detects which if any of a set of token strings has been passed to it. Tokens can include up to MAX_OPT_ARGS instances of basic c-style format identifiers which will be taken into account when matching the tokens, and whose locations will be returned in the array.

Definition at line 107 of file parser.c.