Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Parse a string to get a param value pair.* You can use " around spaces, but can't escape ".* Hyphens and underscores equivalent in parameter names.

Proto:char *next_arg(char *args, char **param, char **val)

Type:char

Parameter:

TypeParameterName
char *args
char **param
char **val
203  equals = 0
204  in_quote = 0 , quoted = 0
207  If args == '"' Then
208  args++
209  in_quote = 1
210  quoted = 1
213  When args[i] cycle
214  If Note: isspace() must return false for %NUL-terminator (args[i]) && Not in_quote Then Break
216  If equals == 0 Then
217  If args[i] == '=' Then equals = i
220  If args[i] == '"' Then in_quote = Not in_quote
224  param = args
225  If Not equals Then * val = NULL
227  Else
228  args[equals] = '\0'
229  val = args + equals + 1
232  If val == '"' Then
233  val++
234  If args[i - 1] == '"' Then args[i - 1] = '\0'
238  If quoted && args[i - 1] == '"' Then args[i - 1] = '\0'
241  If args[i] Then
242  args[i] = '\0'
243  next = args + i + 1
244  Else next = args + i
248  Return skip_spaces - Removes leading whitespace from @str.*@str: The string to be stripped.* Returns a pointer to the first non-whitespace character in @str.