dirent.zc

来自「实现树形结构」· ZC 代码 · 共 41 行

ZC
41
字号

import "base/types"
import "unistd"

public [name="c"]

public typedef ino_t = dword

struct dir
	dummy : int
end

struct dirent
	d_ino : ino_t
	d_off : off_t
	d_reclen : word
	d_type : byte
	d_name : [256] char
end

enum dirent_type
	DT_UNKNOWN = 0
	DT_FIFO = 1
	DT_CHR = 2
	DT_DIR = 4
	DT_BLK = 6
	DT_REG = 8
	DT_LNK = 10
	DT_SOCK = 12
	DT_WHT = 14
end

import func opendir (string): dir
import func closedir (dir): int
import func readdir (dir): dirent
import func rewinddir (dir): void

equ MAXNAMLEN = 255

end

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?