File: mysystem.h

package info (click to toggle)
multimail 0.52-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,048 kB
  • sloc: cpp: 16,140; ansic: 82; makefile: 73
file content (100 lines) | stat: -rw-r--r-- 1,668 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
/*
 * MultiMail offline mail reader
 * protos for mysystem.cc

 Copyright 1997-2017 William McBrine <wmcbrine@gmail.com>
 Distributed under the GNU General Public License, version 3 or later. */

#ifndef MYSYSTEM_H
#define MYSYSTEM_H

extern "C" {
#include <sys/types.h>
}

class mystat;

char *myfgets(char *, int, FILE *);
int mysystem(const char *);
int mysystem2(const char *, const char *);
char *mytmpdir(const char *);
char *mytmpnam();
void edit(const char *);
int mychdir(const char *);
int mymkdir(const char *);
void myrmdir(const char *);
char *mygetcwd();
const char *sysname();
bool myopendir(const char *);
const char *myreaddir(mystat &);
void clearDirectory(const char *);
time_t touchFile(const char *);

#ifdef LIMIT_MEM
long maxfreemem();
long limitmem(long);
#else
# define limitmem(x) x
#endif

char *canonize(char *);

#ifdef HAS_HOME
const char *homify(const char *);
#else
# define homify(x) x
#endif

#ifdef USE_SHELL
class Shell
{
    char *prompt;
 public:
    Shell();
    ~Shell();
    void out();
};
#endif

#ifdef EXTRAPATH
class ExtraPath
{
    char *newpath;
 public:
    ExtraPath();
    ~ExtraPath();
};
#endif

class mystat
{
    int mode;
    off_t size;
    time_t date;
 public:
    mystat(const char *);
    mystat();

    bool init(const char *);
#ifdef USE_FINDFIRST
# ifdef USE_IOH
    void init(long, time_t, unsigned);
# else
    void init(long, long, char);
# endif
#endif
    void init();
    bool isdir();
    bool readable();
    bool writeable();
    off_t fsize();
    time_t fdate();
    void reset_date(const char *);
};

#ifdef USE_STRICMP
# define strcasecmp stricmp
# define strncasecmp strnicmp
#endif

#endif