Nugget
Loading...
Searching...
No Matches
Classes | Macros | Typedefs | Enumerations | Functions
xprintf.c File Reference
#include "psyqo/xprintf.h"
#include <stdarg.h>
#include <stddef.h>
#include <stdint.h>
#include "psyqo/alloc.h"
Include dependency graph for xprintf.c:

Classes

struct  s_info
 
struct  s_strargument
 
struct  sgMprintf
 

Macros

#define NINFO   (sizeof(fmtinfo) / sizeof(info)) /* Size of the fmtinfo table */
 
#define BUFSIZE   100 /* Size of the output buffer */
 
#define SPACESIZE   (sizeof(spaces) - 1)
 

Typedefs

typedef struct s_info info
 

Enumerations

enum  e_type {
  RADIX , FIXED , SIZE , STRING ,
  PERCENT , CHAR , ERROR , CHARLIT ,
  SEEIT , MEM_STRING , ORDINAL
}
 

Functions

int vxprintf (void *func, void *arg, const char *format, va_list ap)
 
int vsprintf (char *buf, const char *fmt, va_list ap)
 Prints a formatted string to a string.
 
int vsnprintf (char *buf, size_t n, const char *fmt, va_list ap)
 Prints a formatted string to a length-limited string.
 
int vasprintf (char **out, const char *zFormat, va_list ap)
 Prints a formatted string to a newly allocated string.
 

Macro Definition Documentation

◆ BUFSIZE

#define BUFSIZE   100 /* Size of the output buffer */

◆ NINFO

#define NINFO   (sizeof(fmtinfo) / sizeof(info)) /* Size of the fmtinfo table */

◆ SPACESIZE

#define SPACESIZE   (sizeof(spaces) - 1)

Typedef Documentation

◆ info

Initial value:
{
register int n asm("t1") = 0x03

Enumeration Type Documentation

◆ e_type

enum e_type
Enumerator
RADIX 
FIXED 
SIZE 
STRING 
PERCENT 
CHAR 
ERROR 
CHARLIT 
SEEIT 
MEM_STRING 
ORDINAL 

Function Documentation

◆ vasprintf()

int vasprintf ( char **  out,
const char *  fmt,
va_list  ap 
)

Prints a formatted string to a newly allocated string.

This function is a helper around vxprintf, which will print to a string, and otherwise behaves the same as normal glibc (v)asprintf. The string will be allocated using psyqo_malloc(), and must be freed using psyqo_free().

Parameters
outThe pointer to the string to allocate.
fmtThe format string.
apThe vararg list of arguments.
Returns
int The number of bytes written.

◆ vsnprintf()

int vsnprintf ( char *  buf,
size_t  n,
const char *  fmt,
va_list  ap 
)

Prints a formatted string to a length-limited string.

This function is a helper around vxprintf, which will print to a string, and otherwise behaves the same as normal libc (v)snprintf.

Parameters
bufThe buffer to print to.
nThe maximum number of bytes to write, including the terminating null byte.
fmtThe format string.
apThe vararg list of arguments.
Returns
int The number of bytes written.

◆ vsprintf()

int vsprintf ( char *  buf,
const char *  fmt,
va_list  ap 
)

Prints a formatted string to a string.

This function is a helper around vxprintf, which will print to a string, and otherwise behaves the same as normal libc (v)sprintf.

Parameters
bufThe buffer to print to.
fmtThe format string.
apThe vararg list of arguments.
Returns
int The number of bytes written.

◆ vxprintf()

int vxprintf ( void func,
void arg,
const char *  format,
va_list  ap 
)