Nugget
|
#include "psyqo/xprintf.h"
#include <stdarg.h>
#include <stddef.h>
#include <stdint.h>
#include "psyqo/alloc.h"
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. | |
#define BUFSIZE 100 /* Size of the output buffer */ |
#define NINFO (sizeof(fmtinfo) / sizeof(info)) /* Size of the fmtinfo table */ |
#define SPACESIZE (sizeof(spaces) - 1) |
static struct HandlerInfo * info |
enum e_type |
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()
.
out | The pointer to the string to allocate. |
fmt | The format string. |
ap | The vararg list of arguments. |
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.
buf | The buffer to print to. |
n | The maximum number of bytes to write, including the terminating null byte. |
fmt | The format string. |
ap | The vararg list of arguments. |
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.
buf | The buffer to print to. |
fmt | The format string. |
ap | The vararg list of arguments. |