-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdirutil.h
83 lines (66 loc) · 2.15 KB
/
dirutil.h
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
#ifndef _DIRUTIL_H
#define _DIRUTIL_H
#ifndef _GLOBAL_H
#include "global.h"
#endif
#ifdef UNIX
#include <time.h>
struct ffblk
{
char ff_name[256]; /* current filename result */
struct tm ff_ftime; /* modify date/time */
long ff_fsize; /* file size */
int ff_attrib; /* DOS-style attributes (ugh) */
#ifdef GLOB_INTERNAL /* ...only visible to internals... */
char *ff_pfx; /* prefix for found patterns */
char *ff_pat; /* pattern for the current level */
DIR *ff_dir; /* directory scan for the current level */
struct dirent *ff_cur; /* current path component */
long ff_sattr; /* selected attributes */
#else
long youdontseethis[5];
#endif
};
#define FA_NORMAL 0 /* anything except the following: */
#define FA_RDONLY 1 /* read-only file */
#define FA_HIDDEN 2 /* dot-files */
#define FA_SYSTEM 4 /* device node or unreadable file */
#define FA_DIREC 16 /* directory */
extern int findfirst(char *pat, struct ffblk *ff, int attr);
extern int findnext(struct ffblk *ff);
extern void findlast __ARGS((struct ffblk *ff));
#else
#include <dir.h>
#endif
struct cur_dirs {
#ifndef UNIX
int drv;
char * curdir[27];
#endif
char * dir;
} ;
/* In dirutil.c */
FILE *dir __ARGS((char *path,int full));
int filedir __ARGS((char *name,int times,char *ret_str));
int getdir __ARGS((char *path,int full,FILE *file));
void undosify __ARGS((char *s));
char * make_dir_path(int count,char *arg,char* curdir);
char * make_fname(char * curdir, char * fname);
char * init_dirs(struct cur_dirs * dirs);
void free_dirs(struct cur_dirs * dirs);
int dir_ok(char * path,struct cur_dirs * dirs);
int dircmd __ARGS((int argc,char *argv[],void *p));
/* Made public for nntp expiry */
int nextname __ARGS((int command, char *name, struct ffblk *sbuf));
char *wildcardize __ARGS((char *path));
#ifdef MSDOS
int dosfnchr __ARGS((int ch));
#endif
/* In pathname.c: */
char *pathname __ARGS((char *cd,char *path));
char *firstpath __ARGS((char *path));
/* In pc.c: */
char *Tmpnam __ARGS((char *name));
/* In bmutil.c */
long fsize __ARGS((char *name));
#endif /* _DIRUTIL_H */