summaryrefslogtreecommitdiffstats
path: root/lib/stringlist.c
Commit message (Collapse)AuthorAgeFilesLines
* 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-3/+3
| | | | | | To ease iterating over a string_list. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* stringlist: fix division by zeroEric Bénard2012-08-291-2/+2
| | | | | | | | len is checked instead of num so when num is zero, we get a division by zero a few lines later Signed-off-by: Eric Bénard <eric@eukrea.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* stringlist: implement string_list_add_asprintfSascha Hauer2012-04-301-0/+24
| | | | | | | 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-6/+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/+34
| | | | | | | | | 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>
* stringlist: Fix printing on smaller consolesSascha Hauer2009-10-151-3/+4
| | | | | | | Do not add additional space between strings, we already did this by adding 4 to the string length. Signed-off-by: Sascha Hauer <sha@pengutronix.de>
* add stringlist function. They can be used to build a listSascha Hauer2008-03-111-0/+45
of strings. For now mainly useful to print the resulting list in columns which is used in tab completion and ls.