28 #ifndef __SimpleTEXT__
29 #define __SimpleTEXT__
31 #include <propeller.h>
38 #if !defined(__PROPELLER_32BIT_DOUBLES__)
39 #error "This library requires 32bit doubles"
42 #define TERM_NAME_LEN 20
43 #define TERM_COG_LEN 7
49 int cogid[TERM_COG_LEN];
53 #define getStopCOGID(id) ((id)-(1))
54 #define setStopCOGID(id) ((id)+(1))
220 void simpleterm_close(
void);
228 terminal *simpleterm_pointer(
void);
237 static inline void simpleterm_set(
text_t *ptr)
274 float getFloat(
void);
295 char *getStr(
char *buffer,
int max);
303 void putBin(
int value);
314 void putBinDigits(
int value,
int digits);
322 void putChar(
char c);
330 void putDec(
int value);
340 void putDecDigits(
int value,
int width);
349 void putFloat(
float value);
357 void putHex(
int value);
368 void putHexDigits(
int value,
int digits);
381 void putFloatPrecision(
float value,
int width,
int precision);
389 int putln(
const char* str);
398 int putLine(
const char* str);
406 int putStr(
const char* str);
416 int readBin(
text_t *device);
426 int readChar(
text_t *device);
436 int readDec(
text_t *device);
446 float readFloat(
text_t *device);
456 int readHex(
text_t *device);
470 char *readStr(
text_t *device,
char *buffer,
int max);
649 int print(
const char *format, ...) __attribute__((format (printf, 1, 2)));
665 int printi(const
char *format, ...) __attribute__((format (printf, 1, 2)));
708 int scan(const
char *fmt, ...) __attribute__((format (printf, 1, 2)));
724 int scani(const
char *fmt, ...) __attribute__((format (printf, 1, 2)));
741 int dprint(
text_t* device, const
char *format, ...) __attribute__((format (printf, 2, 3)));
759 int dprinti(
text_t* device, const
char *format, ...) __attribute__((format (printf, 2, 3)));
776 int dscan(
text_t* device, const
char *fmt, ...) __attribute__((format (printf, 2, 3)));
794 int dscani(
text_t* device, const
char *fmt, ...) __attribute__((format (printf, 2, 3)));
811 int sprint(
char *buffer, const
char *format, ...) __attribute__((format (printf, 2, 3)));
829 int sprinti(
char *buffer, const
char *format, ...) __attribute__((format (printf, 2, 3)));
845 int sscan(const
char *buffer, const
char *fmt, ...) __attribute__((format (printf, 2, 3)));
862 int sscani(const
char *buffer, const
char *fmt, ...) __attribute__((format (printf, 2, 3)));
865 int printNumber(
text_t *p,
unsigned long u,
int base,
int width,
int fill_char);
866 char* _safe_gets(
text_t *term,
char* origBuf,
int count);
867 const
char* _scanf_getf(const
char *str,
float* dst);
868 const
char* _scanf_getl(const
char *str,
int* dst,
int base,
unsigned width,
int isSigned);
870 int SPUTC(
int c,
char *buf);
871 int SPUTS(
char *s,
char *obuf);
872 int SPUTL(
unsigned long u,
int base,
int width,
int fill_char,
char *obuf);
875 int _doscanf(
const char* str,
const char *fmt, va_list args);
876 int _intscanf(
const char* str,
const char *fmt, va_list args);
877 int _dosprnt(
const char *fmt, va_list args,
char *obuf);
878 int _intsprnt(
const char *fmt, va_list args,
char *obuf);
880 char* float2string(
float f,
char *s,
int width,
int precision);
881 float string2float(
char *s,
char **end);