From 5a38f79952b4333bd6ac39a8af632179df5cc8ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Wed, 13 May 2020 08:56:22 +0200 Subject: 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. --- text.h | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'text.h') diff --git a/text.h b/text.h index be99894..5d653ff 100644 --- a/text.h +++ b/text.h @@ -301,14 +301,6 @@ size_t text_mark_get(Text*, Mark); * @defgroup save * @{ */ -/** - * 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. */ @@ -345,6 +337,19 @@ enum TextSaveMethod { TEXT_SAVE_INPLACE, }; +/** + * 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. * -- cgit v1.2.3