aboutsummaryrefslogtreecommitdiff
path: root/text.h
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2020-08-21 12:34:36 +0200
committerMarc André Tanner <mat@brain-dump.org>2020-08-29 13:34:41 +0200
commit397a8a0688c0be874f0e1826ed51d88db039d769 (patch)
tree0378c4d1f976e37be02da5a61690b3178be49509 /text.h
parent57a13bcea2b70c09aff2953bd0a2d451659e9bdd (diff)
downloadvis-397a8a0688c0be874f0e1826ed51d88db039d769.tar.gz
vis-397a8a0688c0be874f0e1826ed51d88db039d769.tar.xz
text: provide save function taking a directory descriptor
The standard does not specify mkstempat(3). We currently implement it in a non thread safe manner, by temporarily changing the process working directory before invoking mkstemp(3).
Diffstat (limited to 'text.h')
-rw-r--r--text.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/text.h b/text.h
index 43ff9c1..6fd484b 100644
--- a/text.h
+++ b/text.h
@@ -347,10 +347,12 @@ enum TextSaveMethod {
* @endrst
*/
bool text_save(Text*, const char *filename);
+bool text_saveat(Text*, int dirfd, const char *filename);
/**
* Save the whole text to the given file name, using the specified method.
*/
bool text_save_method(Text*, const char *filename, enum TextSaveMethod);
+bool text_saveat_method(Text*, int dirfd, const char *filename, enum TextSaveMethod);
/**
* Setup a sequence of write operations.
@@ -363,7 +365,7 @@ bool text_save_method(Text*, const char *filename, enum TextSaveMethod);
* ``text_save_cancel`` to release the underlying resources.
* @endrst
*/
-TextSave *text_save_begin(Text*, const char *filename, enum TextSaveMethod);
+TextSave *text_save_begin(Text*, int dirfd, const char *filename, enum TextSaveMethod);
/**
* Write file range.
* @return The number of bytes written or ``-1`` in case of an error.