ASF docs  3.1.3
Some important library documentation
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
fsaccess.h File Reference
#include <stdio.h>
#include "file.h"
#include "navigation.h"
#include "ctrl_access.h"
+ Include dependency graph for fsaccess.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define O_RDONLY   0
#define O_WRONLY   0x0001
#define O_RDWR   0x0002
#define O_APPEND   0x0008
#define O_CREAT   0x0200

Typedefs

typedef signed int ssize_t

Functions

int open (const char *pathname, int flags,...)
 This function opens a file.
size_t fsaccess_file_get_size (int fd)
 This function returns the opened file size.
ssize_t read (int fd, void *buf, size_t count)
 This function reads from a file.
ssize_t write (int fd, const void *buf, size_t count)
 This function writes to a file.
int close (int fd)
 This function closes a file.
long fsaccess_alloc_nav_id (void)
 This function returns a free navigator id.
void fsaccess_free_nav_id (int fd)
 This function frees a navigator id.
bool b_fsaccess_init (void)
 This function initializes mutex and navigators.
void fsaccess_take_mutex (void)
 This function gives the mutex to the caller.
void fsaccess_give_mutex (void)
 This function frees the mutex.
int8_t fsaccess_IsDirPresent (const char *pcStringDirName)
 Is a directory present?

Macro Definition Documentation

#define O_APPEND   0x0008

Definition at line 62 of file fsaccess.h.

#define O_CREAT   0x0200

Definition at line 63 of file fsaccess.h.

#define O_RDONLY   0

Definition at line 59 of file fsaccess.h.

#define O_RDWR   0x0002

Definition at line 61 of file fsaccess.h.

#define O_WRONLY   0x0001

Definition at line 60 of file fsaccess.h.


Typedef Documentation

typedef signed int ssize_t

Definition at line 66 of file fsaccess.h.


Function Documentation

bool b_fsaccess_init ( void  )

Definition at line 333 of file fsaccess.c.

int close ( int  fd)
Parameters:
fdfile descriptor.
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:
fdfile descriptor.
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)
Parameters:
fdfile descriptor.

Definition at line 324 of file fsaccess.c.

void fsaccess_give_mutex ( void  )

Definition at line 364 of file fsaccess.c.

int8_t fsaccess_IsDirPresent ( const char *  pcStringDirName)
Parameters:
pcStringDirNameInput. 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  )

Definition at line 353 of file fsaccess.c.

int open ( const char *  pathname,
int  flags,
  ... 
)
Parameters:
pathnamepath of the file to open.
flagsflags 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)

This function opens a file.

This function opens a file.

Parameters:
pathnamepath of the file to open.
flagsflags 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:
fdfile descriptor.
bufpointer for data that are read.
countamount 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:
fdfile descriptor.
bufpointer from where data are written.
countamount of bytes to write
Returns:
ssize_t : amount of data written (-1 if error)

Definition at line 246 of file fsaccess.c.