~ubuntu-branches/ubuntu/feisty/elinks/feisty-updates

« back to all changes in this revision

Viewing changes to src/util/secsave.h

  • Committer: Bazaar Package Importer
  • Author(s): Peter Gervai
  • Date: 2004-01-21 22:13:45 UTC
  • Revision ID: james.westby@ubuntu.com-20040121221345-ju33hai1yhhqt6kn
Tags: upstream-0.9.1
ImportĀ upstreamĀ versionĀ 0.9.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Secure file saving handling */
 
2
/* $Id: secsave.h,v 1.7 2003/06/04 20:05:55 zas Exp $ */
 
3
 
 
4
#ifndef EL__UTIL_SECFILE_H
 
5
#define EL__UTIL_SECFILE_H
 
6
 
 
7
#include <stdio.h>
 
8
#include <sys/types.h> /* mode_t */
 
9
 
 
10
enum secsave_errno {
 
11
        SS_ERR_NONE = 0,
 
12
        SS_ERR_DISABLED, /* secsave is disabled. */
 
13
        SS_ERR_OUT_OF_MEM, /* memory allocation failure */
 
14
 
 
15
        /* see err field in struct secure_save_info */
 
16
        SS_ERR_OPEN_READ,
 
17
        SS_ERR_OPEN_WRITE,
 
18
        SS_ERR_STAT,
 
19
        SS_ERR_ACCESS,
 
20
        SS_ERR_MKSTEMP,
 
21
        SS_ERR_RENAME,
 
22
        SS_ERR_OTHER,
 
23
};
 
24
 
 
25
extern enum secsave_errno secsave_errno; /* internal secsave error number */
 
26
 
 
27
struct secure_save_info {
 
28
        FILE *fp; /* file stream pointer */
 
29
        unsigned char *file_name; /* final file name */
 
30
        unsigned char *tmp_file_name; /* temporary file name */
 
31
        int err; /* set to non-zero value in case of error */
 
32
        int secure_save; /* use secure save for this file */
 
33
};
 
34
 
 
35
struct secure_save_info *secure_open(unsigned char *, mode_t);
 
36
int secure_close(struct secure_save_info *);
 
37
 
 
38
int secure_fputs(struct secure_save_info *, const char *);
 
39
int secure_fputc(struct secure_save_info *, int);
 
40
 
 
41
int secure_fprintf(struct secure_save_info *, const char *, ...);
 
42
 
 
43
#endif