1 /* quoting-slots.h - struct quoting_slots declaration for quote.h and quotearg.h.
3 Copyright (C) 2022 Free Software Foundation, Inc.
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <https://www.gnu.org/licenses/>. */
18 /* Written by Sergey Sushilin <sergeysushilin@protonmail.com> */
20 #ifndef LIBQUOTE_QUOTING_SLOTS_H
21 #define LIBQUOTE_QUOTING_SLOTS_H 1
23 #if !defined (LIBQUOTE_QUOTE_H) && !defined (LIBQUOTE_QUOTEARG_H)
24 # error do not include this header directly, include quote.h or quotearg.h instead.
27 /* A storage slot with size and pointer to a buffer. */
28 struct quoting_slot_vector
36 /* Preallocate a slot 0 buffer, so that the caller can always quote
37 one small component of a "memory exhausted" message in slot 0. */
39 struct quoting_slot_vector slot_vector0
;
41 struct quoting_slot_vector
*slot_vector
;
44 /* Initialize quoting slots for further using. */
45 extern void quoting_slots_initialize (struct quoting_slots
*q
);
47 /* Free any dynamically allocated memory. */
48 extern void quoting_slots_finalize (struct quoting_slots
*q
);
50 #endif /* LIBQUOTE_QUOTING_SLOTS_H */