Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\parser.c Create Date:2022-07-28 06:19:19
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:match_one: - Determines if a string matches a simple pattern*@s: the string to examine for presence of the pattern*@p: the string containing the pattern*@args: array of %MAX_OPT_ARGS &substring_t elements. Used to return match* locations.

Proto:static int match_one(char *s, const char *p, substring_t args[])

Type:int

Parameter:

TypeParameterName
char *s
const char *p
substring_targs
27  argc = 0
29  If Not p Then Return 1
32  When 1 cycle
33  len = -1
34  meta = strchr(p, '%')
35  If Not meta Then Return strcmp(p, s) == 0
38  If strncmp(p, s, meta - p) Then Return 0
41  s += meta - p
42  p = meta + 1
44  If isdigit( * p) Then len = simple_strtoul - convert a string to an unsigned long*@cp: The start of the string*@endp: A pointer to the end of the parsed string will be placed here*@base: The number base to use* This function is obsolete. Please use kstrtoul instead.
46  Else if p == '%' Then
47  If s++ != '%' Then Return 0
49  p++
50  Continue
53  If argc >= MAX_OPT_ARGS Then Return 0
56  from = s
58  Case ++ == 's'
59  str_len = strlen(s)
61  If str_len == 0 Then Return 0
63  If len == -1 || len > str_len Then len = str_len
65  to = s + len
66  Break
68  Case ++ == 'd'
69  simple_strtol - convert a string to a signed long*@cp: The start of the string*@endp: A pointer to the end of the parsed string will be placed here*@base: The number base to use* This function is obsolete. Please use kstrtol instead.
70  Go to num
71  Case ++ == 'u'
72  simple_strtoul - convert a string to an unsigned long*@cp: The start of the string*@endp: A pointer to the end of the parsed string will be placed here*@base: The number base to use* This function is obsolete. Please use kstrtoul instead.
73  Go to num
74  Case ++ == 'o'
75  simple_strtoul - convert a string to an unsigned long*@cp: The start of the string*@endp: A pointer to the end of the parsed string will be placed here*@base: The number base to use* This function is obsolete. Please use kstrtoul instead.
76  Go to num
77  Case ++ == 'x'
78  simple_strtoul - convert a string to an unsigned long*@cp: The start of the string*@endp: A pointer to the end of the parsed string will be placed here*@base: The number base to use* This function is obsolete. Please use kstrtoul instead.
79  num :
80  If to == from Then Return 0
82  Break
83  Default
84  Return 0
86  s = to
87  argc++
Caller
NameDescribe
match_tokenmatch_token: - Find a token (and optional args) in a string*@s: the string to examine for token/argument pairs*@table: match_table_t describing the set of allowed option tokens and the* arguments that may be associated with them. Must be terminated with a