PSXSDK
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
Macros | Enumerations | Functions
printf.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

Macros

#define SPRINTF_ALT_FLAG   (1<<0)
 
#define SPRINTF_ZERO_FLAG   (1<<1)
 
#define SPRINTF_NEGFIELD_FLAG   (1<<2)
 
#define SPRINTF_SPACE_FLAG   (1<<3)
 
#define SPRINTF_SIGN_FLAG   (1<<4)
 
#define calculate_real_padding()
 
#define calculate_real_padding_hex()
 
#define write_padding()
 
#define write_neg_padding()
 

Enumerations

enum  {
  SPRINTF_SIZE_CHAR, SPRINTF_SIZE_SHORT, SPRINTF_SIZE_INT, SPRINTF_SIZE_LONG,
  SPRINTF_SIZE_LONG_LONG
}
 

Functions

int vsnprintf (char *string, size_t size, const char *fmt, va_list ap)
 
int sio_vprintf (const char *fmt, va_list ap)
 
int vprintf (char *fmt, va_list ap)
 
int vsprintf (char *string, const char *fmt, va_list ap)
 
int sprintf (char *string, const char *fmt,...)
 
int snprintf (char *string, size_t size, const char *fmt,...)
 
int sio_printf (const char *fmt,...)
 

Macro Definition Documentation

#define calculate_real_padding ( )
Value:
y = 1; \
\
for(x=0;x<=19;x++) \
{ \
if(x == 0) \
pad_quantity--; \
else \
{ \
if(arg / y) \
pad_quantity--; \
} \
\
y *= 10; \
} \
\
if(pad_quantity < 0) pad_quantity = 0;
#define calculate_real_padding_hex ( )
Value:
last = 0; \
for (x = 0; x < 16; x++) \
if((arg >> (x * 4)) & 0xf) \
last = x; \
\
pad_quantity = (pad_quantity - 1) - last; \
if(pad_quantity < 0) pad_quantity = 0;
#define SPRINTF_ALT_FLAG   (1<<0)
#define SPRINTF_NEGFIELD_FLAG   (1<<2)
#define SPRINTF_SIGN_FLAG   (1<<4)
#define SPRINTF_SPACE_FLAG   (1<<3)
#define SPRINTF_ZERO_FLAG   (1<<1)
#define write_neg_padding ( )
Value:
if(flags & SPRINTF_NEGFIELD_FLAG) \
{ \
for(x = 0; x < pad_quantity; x++) \
put_in_string(string, ssz, ' ', string_pos++);\
}
#define write_padding ( )
Value:
if(!(flags & SPRINTF_NEGFIELD_FLAG)) \
for(x = 0; x < pad_quantity; x++) \
{ \
if(flags & SPRINTF_ZERO_FLAG) \
put_in_string(string, ssz, '0', string_pos++); \
else \
put_in_string(string, ssz, ' ', string_pos++); \
}

Enumeration Type Documentation

anonymous enum
Enumerator:
SPRINTF_SIZE_CHAR 
SPRINTF_SIZE_SHORT 
SPRINTF_SIZE_INT 
SPRINTF_SIZE_LONG 
SPRINTF_SIZE_LONG_LONG 

Function Documentation

int sio_printf ( const char *  fmt,
  ... 
)
int sio_vprintf ( const char *  fmt,
va_list  ap 
)
int snprintf ( char *  string,
size_t  size,
const char *  fmt,
  ... 
)
int sprintf ( char *  string,
const char *  fmt,
  ... 
)
int vprintf ( char *  fmt,
va_list  ap 
)
int vsnprintf ( char *  string,
size_t  size,
const char *  fmt,
va_list  ap 
)
int vsprintf ( char *  string,
const char *  fmt,
va_list  ap 
)