Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Split the buffer `buf' into space-separated words.* Handles simple " and ' quoting, i.e. without nested,* embedded or escaped \". Return the number of words* or <0 on error.

Proto:static int ddebug_tokenize(char *buf, char *words[], int maxwords)

Type:int

Parameter:

TypeParameterName
char *buf
char *words
intmaxwords
224  nwords = 0
226  When buf cycle
230  buf = skip_spaces - Removes leading whitespace from @str.*@str: The string to be stripped.* Returns a pointer to the first non-whitespace character in @str.
231  If Not buf Then Break
233  If buf == '#' Then Break
237  If buf == '"' || buf == '\'' Then
238  quote = buf++
239  When end && end != quote cycle If Not end Then
242  pr_err("unclosed quote: %s\n", buf)
243  Return -EINVAL
245  Else
246  When end && Not Note: isspace() must return false for %NUL-terminator ( * end) cycle BUG_ON(end == buf)
252  If nwords == maxwords Then
253  pr_err("too many words, legal max <=%d\n", maxwords)
254  Return -EINVAL
256  If end Then end++ = '\0'
258  words[nwords++] = buf
259  buf = end
262  If verbose Then
264  pr_info("split into words:")
265  When i < nwords cycle Like KERN_CONT, pr_cont() should only be used when continuing* a line with no newline ('\n') enclosed. Otherwise it defaults* back to KERN_DEFAULT.(" \"%s\"", words[i])
267  Like KERN_CONT, pr_cont() should only be used when continuing* a line with no newline ('\n') enclosed. Otherwise it defaults* back to KERN_DEFAULT.("\n")
270  Return nwords
Caller
NameDescribe
ddebug_exec_query