2 * Copyright (C) 2006-2007 Andre Noll <maan@systemlinux.org>
4 * Licensed under the GPL v2. For licencing details see COPYING.
7 /** \file string.h exported sybmols from string.c */
9 /** A string buffer used for para_printf(). */
11 /** The buffer. May be \p NULL. */
13 /** The size of \a buf. */
15 /** The next para_printf() will write at this offset. */
19 __must_check __malloc void *para_realloc(void *p, size_t size);
20 __must_check __malloc void *para_malloc(size_t size);
21 __must_check __malloc void *para_calloc(size_t size);
22 __must_check __malloc char *para_strdup(const char *s);
23 __must_check __malloc __printf_1_2 char *make_message(const char *fmt, ...);
24 __must_check __malloc char *para_strcat(char *a, const char *b);
25 __must_check __malloc char *para_dirname(const char *name);
26 __must_check __malloc char *para_basename(const char *name);
28 __must_check __malloc char *para_tmpname(void);
29 __must_check int para_mkstemp(char *template, mode_t mode);
30 __must_check __malloc char *para_logname(void);
31 __must_check __malloc char *para_homedir(void);
32 __must_check unsigned split_args(char *args, char *** const argv_ptr, const char *delim);
33 __malloc char *para_hostname(void);
34 void valid_fd_012(void);
35 __printf_2_3 int para_printf(struct para_buffer *b, const char *fmt, ...);
36 /** Used for for_each_line() and for_each_line_ro(). */
37 typedef int line_handler_t(char *, void *);
38 int for_each_line(char *buf, size_t size, line_handler_t *line_handler,
40 int for_each_line_ro(char *buf, size_t size, line_handler_t line_handler,
42 int para_atoi64(const char *str, int64_t *result);
43 int para_atoi32(const char *str, int32_t *value);