Richard W.M. Jones
14df5fa5d1
daemon: Implement a growable strings buffer type.
...
Previously a lot of daemon code used three variables (a string list,
'int size' and 'int alloc') to track growable strings buffers. This
commit implements a simple struct containing the same variables, but
using size_t instead of int:
struct stringsbuf {
char **argv;
size_t size;
size_t alloc;
};
Use it like this:
DECLARE_STRINGSBUF (ret);
//...
if (add_string (&ret, str) == -1)
return NULL;
//...
if (end_stringsbuf (&ret) == -1)
return NULL;
return ret.argv;
2012-03-13 08:19:11 +00:00
..
2012-03-13 08:19:11 +00:00
2012-02-01 15:09:09 +00:00
2012-03-13 08:19:11 +00:00
2011-11-08 14:43:07 +00:00
2012-03-13 08:19:11 +00:00
2012-02-06 21:40:38 +00:00
2011-11-11 10:48:16 +00:00
2012-01-18 22:05:02 +00:00
2011-11-08 14:43:07 +00:00
2011-11-08 14:43:07 +00:00
2011-11-08 14:43:07 +00:00
2011-11-08 14:43:07 +00:00
2009-03-03 08:58:37 +00:00
2012-01-18 22:05:02 +00:00
2012-03-13 08:19:11 +00:00
2011-11-08 14:43:07 +00:00
2012-03-08 13:23:15 +00:00
2012-03-13 08:19:11 +00:00
2011-11-08 14:43:07 +00:00
2011-11-08 14:43:07 +00:00
2011-11-08 14:43:07 +00:00
2011-11-08 14:43:07 +00:00
2012-01-18 22:05:02 +00:00
2011-11-08 14:43:07 +00:00
2012-03-13 08:19:11 +00:00
2011-11-08 14:43:07 +00:00
2012-03-13 08:19:11 +00:00
2011-11-08 14:43:07 +00:00
2012-03-13 08:19:11 +00:00
2012-02-08 14:35:55 +00:00
2011-11-08 14:43:07 +00:00
2012-03-08 14:30:10 +00:00
2011-11-08 14:43:07 +00:00
2012-01-18 22:05:02 +00:00
2012-03-13 08:19:11 +00:00
2011-11-08 14:43:07 +00:00
2011-11-08 14:43:07 +00:00
2009-11-26 11:52:44 +00:00
2012-03-13 08:19:11 +00:00
2012-03-13 08:19:11 +00:00
2012-01-21 21:31:50 +00:00
2011-11-08 14:43:07 +00:00
2012-02-27 17:26:09 +00:00
2012-03-13 08:19:11 +00:00
2012-03-13 08:19:11 +00:00
2011-11-11 10:48:16 +00:00
2012-01-18 22:05:02 +00:00
2012-03-13 08:19:11 +00:00
2012-02-27 17:26:09 +00:00
2012-03-13 08:19:11 +00:00
2012-01-18 22:05:02 +00:00
2012-02-01 15:09:09 +00:00
2011-11-08 14:43:07 +00:00
2012-03-13 08:19:11 +00:00
2012-02-27 11:13:45 +00:00
2012-02-27 13:43:35 +00:00
2012-02-06 21:40:38 +00:00
2011-11-08 14:43:07 +00:00
2012-01-24 15:56:19 +00:00
2011-11-08 14:43:07 +00:00
2012-02-01 15:09:09 +00:00
2011-11-08 14:43:07 +00:00
2012-02-01 15:09:09 +00:00
2011-11-08 14:43:07 +00:00
2011-11-08 14:43:07 +00:00
2011-11-08 14:43:07 +00:00
2011-11-08 14:43:07 +00:00
2011-11-08 14:43:07 +00:00
2011-11-08 14:43:07 +00:00
2012-01-21 21:31:50 +00:00
2012-01-18 22:05:02 +00:00
2011-11-08 14:43:07 +00:00
2011-11-08 14:43:07 +00:00
2012-03-08 13:21:58 +00:00
2011-12-08 11:39:58 +00:00
2011-11-08 14:43:07 +00:00
2012-02-01 15:09:09 +00:00
2012-02-10 09:56:24 +00:00
2011-11-08 14:43:07 +00:00