#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include "fsaccess.h"
#include "compiler.h"
#include "file.h"
#include "navigation.h"
#include "ctrl_access.h"
Go to the source code of this file.
Variables |
static unsigned int | pvNavUsed = 0 |
| bitfield for navigator currently used. bit[0..31] is 1 if used, 0 if not.
|
Function Documentation
bool b_fsaccess_init |
( |
void |
| ) |
|
- Parameters:
-
- Returns:
- int : -1 if error, 0 otherwise
Definition at line 273 of file fsaccess.c.
long fsaccess_alloc_nav_id |
( |
void |
| ) |
|
- Returns:
- long : Id navigator allocated or -1 if none free
Definition at line 300 of file fsaccess.c.
size_t fsaccess_file_get_size |
( |
int |
fd | ) |
|
- Parameters:
-
- Returns:
- size_t : size of the file pointed to by the descriptor
Definition at line 181 of file fsaccess.c.
void fsaccess_free_nav_id |
( |
int |
fd | ) |
|
void fsaccess_give_mutex |
( |
void |
| ) |
|
int8_t fsaccess_IsDirPresent |
( |
const char * |
pcStringDirName | ) |
|
- Parameters:
-
pcStringDirName | Input. Directory name string. |
- Returns:
- 1 if the directory exists, 0 if the directory doesn't exist, else -1
Definition at line 380 of file fsaccess.c.
void fsaccess_take_mutex |
( |
void |
| ) |
|
int open |
( |
const char * |
pathname, |
|
|
int |
flags, |
|
|
|
... |
|
) |
| |
This function opens a file.
This function opens a file.
- Parameters:
-
pathname | path of the file to open. |
flags | flags to give file access rights should be O_CREAT : create file if not exist O_APPEND : add data to the end of file O_RDONLY : Read Only O_WRONLY : Write Only O_RDWR : Read/Write |
- Returns:
- int : file descriptor (>= 0 if OK (NavID), -1 otherwise)
Definition at line 106 of file fsaccess.c.
ssize_t read |
( |
int |
fd, |
|
|
void * |
buf, |
|
|
size_t |
count |
|
) |
| |
- Parameters:
-
fd | file descriptor. |
buf | pointer for data that are read. |
count | amount of bytes to read |
- Returns:
- ssize_t : amount of data read (-1 if error)
Definition at line 209 of file fsaccess.c.
ssize_t write |
( |
int |
fd, |
|
|
const void * |
buf, |
|
|
size_t |
count |
|
) |
| |
- Parameters:
-
fd | file descriptor. |
buf | pointer from where data are written. |
count | amount of bytes to write |
- Returns:
- ssize_t : amount of data written (-1 if error)
Definition at line 246 of file fsaccess.c.
Variable Documentation
unsigned int pvNavUsed = 0 |
|
static |