Libtrap: Internal development docs  1.16.1
Modules | Functions
Collaboration diagram for file interface module:

Modules

 File_receiver
 
 File_sender
 

Functions

void file_destroy (void *priv)
 Close file and free allocated memory. More...
 
void file_terminate (void *priv)
 Set interface state as terminated. More...
 
int _mkdir (const char *path)
 Create path, recursive. More...
 
static void file_create_dump (void *priv, uint32_t idx, const char *path)
 Create file dump with current configuration (for debugging) More...
 
int create_next_filename (file_private_t *config)
 Create a new path and filename from the template created during interface initialization. New filename is stored in file_private_t->filename. More...
 
int switch_file (file_private_t *c)
 Close previous file, open next file (name taken in file_private_t->filename). Negotiation must be performed after changing the file. More...
 
void switch_file_wrapper (void *priv)
 

Detailed Description

Function Documentation

◆ _mkdir()

int _mkdir ( const char *  path)

Create path, recursive.

Author Jonathon Reinhart Adapted from https://gist.github.com/JonathonReinhart/8c0d90191c38af2dcadb102c4e202950

Parameters
[in]pathwhere file will be created
Returns
0 on success, -1 otherwise

Definition at line 122 of file ifc_file.c.

◆ create_next_filename()

int create_next_filename ( file_private_t config)

Create a new path and filename from the template created during interface initialization. New filename is stored in file_private_t->filename.

Parameters
[in,out]configPointer to module private data.
Returns
TRAP_E_OK on success, TRAP_E_MEMORY if function time(NULL) returns -1, TRAP_E_IO_ERROR if error occurs during directory creation, TRAP_E_BADPARAMS if the specified path and filename exceeds MAX_PATH - 1 bytes.

Definition at line 194 of file ifc_file.c.

◆ file_create_dump()

static void file_create_dump ( void *  priv,
uint32_t  idx,
const char *  path 
)
static

Create file dump with current configuration (for debugging)

Parameters
[in]privpointer to module private data
[in]idxnumber of interface
[in]pathpath where dump file will be created

Definition at line 158 of file ifc_file.c.

◆ file_destroy()

void file_destroy ( void *  priv)

Close file and free allocated memory.

Parameters
[in]privpointer to module private data

Definition at line 74 of file ifc_file.c.

◆ file_terminate()

void file_terminate ( void *  priv)

Set interface state as terminated.

Parameters
[in]privpointer to module private data

Definition at line 106 of file ifc_file.c.

◆ switch_file()

int switch_file ( file_private_t c)

Close previous file, open next file (name taken in file_private_t->filename). Negotiation must be performed after changing the file.

Parameters
[in,out]cPointer to module private data.
Returns
TRAP_E_OK on success, TRAP_E_BADPARAMS if the next file cannot be opened.

Definition at line 277 of file ifc_file.c.

◆ switch_file_wrapper()

void switch_file_wrapper ( void *  priv)

Definition at line 539 of file ifc_file.c.