blob: 7e9f421fd4da823792fcc4e77521ae751e70ccac (
plain)
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
|
/*
* Portable support for file manipulation and access related functions.
* $Id$
* Copyright (c) 1997 by Tycho Softworks.
* For conditions of distribution and reuse see product license.
*/
#ifndef __OTHER_FILES_H__
#define __OTHER_FILES_H__
#ifndef __STD_FILES_H__
#include <std/files.h>
#endif
#define isdir(fpath) isftype(fpath, S_IFDIR)
#define isfile(fpath) isftype(fpath, S_IFREG)
#define islink(fpath) isftype(fpath, S_IFLNK)
#define isfifo(fpath) isftype(fpath, S_IFIFO)
#define pathfname(fn) basename(fn)
#define rewind(fd) lseek(fd, (off_t)0, SEEK_SET)
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __NAMESPACE
#define isnewfile __NAMESPACE(isnewfile)
#define isftype __NAMESPACE(isftype)
#define ispath __NAMESPACE(ispath)
#define isroot __NAMESPACE(isroot)
#define fncat __NAMESPACE(fncat)
#define search __NAMESPACE(search)
#define basename __NAMESPACE(basename)
#define dirname __NAMESPACE(dirname)
#define extfname __NAMESPACE(extfname)
#endif
bool isnewfile(const char *from, const char *to);
bool isftype(const char *fpath, int ftype);
bool ispath(const char *fpath);
bool isroot(const char *fpath);
char *fncat(char *prefix, const char *suffix);
char *search(const char *path, const char *fname);
char *basename(const char *path);
char *dirname(char *path);
char *extfname(const char *path);
#ifdef __cplusplus
}
#endif
#endif
|