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);
415 int putStrDigits(
char* str,
int width);
424 int readBin(
text_t *device);
434 int readChar(
text_t *device);
444 int readDec(
text_t *device);
454 float readFloat(
text_t *device);
464 int readHex(
text_t *device);
478 char *readStr(
text_t *device,
char *buffer,
int max);
657 int print(
const char *format, ...) __attribute__((format (printf, 1, 2)));
673 int printi(const
char *format, ...) __attribute__((format (printf, 1, 2)));
716 int scan(const
char *fmt, ...) __attribute__((format (printf, 1, 2)));
732 int scani(const
char *fmt, ...) __attribute__((format (printf, 1, 2)));
749 int dprint(
text_t* device, const
char *format, ...) __attribute__((format (printf, 2, 3)));
767 int dprinti(
text_t* device, const
char *format, ...) __attribute__((format (printf, 2, 3)));
784 int dscan(
text_t* device, const
char *fmt, ...) __attribute__((format (printf, 2, 3)));
802 int dscani(
text_t* device, const
char *fmt, ...) __attribute__((format (printf, 2, 3)));
819 int sprint(
char *buffer, const
char *format, ...) __attribute__((format (printf, 2, 3)));
837 int sprinti(
char *buffer, const
char *format, ...) __attribute__((format (printf, 2, 3)));
853 int sscan(const
char *buffer, const
char *fmt, ...) __attribute__((format (printf, 2, 3)));
870 int sscani(const
char *buffer, const
char *fmt, ...) __attribute__((format (printf, 2, 3)));
873 int printNumber(
text_t *p,
unsigned long u,
int base,
int width,
int fill_char);
874 char* _safe_gets(
text_t *term,
char* origBuf,
int count);
875 const
char* _scanf_getf(const
char *str,
float* dst);
876 const
char* _scanf_getl(const
char *str,
int* dst,
int base,
unsigned width,
int isSigned);
878 int SPUTC(
int c,
char *buf);
879 int SPUTS(
char *s,
char *obuf);
880 int SPUTL(
unsigned long u,
int base,
int width,
int fill_char,
char *obuf);
883 int _doscanf(
const char* str,
const char *fmt, va_list args);
884 int _intscanf(
const char* str,
const char *fmt, va_list args);
885 int _dosprnt(
const char *fmt, va_list args,
char *obuf);
886 int _intsprnt(
const char *fmt, va_list args,
char *obuf);
888 char* float2string(
float f,
char *s,
int width,
int precision);
889 float string2float(
char *s,
char **end);