#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include "log.h"
Go to the source code of this file.
|
| static int | chr_count (char *haystack, char needle) |
| |
| static int | fsize (const char *file) |
| |
| void | print_debug (FILE *std, const char *color, const char *file, int line, char *va_format,...) |
| |
| void | log_start_args (int argc, char **argv) |
| |
| #define MESSAGE_MAX_SIZE 20480 |
The printed message's buffer size
Definition at line 18 of file log.c.
| static int chr_count |
( |
char * |
haystack, |
|
|
char |
needle |
|
) |
| |
|
static |
Counts the number of times needle occurs in haystack
- Parameters
-
| haystack | The string to search in |
| needle | The character to search for |
- Returns
- int The number of occurrences
Definition at line 29 of file log.c.
| static int fsize |
( |
const char * |
file | ) |
|
|
static |
Retrieves the size of a file
- Parameters
-
- Returns
- The size of the file in Bytes
Definition at line 49 of file log.c.
| void log_start_args |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Logs the command line arguments the process was started with.
- Parameters
-
| argc | The argc passed to the program/lib. |
| argv | The argv passed to the program/lib. |
Definition at line 219 of file log.c.
| void print_debug |
( |
FILE * |
std, |
|
|
const char * |
color, |
|
|
const char * |
file, |
|
|
int |
line, |
|
|
char * |
va_format, |
|
|
|
... |
|
) |
| |
Prints a debug message, mimicking printf-like function, supports only d, s and c
- Parameters
-
| std | Standard output to use. color Color to print the message in. |
| file | The file the debug message generated in. |
| line | The line number in the file the debug message generated at. |
| message | The debug message to be displayed. |
| ... | Variable number of optional arguments that match with the va_format. |
Definition at line 60 of file log.c.