ESP8266 ILI9341 display support code with printf sources, wire-frame viewer and custom fonts
1.0
ESP8266ILI9341DisplayProject
|
POSIX wrapper for FatFS. More...
Go to the source code of this file.
Data Structures | |
struct | stat |
POSIX stat structure. More... | |
struct | utimbuf |
POSIX utimbuf structure. More... | |
struct | dirent |
struct | __file |
FILE type structure. More... | |
Macros | |
#define | POSIX |
#define | MAX_NAME_LEN 13 |
#define | lstat stat |
POSIX lstat() More... | |
#define | __SRD 0x0001 /* OK to read */ |
#define | __SWR 0x0002 /* OK to write */ |
#define | __SSTR 0x0004 /* this is an sprintf/snprintf string */ |
#define | __SPGM 0x0008 /* fmt string is in progmem */ |
#define | __SERR 0x0010 /* found error */ |
#define | __SEOF 0x0020 /* found EOF */ |
#define | __SUNGET 0x040 /* ungetc() happened */ |
#define | __SMALLOC 0x80 /* handle is malloc()ed */ |
#define | O_ACCMODE 00000003 /*< read, write, read-write modes */ |
POSIX open modes - no other combination are allowed. More... | |
#define | O_RDONLY 00000000 /*< Read only */ |
#define | O_WRONLY 00000001 /*< Write only */ |
#define | O_RDWR 00000002 /*< Read/Write */ |
#define | O_CREAT 00000100 /*< Create file only if it does not exist */ |
#define | O_EXCL |
#define | O_NOCTTY 00000400 /*< @todo */ |
#define | O_TRUNC 00001000 /*< Truncate if exists */ |
#define | O_APPEND 00002000 /*< All writes are to EOF */ |
#define | O_NONBLOCK 00004000 /*< @todo */ |
#define | O_BINARY 00000004 /*< Binary */ |
#define | O_TEXT 00000004 /*< Text End Of Line translation */ |
#define | S_IFMT 0170000 /*< These bits determine file type. */ |
POSIX File types, see fstat and stat. More... | |
#define | S_IFDIR 0040000 /*< Directory. */ |
#define | S_IFCHR 0020000 /*< Character device. */ |
#define | S_IFBLK 0060000 /*< Block device. */ |
#define | S_IFREG 0100000 /*< Regular file. */ |
#define | S_IFIFO 0010000 /*< FIFO. */ |
#define | S_IFLNK 0120000 /*< Symbolic link. */ |
#define | S_IFSOCK 0140000 /*< Socket. */ |
#define | S_IREAD 0400 /*< Read by owner. */ |
#define | S_IWRITE 0200 /*< Write by owner. */ |
#define | S_IEXEC 0100 /*< Execute by owner. */ |
#define | S_ISTYPE(mode, mask) (((mode) & S_IFMT) == (mask)) |
POSIX File type test macros. More... | |
#define | S_ISDIR(mode) S_ISTYPE((mode), S_IFDIR) |
#define | S_ISCHR(mode) S_ISTYPE((mode), S_IFCHR) |
#define | S_ISBLK(mode) S_ISTYPE((mode), S_IFBLK) |
#define | S_ISREG(mode) S_ISTYPE((mode), S_IFREG) |
#define | S_IRUSR S_IREAD /*< Read by owner. */ |
#define | S_IWUSR S_IWRITE /*< Write by owner. */ |
#define | S_IXUSR S_IEXEC /*< Execute by owner. */ |
#define | S_IRWXU (S_IREAD|S_IWRITE|S_IEXEC) /*< Read,Write,Execute by owner */ |
#define | S_IRGRP (S_IRUSR >> 3) /*< Read by group. */ |
#define | S_IWGRP (S_IWUSR >> 3) /*< Write by group. */ |
#define | S_IXGRP (S_IXUSR >> 3) /*< Execute by group. */ |
#define | S_IRWXG (S_IRWXU >> 3) /*< Read,Write,Execute by user */ |
#define | S_IROTH (S_IRGRP >> 3) /*< Read by others. */ |
#define | S_IWOTH (S_IWGRP >> 3) /*< Write by others. */ |
#define | S_IXOTH (S_IXGRP >> 3) /*< Execute by others. */ |
#define | S_IRWXO (S_IRWXG >> 3) /*< Read,Write,Execute by other */ |
#define | modecmp(str, pat) (strcmp(str, pat) == 0 ? 1: 0) |
used in posix.c to compare to ascii file modes More... | |
#define | FATFS_R (S_IRUSR | S_IRGRP | S_IROTH) /*< FatFs Read perms */ |
FATFS open modes. More... | |
#define | FATFS_W (S_IWUSR | S_IWGRP | S_IWOTH) /*< FatFs Write perms */ |
#define | FATFS_X (S_IXUSR | S_IXGRP | S_IXOTH) /*< FatFs Execute perms */ |
#define | EOF (-1) |
End of file or device read. More... | |
#define | SEEK_SET 0 |
Seek offset macros. More... | |
#define | SEEK_CUR 1 |
#define | SEEK_END 2 |
#define | MAX_FILES 16 |
Maximum number of POSIX file handles. More... | |
#define | stdin (__iob[0]) |
define stdin, stdout and stderr More... | |
#define | stdout (__iob[1]) |
#define | stderr (__iob[2]) |
#define | fdev_set_udata(stream, u) do { (stream)->udata = u; } while(0) |
device IO udata More... | |
#define | fdev_get_udata(stream) ((stream)->udata) |
#define | _FDEV_EOF (-1) |
device status flags More... | |
#define | _FDEV_ERR (-2) |
#define | _FDEV_SETUP_READ __SRD |
#define | _FDEV_SETUP_WRITE __SWR |
#define | _FDEV_SETUP_RW (__SRD|__SWR) |
Typedefs | |
typedef uint32_t | dev_t |
make sure we use our EDOM and ERANGE values More... | |
typedef uint32_t | ino_t |
typedef uint32_t | mode_t |
typedef uint32_t | nlink_t |
typedef uint16_t | uid_t |
typedef uint16_t | gid_t |
typedef uint32_t | off_t |
typedef uint32_t | blkcnt_t |
typedef uint32_t | blksize_t |
typedef uint32_t | time_t |
typedef int32_t | ssize_t |
typedef struct utimbuf | utime_t |
POSIX utimbuf structure. More... | |
typedef struct dirent | dirent_t |
typedef struct __file | FILE |
define FILE type More... | |
Enumerations | |
enum | POSIX_errno { EOK, EPERM, ENOENT, ESRCH, EINTR, EIO, ENXIO, E2BIG, ENOEXEC, EBADF, ECHILD, EAGAIN, ENOMEM, EACCES, EFAULT, ENOTBLK, EBUSY, EEXIST, EXDEV, ENODEV, ENOTDIR, EISDIR, EINVAL, ENFILE, EMFILE, ENOTTY, ETXTBSY, EFBIG, ENOSPC, ESPIPE, EROFS, EMLINK, EPIPE, EDOM, ERANGE, EBADMSG } |
Functions | |
MEMSPACE int | isatty (int fileno) |
Test POSIX fileno if it is a Serial Console/TTY. More... | |
MEMSPACE int | fgetc (FILE *stream) |
Get byte from a TTY device or FatFs file stream open() or fopen() sets stream->get = fatfs_getc() for FatFs functions See fdevopen() sets stream->get for TTY devices. More... | |
MEMSPACE int | fputc (int c, FILE *stream) |
Put a byte to TTY device or FatFs file stream open() or fopen() sets stream->put = fatfs_outc() for FatFs functions See fdevopen() sets stream->put get for TTY devices. More... | |
MEMSPACE int | getchar (void) |
functions normally defined as macros More... | |
MEMSPACE int | putchar (int c) |
put a character to stdout See fdevopen() sets stream->put get for TTY devices More... | |
MEMSPACE int | ungetc (int c, FILE *stream) |
Un-Get byte from a TTY device or FatFs file stream. More... | |
MEMSPACE int | putc (int c, FILE *stream) |
Put a character to a stream See fdevopen() sets stream->put get for TTY devices. More... | |
MEMSPACE char * | fgets (char *str, int size, FILE *stream) |
get a string from stdin See fdevopen() sets stream->put get for TTY devices More... | |
MEMSPACE int | fputs (const char *str, FILE *stream) |
put a string to stdout See fdevopen() sets stream->put get for TTY devices More... | |
MEMSPACE int | puts (const char *str) |
put a string to stdout See fdevopen() sets stream->put get for TTY devices More... | |
MEMSPACE int | feof (FILE *stream) |
feof reports if the stream is at EOF More... | |
MEMSPACE int | fgetpos (FILE *stream, size_t *pos) |
POSIX get position of file stream. More... | |
MEMSPACE int | fseek (FILE *stream, long offset, int whence) |
POSIX seek to file possition. More... | |
MEMSPACE int | fsetpos (FILE *stream, size_t *pos) |
POSIX set position of file stream. More... | |
MEMSPACE long | ftell (FILE *stream) |
POSIX file position of open stream. More... | |
MEMSPACE off_t | lseek (int fileno, off_t position, int whence) |
POSIX seek to file position. More... | |
MEMSPACE void | rewind (FILE *stream) |
POSIX rewind file to the beginning. More... | |
MEMSPACE int | close (int fileno) |
POSIX Close a file with fileno handel. More... | |
MEMSPACE int | fileno (FILE *stream) |
Convert POSIX stream pointer to POSIX fileno (index of __iob[]) More... | |
MEMSPACE FILE * | fileno_to_stream (int fileno) |
Convert POSIX fileno to POSIX FILE stream pointer. NOT POSIX. More... | |
MEMSPACE FILE * | fopen (const char *path, const char *mode) |
POSIX Open a file with path name and ascii file mode string. More... | |
MEMSPACE size_t | fread (void *ptr, size_t size, size_t nmemb, FILE *stream) |
POSIX read nmemb elements from buf, size bytes each, to the stream fd. More... | |
MEMSPACE int | ftruncate (int fd, off_t length) |
POSIX truncate open file to length. More... | |
MEMSPACE size_t | fwrite (const void *ptr, size_t size, size_t nmemb, FILE *stream) |
POSIX write nmemb elements from buf, size bytes each, to the stream fd. More... | |
MEMSPACE int | open (const char *pathname, int flags) |
POSIX Open a file with integer mode flags. More... | |
MEMSPACE ssize_t | read (int fd, const void *buf, size_t count) |
POSIX read count bytes from *buf to fileno fd. More... | |
MEMSPACE void | sync (void) |
POSIX Sync all pending file changes and metadata on ALL files. More... | |
MEMSPACE int | syncfs (int fd) |
POSIX Sync pending file changes and metadata for specified fileno. More... | |
MEMSPACE int | truncate (const char *path, off_t length) |
POSIX truncate named file to length. More... | |
MEMSPACE ssize_t | write (int fd, const void *buf, size_t count) |
POSIX Write count bytes from *buf to fileno fd. More... | |
MEMSPACE int | fclose (FILE *stream) |
POSIX close a file stream. More... | |
MEMSPACE void | dump_stat (struct stat *sp) |
Display struct stat, from POSIX stat(0 or fstat(), in ASCII. NOT POSIX. More... | |
MEMSPACE char * | mctime (time_t timev) |
Display Ascii formatted time from timev seconds NOT POSIX. More... | |
MEMSPACE int | stat (char *name, struct stat *buf) |
POSIX stat - get file status of named file. More... | |
MEMSPACE char * | basename (char *str) |
POSIX Basename of filename. More... | |
MEMSPACE char * | baseext (char *str) |
File extention of a file name. NOT POSIX. More... | |
MEMSPACE int | chdir (const char *pathname) |
POSIX change directory. More... | |
MEMSPACE int | chmod (const char *pathname, mode_t mode) |
POSIX chmod function - change file access permission Unfortunately file f_open modes and f_chmod modes are not the same Files that are open have way more options - but only while the file is open. More... | |
MEMSPACE int | dirname (char *str) |
POSIX directory name of a filename. Return the index of the last '/' character. More... | |
MEMSPACE int | utime (const char *filename, const struct utimbuf *times) |
Set Modification and Access time of a file. More... | |
MEMSPACE char * | getcwd (char *pathname, int len) |
POSIX get current working directory. More... | |
MEMSPACE int | mkdir (const char *pathname, mode_t mode) |
POSIX make a directory. More... | |
MEMSPACE int | rename (const char *oldpath, const char *newpath) |
POSIX rename a file by name. More... | |
MEMSPACE int | rmdir (const char *pathname) |
POSIX delete a directory. More... | |
MEMSPACE int | unlink (const char *pathname) |
POSIX delete a file. More... | |
int | closedir (DIR *dirp) |
POSIX closedir. More... | |
DIR * | opendir (const char *pathdir) |
struct dirent * | readdir (DIR *dirp) |
MEMSPACE void | clrerror (FILE *stream) |
clrerror resets stream EOF and error flags More... | |
MEMSPACE int | ferror (FILE *stream) |
ferror reports if the stream has an error flag set More... | |
MEMSPACE void | perror (const char *s) |
POSIX perror() - convert POSIX errno to text with user message. More... | |
MEMSPACE char WEAK_ATR * | strerror (int errnum) |
POSIX strerror() - convert POSIX errno to text with user message. More... | |
MEMSPACE char * | strerror_r (int errnum, char *buf, size_t buflen) |
POSIX strerror_r() - convert POSIX errno to text with user message. More... | |
MEMSPACE FILE * | fdevopen (int(*put)(char, FILE *), int(*get)(FILE *)) |
Device open functions. More... | |
MEMSPACE int | mkfs (char *name) |
Formt SD card. More... | |
MEMSPACE int | fatfs_getc (FILE *stream) |
Private FatFs function called by fgetc() to get a byte from file stream FIXME buffer this function call NOT POSIX open() assigns stream->get = fatfs_getc() More... | |
MEMSPACE int | fatfs_putc (char c, FILE *stream) |
Private FatFs function called by fputc() to put a byte from file stream NOT POSIX open() assigns stream->put = fatfs_putc() More... | |
MEMSPACE int | fatfs_to_errno (FRESULT Result) |
Convert FafFs error result to POSIX errno. NOT POSIX. More... | |
MEMSPACE int | fatfs_to_fileno (FIL *fh) |
Convert FatFS file handle to POSIX fileno. NOT POSIX. More... | |
MEMSPACE time_t | fat_time_to_unix (uint16_t date, uint16_t time) |
Convert FatFs file date and time to POSIX epoch seconds. NOT POSIX. More... | |
MEMSPACE void | unix_time_to_fat (time_t epoch, uint16_t *date, uint16_t *time) |
Convert Linux POSIX time_t to FAT32 date and time. NOT POSIX. More... | |
MEMSPACE FIL * | fileno_to_fatfs (int fileno) |
Convert POSIX fileno to FatFS handle NOT POSIX. More... | |
MEMSPACE int | free_file_descriptor (int fileno) |
Free POSIX fileno FILE descriptor. NOT POSIX. More... | |
MEMSPACE int | new_file_descriptor (void) |
Allocate a POSIX FILE descriptor. NOT POSIX. More... | |
MEMSPACE int | posix_fopen_modes_to_open (const char *mode) |
Convert POSIX fopen mode to POSIX open mode flags. NOT POSIX. More... | |
MEMSPACE int | fprintf (FILE *fp, const char *format,...) |
fprintf function Example user defined printf function using fputc for I/O This method allows I/O to devices and strings without typical C++ overhead More... | |
Variables | |
FILE * | __iob [MAX_FILES] |
POSIX fileno to POSIX FILE stream table. More... | |
POSIX wrapper for FatFS.
This is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
Definition in file posix.h.
#define __SEOF 0x0020 /* found EOF */ |
Definition at line 165 of file posix.h.
Referenced by clrerror(), fatfs_getc(), fatfs_putc(), feof(), fgetc(), and ungetc().
#define __SERR 0x0010 /* found error */ |
Definition at line 164 of file posix.h.
Referenced by clrerror(), ferror(), and fgetc().
#define __SMALLOC 0x80 /* handle is malloc()ed */ |
Definition at line 167 of file posix.h.
Referenced by fdevopen(), and free_file_descriptor().
#define __SRD 0x0001 /* OK to read */ |
Definition at line 160 of file posix.h.
Referenced by fdevopen(), fgetc(), and ungetc().
#define __SSTR 0x0004 /* this is an sprintf/snprintf string */ |
#define __SUNGET 0x040 /* ungetc() happened */ |
#define __SWR 0x0002 /* OK to write */ |
Definition at line 161 of file posix.h.
Referenced by fdevopen(), and fputc().
#define _FDEV_SETUP_READ __SRD |
#define _FDEV_SETUP_WRITE __SWR |
#define EOF (-1) |
End of file or device read.
Definition at line 248 of file posix.h.
Referenced by buffer_getc(), buffer_gets(), fatfs_getc(), fatfs_putc(), fclose(), fgetc(), fgets(), fputc(), fputs(), putc_flush(), puts(), and ungetc().
#define fdev_get_udata | ( | stream | ) | ((stream)->udata) |
Definition at line 292 of file posix.h.
Referenced by fatfs_getc(), fatfs_putc(), fatfs_to_fileno(), fileno_to_fatfs(), and free_file_descriptor().
#define fdev_set_udata | ( | stream, | |
u | |||
) | do { (stream)->udata = u; } while(0) |
#define MAX_FILES 16 |
Maximum number of POSIX file handles.
Definition at line 260 of file posix.h.
Referenced by fatfs_to_fileno(), fileno(), fileno_to_stream(), new_file_descriptor(), and sync().
#define modecmp | ( | str, | |
pat | |||
) | (strcmp(str, pat) == 0 ? 1: 0) |
used in posix.c to compare to ascii file modes
Definition at line 238 of file posix.h.
Referenced by posix_fopen_modes_to_open().
#define O_APPEND 00002000 /*< All writes are to EOF */ |
Definition at line 195 of file posix.h.
Referenced by open(), and posix_fopen_modes_to_open().
#define O_CREAT 00000100 /*< Create file only if it does not exist */ |
Definition at line 190 of file posix.h.
Referenced by open(), and posix_fopen_modes_to_open().
#define O_EXCL |
#define O_RDONLY 00000000 /*< Read only */ |
Definition at line 187 of file posix.h.
Referenced by open(), and posix_fopen_modes_to_open().
#define O_RDWR 00000002 /*< Read/Write */ |
Definition at line 189 of file posix.h.
Referenced by open(), and posix_fopen_modes_to_open().
#define O_TRUNC 00001000 /*< Truncate if exists */ |
Definition at line 194 of file posix.h.
Referenced by open(), and posix_fopen_modes_to_open().
#define O_WRONLY 00000001 /*< Write only */ |
Definition at line 188 of file posix.h.
Referenced by posix_fopen_modes_to_open().
#define S_IFDIR 0040000 /*< Directory. */ |
#define S_IFMT 0170000 /*< These bits determine file type. */ |
#define S_IFREG 0100000 /*< Regular file. */ |
#define S_IRWXG (S_IRWXU >> 3) /*< Read,Write,Execute by user */ |
#define S_IRWXO (S_IRWXG >> 3) /*< Read,Write,Execute by other */ |
Definition at line 215 of file posix.h.
Referenced by dump_stat(), and ls_info().
Definition at line 218 of file posix.h.
Referenced by dump_stat().
#define S_ISTYPE | ( | mode, | |
mask | |||
) | (((mode) & S_IFMT) == (mask)) |
#define S_IWGRP (S_IWUSR >> 3) /*< Write by group. */ |
#define S_IWOTH (S_IWGRP >> 3) /*< Write by others. */ |
#define S_IWUSR S_IWRITE /*< Write by owner. */ |
#define SEEK_SET 0 |
#define stderr (__iob[2]) |
Definition at line 271 of file posix.h.
Referenced by db_calloc(), escape(), fdevopen(), fputc(), main(), read(), ReadBdf(), send_message(), and write().
#define stdin (__iob[0]) |
define stdin, stdout and stderr
Definition at line 269 of file posix.h.
Referenced by fdevopen(), getchar(), read(), setdate(), upload(), user_tasks(), and write().
#define stdout (__iob[1]) |
Definition at line 270 of file posix.h.
Referenced by fatfs_ls(), fdevopen(), fputc(), main(), putchar(), puts(), read(), timetests(), and write().
enum POSIX_errno |
MEMSPACE char* baseext | ( | char * | str | ) |
MEMSPACE char* basename | ( | char * | str | ) |
POSIX Basename of filename.
[in] | str | string to find basename in. |
Definition at line 1446 of file posix.c.
Referenced by FontHeaderInfo(), ls_info(), and main().
MEMSPACE int chdir | ( | const char * | pathname | ) |
POSIX change directory.
[in] | pathname | directory to change to |
Definition at line 1488 of file posix.c.
Referenced by posix_tests().
POSIX chmod function - change file access permission Unfortunately file f_open modes and f_chmod modes are not the same Files that are open have way more options - but only while the file is open.
man page chmod (2).
[in] | pathname | filename string. |
[in] | mode | POSIX chmod modes. |
Definition at line 1513 of file posix.c.
Referenced by mkdir(), and posix_tests().
MEMSPACE int close | ( | int | fileno | ) |
POSIX Close a file with fileno handel.
[in] | fileno | fileno of file. |
Definition at line 685 of file posix.c.
Referenced by fclose(), and send_message().
int closedir | ( | DIR * | dirp | ) |
MEMSPACE int dirname | ( | char * | str | ) |
Display struct stat, from POSIX stat(0 or fstat(), in ASCII. NOT POSIX.
[in] | sp | struct stat pointer. |
Definition at line 1260 of file posix.c.
Referenced by posix_tests().
Private FatFs function called by fgetc() to get a byte from file stream FIXME buffer this function call NOT POSIX open() assigns stream->get = fatfs_getc()
[in] | stream | POSIX stream pointer. |
Definition at line 1984 of file posix.c.
Referenced by open().
Private FatFs function called by fputc() to put a byte from file stream NOT POSIX open() assigns stream->put = fatfs_putc()
[in] | c | character. |
[in] | stream | POSIX stream pointer. |
Convert FafFs error result to POSIX errno. NOT POSIX.
[in] | Result | FatFs Result code. |
Definition at line 2114 of file posix.c.
Referenced by chdir(), chmod(), close(), closedir(), fatfs_getc(), fatfs_putc(), ftruncate(), getcwd(), lseek(), mkdir(), open(), opendir(), read(), readdir(), rename(), rmdir(), stat(), syncfs(), truncate(), unlink(), utime(), and write().
POSIX close a file stream.
[in] | stream | POSIX stream pointer. |
Definition at line 1239 of file posix.c.
Referenced by buffer_read_close(), cat(), copy(), hexdump(), logfile(), main(), MatRead(), MatWrite(), ReadBdf(), sum(), timetests(), and upload().
Get byte from a TTY device or FatFs file stream open() or fopen() sets stream->get = fatfs_getc() for FatFs functions See fdevopen() sets stream->get for TTY devices.
[in] | stream | POSIX stream pointer. |
get a string from stdin See fdevopen() sets stream->put get for TTY devices
POSIX string I/O
[in] | stream | POSIX stream pointer. |
Definition at line 420 of file posix.c.
Referenced by cat(), main(), MatRead(), ReadBdf(), setdate(), upload(), and user_tasks().
Convert POSIX stream pointer to POSIX fileno (index of __iob[])
[in] | stream | stream pointer |
Definition at line 724 of file posix.c.
Referenced by fclose(), fileno(), fileno_to_stream(), fopen(), fread(), free_file_descriptor(), fseek(), ftell(), fwrite(), open(), and ungetc().
Convert POSIX fileno to FatFS handle NOT POSIX.
[in] | fileno | fileno of file |
Definition at line 2276 of file posix.c.
Referenced by close(), ftell(), ftruncate(), lseek(), open(), read(), sync(), syncfs(), and write().
Convert POSIX fileno to POSIX FILE stream pointer. NOT POSIX.
[in] | fileno | POSIX fileno is the index of __iob[]. |
Definition at line 754 of file posix.c.
Referenced by close(), fileno_to_fatfs(), fopen(), free_file_descriptor(), lseek(), open(), read(), syncfs(), and write().
POSIX Open a file with path name and ascii file mode string.
[in] | path | filename string. |
[in] | mode | POSIX open mode strings. |
Definition at line 782 of file posix.c.
Referenced by buffer_read_open(), cat(), copy(), hexdump(), logfile(), main(), MatRead(), MatWrite(), ReadBdf(), sum(), timetests(), and upload().
fprintf function Example user defined printf function using fputc for I/O This method allows I/O to devices and strings without typical C++ overhead
[in] | *fp | FILE stream pointer |
[in] | fmt | printf forat string |
[in] | ... | vararg list or arguments |
Definition at line 2484 of file posix.c.
Referenced by Convert_Font2c(), db_calloc(), emit_data(), emit_number(), emit_str(), escape(), FontHeaderInfo(), FontPreview(), FontPreviewFull(), FontPreviewProportional(), get_date(), main(), MatWrite(), ReadBdf(), send_message(), timetests(), WriteCharacterBits(), WriteFontBits(), WriteFontBitsPreview(), WriteFontInfo(), and WriteFontTable().
Put a byte to TTY device or FatFs file stream open() or fopen() sets stream->put = fatfs_outc() for FatFs functions See fdevopen() sets stream->put get for TTY devices.
[in] | stream | POSIX stream pointer. |
Definition at line 278 of file posix.c.
Referenced by _fprintf_putc(), fputs(), putc(), putchar(), puts(), and write().
put a string to stdout See fdevopen() sets stream->put get for TTY devices
[in] | stream | POSIX stream pointer. |
POSIX read nmemb elements from buf, size bytes each, to the stream fd.
[in] | ptr | buffer. |
[in] | nmemb | number of items to read. |
[in] | size | size of each item in bytes. |
[in] | stream | POSIX file stream. |
Definition at line 803 of file posix.c.
Referenced by buffer_getc(), copy(), hexdump(), main(), and sum().
MEMSPACE int free_file_descriptor | ( | int | fileno | ) |
POSIX seek to file possition.
[in] | stream | POSIX file stream. |
[in] | offset | offset to seek to. |
[in] | whence |
|
POSIX write nmemb elements from buf, size bytes each, to the stream fd.
[in] | ptr | buffer. |
[in] | nmemb | number of items to write. |
[in] | size | size of each item in bytes. |
[in] | stream | POSIX file stream. |
MEMSPACE int getchar | ( | void | ) |
functions normally defined as macros
get a character from stdin See fdevopen() sets stream->get for TTY devices
[in] | stream | POSIX stream pointer. |
Definition at line 336 of file posix.c.
Referenced by testpage().
MEMSPACE char* getcwd | ( | char * | pathname, |
int | len | ||
) |
POSIX get current working directory.
[in] | pathname | directory to change to |
Definition at line 1596 of file posix.c.
Referenced by ls(), main(), and posix_tests().
MEMSPACE int isatty | ( | int | fileno | ) |
Test POSIX fileno if it is a Serial Console/TTY.
[in] | fileno | POSIX fileno of open file. |
Definition at line 196 of file posix.c.
Referenced by dump_stat(), fileno_to_fatfs(), free_file_descriptor(), ftell(), ftruncate(), lseek(), new_file_descriptor(), sync(), syncfs(), and ungetc().
POSIX seek to file position.
[in] | fileno | POSIX fileno of open file. |
[in] | position | offset to seek to. |
[in] | whence |
|
Definition at line 617 of file posix.c.
Referenced by fseek().
POSIX make a directory.
[in] | pathname | directory to create |
Definition at line 1619 of file posix.c.
Referenced by posix_tests().
MEMSPACE int mkfs | ( | char * | name | ) |
Formt SD card.
[in] | *name | device name void |
Definition at line 1922 of file posix.c.
Referenced by posix_tests().
MEMSPACE int new_file_descriptor | ( | void | ) |
MEMSPACE int open | ( | const char * | pathname, |
int | flags | ||
) |
MEMSPACE void perror | ( | const char * | s | ) |
POSIX perror() - convert POSIX errno to text with user message.
[in] | s | User message displayed before the error message |
Definition at line 1814 of file posix.c.
Referenced by escape(), send_message(), and timetests().
MEMSPACE int posix_fopen_modes_to_open | ( | const char * | mode | ) |
Convert POSIX fopen mode to POSIX open mode flags. NOT POSIX.
[in] | mode | POSIX file mode string. |
Definition at line 2418 of file posix.c.
Referenced by fopen().
Put a character to a stream See fdevopen() sets stream->put get for TTY devices.
[in] | stream | POSIX stream pointer. |
MEMSPACE int putchar | ( | int | c | ) |
put a character to stdout See fdevopen() sets stream->put get for TTY devices
[in] | stream | POSIX stream pointer. |
MEMSPACE int puts | ( | const char * | str | ) |
put a string to stdout See fdevopen() sets stream->put get for TTY devices
[in] | stream | POSIX stream pointer. |
Definition at line 480 of file posix.c.
Referenced by cat().
POSIX read count bytes from *buf to fileno fd.
[in] | fd | POSIX fileno. |
[in] | buf | buffer. |
[in] | count | number of bytes to write. |
Definition at line 1006 of file posix.c.
Referenced by fread(), rx_fifo_read(), and send_message().
MEMSPACE int rename | ( | const char * | oldpath, |
const char * | newpath | ||
) |
POSIX rename a file by name.
[in] | oldpath | original name. |
[in] | newpath | new name. |
Definition at line 1648 of file posix.c.
Referenced by posix_tests().
MEMSPACE int rmdir | ( | const char * | pathname | ) |
POSIX delete a directory.
[in] | pathname | directory to delete. |
Definition at line 1671 of file posix.c.
Referenced by posix_tests().
POSIX stat - get file status of named file.
[in] | name | file name. |
[in] | buf | struct stat buffer to return results in. |
Definition at line 1344 of file posix.c.
Referenced by f_getfree(), f_mkfs(), find_volume(), ls(), ls_info(), main(), and posix_tests().
POSIX strerror() - convert POSIX errno to text with user message.
[in] | errnum | index for sys_errlist[] |
POSIX strerror_r() - convert POSIX errno to text with user message.
[in] | errnum | index for sys_errlist[] |
[in] | buf | user buffer for error message |
[in] | buflen | length of user buffer for error message |
MEMSPACE void sync | ( | void | ) |
MEMSPACE int syncfs | ( | int | fd | ) |
MEMSPACE int unlink | ( | const char * | pathname | ) |
POSIX delete a file.
[in] | pathname | filename to delete. |
Definition at line 1693 of file posix.c.
Referenced by posix_tests().
POSIX Write count bytes from *buf to fileno fd.
[in] | fd | POSIX fileno. |
[in] | buf | buffer. |
[in] | count | number of bytes to write. |
Definition at line 1180 of file posix.c.
Referenced by fwrite(), and send_message().