Subversion Repositories Kolibri OS

Rev

Rev 9810 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 9810 Rev 9811
1
/* Copyright (C) 2021 Logaev Maxim (turbocat2001), GPLv2 */
1
/* Copyright (C) 2021 Logaev Maxim (turbocat2001), GPLv2 */
2
 
2
 
3
#ifndef _DIRENT_H_
3
#ifndef _DIRENT_H_
4
#define _DIRENT_H_
4
#define _DIRENT_H_
5
 
5
 
6
#include 
6
#include 
7
#include 
7
#include 
8
 
8
 
9
#define IS_FOLDER 16
9
#define IS_FOLDER 16
10
#define IS_FILE   0
10
#define IS_FILE   0
11
 
11
 
12
typedef unsigned ino_t;
12
typedef unsigned ino_t;
13
 
13
 
14
struct dirent {
14
struct dirent {
15
    ino_t d_ino;           //File serial number.
15
    ino_t d_ino;           //File serial number.
16
    char d_name[PATH_MAX]; // Name of entry.
16
    char d_name[PATH_MAX]; // Name of entry.
17
    unsigned d_type;
17
    unsigned d_type;
18
};
18
};
19
 
19
 
20
typedef struct {
20
typedef struct {
21
    struct dirent* objs;
21
    struct dirent* objs;
22
    ino_t pos;
22
    ino_t pos;
23
    ino_t num_objs;
23
    ino_t num_objs;
24
} DIR;
24
} DIR;
25
 
25
 
26
DLLAPI int closedir(DIR* dir);
26
extern int _FUNC(closedir)(DIR* dir);
27
DLLAPI DIR* opendir(const char* path);
27
extern DIR* _FUNC(opendir)(const char* path);
28
DLLAPI struct dirent* readdir(DIR*);
28
extern struct dirent* _FUNC(readdir)(DIR*);
29
DLLAPI void rewinddir(DIR* dir);
29
extern void _FUNC(rewinddir)(DIR* dir);
30
DLLAPI void seekdir(DIR* dir, unsigned pos);
30
extern void _FUNC(seekdir)(DIR* dir, unsigned pos);
31
DLLAPI unsigned telldir(DIR* dir);
31
extern unsigned _FUNC(telldir)(DIR* dir);
32
 
32
 
33
#endif // _DIRENT_H_
33
#endif // _DIRENT_H_