summaryrefslogtreecommitdiffstats
path: root/include/stringlist.h
Commit message (Collapse)AuthorAgeFilesLines
* param: introduce file-list parameter typeAhmad Fatoum2021-05-121-0/+1
| | | | | | | | | | | | | | DFU, fastboot and incoming mass storage support all use file lists as input, but individually check syntax correctness only on use. A dedicated file list parameter would improve the user experience and makes the code using it easier to handle: the struct file_list can be passed around directly instead of having to parse it first on use. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210503114901.13095-6-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* stringlist: Initialize HEAD str member to NULLSascha Hauer2021-03-161-0/+1
| | | | | | | HEAD str member should be unused, but when it's used accidently then at least make sure we do not use an uninitialized string. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* stringlist: Add adding sort uniqSascha Hauer2021-03-161-0/+1
| | | | | | | Function to add an entry sorted to a string list only when it doesn't exist. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* include: add SPDX GPL-2.0-only license tags for files without licensing ↵Roland Hieber2020-02-171-0/+1
| | | | | | | | | | | information According to our /README, GPL-2.0-only applies for the whole project except noted otherwise. Signed-off-by: Roland Hieber <rohieb@rohieb.name> Reviewed-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* stringlist: the string argument should be constJan Luebbe2014-12-041-2/+2
| | | | | Signed-off-by: Jan Luebbe <jlu@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* stringlist: string_list_contains can use a const stringJan Luebbe2014-11-201-1/+1
| | | | | Signed-off-by: Jan Luebbe <jlu@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* string_list: Add string_list_for_each_entry macroSascha Hauer2014-07-031-0/+3
| | | | | | To ease iterating over a string_list. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* stringlist: fix cpp macro in headerSteffen Trumtrar2013-01-091-3/+3
| | | | | | | | | | | Both include/string.h and include/stringlist.h define the c preprocessor macro __STRING_H. This leads to a compile time error, in case both files are (indirectly) included. Rename the macro to __STRINGLIST_H in stringlist.h. Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* stringlist: implement string_list_add_asprintfSascha Hauer2012-04-301-0/+1
| | | | | | | Useful for allocating a string list entry on the fly. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* stringlist: use seperately allocated stringSascha Hauer2012-04-301-2/+4
| | | | | | | | | | Allocate the string in string list seperately instead of embedding a zero length string into struct stringlist. Besides looking cleaner this allows us to implement a string_list_asprintf. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* stringlist-functions: add sorted insertAlexander Aring2011-12-211-0/+2
| | | | | | | | | Add sorted insert in stringlist functions. Also added function to checked if string is already in string list. Signed-off-by: Alexander Aring <a.aring@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* list: remove duplicated list.hSascha Hauer2009-11-031-1/+1
| | | | | | | | We accidently have two list implementations in the tree: include/list.h and include/linux/list.h. This patch moves the latter (newer one) to include/linux/list.h. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* add stringlist function. They can be used to build a listSascha Hauer2008-03-111-0/+27
of strings. For now mainly useful to print the resulting list in columns which is used in tab completion and ls.