9
0
Fork 0
Commit Graph

7 Commits

Author SHA1 Message Date
Sascha Hauer 6dd613f1bc string_list: Add string_list_for_each_entry macro
To ease iterating over a string_list.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-03 09:39:16 +02:00
Eric Bénard 738c57eeaa stringlist: fix division by zero
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>
2012-08-29 09:10:13 +02:00
Sascha Hauer f152f6a770 stringlist: implement string_list_add_asprintf
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>
2012-04-30 20:22:23 +08:00
Sascha Hauer 34faa2e7ca stringlist: use seperately allocated string
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>
2012-04-30 20:22:23 +08:00
Alexander Aring 049100fe37 stringlist-functions: add sorted insert
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>
2011-12-21 12:38:14 +01:00
Sascha Hauer 51b0b001d3 stringlist: Fix printing on smaller consoles
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>
2009-10-15 16:06:05 +02:00
Sascha Hauer 8f35e16333 add stringlist function. They can be used to build a list
of strings. For now mainly useful to print the resulting
list in columns which is used in tab completion and ls.
2008-03-11 21:38:22 +01:00