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