mirror of
https://github.com/pret/pokestadium.git
synced 2026-03-22 01:34:25 -05:00
59 lines
1.3 KiB
C
59 lines
1.3 KiB
C
#ifndef _XSTDIO_H
|
|
#define _XSTDIO_H
|
|
#include "ultratypes.h"
|
|
#include <stdlib.h>
|
|
#include <stdarg.h>
|
|
|
|
typedef struct
|
|
{
|
|
union {
|
|
/* 00 */ long long s64;
|
|
double f64;
|
|
} value;
|
|
/* 08 */ char *buff;
|
|
/* 0c */ int n0;
|
|
/* 10 */ int num_leading_zeros;
|
|
/* 14 */ int part2_len;
|
|
/* 18 */ int num_mid_zeros;
|
|
/* 1c */ int part3_len;
|
|
/* 20 */ int num_trailing_zeros;
|
|
/* 24 */ int precision;
|
|
/* 28 */ int width;
|
|
/* 2c */ unsigned int size;
|
|
/* 30 */ unsigned int flags;
|
|
/* 34 */ char length;
|
|
} printf_struct;
|
|
|
|
// these are the same struct. TODO: Merge
|
|
typedef struct {
|
|
/* 0x0 */ union {
|
|
/* 0x0 */ long long ll;
|
|
/* 0x0 */ double ld;
|
|
} v;
|
|
/* 0x8 */ unsigned char* s;
|
|
/* 0xC */ int n0;
|
|
/* 0x10 */ int nz0;
|
|
/* 0x14 */ int n1;
|
|
/* 0x18 */ int nz1;
|
|
/* 0x1C */ int n2;
|
|
/* 0x20 */ int nz2;
|
|
/* 0x24 */ int prec;
|
|
/* 0x28 */ int width;
|
|
/* 0x2C */ size_t nchar;
|
|
/* 0x30 */ unsigned int flags;
|
|
/* 0x34 */ char qual;
|
|
} _Pft;
|
|
|
|
#define FLAGS_SPACE 1
|
|
#define FLAGS_PLUS 2
|
|
#define FLAGS_MINUS 4
|
|
#define FLAGS_HASH 8
|
|
#define FLAGS_ZERO 16
|
|
typedef char *outfun(char*,const char*,size_t);
|
|
|
|
int _Printf(outfun prout, char *arg, const char *fmt, va_list args);
|
|
void _Litob(_Pft *args, char type);
|
|
void _Ldtob(_Pft *args, char type);
|
|
|
|
#endif
|