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
Steffen Trumtrar 2a7b142b76 stringlist: fix cpp macro in header
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>
2013-01-09 09:42:47 +01: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 73d57b1d35 list: remove duplicated list.h
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>
2009-11-03 09:48:53 +01: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