fplayer
C99 Falcon Sequence (fseq) file player for Light-O-Rama hardware (like xLights)
Loading...
Searching...
No Matches
fc.h
Go to the documentation of this file.
1
3#ifndef FPLAYER_FC_H
4#define FPLAYER_FC_H
5
6#include <stdint.h>
7
11struct FC;
12
19
24struct FC* FC_open(const char* fp, enum fc_mode_t mode);
25
28void FC_close(struct FC* fc);
29
38uint32_t FC_read(struct FC* fc, uint32_t offset, uint32_t size, uint8_t* b);
39
50uint32_t FC_readto(struct FC* fc,
51 uint32_t offset,
52 uint32_t size,
53 uint32_t maxCount,
54 uint8_t* b);
55
64uint32_t
65FC_write(struct FC* fc, uint32_t offset, uint32_t size, const uint8_t* b);
66
72uint32_t FC_filesize(struct FC* fc);
73
74#endif//FPLAYER_FC_H
uint32_t FC_readto(struct FC *fc, uint32_t offset, uint32_t size, uint32_t maxCount, uint8_t *b)
Reads up to the given number of bytes from the file controller starting at the given offset,...
Definition fc.c:58
uint32_t FC_filesize(struct FC *fc)
Returns the size of the file backing the given file controller. This performs a seek to the end of th...
Definition fc.c:83
struct FC * FC_open(const char *fp, enum fc_mode_t mode)
Opens a file controller instance for the given file path and mode.
Definition fc.c:16
void FC_close(struct FC *fc)
Closes the given file controller instance and frees its resources.
Definition fc.c:39
uint32_t FC_write(struct FC *fc, uint32_t offset, uint32_t size, const uint8_t *b)
Writes the given number of bytes to the file controller starting at the given offset.
Definition fc.c:71
uint32_t FC_read(struct FC *fc, uint32_t offset, uint32_t size, uint8_t *b)
Reads the given number of bytes from the file controller starting at the given offset.
Definition fc.c:47
fc_mode_t
File controller open mode.
Definition fc.h:15
@ FC_MODE_WRITE
Equivalent to "wb".
Definition fc.h:17
@ FC_MODE_READ
Equivalent to "rb".
Definition fc.h:16
File controller that wraps a stdlib file pointer and provides additional functionality for reading fi...
Definition fc.c:10
char * fp
Duplicate of filepath provided to FC_open.
Definition fc.c:11