1 : /* Copyright (c) 2007 James Antill -- See LICENSE file for terms. */
2 : #ifndef USTR_IO_H
3 : #define USTR_IO_H 1
4 :
5 : #ifndef USTR_MAIN_H
6 : #error " You should have already included ustr-main.h, or just include ustr.h."
7 : #endif
8 :
9 : USTR_CONF_E_PROTO int ustr_io_get(struct Ustr **, FILE *, size_t, size_t *)
10 : USTR__COMPILE_ATTR_WARN_UNUSED_RET() USTR__COMPILE_ATTR_NONNULL_L((1, 2));
11 : USTR_CONF_E_PROTO int ustr_io_getfile(struct Ustr **, FILE *)
12 : USTR__COMPILE_ATTR_WARN_UNUSED_RET() USTR__COMPILE_ATTR_NONNULL_A();
13 : USTR_CONF_E_PROTO int ustr_io_getfilename(struct Ustr **, const char *)
14 : USTR__COMPILE_ATTR_WARN_UNUSED_RET() USTR__COMPILE_ATTR_NONNULL_A();
15 :
16 : USTR_CONF_E_PROTO int ustr_io_getdelim(struct Ustr **, FILE *, char)
17 : USTR__COMPILE_ATTR_WARN_UNUSED_RET() USTR__COMPILE_ATTR_NONNULL_A();
18 : USTR_CONF_E_PROTO int ustr_io_getline(struct Ustr **, FILE *)
19 : USTR__COMPILE_ATTR_WARN_UNUSED_RET() USTR__COMPILE_ATTR_NONNULL_A();
20 :
21 : USTR_CONF_E_PROTO int ustr_io_put(struct Ustr **, FILE *, size_t)
22 : USTR__COMPILE_ATTR_WARN_UNUSED_RET() USTR__COMPILE_ATTR_NONNULL_A();
23 : USTR_CONF_E_PROTO int ustr_io_putline(struct Ustr **, FILE *, size_t)
24 : USTR__COMPILE_ATTR_WARN_UNUSED_RET() USTR__COMPILE_ATTR_NONNULL_A();
25 : USTR_CONF_EI_PROTO int ustr_io_putfile(struct Ustr **, FILE *)
26 : USTR__COMPILE_ATTR_WARN_UNUSED_RET() USTR__COMPILE_ATTR_NONNULL_A();
27 : USTR_CONF_EI_PROTO int ustr_io_putfileline(struct Ustr **, FILE *)
28 : USTR__COMPILE_ATTR_WARN_UNUSED_RET() USTR__COMPILE_ATTR_NONNULL_A();
29 : USTR_CONF_E_PROTO
30 : int ustr_io_putfilename(struct Ustr **, const char *, const char *)
31 : USTR__COMPILE_ATTR_WARN_UNUSED_RET() USTR__COMPILE_ATTR_NONNULL_A();
32 :
33 : USTR_CONF_E_PROTO
34 : int ustrp_io_get(struct Ustr_pool *, struct Ustrp **, FILE *, size_t, size_t *)
35 : USTR__COMPILE_ATTR_WARN_UNUSED_RET() USTR__COMPILE_ATTR_NONNULL_L((2, 3));
36 : USTR_CONF_E_PROTO
37 : int ustrp_io_getfile(struct Ustr_pool *, struct Ustrp **, FILE *)
38 : USTR__COMPILE_ATTR_WARN_UNUSED_RET() USTR__COMPILE_ATTR_NONNULL_L((2, 3));
39 : USTR_CONF_E_PROTO
40 : int ustrp_io_getfilename(struct Ustr_pool *, struct Ustrp **,const char *)
41 : USTR__COMPILE_ATTR_WARN_UNUSED_RET() USTR__COMPILE_ATTR_NONNULL_L((2, 3));
42 :
43 : USTR_CONF_E_PROTO
44 : int ustrp_io_getdelim(struct Ustr_pool *, struct Ustrp **, FILE *, char)
45 : USTR__COMPILE_ATTR_WARN_UNUSED_RET() USTR__COMPILE_ATTR_NONNULL_L((2, 3));
46 : USTR_CONF_E_PROTO int ustrp_io_getline(struct Ustr_pool *, struct Ustrp**,FILE*)
47 : USTR__COMPILE_ATTR_WARN_UNUSED_RET() USTR__COMPILE_ATTR_NONNULL_L((2, 3));
48 :
49 : USTR_CONF_E_PROTO
50 : int ustrp_io_put(struct Ustr_pool *, struct Ustrp **, FILE *, size_t)
51 : USTR__COMPILE_ATTR_WARN_UNUSED_RET() USTR__COMPILE_ATTR_NONNULL_L((2, 3));
52 : USTR_CONF_E_PROTO
53 : int ustrp_io_putline(struct Ustr_pool *, struct Ustrp **, FILE *, size_t)
54 : USTR__COMPILE_ATTR_WARN_UNUSED_RET() USTR__COMPILE_ATTR_NONNULL_L((2, 3));
55 : USTR_CONF_EI_PROTO
56 : int ustrp_io_putfile(struct Ustr_pool *, struct Ustrp **, FILE *)
57 : USTR__COMPILE_ATTR_WARN_UNUSED_RET() USTR__COMPILE_ATTR_NONNULL_L((2, 3));
58 : USTR_CONF_EI_PROTO
59 : int ustrp_io_putfileline(struct Ustr_pool *, struct Ustrp **, FILE *)
60 : USTR__COMPILE_ATTR_WARN_UNUSED_RET() USTR__COMPILE_ATTR_NONNULL_L((2, 3));
61 : USTR_CONF_E_PROTO
62 : int ustrp_io_putfilename(struct Ustr_pool *, struct Ustrp **,
63 : const char *, const char *)
64 : USTR__COMPILE_ATTR_WARN_UNUSED_RET() USTR__COMPILE_ATTR_NONNULL_L((2, 3, 4));
65 :
66 : #if USTR_CONF_INCLUDE_INTERNAL_HEADERS
67 : # include "ustr-io-internal.h"
68 : #endif
69 :
70 : #if USTR_CONF_INCLUDE_CODEONLY_HEADERS
71 : # include "ustr-io-code.h"
72 : #endif
73 :
74 : #if USTR_CONF_COMPILE_USE_INLINE
75 : USTR_CONF_II_PROTO int ustr_io_putfile(struct Ustr **ps1, FILE *fp)
76 10 : { return (ustr_io_put(ps1, fp, ustr_len(*ps1))); }
77 : USTR_CONF_II_PROTO int ustr_io_putfileline(struct Ustr **ps1, FILE *fp)
78 5 : { return (ustr_io_putline(ps1, fp, ustr_len(*ps1))); }
79 :
80 : USTR_CONF_II_PROTO
81 : int ustrp_io_putfile(struct Ustr_pool *p, struct Ustrp **ps1, FILE *fp)
82 6 : { return (ustrp_io_put(p, ps1, fp, ustrp_len(*ps1))); }
83 : USTR_CONF_II_PROTO
84 : int ustrp_io_putfileline(struct Ustr_pool *p, struct Ustrp **ps1, FILE *fp)
85 6 : { return (ustrp_io_putline(p, ps1, fp, ustrp_len(*ps1))); }
86 : #endif
87 :
88 : #endif
|