From: <sp...@us...> - 2004-02-23 20:30:25
|
Update of /cvsroot/rtk/rtk/rtk In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7855/rtk Modified Files: rchar.h rchar_ascii.h rchar_unicode.h Log Message: Made a temporary solution for the printf problemt It now converts %s to %S, its good until we get a better one Index: rchar.h =================================================================== RCS file: /cvsroot/rtk/rtk/rtk/rchar.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** rchar.h 22 Feb 2004 10:21:29 -0000 1.8 --- rchar.h 23 Feb 2004 20:16:43 -0000 1.9 *************** *** 8,11 **** --- 8,12 ---- #include <wchar.h> #include <wctype.h> + #include <stdarg.h> /***************************************************************************** *************** *** 13,16 **** --- 14,18 ---- *****************************************************************************/ + #define INCLUDED_FROM_RCHAR 1 #ifdef UNICODE # include "rchar_unicode.h" *************** *** 18,21 **** --- 20,27 ---- # include "rchar_ascii.h" #endif /* UNICODE */ + #undef INCLUDED_FROM_RCHAR + + RCHAR* rstrlwr(const RCHAR* str); + RCHAR* rstrupr(const RCHAR* str); #endif /* _RTK_RCHAR_H_ */ Index: rchar_ascii.h =================================================================== RCS file: /cvsroot/rtk/rtk/rtk/rchar_ascii.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** rchar_ascii.h 22 Feb 2004 11:50:15 -0000 1.2 --- rchar_ascii.h 23 Feb 2004 20:16:43 -0000 1.3 *************** *** 1,2 **** --- 1,5 ---- + #ifndef INCLUDE_FROM_RCHAR + # error "This file must be included from rchar.h" + #endif // using 8 bit ASCII characters *************** *** 17,20 **** --- 20,24 ---- // Get #define rfgets fgets + // Not recomended #define rgets gets #define rgetchar getchar *************** *** 40,48 **** #define rfprintf fprintf #define rsnprintf snprintf ! #define rsprintf sprintf #define rprintf printf #define rvfprintf vfprintf #define rvsnprintf vsnprintf ! #define rvsprintf vsprintf #define rvprintf vprintf --- 44,52 ---- #define rfprintf fprintf #define rsnprintf snprintf ! //#define rsprintf sprintf #define rprintf printf #define rvfprintf vfprintf #define rvsnprintf vsnprintf ! //#define rvsprintf vsprintf #define rvprintf vprintf *************** *** 95,100 **** #define rtolower towlower #define rtoupper towupper ! #define rstrlwr strlwr ! #define rstrupr strupr #define REOF EOF --- 99,104 ---- #define rtolower towlower #define rtoupper towupper ! //#define rstrlwr strlwr ! //#define rstrupr strupr #define REOF EOF Index: rchar_unicode.h =================================================================== RCS file: /cvsroot/rtk/rtk/rtk/rchar_unicode.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** rchar_unicode.h 22 Feb 2004 11:50:15 -0000 1.2 --- rchar_unicode.h 23 Feb 2004 20:16:43 -0000 1.3 *************** *** 1,2 **** --- 1,5 ---- + #ifndef INCLUDED_FROM_RCHAR + # error "This file must be included from rchar.h" + #endif // using 16 bit (usually) unicode characters *************** *** 35,39 **** // Get #define rfgets fgetws ! #define rgets getws #define rgetchar getwchar #define rungetc ungetwc --- 38,43 ---- // Get #define rfgets fgetws ! //not recomended! ! //#define rgets getws #define rgetchar getwchar #define rungetc ungetwc *************** *** 43,53 **** #define rfputs fputws #define rputtchar putwchar ! #define rputs putws // str <-> number conversions #define ritoa _itow #define rltoa _ltow #define ratoi _wtoi #define ratol _wtol #define rultoa _ultow #define rstrtod wcstod --- 47,60 ---- #define rfputs fputws #define rputtchar putwchar ! //#define rputs putws ! inline int rputs(const RCHAR* str) { fputws(str, stdout); } // str <-> number conversions + // todo: what about linux? #define ritoa _itow #define rltoa _ltow #define ratoi _wtoi #define ratol _wtol + #define rultoa _ultow #define rstrtod wcstod *************** *** 56,69 **** // printf like ! #define rfprintf fwprintf ! #define rsnprintf snwprintf ! #define rsprintf swprintf ! #define rprintf wprintf ! #define rvfprintf vfwprintf ! #define rvsnprintf vsnwprintf ! #define rvsprintf vswprintf ! #define rvprintf vwprintf // scanf's #define rfscanf fwscanf #define rsscanf swscanf --- 63,81 ---- // printf like ! //the s version without n is not recomended! ! int rvsnprintf(RCHAR* dst, int max_len, const RCHAR* fmt, va_list args); ! int rvfprintf(FILE* f, const RCHAR* fmt, va_list args); ! int rvprintf(const RCHAR* fmt, va_list args); ! int rsnprintf(RCHAR* dst, int max_len, const RCHAR* fmt, ...); ! int rfprintf(FILE* f, const RCHAR* fmt, ...); ! int rprintf(const RCHAR* fmt, ...); // scanf's + int rvsscanf(const RCHAR* src, const RCHAR* fmt, va_list args); + int rvfscanf(FILE* f, const RCHAR* fmt, va_list args); + int rvscanf(const RCHAR* fmt, va_list args); + int rsscanf(const RCHAR* src, const RCHAR* fmt, ...); + int rfscanf(FILE* f, const RCHAR* fmt, ...); + int rscanf(const RCHAR* fmt, ...); #define rfscanf fwscanf #define rsscanf swscanf *************** *** 71,74 **** --- 83,87 ---- // File + // todo: what about linux? #define rfdopen _wfdopen #define rfopen _wfopen *************** *** 90,98 **** #define rstrncmp wcsncmp #define rstrncpy wcsncpy ! #define rstrnset wcsnset #define rstrpbrk wcspbrk #define rstrrchr wcsrchr #define rstrrev wcsrev ! #define rstrset wcsset #define rstrspn wcsspn #define rstrstr wcsstr --- 103,111 ---- #define rstrncmp wcsncmp #define rstrncpy wcsncpy ! #define rstrnset wmemset #define rstrpbrk wcspbrk #define rstrrchr wcsrchr #define rstrrev wcsrev ! #define rstrset wmemset #define rstrspn wcsspn #define rstrstr wcsstr *************** *** 100,104 **** // is* ! #define risascii iswascii #define riscntrl iswcntrl #define risgraph iswgraph --- 113,118 ---- // is* ! //#define risascii iswascii ! inline int risascii(RCHAR c) { return !(c & 0x7f); } #define riscntrl iswcntrl #define risgraph iswgraph *************** *** 113,118 **** #define rtolower towlower #define rtoupper towupper ! #define rstrlwr _wcslwr ! #define rstrupr _wcsupr #define REOF WEOF --- 127,132 ---- #define rtolower towlower #define rtoupper towupper ! //#define rstrlwr _wcslwr ! //#define rstrupr _wcsupr #define REOF WEOF |