#include <errno.h>
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
#include "lite.h"
Go to the source code of this file.
|
char * | vreadsnf (char *line, size_t len, const char *fmt, va_list ap) |
|
char * | readsnf (char *line, size_t len, const char *fmt,...) |
|
int | writesf (const char *str, const char *mode, const char *fmt,...) |
|
int | vreadllf (long long *value, const char *fmt, va_list ap) |
|
int | readllf (long long *value, const char *fmt,...) |
|
int | readdf (int *value, const char *fmt,...) |
|
int | writellf (long long value, const char *mode, const char *fmt,...) |
|
int | writedf (int value, const char *mode, const char *fmt,...) |
|
- Author
- Joachim Wiberg
- Date
- 2023
- Copyright
- ISC License
Definition in file procval.c.
◆ readdf()
int readdf |
( |
int * | value, |
|
|
const char * | fmt, |
|
|
| ... ) |
Read integer value from a file composed from fmt and optional args.
- Parameters
-
value | Pointer to where to store read integer value. |
mode | An fopen() mode string, e.g. "w+". |
fmt | Formatted string to be composed into a pathname. |
- Returns
- result of operation, with errno set on error.
Definition at line 154 of file procval.c.
◆ readllf()
int readllf |
( |
long long * | value, |
|
|
const char * | fmt, |
|
|
| ... ) |
Read 64-bit integer value from a file composed from fmt and optional args.
- Parameters
-
value | Pointer to where to store read 64-bit integer value. |
mode | An fopen() mode string, e.g. "w+". |
fmt | Formatted string to be composed into a pathname. |
- Returns
- result of operation, with errno set on error.
Definition at line 133 of file procval.c.
◆ readsnf()
char * readsnf |
( |
char * | line, |
|
|
size_t | len, |
|
|
const char * | fmt, |
|
|
| ... ) |
Read first line from a file composed from fmt and optional args.
- Parameters
-
line | Pointer to line buffer. |
len | Size of line buffer. |
fmt | Formatted string to be composed into a pathname. |
- Returns
- On success, this function returns the
line
read from the file, with any trailing '
' chomp()ed out. On error, NULL
.
Definition at line 74 of file procval.c.
◆ vreadllf()
int vreadllf |
( |
long long * | value, |
|
|
const char * | fmt, |
|
|
va_list | ap ) |
◆ vreadsnf()
char * vreadsnf |
( |
char * | line, |
|
|
size_t | len, |
|
|
const char * | fmt, |
|
|
va_list | ap ) |
Similar to readsnf() except it takes a va_list argument
- Parameters
-
line | Pointer to line buffer. |
len | Size of line buffer. |
fmt | Formatted string to be composed into a pathname. |
ap | List of variable arguemnts from va_start(). |
For details, see readsnf().
- Returns
- same as readsnf().
Definition at line 44 of file procval.c.
◆ writedf()
int writedf |
( |
int | value, |
|
|
const char * | mode, |
|
|
const char * | fmt, |
|
|
| ... ) |
Write integer value to a file composed from fmt and optional args.
- Parameters
-
value | Integer value to write. |
mode | An fopen() mode string, e.g. "w+". |
fmt | Formatted string to be composed into a pathname. |
- Returns
- result of operation, with errno set on error.
Definition at line 208 of file procval.c.
◆ writellf()
int writellf |
( |
long long | value, |
|
|
const char * | mode, |
|
|
const char * | fmt, |
|
|
| ... ) |
Write 64-bit integer value to a file composed from fmt and optional args.
- Parameters
-
value | 64-bit integer value to write. |
mode | An fopen() mode string, e.g. "w+". |
fmt | Formatted string to be composed into a pathname. |
- Returns
- result of operation, with errno set on error.
Definition at line 184 of file procval.c.
◆ writesf()
int writesf |
( |
const char * | str, |
|
|
const char * | mode, |
|
|
const char * | fmt, |
|
|
| ... ) |
Write a string buffer to a file composed from fmt and optional args.
- Parameters
-
str | Pointer to string buffer, may be multiple lines. |
mode | An fopen() mode string, e.g. "w+". |
fmt | Formatted string to be composed into a pathname. |
- Returns
- result of operation, with errno set on error.
Definition at line 94 of file procval.c.