Merge the new afs code.
[paraslash.git] / string.h
1 /*
2 * Copyright (C) 2006-2007 Andre Noll <maan@systemlinux.org>
3 *
4 * Licensed under the GPL v2. For licencing details see COPYING.
5 */
6
7 /** \file string.h exported sybmols from string.c */
8
9 struct para_buffer {
10 char *buf;
11 size_t size;
12 size_t offset;
13 };
14
15 __must_check __malloc void *para_realloc(void *p, size_t size);
16 __must_check __malloc void *para_malloc(size_t size);
17 __must_check __malloc void *para_calloc(size_t size);
18 __must_check __malloc char *para_strdup(const char *s);
19 __must_check __malloc __printf_1_2 char *make_message(const char *fmt, ...);
20 __must_check __malloc char *para_strcat(char *a, const char *b);
21 __must_check __malloc char *para_dirname(const char *name);
22 __must_check __malloc char *para_basename(const char *name);
23 void chop(char* buf);
24 __must_check __malloc char *para_tmpname(void);
25 __must_check int para_mkstemp(char *template, mode_t mode);
26 __must_check __malloc char *para_logname(void);
27 __must_check __malloc char *para_homedir(void);
28 __must_check unsigned split_args(char *args, char ***argv_ptr, const char *delim);
29 __malloc char *para_hostname(void);
30 void valid_fd_012(void);
31 __printf_2_3 int para_printf(struct para_buffer *b, const char *fmt, ...);
32 typedef int line_handler_t(char *, void *);
33 int for_each_line(char *buf, size_t size, line_handler_t *line_handler,
34 void *private_data);
35 int for_each_line_ro(char *buf, size_t size, line_handler_t line_handler,
36 void *private_data);
37