diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2020-05-13 08:56:22 +0200 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2020-05-13 09:11:30 +0200 |
| commit | 5a38f79952b4333bd6ac39a8af632179df5cc8ab (patch) | |
| tree | 3b2092a1ddb59d48671c3c950e5fa0ec7f373f53 /text.h | |
| parent | a1e7fb337927a4b76c93b10395f6030defcf2d34 (diff) | |
| download | vis-5a38f79952b4333bd6ac39a8af632179df5cc8ab.tar.gz vis-5a38f79952b4333bd6ac39a8af632179df5cc8ab.tar.xz | |
text: introduce text_save_method, remove text_save_range
This utility function is analogous to text_load_method and allows the
caller to specify how the file should be saved. It is implemented as a
wrapper around the lower level text_save_{begin,write,commit} primitives.
The unused text_save_range function has been removed. If needed, use
the aforementioned lower level functionality.
Diffstat (limited to 'text.h')
| -rw-r--r-- | text.h | 21 |
1 files changed, 13 insertions, 8 deletions
@@ -302,14 +302,6 @@ size_t text_mark_get(Text*, Mark); * @{ */ /** - * Save the whole text to the given file name. - */ -bool text_save(Text*, const char *filename); -/** - * Save a file range to the given file name. - */ -bool text_save_range(Text*, Filerange*, const char *filename); -/** * Method used to save the text. */ enum TextSaveMethod { @@ -346,6 +338,19 @@ enum TextSaveMethod { }; /** + * Save the whole text to the given file name. + */ +bool text_save(Text*, const char *filename); +/** + * Save the whole text to the given file name, using the specified method. + * + * @rst + * .. note:: Equivalent to ``text_save_method(filename, TEXT_SAVE_AUTO)``. + * @endrst + */ +bool text_save_method(Text*, const char *filename, enum TextSaveMethod); + +/** * Setup a sequence of write operations. * * The returned `TextSave` pointer can be used to write multiple, possibly |
