deprecated os.h and removed scanf from istream as it can't return the end position
This commit is contained in:
parent
a08fc40eba
commit
5086bda758
4 changed files with 6 additions and 14 deletions
|
|
@ -9,6 +9,12 @@
|
||||||
#include <math.h> // HUGE_VALF
|
#include <math.h> // HUGE_VALF
|
||||||
#include "tracelog.h"
|
#include "tracelog.h"
|
||||||
|
|
||||||
|
#if defined(_WIN32) && defined(__TINYC__)
|
||||||
|
#define strtoull _strtoui64
|
||||||
|
#define strtoll _strtoi64
|
||||||
|
#define strtof strtod
|
||||||
|
#endif
|
||||||
|
|
||||||
/* == INPUT STREAM ============================================ */
|
/* == INPUT STREAM ============================================ */
|
||||||
|
|
||||||
str_istream_t istrInit(const char *str) {
|
str_istream_t istrInit(const char *str) {
|
||||||
|
|
@ -22,17 +28,6 @@ str_istream_t istrInitLen(const char *str, usize len) {
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
void istrScanf(str_istream_t *ctx, const char *fmt, ...) {
|
|
||||||
va_list va;
|
|
||||||
va_start(va, fmt);
|
|
||||||
istrScanfV(ctx, fmt, va);
|
|
||||||
va_end(va);
|
|
||||||
}
|
|
||||||
|
|
||||||
void istrScanfV(str_istream_t *ctx, const char *fmt, va_list args) {
|
|
||||||
vsscanf(ctx->cur, fmt, args);
|
|
||||||
}
|
|
||||||
|
|
||||||
char istrGet(str_istream_t *ctx) {
|
char istrGet(str_istream_t *ctx) {
|
||||||
return *ctx->cur++;
|
return *ctx->cur++;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -23,9 +23,6 @@ typedef struct {
|
||||||
str_istream_t istrInit(const char *str);
|
str_istream_t istrInit(const char *str);
|
||||||
str_istream_t istrInitLen(const char *str, usize len);
|
str_istream_t istrInitLen(const char *str, usize len);
|
||||||
|
|
||||||
void istrScanf(str_istream_t *ctx, const char *fmt, ...);
|
|
||||||
void istrScanfV(str_istream_t *ctx, const char *fmt, va_list args);
|
|
||||||
|
|
||||||
// get the current character and advance
|
// get the current character and advance
|
||||||
char istrGet(str_istream_t *ctx);
|
char istrGet(str_istream_t *ctx);
|
||||||
// get the current character but don't advance
|
// get the current character but don't advance
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue