ACIL FM
Dark
Refresh
Current DIR:
/usr/src/kernels/5.14.0-611.27.1.el9_7.x86_64/tools/lib
/
usr
src
kernels
5.14.0-611.27.1.el9_7.x86_64
tools
lib
Upload
Zip Selected
Delete Selected
Pilih semua
Nama
Ukuran
Permission
Aksi
api
-
chmod
Open
Rename
Delete
bpf
-
chmod
Open
Rename
Delete
lockdep
-
chmod
Open
Rename
Delete
perf
-
chmod
Open
Rename
Delete
subcmd
-
chmod
Open
Rename
Delete
symbol
-
chmod
Open
Rename
Delete
argv_split.c
1.68 MB
chmod
View
DL
Edit
Rename
Delete
bitmap.c
2.88 MB
chmod
View
DL
Edit
Rename
Delete
ctype.c
1.34 MB
chmod
View
DL
Edit
Rename
Delete
find_bit.c
2.98 MB
chmod
View
DL
Edit
Rename
Delete
hweight.c
1.77 MB
chmod
View
DL
Edit
Rename
Delete
list_sort.c
7.82 MB
chmod
View
DL
Edit
Rename
Delete
rbtree.c
16.09 MB
chmod
View
DL
Edit
Rename
Delete
slab.c
664 B
chmod
View
DL
Edit
Rename
Delete
string.c
4.65 MB
chmod
View
DL
Edit
Rename
Delete
str_error_r.c
1.01 MB
chmod
View
DL
Edit
Rename
Delete
vsprintf.c
900 B
chmod
View
DL
Edit
Rename
Delete
zalloc.c
197 B
chmod
View
DL
Edit
Rename
Delete
Edit file: /usr/src/kernels/5.14.0-611.27.1.el9_7.x86_64/tools/lib/argv_split.c
// SPDX-License-Identifier: GPL-2.0 /* * Helper function for splitting a string into an argv-like array. */ #include <stdlib.h> #include <linux/kernel.h> #include <linux/ctype.h> #include <linux/string.h> static const char *skip_arg(const char *cp) { while (*cp && !isspace(*cp)) cp++; return cp; } static int count_argc(const char *str) { int count = 0; while (*str) { str = skip_spaces(str); if (*str) { count++; str = skip_arg(str); } } return count; } /** * argv_free - free an argv * @argv - the argument vector to be freed * * Frees an argv and the strings it points to. */ void argv_free(char **argv) { char **p; for (p = argv; *p; p++) { free(*p); *p = NULL; } free(argv); } /** * argv_split - split a string at whitespace, returning an argv * @str: the string to be split * @argcp: returned argument count * * Returns an array of pointers to strings which are split out from * @str. This is performed by strictly splitting on white-space; no * quote processing is performed. Multiple whitespace characters are * considered to be a single argument separator. The returned array * is always NULL-terminated. Returns NULL on memory allocation * failure. */ char **argv_split(const char *str, int *argcp) { int argc = count_argc(str); char **argv = calloc(argc + 1, sizeof(*argv)); char **argvp; if (argv == NULL) goto out; if (argcp) *argcp = argc; argvp = argv; while (*str) { str = skip_spaces(str); if (*str) { const char *p = str; char *t; str = skip_arg(str); t = strndup(p, str-p); if (t == NULL) goto fail; *argvp++ = t; } } *argvp = NULL; out: return argv; fail: argv_free(argv); return NULL; }
Simpan
Batal
Isi Zip:
Unzip
Create
Buat Folder
Buat File
Terminal / Execute
Run
Chmod Bulk
All File
All Folder
All File dan Folder
Apply