1
0
Fork 0
mirror of https://github.com/tailix/libkernaux.git synced 2024-10-30 11:54:01 -04:00

Rename funcs

This commit is contained in:
Alex Kotov 2022-01-19 16:57:41 +05:00
parent 000c26c7d7
commit 8eae115cbd
2 changed files with 10 additions and 15 deletions

View file

@ -47,10 +47,8 @@ extern "C" {
* \param va A value identifying a variable arguments list
* \return The number of characters that are sent to the output function, not counting the terminating null character
*/
#define printf printf_
#define vprintf vprintf_
int printf_(void (*out)(char character, void* arg), void* arg, const char* format, ...);
int vprintf_(void (*out)(char character, void* arg), void* arg, const char* format, va_list va);
int kernaux_printf(void (*out)(char character, void* arg), void* arg, const char* format, ...);
int kernaux_vprintf(void (*out)(char character, void* arg), void* arg, const char* format, va_list va);
/**
* Tiny sprintf implementation
@ -59,8 +57,7 @@ int vprintf_(void (*out)(char character, void* arg), void* arg, const char* form
* \param format A string that specifies the format of the output
* \return The number of characters that are WRITTEN into the buffer, not counting the terminating null character
*/
#define sprintf sprintf_
int sprintf_(char* buffer, const char* format, ...);
int kernaux_sprintf(char* buffer, const char* format, ...);
/**
* Tiny snprintf/vsnprintf implementation
@ -72,10 +69,8 @@ int sprintf_(char* buffer, const char* format, ...);
* null character. A value equal or larger than count indicates truncation. Only when the returned value
* is non-negative and less than count, the string has been completely written.
*/
#define snprintf snprintf_
#define vsnprintf vsnprintf_
int snprintf_(char* buffer, size_t count, const char* format, ...);
int vsnprintf_(char* buffer, size_t count, const char* format, va_list va);
int kernaux_snprintf(char* buffer, size_t count, const char* format, ...);
int kernaux_vsnprintf(char* buffer, size_t count, const char* format, va_list va);
#ifdef __cplusplus
}

View file

@ -834,7 +834,7 @@ static int _vsnprintf(out_fct_type out, char* buffer, const size_t maxlen, const
///////////////////////////////////////////////////////////////////////////////
int printf_(void (*out)(char character, void* arg), void* arg, const char* format, ...)
int kernaux_printf(void (*out)(char character, void* arg), void* arg, const char* format, ...)
{
va_list va;
va_start(va, format);
@ -845,14 +845,14 @@ int printf_(void (*out)(char character, void* arg), void* arg, const char* forma
}
int vprintf_(void (*out)(char character, void* arg), void* arg, const char* format, va_list va)
int kernaux_vprintf(void (*out)(char character, void* arg), void* arg, const char* format, va_list va)
{
const out_fct_wrap_type out_fct_wrap = { out, arg };
return _vsnprintf(_out_fct, (char*)(uintptr_t)&out_fct_wrap, (size_t)-1, format, va);
}
int sprintf_(char* buffer, const char* format, ...)
int kernaux_sprintf(char* buffer, const char* format, ...)
{
va_list va;
va_start(va, format);
@ -862,7 +862,7 @@ int sprintf_(char* buffer, const char* format, ...)
}
int snprintf_(char* buffer, size_t count, const char* format, ...)
int kernaux_snprintf(char* buffer, size_t count, const char* format, ...)
{
va_list va;
va_start(va, format);
@ -872,7 +872,7 @@ int snprintf_(char* buffer, size_t count, const char* format, ...)
}
int vsnprintf_(char* buffer, size_t count, const char* format, va_list va)
int kernaux_vsnprintf(char* buffer, size_t count, const char* format, va_list va)
{
return _vsnprintf(_out_buffer, buffer, count, format, va);
}