PatchworkOS  966e257
A non-POSIX operating system.
Loading...
Searching...
No Matches
file.c File Reference
#include "file.h"
#include <errno.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/io.h>
Include dependency graph for file.c:

Go to the source code of this file.

Functions

_file_flags_t _file_flags_parse (const char *mode)
 
FILE_file_new (void)
 
void _file_free (FILE *stream)
 
uint64_t _file_init (FILE *stream, fd_t fd, _file_flags_t flags, void *buffer, uint64_t bufferSize)
 
void _file_deinit (FILE *stream)
 
uint64_t _file_flush_buffer (FILE *stream)
 
uint64_t _file_fill_buffer (FILE *stream)
 
uint64_t _file_seek (FILE *stream, int64_t offset, int whence)
 
uint64_t _file_prepare_read (FILE *stream)
 
uint64_t _file_prepare_write (FILE *stream)
 
void _files_init (void)
 
void _files_push (FILE *file)
 
void _files_remove (FILE *file)
 
void _files_close (void)
 
uint64_t _files_flush (void)
 

Variables

static list_t files
 
static mtx_t filesMtx
 

Function Documentation

◆ _file_flags_parse()

_file_flags_t _file_flags_parse ( const char *  mode)

Definition at line 12 of file file.c.

Here is the caller graph for this function:

◆ _file_new()

FILE * _file_new ( void  )

Definition at line 80 of file file.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _file_free()

void _file_free ( FILE stream)

Definition at line 92 of file file.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _file_init()

uint64_t _file_init ( FILE stream,
fd_t  fd,
_file_flags_t  flags,
void *  buffer,
uint64_t  bufferSize 
)

Definition at line 100 of file file.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _file_deinit()

void _file_deinit ( FILE stream)

Definition at line 146 of file file.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _file_flush_buffer()

uint64_t _file_flush_buffer ( FILE stream)
Todo:
Text stream conversion here

Definition at line 158 of file file.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _file_fill_buffer()

uint64_t _file_fill_buffer ( FILE stream)

Definition at line 177 of file file.c.

Here is the call graph for this function:

◆ _file_seek()

uint64_t _file_seek ( FILE stream,
int64_t  offset,
int  whence 
)

Definition at line 202 of file file.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _file_prepare_read()

uint64_t _file_prepare_read ( FILE stream)

Definition at line 224 of file file.c.

Here is the caller graph for this function:

◆ _file_prepare_write()

uint64_t _file_prepare_write ( FILE stream)

Definition at line 239 of file file.c.

Here is the caller graph for this function:

◆ _files_init()

void _files_init ( void  )

Definition at line 254 of file file.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _files_push()

void _files_push ( FILE file)

Definition at line 264 of file file.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _files_remove()

void _files_remove ( FILE file)

Definition at line 271 of file file.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _files_close()

void _files_close ( void  )

Definition at line 278 of file file.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _files_flush()

uint64_t _files_flush ( void  )

Definition at line 292 of file file.c.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ files

list_t files
static

Definition at line 9 of file file.c.

◆ filesMtx

mtx_t filesMtx
static

Definition at line 10 of file file.c.