XenevaOS
Loading...
Searching...
No Matches
Macros | Functions
_print.c File Reference
#include <string.h>
#include <stdarg.h>
#include <ctype.h>
#include <_null.h>
#include <Log/_print.h>
Include dependency graph for _print.c:

Macros

#define MAX_STRING_LENGTH   4095
 
#define max(a, b)   ((a) > (b) ? (a) : (b))
 
#define min(a, b)   ((a) < (b) ? (a) : (b))
 
#define atou(string)   ((unsigned) _str2num(string, 10, 0, NULL))
 
#define atoull(string)   _str2num(string, 10, 0, NULL)
 
#define atoo(string)   ((unsigned)_str2num(string, 8, 0, NULL))
 
#define atooll(string)   _str2num(string, 8, 0, NULL)
 
#define dtoa(num, string, round)   _dbl2str(num, string, round)
 
#define ftoa(num, string)   _flt2str(num, string, round)
 
#define itoa(num, string)   _num2str(num, string, 10, 1)
 
#define itouo(num, string)   _num2str(num,string, 10, 1)
 
#define itoux(num, string)   _num2str(num, string, 16,0);
 
#define itox(num, string)   _num2str(num, string, 16, 1)
 
#define lltoa(num, string)   _lnum2str(num, string, 10,1)
 
#define lltouo(num, string)   _lnum2str(num, string, 8, 0)
 
#define lltoux(num, string)   _lnum2str(num, string, 16,0)
 
#define lltox(num, string)   _lnum2str(num, string, 16, 1)
 
#define xtoi(string)   ((int)_str2num(string, 16, 1, NULL))
 
#define xtoll(string)   ((long long) _str2num(string, 16,1, NULL))
 
#define ulltoa(num, string)   _lnum2str(num, string, 10, 0)
 
#define utoa(num, string)   _num2str(num, string, 10, 0)
 

Functions

int _xeprint (char *output, int outputlen, const char *format, va_list list)
 _xeprint – copied from XEClib implementation
 
int _vsnprintf (char *output, size_t sz, const char *format, va_list ap)
 
void store_x2_x7 (uint8_t *buffer)
 
void store_x3_x7 (uint8_t *buffer)
 
int _sprintf (char *output, const char *format,...)
 
int _snprintf (char *output, size_t sz, const char *format,...)
 

Macro Definition Documentation

◆ atoo

#define atoo (   string)    ((unsigned)_str2num(string, 8, 0, NULL))

◆ atooll

#define atooll (   string)    _str2num(string, 8, 0, NULL)

◆ atou

#define atou (   string)    ((unsigned) _str2num(string, 10, 0, NULL))

◆ atoull

#define atoull (   string)    _str2num(string, 10, 0, NULL)

◆ dtoa

#define dtoa (   num,
  string,
  round 
)    _dbl2str(num, string, round)

◆ ftoa

#define ftoa (   num,
  string 
)    _flt2str(num, string, round)

◆ itoa

#define itoa (   num,
  string 
)    _num2str(num, string, 10, 1)

◆ itouo

#define itouo (   num,
  string 
)    _num2str(num,string, 10, 1)

◆ itoux

#define itoux (   num,
  string 
)    _num2str(num, string, 16,0);

◆ itox

#define itox (   num,
  string 
)    _num2str(num, string, 16, 1)

◆ lltoa

#define lltoa (   num,
  string 
)    _lnum2str(num, string, 10,1)

◆ lltouo

#define lltouo (   num,
  string 
)    _lnum2str(num, string, 8, 0)

◆ lltoux

#define lltoux (   num,
  string 
)    _lnum2str(num, string, 16,0)

◆ lltox

#define lltox (   num,
  string 
)    _lnum2str(num, string, 16, 1)

◆ max

#define max (   a,
 
)    ((a) > (b) ? (a) : (b))

◆ MAX_STRING_LENGTH

#define MAX_STRING_LENGTH   4095

BSD 2-Clause License

Copyright (c) 2022-2026, Manas Kamal Choudhury All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

◆ min

#define min (   a,
 
)    ((a) < (b) ? (a) : (b))

◆ ulltoa

#define ulltoa (   num,
  string 
)    _lnum2str(num, string, 10, 0)

◆ utoa

#define utoa (   num,
  string 
)    _num2str(num, string, 10, 0)

◆ xtoi

#define xtoi (   string)    ((int)_str2num(string, 16, 1, NULL))

◆ xtoll

#define xtoll (   string)    ((long long) _str2num(string, 16,1, NULL))

Function Documentation

◆ _snprintf()

int _snprintf ( char *  output,
size_t  sz,
const char *  format,
  ... 
)

◆ _sprintf()

int _sprintf ( char *  output,
const char *  format,
  ... 
)

◆ _vsnprintf()

int _vsnprintf ( char *  output,
size_t  sz,
const char *  format,
va_list  ap 
)

◆ _xeprint()

int _xeprint ( char *  output,
int  outputlen,
const char *  format,
va_list  list 
)

_xeprint – copied from XEClib implementation

Parameters
output– pointer to memory buffer, where to put formatted string
outputLen– output len
format– formatted string
list– pointer to variable argument list

◆ store_x2_x7()

void store_x2_x7 ( uint8_t buffer)
extern

◆ store_x3_x7()

void store_x3_x7 ( uint8_t buffer)
extern