OpenOCD
helper/fileio.c File Reference
Include dependency graph for helper/fileio.c:

Go to the source code of this file.

Data Structures

struct  fileio
 

Functions

int fileio_close (struct fileio *fileio)
 
static int fileio_close_local (struct fileio *fileio)
 
int fileio_feof (struct fileio *fileio)
 
int fileio_fgets (struct fileio *fileio, size_t size, void *buffer)
 
static int fileio_local_fgets (struct fileio *fileio, size_t size, void *buffer)
 
static int fileio_local_read (struct fileio *fileio, size_t size, void *buffer, size_t *size_read)
 
static int fileio_local_write (struct fileio *fileio, size_t size, const void *buffer, size_t *size_written)
 
int fileio_open (struct fileio **fileio, const char *url, enum fileio_access access_type, enum fileio_type type)
 
static int fileio_open_local (struct fileio *fileio)
 
int fileio_read (struct fileio *fileio, size_t size, void *buffer, size_t *size_read)
 
int fileio_read_u32 (struct fileio *fileio, uint32_t *data)
 
int fileio_seek (struct fileio *fileio, size_t position)
 
int fileio_size (struct fileio *fileio, size_t *size)
 FIX!!!! More...
 
int fileio_write (struct fileio *fileio, size_t size, const void *buffer, size_t *size_written)
 
int fileio_write_u32 (struct fileio *fileio, uint32_t data)
 

Function Documentation

◆ fileio_close()

int fileio_close ( struct fileio fileio)

◆ fileio_close_local()

static int fileio_close_local ( struct fileio fileio)
inlinestatic

◆ fileio_feof()

int fileio_feof ( struct fileio fileio)

Definition at line 146 of file helper/fileio.c.

References fileio::file.

Referenced by image_ihex_buffer_complete_inner(), and image_mot_buffer_complete_inner().

◆ fileio_fgets()

int fileio_fgets ( struct fileio fileio,
size_t  size,
void *  buffer 
)

◆ fileio_local_fgets()

static int fileio_local_fgets ( struct fileio fileio,
size_t  size,
void *  buffer 
)
static

Definition at line 198 of file helper/fileio.c.

References buffer, ERROR_FILEIO_OPERATION_FAILED, ERROR_OK, fileio::file, and size.

Referenced by fileio_fgets().

◆ fileio_local_read()

static int fileio_local_read ( struct fileio fileio,
size_t  size,
void *  buffer,
size_t *  size_read 
)
static

Definition at line 165 of file helper/fileio.c.

References buffer, ERROR_OK, fileio::file, and size.

Referenced by fileio_read(), and fileio_read_u32().

◆ fileio_local_write()

static int fileio_local_write ( struct fileio fileio,
size_t  size,
const void *  buffer,
size_t *  size_written 
)
static

Definition at line 211 of file helper/fileio.c.

References buffer, ERROR_OK, fileio::file, and size.

Referenced by fileio_write().

◆ fileio_open()

int fileio_open ( struct fileio **  fileio,
const char *  url,
enum fileio_access  access_type,
enum fileio_type  type 
)

◆ fileio_open_local()

◆ fileio_read()

int fileio_read ( struct fileio fileio,
size_t  size,
void *  buffer,
size_t *  size_read 
)

◆ fileio_read_u32()

int fileio_read_u32 ( struct fileio fileio,
uint32_t *  data 
)

Definition at line 182 of file helper/fileio.c.

References be_to_h_u32(), ERROR_OK, and fileio_local_read().

Referenced by COMMAND_HANDLER().

◆ fileio_seek()

◆ fileio_size()

int fileio_size ( struct fileio fileio,
size_t *  size 
)

FIX!!!!

For now this can not fail, but that's because a seek was executed on startup.

Avoiding the seek on startup opens up for using streams.

Definition at line 259 of file helper/fileio.c.

References ERROR_OK, fileio::size, and size.

Referenced by COMMAND_HANDLER(), COMMAND_HELPER(), image_ihex_buffer_complete_inner(), image_mot_buffer_complete_inner(), and image_open().

◆ fileio_write()

int fileio_write ( struct fileio fileio,
size_t  size,
const void *  buffer,
size_t *  size_written 
)

◆ fileio_write_u32()

int fileio_write_u32 ( struct fileio fileio,
uint32_t  data 
)

Definition at line 235 of file helper/fileio.c.

References ERROR_OK, fileio_write(), and h_u32_to_be().

Referenced by COMMAND_HANDLER().