1 /** Secure file saving handling
4 #ifndef EL__UTIL_SECSAVE_H
5 #define EL__UTIL_SECSAVE_H
8 #include <sys/types.h> /* mode_t */
14 SS_ERR_DISABLED
, /**< secsave is disabled. */
15 SS_ERR_OUT_OF_MEM
, /**< memory allocation failure */
17 /* see err field in struct secure_save_info */
27 extern enum secsave_errno secsave_errno
; /**< internal secsave error number */
29 struct secure_save_info
{
30 FILE *fp
; /**< file stream pointer */
31 unsigned char *file_name
; /**< final file name */
32 unsigned char *tmp_file_name
; /**< temporary file name */
33 int err
; /**< set to non-zero value in case of error */
34 int secure_save
; /**< use secure save for this file */
37 struct secure_save_info
*secure_open(unsigned char *);
39 int secure_close(struct secure_save_info
*);
41 int secure_fputs(struct secure_save_info
*, const char *);
42 int secure_fputc(struct secure_save_info
*, int);
44 int secure_fprintf(struct secure_save_info
*, const char *, ...);
46 unsigned char *secsave_strerror(enum secsave_errno
, struct terminal
*);