22#define __TWR_JSIMPORTS_H__
33
44#include <time.h>
5- #include "twr-draw2d.h"
65#include <twr-io.h>
76
87/* WebAssembly.ModuleImports (Javascript/TypeScript functions callable by C code) */
@@ -13,22 +12,6 @@ extern "C" {
1312#endif
1413
1514
16- __attribute__((import_name ("twrConCharOut" ))) void twrConCharOut (int jsid , int c , int code_page );
17- __attribute__((import_name ("twrConPutStr" ))) void twrConPutStr (int jsid , const char * str , int code_page );
18- __attribute__((import_name ("twrConCharIn" ))) int twrConCharIn (int jsid );
19- __attribute__((import_name ("twrConGetProp" ))) int twrConGetProp (int jsid , const char * prop_name );
20- __attribute__((import_name ("twrConCls" ))) void twrConCls (int jsid );
21- __attribute__((import_name ("twrConSetC32" ))) void twrConSetC32 (int jsid , int location , int c32 );
22- __attribute__((import_name ("twrConSetReset" ))) void twrConSetReset (int jsid , int x , int y , bool isset );
23- __attribute__((import_name ("twrConPoint" ))) int twrConPoint (int jsid , int x , int y );
24- __attribute__((import_name ("twrConSetCursor" ))) void twrConSetCursor (int jsid , int position );
25- __attribute__((import_name ("twrConSetColors" ))) void twrConSetColors (int jsid , unsigned long foreground , unsigned long background );
26- __attribute__((import_name ("twrConSetRange" ))) void twrConSetRange (int jsid , int * chars , int start , int len );
27- __attribute__((import_name ("twrConDrawSeq" ))) void twrConDrawSeq (int jsid , struct d2d_draw_seq * );
28- __attribute__((import_name ("twrConLoadImage" ))) bool twrConLoadImage (int jsid , const char * url , long id );
29- __attribute__((import_name ("twrConSetFocus" ))) void twrConSetFocus (int jsid );
30- __attribute__((import_name ("twrConGetIDFromName" ))) int twrConGetIDFromName (const char * name );
31-
3215__attribute__((import_name ("twrTimeTmLocal" ))) void twrTimeTmLocal (struct tm * , const time_t );
3316__attribute__((import_name ("twrUserLconv" ))) void twrUserLconv (struct lconv * , int code_page );
3417__attribute__((import_name ("twrUserLanguage" ))) char * twrUserLanguage (void );
@@ -58,18 +41,10 @@ __attribute__((import_name("twrSqrt"))) double twrSqrt(double arg);
5841__attribute__((import_name ("twrTrunc" ))) double twrTrunc (double arg );
5942
6043__attribute__((import_name ("twrAtod" ))) double twrAtod (const char * str , int len );
61- __attribute__((import_name ("twrToFixed" ))) double twrToFixed (char * buffer , int buffer_size , double value , int dec_digits );
62- __attribute__((import_name ("twrToExponential" ))) void twrToExponential (char * buffer , int buffer_size , double value , int dec_digits );
6344
64- __attribute__((import_name ("twrDtoa" ))) void twrDtoa (char * buffer , int buffer_size , double value , int max_precision );
65- __attribute__((import_name ("twrFcvtS" ))) int twrFcvtS (
66- char * buffer ,
67- unsigned long sizeInBytes , //size_t
68- double value ,
69- int fracpart_numdigits ,
70- int * dec ,
71- int * sign
72- );
45+ // does not use locale information; it always uses . (a dot) as the decimal separator.
46+ // twr_localize_numeric_string() is available to convert buffer if needed
47+ __attribute__((import_name ("twrDtoa" ))) void twr_dtoa (char * buffer , int buffer_size , double value , int max_precision );
7348
7449#ifdef __cplusplus
7550}
0 commit comments