aboutsummaryrefslogtreecommitdiff
path: root/include/linux/string.h
AgeCommit message (Collapse)AuthorFilesLines
2022-01-19doc: replace @return by Return:Heinrich Schuchardt1-3/+3
Sphinx expects Return: and not @return to indicate a return value. find . -name '*.c' -exec \ sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \; find . -name '*.h' -exec \ sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \; Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2021-10-08lib: Add memdup()Simon Glass1-0/+13
Add a function to duplicate a memory region, a little like strdup(). Signed-off-by: Simon Glass <sjg@chromium.org>
2021-04-12lib: string: Implement strlcatSean Anderson1-0/+3
This introduces strlcat, which provides a safer interface than strncat. It never copies more than its size bytes, including the terminating nul. In addition, it never reads past dest[size - 1], even if dest is not nul-terminated. This also removes the stub for dwc3 now that we have a proper implementation. Signed-off-by: Sean Anderson <seanga2@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-02-05sandbox: Rename strdup() functionsSimon Glass1-0/+5
These functions include calls to a memory-allocation routine and so need to use the system routine when called from a library. To preserve access to these functions for libraries that need it, such as SDL, rename these functions within U-Boot. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-02-05string: Allow arch override of strndup() alsoSimon Glass1-1/+1
At present architectures can override strdup() but not strndup(). Use the same option for both. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-06-05lib: Implement strndup()Thierry Reding1-0/+1
Signed-off-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Tom Warren <twarren@nvidia.com>
2017-06-01string: Add strcspn()Simon Glass1-0/+15
Add an implementation of strcspn() which returns the number of initial characters that do not match any in a rejection list. Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-01string: Add strchrnul()Simon Glass1-0/+13
This functions works like strchr() but returns the end of the string if the character is not found. Add an implementation of this. Signed-off-by: Simon Glass <sjg@chromium.org>
2016-06-06Remove unneeded remnants of bcopy().Robert P. J. Day1-4/+0
Since bcopy() is no longer used, delete all remaining references to it. Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
2014-12-11lib: string: move strlcpy() to a common placeMasahiro Yamada1-0/+3
Move strlcpy() definition from drivers/usb/gadget/ether.c to lib/string.c because it is a very useful function. Let's add the prototype to include/linux/string.h too. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: Simon Glass <sjg@chromium.org>
2014-10-25string.h: add missing prototypesJeroen Hofstee1-0/+7
Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
2013-05-31mtd: resync with Linux-3.7.1Sergey Lapin1-0/+3
This patch is essentially an update of u-boot MTD subsystem to the state of Linux-3.7.1 with exclusion of some bits: - the update is concentrated on NAND, no onenand or CFI/NOR/SPI flashes interfaces are updated EXCEPT for API changes. - new large NAND chips support is there, though some updates have got in Linux-3.8.-rc1, (which will follow on top of this patch). To produce this update I used tag v3.7.1 of linux-stable repository. The update was made using application of relevant patches, with changes relevant to U-Boot-only stuff sticked together to keep bisectability. Then all changes were grouped together to this patch. Signed-off-by: Sergey Lapin <slapin@ossfans.org> [scottwood@freescale.com: some eccstrength and build fixes] Signed-off-by: Scott Wood <scottwood@freescale.com>
2012-12-13Make linux kernel string funcs available to toolsJoe Hershberger1-4/+1
isspace() and strim() are not in the typical user-mode string.h, so put them in a separate compilation unit so that they can be built into tools that need them independent of the other common string functions. This allows code shared by u-boot and the linux user-mode tools to link. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
2012-12-11Add strcasecmp() and strncasecmp()Simon Glass1-2/+5
strncasecmp() is present as strnicmp() but disabled. Make it available and define strcasecmp() also. There is a only a small performance penalty to having strcasecmp() call strncasecmp(), so do this instead of a standalone function, to save code space. Update the prototype in arch-specific headers as needed to avoid warnings. Signed-off-by: Simon Glass <sjg@chromium.org>
2012-01-26nand: Sanitize ONFI strings.Christian Hitz1-0/+4
[backport from linux commit 02f8c6aee8df3cdc935e9bdd4f2d020306035dbe] This is part of the synchronization with the nand driver to the Linux 3.0 state. Signed-off-by: Christian Hitz <christian.hitz@aizo.com> Cc: Scott Wood <scottwood@freescale.com> Signed-off-by: Scott Wood <scottwood@freescale.com>
2006-05-03Scheduled for removal: strnicmp() which is unusedWolfgang Denk1-1/+1
2004-03-23* Patch by Carl Riechers, 17 Mar 2004:wdenk1-1/+1
Ignore '\0' characters in console input for use with telnet and telco pads. * Patch by Leon Kukovec, 17 Mar 2004: typo fix for strswab prototype #ifdef
2004-03-14* Patch by Yuli Barcohen, 4 Mar 2004:wdenk1-0/+3
Fix problems with GCC 3.3.x which changed handling of global variables explicitly initialized to zero (now in .bss instead of .data as before). * Patch by Leon Kukovec, 02 Mar 2004: add strswab() to fix IDE LBA capacity, firmware and model numbers on little endian machines * Patch by Masami Komiya, 02 Mar 2004: - Remove get_ticks() from NFS code - Add verification of RPC transaction ID * Patch by Pierre Aubert, 02 Mar 2004: cleanup for IDE and USB drivers for MPC5200
2001-10-17Initial revisionwdenk1-0/+86