550W Document
550W, a high-end OS
file.h 文件参考
#include <common/types.h>
#include <lib/list.h>
#include <lib/string.h>
#include <os/lock.h>
#include <os/mm.h>
file.h 的引用(Include)关系图:
此图展示该文件直接或间接的被哪些文件引用了:

浏览源代码.

struct  fd
 
struct  ring_buffer
 
struct  pipe
 

宏定义

#define O_RDONLY   0x00
 
#define O_WRONLY   0x01
 
#define O_RDWR   0x02
 
#define O_CREATE   0x40
 
#define O_DIRECTORY   0x0200000
 
#define AT_FDCWD   -100
 
#define AT_REMOVEDIR   0x200 /* Remove directory instead of unlinking file. */
 
#define MAX_NAME_LEN   256
 
#define MAX_FD   200
 
#define RING_BUFFER_SIZE   4095
 
#define PIPE_NUM   200
 
#define min(x, y)   ((x) < (y) ? (x) : (y))
 

类型定义

typedef uint32_t fd_num_t
 
typedef uint32_t pipe_num_t
 
typedef uint64_t dev_t
 
typedef uint64_t ino_t
 
typedef uint32_t mode_t
 
typedef uint32_t nlink_t
 
typedef uint32_t uid_t
 
typedef uint32_t gid_t
 
typedef int64_t off_t
 
typedef struct fd fd_t
 
typedef struct pipe pipe_t
 

函数

int fd_table_init ()
 
int fd_alloc ()
 
fd_tfd_alloc_spec (int fd)
 
int fd_free (int fd)
 
fd_tget_fd (int fd)
 
int pipe_alloc (int *fd)
 
void ring_buffer_init (struct ring_buffer *rbuf)
 
size_t read_ring_buffer (struct ring_buffer *rbuf, uint8_t *buf, size_t size)
 
size_t write_ring_buffer (struct ring_buffer *rbuf, uint8_t *buf, size_t size)
 

变量

fd_t fd_table [MAX_FD]
 
pipe_t pipe_table [PIPE_NUM]
 

宏定义说明

◆ AT_FDCWD

#define AT_FDCWD   -100

◆ AT_REMOVEDIR

#define AT_REMOVEDIR   0x200 /* Remove directory instead of unlinking file. */

◆ MAX_FD

#define MAX_FD   200

◆ MAX_NAME_LEN

#define MAX_NAME_LEN   256

◆ min

#define min (   x,
 
)    ((x) < (y) ? (x) : (y))

◆ O_CREATE

#define O_CREATE   0x40

◆ O_DIRECTORY

#define O_DIRECTORY   0x0200000

◆ O_RDONLY

#define O_RDONLY   0x00

◆ O_RDWR

#define O_RDWR   0x02

◆ O_WRONLY

#define O_WRONLY   0x01

◆ PIPE_NUM

#define PIPE_NUM   200

◆ RING_BUFFER_SIZE

#define RING_BUFFER_SIZE   4095

类型定义说明

◆ dev_t

typedef uint64_t dev_t

◆ fd_num_t

typedef uint32_t fd_num_t

◆ fd_t

typedef struct fd fd_t

◆ gid_t

typedef uint32_t gid_t

◆ ino_t

typedef uint64_t ino_t

◆ mode_t

typedef uint32_t mode_t

◆ nlink_t

typedef uint32_t nlink_t

◆ off_t

typedef int64_t off_t

◆ pipe_num_t

typedef uint32_t pipe_num_t

◆ pipe_t

typedef struct pipe pipe_t

◆ uid_t

typedef uint32_t uid_t

函数说明

◆ fd_alloc()

int fd_alloc ( )

◆ fd_alloc_spec()

fd_t* fd_alloc_spec ( int  fd)

◆ fd_free()

int fd_free ( int  fd)

◆ fd_table_init()

int fd_table_init ( )

◆ get_fd()

fd_t* get_fd ( int  fd)

◆ pipe_alloc()

int pipe_alloc ( int *  fd)

◆ read_ring_buffer()

size_t read_ring_buffer ( struct ring_buffer rbuf,
uint8_t *  buf,
size_t  size 
)

◆ ring_buffer_init()

void ring_buffer_init ( struct ring_buffer rbuf)

◆ write_ring_buffer()

size_t write_ring_buffer ( struct ring_buffer rbuf,
uint8_t *  buf,
size_t  size 
)

变量说明

◆ fd_table

fd_t fd_table[MAX_FD]
extern

◆ pipe_table

pipe_t pipe_table[PIPE_NUM]
extern