-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
94 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#include "param_log.h" | ||
#include <ft_printf.h> | ||
|
||
/** | ||
* @brief log a hexadecimal value | ||
* | ||
* @param value | ||
* @return int | ||
*/ | ||
int log_HEX(uint64_t value) | ||
{ | ||
if (value == 0) | ||
return ft_dprintf(STDERR_FILENO, "0"); | ||
return ft_dprintf(STDERR_FILENO, "%#llx", value); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#include "param_log.h" | ||
#include <ft_printf.h> | ||
|
||
/** | ||
* @brief Log an unsigned integer | ||
* | ||
* @param value value to log | ||
* @return int number of bytes written | ||
*/ | ||
int log_INT(uint64_t value) | ||
{ | ||
return ft_dprintf(STDERR_FILENO, "%llu", value); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#include "param_log.h" | ||
#include <ft_printf.h> | ||
|
||
int log_NONE(void) | ||
{ | ||
return ft_dprintf(STDERR_FILENO, "?"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#include "param_log.h" | ||
#include <ft_printf.h> | ||
|
||
int log_PTR(uint64_t value) | ||
{ | ||
if (value == 0) | ||
return ft_dprintf(STDERR_FILENO, "NULL"); | ||
return ft_dprintf(STDERR_FILENO, "%p", (void *)value); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#include "param_log.h" | ||
#include <ft_printf.h> | ||
|
||
int log_SIGNED_INT(int64_t value) | ||
{ | ||
return ft_dprintf(STDERR_FILENO, "%d", value); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters