You can subscribe to this list here.
2004 |
Jan
|
Feb
(48) |
Mar
(80) |
Apr
(9) |
May
(2) |
Jun
(91) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
---|
From: <le...@us...> - 2004-03-05 18:45:50
|
Update of /cvsroot/rtk/rtk/src/core/platform/linux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29595 Modified Files: CMakeLists.txt Log Message: Small change in line for log-writing. Index: CMakeLists.txt =================================================================== RCS file: /cvsroot/rtk/rtk/src/core/platform/linux/CMakeLists.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CMakeLists.txt 5 Mar 2004 18:18:25 -0000 1.1 --- CMakeLists.txt 5 Mar 2004 18:23:38 -0000 1.2 *************** *** 28,32 **** # # Authors (chronological order): ! # Dejan Lekic , de...@nu... # Contributors # N/A --- 28,32 ---- # # Authors (chronological order): ! # Dejan Lekic, de...@nu... # Contributors # N/A *************** *** 43,51 **** ADD_LIBRARY(${RTK_LIBRTK} STATIC ${RTK_CORE_LINUX_SFILES}) MESSAGE("### ${RTK_CORE_SFILES}") ##------------------------------------------------------------------- # LOG # IF (RTK_OPT_BCLOG) ! WRITE_FILE(${RTK_BC_LOGFILE} "was in /src/core/platform/linux\n" APPEND) ENDIF (RTK_OPT_BCLOG) --- 43,52 ---- ADD_LIBRARY(${RTK_LIBRTK} STATIC ${RTK_CORE_LINUX_SFILES}) MESSAGE("### ${RTK_CORE_SFILES}") + ##------------------------------------------------------------------- # LOG # IF (RTK_OPT_BCLOG) ! WRITE_FILE(${RTK_BC_LOGFILE} "Visited: /src/core/platform/linux\n" APPEND) ENDIF (RTK_OPT_BCLOG) |
From: <le...@us...> - 2004-03-05 18:40:34
|
Update of /cvsroot/rtk/rtk/src/core/platform/linux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28229 Added Files: CMakeLists.txt Mutex.cpp Thread.cpp Log Message: Linux Mutex and Thread implementations added to RTK CVS repository. NOTE: CMake build system is still not good - i have to learn how to add stuff to RTK CORE library, which is in .. --- NEW FILE: CMakeLists.txt --- ## # # RTK # Fast and easy cross-platform GUI ToolKit. # # Copyright (C) 2001-200x RTK Development Team # # This library is free software; you can redistribute it and/or modify it # under the terms of the slightly modified (see the "EXCEPTION NOTICE" part # of RTK Library License) GNU Lesser General Public License as published # by the Free Software Foundation; either version 2.1 of the License, or # (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public # License for more details. # # You should have received a copy of the GNU Lesser General Public License # and along with this library; if not, write to the # Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA . # # Also you should have received a copy of RTK Library License, if not please # write an e-mail to some of RTK authors (listed in file AUTHORS). # # Bug reports: bu...@rt... # Suggestions: rf...@rt... # # Authors (chronological order): # Dejan Lekic , de...@nu... # Contributors # N/A #################################################################### ##------------------------------------------------------------------- # Here we define all platform/linux core RTK files # - It's IMHO (Dejan) handy to have them in one variable # SET(RTK_CORE_LINUX_SFILES Thread.cpp Mutex.cpp) # Now we can put 'em in main RTK_CORE_SFILES variable SET(RTK_CORE_SFILES ${RTK_CORE_SFILES} ${RTK_CORE_LINUX_SFILES}) ADD_LIBRARY(${RTK_LIBRTK} STATIC ${RTK_CORE_LINUX_SFILES}) MESSAGE("### ${RTK_CORE_SFILES}") ##------------------------------------------------------------------- # LOG # IF (RTK_OPT_BCLOG) WRITE_FILE(${RTK_BC_LOGFILE} "was in /src/core/platform/linux\n" APPEND) ENDIF (RTK_OPT_BCLOG) ## # $Id: CMakeLists.txt,v 1.1 2004/03/05 18:18:25 leka Exp $ #################################################################### --- NEW FILE: Mutex.cpp --- /** * * RTK * Fast and easy cross-platform GUI ToolKit. * * Copyright (C) 2001-200x RTK Development Team * * This library is free software; you can redistribute it and/or modify it * under the terms of the slightly modified (see the "EXCEPTION NOTICE" part * of RTK Library License) GNU Lesser General Public License as published * by the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * and along with this library; if not, write to the * Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA . * * Also you should have received a copy of RTK Library License, if not please * write an e-mail to some of RTK authors (listed in file AUTHORS). * * Bug reports: bu...@rt... * Suggestions: rf...@rt... ***************************************************************************/ /** * $Source: /cvsroot/rtk/rtk/src/core/platform/linux/Mutex.cpp,v $ ***** * Authors (chronological order): * Mikko Lahteenmaki, mikko§rtk.cx * Dejan Lekic, dejan§rtk.cx * Contributors (chronological order): * $fname $lname, $email ***** * T0D0 List: * - ***************************************************************************/ #include <rtk/Mutex.h> namespace Rtk { // Linux supports recursive locks, use them directly, with some cheating: #ifdef PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP extern pthread_mutexattr_t Mutex_attrib; void Mutex::Init() { pthread_mutex_init(&_cs, &Mutex_attrib); } void Mutex::Lock() { pthread_mutex_lock(&_cs); } void Mutex::Unlock() { pthread_mutex_unlock(&_cs); } #else // standard pthread mutexes need a bit of work to be recursive: void Mutex::Init() { recursive_counter = 0; pthread_mutex_init(&_cs, NULL); } void Mutex::Lock() { if(!recursive_counter || owner_ != pthread_self()) { pthread_mutex_lock(&_cs); owner_ = pthread_self(); } recursive_counter++; } void Mutex::Unlock() { if (!--recursive_counter) pthread_mutex_unlock(&_cs); } // unlock() #endif void Mutex::Destroy() { pthread_mutex_destroy(&_cs); } // destroy() }; // Rtk /** * $Id: Mutex.cpp,v 1.1 2004/03/05 18:18:25 leka Exp $ ***************************************************************************/ --- NEW FILE: Thread.cpp --- /** * * RTK * Fast and easy cross-platform GUI ToolKit. * * Copyright (C) 2001-200x RTK Development Team * * This library is free software; you can redistribute it and/or modify it * under the terms of the slightly modified (see the "EXCEPTION NOTICE" part * of RTK Library License) GNU Lesser General Public License as published * by the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * and along with this library; if not, write to the * Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA . * * Also you should have received a copy of RTK Library License, if not please * write an e-mail to some of RTK authors (listed in file AUTHORS). * * Bug reports: bu...@rt... * Suggestions: rf...@rt... ***************************************************************************/ /** * $Source: /cvsroot/rtk/rtk/src/core/platform/linux/Thread.cpp,v $ ***** * Authors (chronological order): * Mikko Lahteenmaki, mikko§rtk.cx * Dejan Lekic, dejan§rtk.cx * Contributors (chronological order): * $fname $lname, $email ***** * T0D0 List: * - ***************************************************************************/ #include <rtk/Thread.h> namespace Rtk { void* thread_function(void *arg) { Thread *t = (Thread*)arg; ThreadFunction func = t->GetFunction(); void *f_arg = t->GetUserdata(); t->_running = true; int ret = 0; if(!func) { while(t->ThreadStep()); } else { ret = (*func)(f_arg); } t->_running = false; return (void*)ret; } bool Thread::Create(ThreadFunction function, void* arg) { bool result = true; _function = function; _arg = arg; _kill_thread = _running = 0; if (pthread_create((pthread_t*)(_thread_handle), NULL, thread_function, this)) result = false; return result; } void Thread::Terminate(int exitcode) { pthread_cancel(*((pthread_t*)(_thread_handle))); } bool Thread::Join(int timeout) { void *result; return (bool)pthread_join(*((pthread_t*)(_thread_handle)), &result); } int Thread::GetPriority() const { return 0; } int Thread::SetPriority(int priority) { return 0; } }; // Rtk /** * $Id: Thread.cpp,v 1.1 2004/03/05 18:18:25 leka Exp $ ***************************************************************************/ |
From: <le...@us...> - 2004-03-05 15:28:34
|
Update of /cvsroot/rtk/rtk/src/core/platform/linux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17260/linux Log Message: Directory /cvsroot/rtk/rtk/src/core/platform/linux added to the repository |
From: <de...@us...> - 2004-03-03 15:55:20
|
Update of /cvsroot/rtk/rtk/rtk In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7832/rtk Added Files: Buffer.h Log Message: Header file (interface) for Buffer class. --- NEW FILE: Buffer.h --- /** * * RTK * Fast and easy cross-platform GUI ToolKit. * * Copyright (C) 2001-200x RTK Development Team * * This library is free software; you can redistribute it and/or modify it * under the terms of the slightly modified (see the "EXCEPTION NOTICE" part * of RTK Library License) GNU Lesser General Public License as published * by the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * and along with this library; if not, write to the * Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA . * * Also you should have received a copy of RTK Library License, if not please * write an e-mail to some of RTK authors (listed in file AUTHORS). * * Bug reports: bu...@rt... * Suggestions: rf...@rt... ***************************************************************************/ /** * $Source: /cvsroot/rtk/rtk/rtk/Buffer.h,v $ ***** * Authors (chronological order): * Dejan Lekic, de...@nu... (dejan§rtk.cx) * Contributors (chronological order): * $fname $lname, $email ***** * T0D0 List: * - ***************************************************************************/ #ifndef _RTK_BUFFER_H_ #define _RTK_BUFFER_H_ 1 namespace Rtk { /** * T0D0: Comment for Buffer class * T0D0: Description for Buffer class */ class RTK_API Buffer { public: protected: private: }; // Buffer }; // Rtk namespace #endif /** * $Id: Buffer.h,v 1.1 2004/03/03 15:34:50 dejan Exp $ ***************************************************************************/ |
From: <de...@us...> - 2004-03-03 15:51:39
|
Update of /cvsroot/rtk/rtk/src/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6995/src/core Added Files: Buffer.cpp Log Message: This file is in CVS just because i will work on it from three different places - so i really need to use CVS for synchronizing source trees (that's what CVS is for anyway :). --- NEW FILE: Buffer.cpp --- /** * * RTK * Fast and easy cross-platform GUI ToolKit. * * Copyright (C) 2001-200x RTK Development Team * * This library is free software; you can redistribute it and/or modify it * under the terms of the slightly modified (see the "EXCEPTION NOTICE" part * of RTK Library License) GNU Lesser General Public License as published * by the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * and along with this library; if not, write to the * Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA . * * Also you should have received a copy of RTK Library License, if not please * write an e-mail to some of RTK authors (listed in file AUTHORS). * * Bug reports: bu...@rt... * Suggestions: rf...@rt... ***************************************************************************/ /** * $Source: /cvsroot/rtk/rtk/src/core/Buffer.cpp,v $ ***** * Authors (chronological order): * $fname $lname, $email * Contributors (chronological order): * $fname $lname, $email ***** * T0D0 List: * - ***************************************************************************/ #include <rtk/Buffer.h> namespace Rtk { // C/C++ code here }; // Rtk /** * $Id: Buffer.cpp,v 1.1 2004/03/03 15:31:09 dejan Exp $ ***************************************************************************/ |
From: <le...@us...> - 2004-03-03 11:00:35
|
Update of /cvsroot/rtk/rtk In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17065 Modified Files: CMakeLists.txt Log Message: Small change in /CMakeLists.txt . Index: CMakeLists.txt =================================================================== RCS file: /cvsroot/rtk/rtk/CMakeLists.txt,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** CMakeLists.txt 26 Feb 2004 20:13:15 -0000 1.10 --- CMakeLists.txt 3 Mar 2004 10:40:15 -0000 1.11 *************** *** 120,124 **** SET(RTK_LIBRTK rtk${RTK_LIB_SUFFIX}) - FILE(APPEND filename "message to write"... ) ## --- 120,123 ---- |
From: <de...@us...> - 2004-03-02 11:45:57
|
Update of /cvsroot/rtk/rtk/rtk In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1228/rtk Added Files: conf.h Log Message: rtk/conf.h file back from the death. |
From: <de...@us...> - 2004-03-01 23:51:46
|
Update of /cvsroot/rtk/rtk/rtk In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9096/rtk Removed Files: conf.h Log Message: Removed rtk/conf.h file - we don't need this file to be in CVS. --- conf.h DELETED --- |
From: <laz...@us...> - 2004-02-29 21:45:55
|
Update of /cvsroot/rtk/rtk/rtk In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29658/rtk Modified Files: rchar_unicode.h Log Message: fixed risascii Index: rchar_unicode.h =================================================================== RCS file: /cvsroot/rtk/rtk/rtk/rchar_unicode.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** rchar_unicode.h 29 Feb 2004 20:53:25 -0000 1.6 --- rchar_unicode.h 29 Feb 2004 21:27:34 -0000 1.7 *************** *** 121,125 **** // is* ! #define risascii iswascii #define riscntrl iswcntrl #define risgraph iswgraph --- 121,125 ---- // is* ! #define risascii(c) (((c) & ~0x7f)==0) /* If C is a 7 bit value. */ #define riscntrl iswcntrl #define risgraph iswgraph |
From: <laz...@us...> - 2004-02-29 21:11:46
|
Update of /cvsroot/rtk/rtk/rtk In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22997/rtk Modified Files: rchar.h rchar_ascii.h rchar_unicode.h Log Message: More string fixes - Own strtok_r - removed strrev (who will need that?) :) Index: rchar.h =================================================================== RCS file: /cvsroot/rtk/rtk/rtk/rchar.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** rchar.h 29 Feb 2004 17:57:09 -0000 1.11 --- rchar.h 29 Feb 2004 20:53:25 -0000 1.12 *************** *** 3,6 **** --- 3,7 ---- #include "conf.h" + #include "Export.h" #include <stdio.h> *************** *** 29,33 **** * @return The address of the original string, 'str'. */ ! RCHAR* rstrlwr(RCHAR* str); /** Convert a string to uppercase. --- 30,34 ---- * @return The address of the original string, 'str'. */ ! RTK_API RCHAR* rstrlwr(RCHAR* str); /** Convert a string to uppercase. *************** *** 36,40 **** * @return The address of the original string, 'str'. */ ! RCHAR* rstrupr(RCHAR* str); } // namespace Rtk --- 37,51 ---- * @return The address of the original string, 'str'. */ ! RTK_API RCHAR* rstrupr(RCHAR* str); ! ! ! /** Breaks the string 'str' into a sequence of tokens, ! * each of which is delimited by a character from the string pointed to by 'delim'. ! * @param str NULL, or the string that you want to break into tokens. ! * @param delim A set of the characters that separate the tokens. ! * @param save_ptr The address of a pointer to a character, which the function can use to store information necessary for it to continue scanning the same string. ! * @return A pointer to the token found, or NULL if no token was found. ! */ ! RTK_API RCHAR *rstrtok_r (RCHAR *str, const RCHAR *delim, RCHAR **save_ptr); } // namespace Rtk Index: rchar_ascii.h =================================================================== RCS file: /cvsroot/rtk/rtk/rtk/rchar_ascii.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** rchar_ascii.h 29 Feb 2004 17:57:10 -0000 1.6 --- rchar_ascii.h 29 Feb 2004 20:53:25 -0000 1.7 *************** *** 76,84 **** #define rstrpbrk strpbrk #define rstrrchr strrchr - #define rstrrev strrev #define rstrspn strspn #define rstrstr strstr - #define rstrtok strtok - #define rstrtok_r strtok_r #define rstrset(s,v) ((RCHAR*)memset((s),(v),rstrlen(s))) #define rstrnset(s,v,n) ((RCHAR*)memset((s),(v),(n))) --- 76,81 ---- Index: rchar_unicode.h =================================================================== RCS file: /cvsroot/rtk/rtk/rtk/rchar_unicode.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** rchar_unicode.h 29 Feb 2004 17:57:10 -0000 1.5 --- rchar_unicode.h 29 Feb 2004 20:53:25 -0000 1.6 *************** *** 18,23 **** # define snwprintf _snwprintf # define getws _getws - # define putws _putws - # define wcsrev _wcsrev # define wcsset _wcsset # define wcsnset _wcsnset --- 18,21 ---- *************** *** 46,50 **** #define rfputs fputws #define rputtchar putwchar ! #define rputs putws // str <-> number conversions --- 44,48 ---- #define rfputs fputws #define rputtchar putwchar ! #define rputs(x) fputws((x), stdout) // str <-> number conversions *************** *** 58,63 **** #if !defined(_RTK_WIN32_) && defined(UNICODE) - #include "Export.h" - // printf like RTK_API int rvsnprintf(RCHAR* dst, int max_len, const RCHAR* fmt, va_list args); --- 56,59 ---- *************** *** 119,127 **** #define rstrpbrk wcspbrk #define rstrrchr wcsrchr - #define rstrrev wcsrev #define rstrspn wcsspn #define rstrstr wcsstr - #define rstrtok wcstok - #define rstrtok_r wcstok #define rstrset(s,v) ((RCHAR*)wmemset((s),(v),rstrlen(s))) #define rstrnset(s,v,n) ((RCHAR*)wmemset((s),(v),(n))) --- 115,120 ---- |
From: <laz...@us...> - 2004-02-29 21:11:46
|
Update of /cvsroot/rtk/rtk/test/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22997/test/core Modified Files: string0.cpp Log Message: More string fixes - Own strtok_r - removed strrev (who will need that?) :) Index: string0.cpp =================================================================== RCS file: /cvsroot/rtk/rtk/test/core/string0.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** string0.cpp 29 Feb 2004 17:57:10 -0000 1.12 --- string0.cpp 29 Feb 2004 20:53:25 -0000 1.13 *************** *** 40,56 **** } ! void rstrrev_test() { ! rprintf(_R("rstrrev_test()\n")); - RCHAR source[] = { _R("A sample STRING") }; - - OUT("source = '%s'", source); - - STEP( rstrrev(source) ); - OUT("source = '%s'", source); - - STEP( rstrrev(source) ); OUT("source = '%s'", source); } --- 40,61 ---- } ! void rstrtok_r_test() { ! rprintf(_R("rstrtok_r_test()\n")); ! ! RCHAR *token, *sp; ! RCHAR source[] = { _R("LINE TO BE SEPARATED") }; ! RCHAR *search = _R(" "); OUT("source = '%s'", source); + + /* Token will point to "LINE". */ + STEP(token = rstrtok_r(source, search, &sp)); + OUT("token = '%s'", token); + + while(token) { + STEP(token = rstrtok_r(NULL, search, &sp)); + OUT("token = '%s'", token); + } } *************** *** 161,166 **** rstrset_test(); - rstrrev_test(); rstr_case_test(); return 0; --- 166,171 ---- rstrset_test(); rstr_case_test(); + rstrtok_r_test(); return 0; *************** *** 224,234 **** rstrpbrk(_R(""),0); rstrrchr(_R(""),0); - rstrrev(0); rstrset(0,0); rstrnset(0,0,0); rstrspn(0,0); rstrstr(_R(""), _R("")); ! rstrtok(0,0); ! rstrtok_r(0,0); // is* --- 229,237 ---- rstrpbrk(_R(""),0); rstrrchr(_R(""),0); rstrset(0,0); rstrnset(0,0,0); rstrspn(0,0); rstrstr(_R(""), _R("")); ! rstrtok_r(0,0,0); // is* |
From: <laz...@us...> - 2004-02-29 21:11:46
|
Update of /cvsroot/rtk/rtk/src/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22997/src/core Modified Files: rchar.cpp Log Message: More string fixes - Own strtok_r - removed strrev (who will need that?) :) Index: rchar.cpp =================================================================== RCS file: /cvsroot/rtk/rtk/src/core/rchar.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** rchar.cpp 29 Feb 2004 17:57:10 -0000 1.7 --- rchar.cpp 29 Feb 2004 20:53:25 -0000 1.8 *************** *** 34,37 **** --- 34,67 ---- } + RCHAR *rstrtok_r (RCHAR *s, const RCHAR *delim, RCHAR **save_ptr) + { + RCHAR *token; + + if (s == NULL) + s = *save_ptr; + + /* Scan leading delimiters. */ + s += rstrspn (s, delim); + if (*s == '\0') + { + *save_ptr = s; + return NULL; + } + + /* Find the end of the token. */ + token = s; + s = rstrpbrk (token, delim); + if (s == NULL) { + /* This token finishes the string. */ + *save_ptr = rstrchr(token, '\0'); + } else + { + /* Terminate the token and make *SAVE_PTR point past it. */ + *s = '\0'; + *save_ptr = s + 1; + } + return token; + } + #if !defined(_RTK_WIN32_) && defined(UNICODE) |
From: <laz...@us...> - 2004-02-29 18:15:25
|
Update of /cvsroot/rtk/rtk/rtk In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17958/rtk Modified Files: rchar.h rchar_ascii.h rchar_unicode.h Log Message: More string stuff... uhh.. :) Index: rchar.h =================================================================== RCS file: /cvsroot/rtk/rtk/rtk/rchar.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** rchar.h 26 Feb 2004 20:02:16 -0000 1.10 --- rchar.h 29 Feb 2004 17:57:09 -0000 1.11 *************** *** 24,29 **** #undef INCLUDED_FROM_RCHAR ! RCHAR* rstrlwr(const RCHAR* str); ! RCHAR* rstrupr(const RCHAR* str); } // namespace Rtk --- 24,40 ---- #undef INCLUDED_FROM_RCHAR ! /** Convert a string to lowercase. ! * Replaces the string 'str' with lowercase characters, ! * by invoking the rtolower function for each character in the string. ! * @return The address of the original string, 'str'. ! */ ! RCHAR* rstrlwr(RCHAR* str); ! ! /** Convert a string to uppercase. ! * Replaces the string 'str' with uppercase characters, ! * by invoking the rtoupper function for each character in the string. ! * @return The address of the original string, 'str'. ! */ ! RCHAR* rstrupr(RCHAR* str); } // namespace Rtk Index: rchar_ascii.h =================================================================== RCS file: /cvsroot/rtk/rtk/rtk/rchar_ascii.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** rchar_ascii.h 28 Feb 2004 07:39:44 -0000 1.5 --- rchar_ascii.h 29 Feb 2004 17:57:10 -0000 1.6 *************** *** 32,40 **** // str <-> number conversions - #define ritoa itoa - #define rltoa ltoa #define ratoi atoi #define ratol atol ! #define rultoa ultoa #define rstrtod strtod #define rstrtol strtol --- 32,38 ---- // str <-> number conversions #define ratoi atoi #define ratol atol ! #define rstrtod strtod #define rstrtol strtol *************** *** 55,61 **** #define rsscanf sscanf #define rscanf scanf - #define rvfscanf vfscanf - #define rvsscanf vsscanf - #define rvscanf vscanf // File --- 53,56 ---- *************** *** 79,90 **** #define rstrncmp strncmp #define rstrncpy strncpy - #define rstrnset strnset #define rstrpbrk strpbrk #define rstrrchr strrchr #define rstrrev strrev - #define rstrset strset #define rstrspn strspn #define rstrstr strstr #define rstrtok strtok // is* --- 74,86 ---- #define rstrncmp strncmp #define rstrncpy strncpy #define rstrpbrk strpbrk #define rstrrchr strrchr #define rstrrev strrev #define rstrspn strspn #define rstrstr strstr #define rstrtok strtok + #define rstrtok_r strtok_r + #define rstrset(s,v) ((RCHAR*)memset((s),(v),rstrlen(s))) + #define rstrnset(s,v,n) ((RCHAR*)memset((s),(v),(n))) // is* *************** *** 105,111 **** #define rtoupper toupper - //#define rstrlwr strlwr - //#define rstrupr strupr - #define REOF EOF --- 101,104 ---- Index: rchar_unicode.h =================================================================== RCS file: /cvsroot/rtk/rtk/rtk/rchar_unicode.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** rchar_unicode.h 28 Feb 2004 07:39:44 -0000 1.4 --- rchar_unicode.h 29 Feb 2004 17:57:10 -0000 1.5 *************** *** 38,43 **** // Get #define rfgets fgetws ! //not recomended! ! //#define rgets getws #define rgetchar getwchar #define rungetc ungetwc --- 38,42 ---- // Get #define rfgets fgetws ! #define rgets getws #define rgetchar getwchar #define rungetc ungetwc *************** *** 47,61 **** #define rfputs fputws #define rputtchar putwchar ! //#define rputs putws ! static RTK_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 #define rstrtol wcstol --- 46,55 ---- #define rfputs fputws #define rputtchar putwchar ! #define rputs putws // str <-> number conversions ! #define ratoi(s) ((int)wcstol((s), NULL, 10)) ! #define ratol(s) ((long)wcstol((s), NULL, 10)) #define rstrtod wcstod #define rstrtol wcstol *************** *** 64,82 **** #if !defined(_RTK_WIN32_) && defined(UNICODE) // printf like ! 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, ...); #else --- 58,80 ---- #if !defined(_RTK_WIN32_) && defined(UNICODE) + #include "Export.h" + // printf like ! RTK_API int rvsnprintf(RCHAR* dst, int max_len, const RCHAR* fmt, va_list args); ! RTK_API int rvfprintf(FILE* f, const RCHAR* fmt, va_list args); ! RTK_API int rvprintf(const RCHAR* fmt, va_list args); ! RTK_API int rsnprintf(RCHAR* dst, int max_len, const RCHAR* fmt, ...); ! RTK_API int rfprintf(FILE* f, const RCHAR* fmt, ...); ! RTK_API int rprintf(const RCHAR* fmt, ...); // scanf's ! RTK_API int rsscanf(const RCHAR* src, const RCHAR* fmt, ...); ! RTK_API int rfscanf(FILE* f, const RCHAR* fmt, ...); ! RTK_API int rscanf(const RCHAR* fmt, ...); ! ! // File ! RTK_API FILE *rfdopen(int fildes, const RCHAR *mode); ! RTK_API FILE *rfopen(const RCHAR *path, const RCHAR *mode); ! RTK_API FILE *rfreopen(const RCHAR *path, const RCHAR *mode, FILE *stream); #else *************** *** 97,108 **** #define rscanf wscanf - #endif - // File - // todo: what about linux? #define rfdopen _wfdopen #define rfopen _wfopen #define rfreopen _wfreopen // str #define rstrcasecmp wcscasecmp --- 95,105 ---- #define rscanf wscanf // File #define rfdopen _wfdopen #define rfopen _wfopen #define rfreopen _wfreopen + #endif + // str #define rstrcasecmp wcscasecmp *************** *** 120,131 **** #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 #define rstrtok wcstok // is* --- 117,129 ---- #define rstrncmp wcsncmp #define rstrncpy wcsncpy #define rstrpbrk wcspbrk #define rstrrchr wcsrchr #define rstrrev wcsrev #define rstrspn wcsspn #define rstrstr wcsstr #define rstrtok wcstok + #define rstrtok_r wcstok + #define rstrset(s,v) ((RCHAR*)wmemset((s),(v),rstrlen(s))) + #define rstrnset(s,v,n) ((RCHAR*)wmemset((s),(v),(n))) // is* *************** *** 146,152 **** #define rtoupper towupper - //#define rstrlwr _wcslwr - //#define rstrupr _wcsupr - #define REOF WEOF --- 144,147 ---- |
From: <laz...@us...> - 2004-02-29 18:15:25
|
Update of /cvsroot/rtk/rtk/src/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17958/src/core Modified Files: rchar.cpp Log Message: More string stuff... uhh.. :) Index: rchar.cpp =================================================================== RCS file: /cvsroot/rtk/rtk/src/core/rchar.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** rchar.cpp 29 Feb 2004 08:46:54 -0000 1.6 --- rchar.cpp 29 Feb 2004 17:57:10 -0000 1.7 *************** *** 10,31 **** namespace Rtk { ! RCHAR* rstrlwr(const RCHAR* str) { ! RCHAR* ret = (RCHAR*)malloc(sizeof(RCHAR)*rstrlen(str)); ! RCHAR* ptr = ret; ! while (*str) { ! *ptr++ = rtolower(*str++); } ! return ret; } ! RCHAR* rstrupr(const RCHAR* str) ! { ! RCHAR* ret = (RCHAR*)malloc(sizeof(RCHAR)*rstrlen(str)); ! RCHAR* ptr = ret; ! while (*str) { ! *ptr++ = rtoupper(*str++); } ! return ret; } --- 10,35 ---- namespace Rtk { ! RCHAR *rstrlwr(RCHAR *str) { ! RCHAR *ptr = str; ! while(*ptr) { ! if(risupper(*ptr)) { ! *ptr = rtolower(*ptr); ! } ! ptr++; } ! return str; } ! RCHAR *rstrupr(RCHAR* str) ! { ! RCHAR *ptr = str; ! while(*ptr) { ! if(rislower(*ptr)) { ! *ptr = rtoupper(*ptr); ! } ! ptr++; } ! return str; } *************** *** 57,77 **** then s_ptr[1] == '\0' ;-) */ #define CVT(fmt_len) \ RCHAR *fmt2 = (RCHAR*)alloca((fmt_len)*sizeof(RCHAR)); \ const RCHAR *s_ptr = fmt; RCHAR *d_ptr = fmt2; \ - bool check = false; \ while (*s_ptr) { \ ! if(check && *s_ptr=='s') { \ *d_ptr++ = 'S'; \ s_ptr++; \ - check = false; \ } else { \ - if(*s_ptr=='%') check = true; \ - else check = false; \ *d_ptr++ = *s_ptr++; \ } \ } \ ! *d_ptr = '\0'; \ fmt = fmt2 --- 61,81 ---- then s_ptr[1] == '\0' ;-) + Mikko: + Right :) Sorry, I forgot that we are working with null terminated strings :))) + */ #define CVT(fmt_len) \ RCHAR *fmt2 = (RCHAR*)alloca((fmt_len)*sizeof(RCHAR)); \ const RCHAR *s_ptr = fmt; RCHAR *d_ptr = fmt2; \ while (*s_ptr) { \ ! if(s_ptr[0] == '%' && s_ptr[1] == 's') { \ ! *d_ptr++ = *s_ptr++; \ *d_ptr++ = 'S'; \ s_ptr++; \ } else { \ *d_ptr++ = *s_ptr++; \ } \ } \ ! *d_ptr++ = *s_ptr++; /* Copy null */ \ fmt = fmt2 *************** *** 125,144 **** // scanf ! int rvsscanf(const RCHAR* src, const RCHAR* fmt, va_list args) ! { ! CVT(rstrlen(fmt)); // +\0 ! return vswscanf(src, fmt2, args); ! } ! ! int rvfscanf(FILE* f, const RCHAR* fmt, va_list args) { CVT(rstrlen(fmt)); // +\0 ! return vfwscanf(f, fmt2, args); } ! int rvscanf(const RCHAR* fmt, va_list args) { CVT(rstrlen(fmt)); // +\0 ! return vfwscanf(stdin, fmt2, args); } --- 129,142 ---- // scanf ! static RTK_INLINE int rvsscanf(const RCHAR* src, const RCHAR* fmt, va_list args) { CVT(rstrlen(fmt)); // +\0 ! return vswscanf(src, fmt, args); } ! static RTK_INLINE int rvfscanf(FILE* f, const RCHAR* fmt, va_list args) { CVT(rstrlen(fmt)); // +\0 ! return vfwscanf(f, fmt, args); } *************** *** 170,173 **** --- 168,217 ---- } + // File + + #define W2A(src, dst) do { \ + int src_len = rstrlen(src); \ + int dst_len = wcstombs(NULL, src, src_len); \ + if(dst_len==-1) break; \ + char *_dst = (char*)alloca(dst_len+1); \ + if(wcstombs(_dst, src, src_len)==-1) break; \ + _dst[dst_len] = '\0'; \ + dst = _dst; \ + } while(0) + + FILE *rfdopen(int fildes, const RCHAR *mode) + { + char *amode = NULL; + W2A(mode, amode); + if(amode==NULL) return NULL; + return fdopen(fildes, amode); + } + + FILE *rfopen(const RCHAR *path, const RCHAR *mode) + { + char *amode = NULL; + char *apath = NULL; + + W2A(mode, amode); + if(amode==NULL) return NULL; + W2A(path, apath); + if(apath==NULL) return NULL; + + return fopen(apath, amode); + } + + FILE *rfreopen(const RCHAR *path, const RCHAR *mode, FILE *stream) + { + char *amode = NULL; + char *apath = NULL; + + W2A(mode, amode); + if(amode==NULL) return NULL; + W2A(path, apath); + if(apath==NULL) return NULL; + + return freopen(apath, amode, stream); + } + #endif /* !UNICODE */ |
From: <laz...@us...> - 2004-02-29 18:15:25
|
Update of /cvsroot/rtk/rtk/test/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17958/test/core Modified Files: string0.cpp Log Message: More string stuff... uhh.. :) Index: string0.cpp =================================================================== RCS file: /cvsroot/rtk/rtk/test/core/string0.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** string0.cpp 28 Feb 2004 07:39:44 -0000 1.11 --- string0.cpp 29 Feb 2004 17:57:10 -0000 1.12 *************** *** 9,12 **** --- 9,58 ---- #include "../test.h" + void rstrset_test() + { + rprintf(_R("rstrset_test()\n")); + + RCHAR source[] = { _R("A sample STRING") }; + + OUT("source = '%s'", source); + + STEP( rstrnset(source, '=', 5) ); + OUT("source = '%s'", source); + + STEP( rstrset(source, '*') ); + OUT("source = '%s'", source); + } + + void rstr_case_test() + { + rprintf(_R("rstr_case_test()\n")); + + RCHAR source[] = { _R("A miXED-CAse StrinG") }; + RCHAR source2[] = { _R("A miXED-CAse StrinG") }; + + OUT("source = '%s'", source); + STEP( rstrupr(source) ); + OUT("source = '%s'", source); + + OUT("source2 = '%s'", source2); + STEP( rstrlwr(source2) ); + OUT("source2 = '%s'", source2); + } + + void rstrrev_test() + { + rprintf(_R("rstrrev_test()\n")); + + RCHAR source[] = { _R("A sample STRING") }; + + OUT("source = '%s'", source); + + STEP( rstrrev(source) ); + OUT("source = '%s'", source); + + STEP( rstrrev(source) ); + OUT("source = '%s'", source); + } + String some_func(RCHAR * input) { *************** *** 112,121 **** //String sCyr = L"ÐоздÑав Ñвим ÑÑбиÑеÑима RTK-а\n"; //wprintf(sCyr.c_str()); ! #endif return 0; } - #if 0 // This is dummy function // Just to check declarations of functions at compile time --- 158,170 ---- //String sCyr = L"ÐоздÑав Ñвим ÑÑбиÑеÑима RTK-а\n"; //wprintf(sCyr.c_str()); ! #endif ! ! rstrset_test(); ! rstrrev_test(); ! rstr_case_test(); return 0; } // This is dummy function // Just to check declarations of functions at compile time *************** *** 134,142 **** // str <-> number conversions ! // ritoa(0,0,0); ! // rltoa(0,0,0); ! // rultoa(0,0,0); ! // ratoi(0); ! // ratol(0); rstrtod(0,0); rstrtol(0,0,0); --- 183,188 ---- // str <-> number conversions ! ratoi(0); ! ratol(0); rstrtod(0,0); rstrtol(0,0,0); *************** *** 152,166 **** // scanf's ! /*rfscanf(0,0,0); rsscanf(0,0); rscanf(0,0); - rvfscanf(0,0,0); - rvsscanf(0,0,0); - rvscanf(0,0);*/ // File ! // rfdopen(0,0); ! // rfopen(0,0); ! // rfreopen(0,0,0); // str --- 198,209 ---- // scanf's ! rfscanf(0,0,0); rsscanf(0,0); rscanf(0,0); // File ! rfdopen(0,0); ! rfopen(0,0); ! rfreopen(0,0,0); // str *************** *** 179,190 **** rstrncmp(0,0,0); rstrncpy(0,0,0); - // rstrnset(0,0,0); ??? rstrpbrk(_R(""),0); rstrrchr(_R(""),0); ! // rstrrev(0); ??? ! // rstrset(0,0); ??? rstrspn(0,0); rstrstr(_R(""), _R("")); ! // rstrtok(0,0); <- multi-thread safe version is needed!!! // is* --- 222,234 ---- rstrncmp(0,0,0); rstrncpy(0,0,0); rstrpbrk(_R(""),0); rstrrchr(_R(""),0); ! rstrrev(0); ! rstrset(0,0); ! rstrnset(0,0,0); rstrspn(0,0); rstrstr(_R(""), _R("")); ! rstrtok(0,0); ! rstrtok_r(0,0); // is* *************** *** 202,209 **** rtolower(0); rtoupper(0); ! //rstrlwr(0); ! //rstrupr(0); } - #endif /** --- 246,252 ---- rtolower(0); rtoupper(0); ! rstrlwr(0); ! rstrupr(0); } /** |
From: <sp...@us...> - 2004-02-29 09:04:54
|
Update of /cvsroot/rtk/rtk/src/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15437 Modified Files: rchar.cpp Log Message: Just a little comment Index: rchar.cpp =================================================================== RCS file: /cvsroot/rtk/rtk/src/core/rchar.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** rchar.cpp 28 Feb 2004 22:27:26 -0000 1.5 --- rchar.cpp 29 Feb 2004 08:46:54 -0000 1.6 *************** *** 52,55 **** --- 52,59 ---- s_ptr[1] can be over the actual buffer, if last char in fmt is '%' So this is incorrect. + + Pali: + IMHO if last char in fmt is '%', which means s_ptr[0] == '%' + then s_ptr[1] == '\0' ;-) */ |
From: <laz...@us...> - 2004-02-28 22:45:07
|
Update of /cvsroot/rtk/rtk/src/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15328/src/core Modified Files: rchar.cpp Log Message: really minor change :) Pali: No I didn't test it :)) Sooorry about that!!! but allocating in heap is not necessary in that case, (atleast embed sys) allocating in stack is more robust than in heap. Copying buffer while looping is normally same as strdup does, so this way we eliminate strdup loop completely. Index: rchar.cpp =================================================================== RCS file: /cvsroot/rtk/rtk/src/core/rchar.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** rchar.cpp 28 Feb 2004 20:59:24 -0000 1.4 --- rchar.cpp 28 Feb 2004 22:27:26 -0000 1.5 *************** *** 48,51 **** --- 48,56 ---- [...] IMHO smaller and faster + + Mikko: + s_ptr[1] can be over the actual buffer, if last char in fmt is '%' + So this is incorrect. + */ #define CVT(fmt_len) \ *************** *** 64,68 **** } \ } \ ! *d_ptr = 0; \ fmt = fmt2 --- 69,73 ---- } \ } \ ! *d_ptr = '\0'; \ fmt = fmt2 |
From: <sp...@us...> - 2004-02-28 21:17:01
|
Update of /cvsroot/rtk/rtk/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30850/test Modified Files: test.h Log Message: The linux build was broken (Mikko, have you tested the CVT macron in rchar.cpp ;-)?) Index: test.h =================================================================== RCS file: /cvsroot/rtk/rtk/test/test.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** test.h 28 Feb 2004 07:39:44 -0000 1.6 --- test.h 28 Feb 2004 20:59:24 -0000 1.7 *************** *** 27,31 **** /*#define PRINTF(fmt,rest...) rprintf(_R(" ") fmt, #rest)*/ ! #define PRINTF(printf_exp) rprintf printf_exp #endif --- 27,31 ---- /*#define PRINTF(fmt,rest...) rprintf(_R(" ") fmt, #rest)*/ ! //#define PRINTF(printf_exp) rprintf printf_exp #endif |
From: <sp...@us...> - 2004-02-28 21:16:59
|
Update of /cvsroot/rtk/rtk/rtk In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30850/rtk Modified Files: TVector.h Log Message: The linux build was broken (Mikko, have you tested the CVT macron in rchar.cpp ;-)?) Index: TVector.h =================================================================== RCS file: /cvsroot/rtk/rtk/rtk/TVector.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TVector.h 28 Feb 2004 07:39:43 -0000 1.2 --- TVector.h 28 Feb 2004 20:59:24 -0000 1.3 *************** *** 44,47 **** --- 44,48 ---- #include <rtk/rchar.h> + #include <rtk/Vector.h> namespace Rtk |
From: <sp...@us...> - 2004-02-28 21:16:58
|
Update of /cvsroot/rtk/rtk/src/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30850/src/core Modified Files: rchar.cpp Log Message: The linux build was broken (Mikko, have you tested the CVT macron in rchar.cpp ;-)?) Index: rchar.cpp =================================================================== RCS file: /cvsroot/rtk/rtk/src/core/rchar.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** rchar.cpp 28 Feb 2004 07:39:44 -0000 1.3 --- rchar.cpp 28 Feb 2004 20:59:24 -0000 1.4 *************** *** 32,37 **** #if !defined(_RTK_WIN32_) && defined(UNICODE) #define CVT(fmt_len) \ ! RCHAR *fmt2 = (RCHAR*)alloca(fmt_len); \ const RCHAR *s_ptr = fmt; RCHAR *d_ptr = fmt2; \ bool check = false; \ --- 32,54 ---- #if !defined(_RTK_WIN32_) && defined(UNICODE) + /* + I'm not sure if this is faster then the old one! + Write the value if check in EACH cycle? + What about this: + [...] + while (*s_ptr) { + if(s_ptr[0] == '%' && s_ptr[1] == 's') { + *d_ptr++ = '%'; + *d_ptr++ = 'S'; + s_ptr++; + } else { + *d_ptr++ = *s_ptr++; + } + } + [...] + IMHO smaller and faster + */ #define CVT(fmt_len) \ ! RCHAR *fmt2 = (RCHAR*)alloca((fmt_len)*sizeof(RCHAR)); \ const RCHAR *s_ptr = fmt; RCHAR *d_ptr = fmt2; \ bool check = false; \ *************** *** 46,50 **** *d_ptr++ = *s_ptr++; \ } \ ! } fmt = fmt2 // printf --- 63,69 ---- *d_ptr++ = *s_ptr++; \ } \ ! } \ ! *d_ptr = 0; \ ! fmt = fmt2 // printf *************** *** 58,62 **** int rvfprintf(FILE* f, const RCHAR* fmt, va_list args) { ! CVT(rstrlen(fmt)); return vfwprintf(f, fmt, args); } --- 77,81 ---- int rvfprintf(FILE* f, const RCHAR* fmt, va_list args) { ! CVT(rstrlen(fmt)+1); // +\0 return vfwprintf(f, fmt, args); } *************** *** 64,68 **** int rvprintf(const RCHAR* fmt, va_list args) { ! CVT(rstrlen(fmt)); return vfwprintf(stdout, fmt, args); } --- 83,87 ---- int rvprintf(const RCHAR* fmt, va_list args) { ! CVT(rstrlen(fmt)+1); // +\0 return vfwprintf(stdout, fmt, args); } *************** *** 99,103 **** int rvsscanf(const RCHAR* src, const RCHAR* fmt, va_list args) { ! CVT(rstrlen(fmt)); return vswscanf(src, fmt2, args); } --- 118,122 ---- int rvsscanf(const RCHAR* src, const RCHAR* fmt, va_list args) { ! CVT(rstrlen(fmt)); // +\0 return vswscanf(src, fmt2, args); } *************** *** 105,109 **** int rvfscanf(FILE* f, const RCHAR* fmt, va_list args) { ! CVT(rstrlen(fmt)); return vfwscanf(f, fmt2, args); } --- 124,128 ---- int rvfscanf(FILE* f, const RCHAR* fmt, va_list args) { ! CVT(rstrlen(fmt)); // +\0 return vfwscanf(f, fmt2, args); } *************** *** 111,115 **** int rvscanf(const RCHAR* fmt, va_list args) { ! CVT(rstrlen(fmt)); return vfwscanf(stdin, fmt2, args); } --- 130,134 ---- int rvscanf(const RCHAR* fmt, va_list args) { ! CVT(rstrlen(fmt)); // +\0 return vfwscanf(stdin, fmt2, args); } |
From: <sp...@us...> - 2004-02-28 21:16:58
|
Update of /cvsroot/rtk/rtk/test/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30850/test/core Modified Files: dlist0.cpp vector0.cpp Log Message: The linux build was broken (Mikko, have you tested the CVT macron in rchar.cpp ;-)?) Index: dlist0.cpp =================================================================== RCS file: /cvsroot/rtk/rtk/test/core/dlist0.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** dlist0.cpp 26 Feb 2004 20:07:41 -0000 1.1 --- dlist0.cpp 28 Feb 2004 20:59:24 -0000 1.2 *************** *** 8,12 **** void print(IntDList& list) { ! PRINTF(_R("list = ")); IntIter* iter = list.GetIterator(); int v; --- 8,12 ---- void print(IntDList& list) { ! rprintf(_R(" list = ")); IntIter* iter = list.GetIterator(); int v; *************** *** 25,29 **** void print_odd(IntDList& list) { ! PRINTF(_R("odds = ")); IntFilter* iter = list.GetFilter<int>(is_odd); int v; --- 25,29 ---- void print_odd(IntDList& list) { ! rprintf(_R(" odds = ")); IntFilter* iter = list.GetFilter<int>(is_odd); int v; *************** *** 38,43 **** { public: ! A() { PRINTF(_R("A::A\n")); } ! ~A() { PRINTF(_R("A::~A\n")); } }; --- 38,43 ---- { public: ! A() { rprintf(_R(" A::A\n")); } ! ~A() { rprintf(_R(" A::~A\n")); } }; Index: vector0.cpp =================================================================== RCS file: /cvsroot/rtk/rtk/test/core/vector0.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** vector0.cpp 28 Feb 2004 07:39:44 -0000 1.3 --- vector0.cpp 28 Feb 2004 20:59:24 -0000 1.4 *************** *** 4,8 **** #define PRINT(v,fmt) \ ! PRINTF(_R(#v " =")); \ for(int i = 0; i < v.GetCount(); i++) \ rprintf(_R(" '" fmt "'"), v[i]); \ --- 4,8 ---- #define PRINT(v,fmt) \ ! rprintf(_R(" " #v " =")); \ for(int i = 0; i < v.GetCount(); i++) \ rprintf(_R(" '" fmt "'"), v[i]); \ *************** *** 14,21 **** public: A() { ! PRINTF( (_R("A::A\n")) ); } ~A() { ! PRINTF( (_R("A::~A\n")) ); } }; --- 14,21 ---- public: A() { ! rprintf(_R(" A::A\n")); } ~A() { ! rprintf(_R(" A::~A\n")); } }; |
From: <laz...@us...> - 2004-02-28 07:56:53
|
Update of /cvsroot/rtk/rtk/src/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17692/src/core Modified Files: error.cpp rchar.cpp Log Message: - Fixed string stuff for W32..... - printf convert defined as macro and uses alloca now PLEASE do not ANY GNU GCC specific code, e.g. in test.h PRINTF macro.. There's no way in this world compile vector test.. So, I changed PRINTF macro to what MS VCPP support, though no idea about gcc... Index: error.cpp =================================================================== RCS file: /cvsroot/rtk/rtk/src/core/error.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** error.cpp 18 Jan 2004 20:17:07 -0000 1.2 --- error.cpp 28 Feb 2004 07:39:44 -0000 1.3 *************** *** 4,14 **** static const RCHAR * error_names[] = { ! _NOP(_R("No Error")), #if 1 # define INC_ERROR_CODES 1 ! # define ERROR_CODE0(name) _NOP( _R(#name) ), ! # define ERROR_CODE1(name,type) _NOP( _R(#type) _R(":") _R(#name) ), # include <rtk/error_codes.h> --- 4,14 ---- static const RCHAR * error_names[] = { ! _R("No Error"), #if 1 # define INC_ERROR_CODES 1 ! # define ERROR_CODE0(name) _R(#name), ! # define ERROR_CODE1(name,type) _R(#type) _R(":") _R(#name), # include <rtk/error_codes.h> *************** *** 19,24 **** #else ! _NOP_(_R("Out of memory")), ! _NOP_(_R("File not found")), #endif }; --- 19,24 ---- #else ! _R("Out of memory"), ! _R("File not found"), #endif }; *************** *** 30,34 **** if (code < 0) code = -code; if (code >= error_count) ! return _TR(_R("Unknown error")); return error_names[code]; } --- 30,34 ---- if (code < 0) code = -code; if (code >= error_count) ! return _R("Unknown error"); return error_names[code]; } Index: rchar.cpp =================================================================== RCS file: /cvsroot/rtk/rtk/src/core/rchar.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** rchar.cpp 26 Feb 2004 20:02:16 -0000 1.2 --- rchar.cpp 28 Feb 2004 07:39:44 -0000 1.3 *************** *** 4,7 **** --- 4,11 ---- #include <stdlib.h> + #ifdef _RTK_WIN32_ + #include <malloc.h> + #endif + namespace Rtk { *************** *** 11,15 **** RCHAR* ptr = ret; while (*str) { ! *ptr++ = rtolower(*str++); } return ret; --- 15,19 ---- RCHAR* ptr = ret; while (*str) { ! *ptr++ = rtolower(*str++); } return ret; *************** *** 21,45 **** RCHAR* ptr = ret; while (*str) { ! *ptr++ = rtoupper(*str++); } return ret; } ! #if UNICODE ! static RCHAR* convert(const RCHAR* fmt) ! { ! RCHAR* fmt2 = rstrdup(fmt); ! RCHAR* ptr = fmt2; ! while (*ptr) { ! if (ptr[0] == '%' && ptr[1] == 's') { ! ptr[1] = 'S'; ! ptr+=2; ! } else { ! ptr++; ! } ! } ! return fmt2; ! } // printf --- 25,50 ---- RCHAR* ptr = ret; while (*str) { ! *ptr++ = rtoupper(*str++); } return ret; } ! #if !defined(_RTK_WIN32_) && defined(UNICODE) ! #define CVT(fmt_len) \ ! RCHAR *fmt2 = (RCHAR*)alloca(fmt_len); \ ! const RCHAR *s_ptr = fmt; RCHAR *d_ptr = fmt2; \ ! bool check = false; \ ! while (*s_ptr) { \ ! if(check && *s_ptr=='s') { \ ! *d_ptr++ = 'S'; \ ! s_ptr++; \ ! check = false; \ ! } else { \ ! if(*s_ptr=='%') check = true; \ ! else check = false; \ ! *d_ptr++ = *s_ptr++; \ ! } \ ! } fmt = fmt2 // printf *************** *** 47,70 **** int rvsnprintf(RCHAR* dst, int max_len, const RCHAR* fmt, va_list args) { ! RCHAR* fmt2 = convert(fmt); ! int ret = vswprintf(dst, max_len, fmt2, args); ! free(fmt2); ! return ret; } int rvfprintf(FILE* f, const RCHAR* fmt, va_list args) { ! RCHAR* fmt2 = convert(fmt); ! int ret = vfwprintf(f, fmt2, args); ! free(fmt2); ! return ret; } int rvprintf(const RCHAR* fmt, va_list args) { ! RCHAR* fmt2 = convert(fmt); ! int ret = vfwprintf(stdout, fmt2, args); ! free(fmt2); ! return ret; } --- 52,69 ---- int rvsnprintf(RCHAR* dst, int max_len, const RCHAR* fmt, va_list args) { ! CVT(max_len); ! return vsnwprintf(dst, max_len, fmt, args); } int rvfprintf(FILE* f, const RCHAR* fmt, va_list args) { ! CVT(rstrlen(fmt)); ! return vfwprintf(f, fmt, args); } int rvprintf(const RCHAR* fmt, va_list args) { ! CVT(rstrlen(fmt)); ! return vfwprintf(stdout, fmt, args); } *************** *** 100,123 **** int rvsscanf(const RCHAR* src, const RCHAR* fmt, va_list args) { ! RCHAR* fmt2 = convert(fmt); ! int ret = vswscanf(src, fmt2, args); ! free(fmt2); ! return ret; } int rvfscanf(FILE* f, const RCHAR* fmt, va_list args) { ! RCHAR* fmt2 = convert(fmt); ! int ret = vfwscanf(f, fmt2, args); ! free(fmt2); ! return ret; } int rvscanf(const RCHAR* fmt, va_list args) { ! RCHAR* fmt2 = convert(fmt); ! int ret = vfwscanf(stdin, fmt2, args); ! free(fmt2); ! return ret; } --- 99,116 ---- int rvsscanf(const RCHAR* src, const RCHAR* fmt, va_list args) { ! CVT(rstrlen(fmt)); ! return vswscanf(src, fmt2, args); } int rvfscanf(FILE* f, const RCHAR* fmt, va_list args) { ! CVT(rstrlen(fmt)); ! return vfwscanf(f, fmt2, args); } int rvscanf(const RCHAR* fmt, va_list args) { ! CVT(rstrlen(fmt)); ! return vfwscanf(stdin, fmt2, args); } *************** *** 149,154 **** } - #else /* !UNICODE */ - #endif /* !UNICODE */ --- 142,145 ---- |
Update of /cvsroot/rtk/rtk/rtk In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17692/rtk Modified Files: DList.h List.h String.h TVector.h Vector.h conf.h conf.h.in debug.h rchar_ascii.h rchar_unicode.h rtkdef.h Log Message: - Fixed string stuff for W32..... - printf convert defined as macro and uses alloca now PLEASE do not ANY GNU GCC specific code, e.g. in test.h PRINTF macro.. There's no way in this world compile vector test.. So, I changed PRINTF macro to what MS VCPP support, though no idea about gcc... Index: DList.h =================================================================== RCS file: /cvsroot/rtk/rtk/rtk/DList.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** DList.h 26 Feb 2004 20:07:41 -0000 1.1 --- DList.h 28 Feb 2004 07:39:43 -0000 1.2 *************** *** 181,186 **** /////////////////////////////////////////////////////////////// ! inline void Push(T obj) { AddTail(obj); } ! inline T Pop() { return RemoveTail(); } /////////////////////////////////////////////////////////////// --- 181,186 ---- /////////////////////////////////////////////////////////////// ! RTK_INLINE void Push(T obj) { AddTail(obj); } ! RTK_INLINE T Pop() { return RemoveTail(); } /////////////////////////////////////////////////////////////// *************** *** 188,193 **** /////////////////////////////////////////////////////////////// ! inline void Queue(T obj) { AddTail(obj); } ! inline T Dequeue() { return RemoveFront(); } /////////////////////////////////////////////////////////////// --- 188,193 ---- /////////////////////////////////////////////////////////////// ! RTK_INLINE void Queue(T obj) { AddTail(obj); } ! RTK_INLINE T Dequeue() { return RemoveFront(); } /////////////////////////////////////////////////////////////// Index: List.h =================================================================== RCS file: /cvsroot/rtk/rtk/rtk/List.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** List.h 11 Feb 2004 12:29:29 -0000 1.5 --- List.h 28 Feb 2004 07:39:43 -0000 1.6 *************** *** 77,81 **** * Default constructor. */ ! inline List(): _head(0), _tail(0), _count(0), _free_func(0) { } // --------- DESTRUCTORS ----------------------------------- --- 77,81 ---- * Default constructor. */ ! List(): _head(0), _tail(0), _count(0), _free_func(0) { } // --------- DESTRUCTORS ----------------------------------- *************** *** 91,95 **** * Returns number of items in the list. */ ! inline int GetCount() const { return this->_count; } /** --- 91,95 ---- * Returns number of items in the list. */ ! RTK_INLINE int GetCount() const { return this->_count; } /** *************** *** 97,101 **** * @return LNode pointer to first node in List. */ ! inline LNode* GetFirst() const { return this->_head; } /** --- 97,101 ---- * @return LNode pointer to first node in List. */ ! RTK_INLINE LNode* GetFirst() const { return this->_head; } /** *************** *** 103,107 **** * @return LNode pointer to last node in List. */ ! inline LNode* GetLast() const { return this->_tail; } --- 103,107 ---- * @return LNode pointer to last node in List. */ ! RTK_INLINE LNode* GetLast() const { return this->_tail; } Index: String.h =================================================================== RCS file: /cvsroot/rtk/rtk/rtk/String.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** String.h 14 Feb 2004 20:02:12 -0000 1.5 --- String.h 28 Feb 2004 07:39:43 -0000 1.6 *************** *** 57,61 **** unsigned long ref; ! inline void delete_self() { ::free(str); delete this; } }; --- 57,61 ---- unsigned long ref; ! RTK_INLINE void delete_self() { ::free(str); delete this; } }; *************** *** 429,452 **** }; ! static inline bool operator < (const String &s1, const String &s2) { return s1.Cmp(s2)<0; } ! static inline bool operator <= (const String &s1, const String &s2) { return s1.Cmp(s2)<=0; } ! static inline bool operator > (const String &s1, const String &s2) { return s1.Cmp(s2)>0; } ! static inline bool operator >= (const String &s1, const String &s2) { return s1.Cmp(s2)>=0; } ! static inline bool operator == (const String &s1, const String &s2) { if(&s1==&s2) return true; return s1.Cmp(s2)==0; } ! static inline bool operator != (const String &s1, const String &s2) { return s1.Cmp(s2)!=0; } ! static inline bool operator < (const String &s1, const RCHAR *s2) { return s1.Cmp(s2)<0; } ! static inline bool operator <= (const String &s1, const RCHAR *s2) { return s1.Cmp(s2)<=0; } ! static inline bool operator > (const String &s1, const RCHAR *s2) { return s1.Cmp(s2)>0; } ! static inline bool operator >= (const String &s1, const RCHAR *s2) { return s1.Cmp(s2)>=0; } ! static inline bool operator == (const String &s1, const RCHAR *s2) { return s1.Cmp(s2)==0; } ! static inline bool operator != (const String &s1, const RCHAR *s2) { return s1.Cmp(s2)!=0; } ! static inline bool operator < (const RCHAR *s1, const String &s2) { return (rstrcmp(s1, s2.c_str()?s2.c_str():_R(""))<0); } ! static inline bool operator <= (const RCHAR *s1, const String &s2) { return (rstrcmp(s1, s2.c_str()?s2.c_str():_R(""))<=0); } ! static inline bool operator > (const RCHAR *s1, const String &s2) { return (rstrcmp(s1, s2.c_str()?s2.c_str():_R(""))>0); } ! static inline bool operator >= (const RCHAR *s1, const String &s2) { return (rstrcmp(s1, s2.c_str()?s2.c_str():_R(""))>=0); } ! static inline bool operator == (const RCHAR *s1, const String &s2) { return (rstrcmp(s1, s2.c_str()?s2.c_str():_R(""))==0); } ! static inline bool operator != (const RCHAR *s1, const String &s2) { return (rstrcmp(s1, s2.c_str()?s2.c_str():_R(""))!=0); } extern RTK_API String operator +(const wchar_t*, const String& rhs); --- 429,452 ---- }; ! static RTK_INLINE bool operator < (const String &s1, const String &s2) { return s1.Cmp(s2)<0; } ! static RTK_INLINE bool operator <= (const String &s1, const String &s2) { return s1.Cmp(s2)<=0; } ! static RTK_INLINE bool operator > (const String &s1, const String &s2) { return s1.Cmp(s2)>0; } ! static RTK_INLINE bool operator >= (const String &s1, const String &s2) { return s1.Cmp(s2)>=0; } ! static RTK_INLINE bool operator == (const String &s1, const String &s2) { if(&s1==&s2) return true; return s1.Cmp(s2)==0; } ! static RTK_INLINE bool operator != (const String &s1, const String &s2) { return s1.Cmp(s2)!=0; } ! static RTK_INLINE bool operator < (const String &s1, const RCHAR *s2) { return s1.Cmp(s2)<0; } ! static RTK_INLINE bool operator <= (const String &s1, const RCHAR *s2) { return s1.Cmp(s2)<=0; } ! static RTK_INLINE bool operator > (const String &s1, const RCHAR *s2) { return s1.Cmp(s2)>0; } ! static RTK_INLINE bool operator >= (const String &s1, const RCHAR *s2) { return s1.Cmp(s2)>=0; } ! static RTK_INLINE bool operator == (const String &s1, const RCHAR *s2) { return s1.Cmp(s2)==0; } ! static RTK_INLINE bool operator != (const String &s1, const RCHAR *s2) { return s1.Cmp(s2)!=0; } ! static RTK_INLINE bool operator < (const RCHAR *s1, const String &s2) { return (rstrcmp(s1, s2.c_str()?s2.c_str():_R(""))<0); } ! static RTK_INLINE bool operator <= (const RCHAR *s1, const String &s2) { return (rstrcmp(s1, s2.c_str()?s2.c_str():_R(""))<=0); } ! static RTK_INLINE bool operator > (const RCHAR *s1, const String &s2) { return (rstrcmp(s1, s2.c_str()?s2.c_str():_R(""))>0); } ! static RTK_INLINE bool operator >= (const RCHAR *s1, const String &s2) { return (rstrcmp(s1, s2.c_str()?s2.c_str():_R(""))>=0); } ! static RTK_INLINE bool operator == (const RCHAR *s1, const String &s2) { return (rstrcmp(s1, s2.c_str()?s2.c_str():_R(""))==0); } ! static RTK_INLINE bool operator != (const RCHAR *s1, const String &s2) { return (rstrcmp(s1, s2.c_str()?s2.c_str():_R(""))!=0); } extern RTK_API String operator +(const wchar_t*, const String& rhs); Index: TVector.h =================================================================== RCS file: /cvsroot/rtk/rtk/rtk/TVector.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TVector.h 26 Feb 2004 21:52:36 -0000 1.1 --- TVector.h 28 Feb 2004 07:39:43 -0000 1.2 *************** *** 82,92 **** const T Get(int idx) const { return (T)Vector::Get(idx); } T& At(int idx) { return (T&)Vector::At(idx); } ! inline T& operator[](int idx) { return (T&)Vector::At(idx); } ! inline void Push(T obj) { Vector::Push((void*)obj); } ! inline T Pop() { return (T)Vector::Pop(); } ! inline T Top() { return (T)Vector::Top(); } ! inline void Queue(T obj) { Vector::Queue((void*)obj); } T Dequeue() { return (T)Vector::Dequeue(); } }; --- 82,92 ---- const T Get(int idx) const { return (T)Vector::Get(idx); } T& At(int idx) { return (T&)Vector::At(idx); } ! RTK_INLINE T& operator[](int idx) { return (T&)Vector::At(idx); } ! RTK_INLINE void Push(T obj) { Vector::Push((void*)obj); } ! RTK_INLINE T Pop() { return (T)Vector::Pop(); } ! RTK_INLINE T Top() { return (T)Vector::Top(); } ! RTK_INLINE void Queue(T obj) { Vector::Queue((void*)obj); } T Dequeue() { return (T)Vector::Dequeue(); } }; Index: Vector.h =================================================================== RCS file: /cvsroot/rtk/rtk/rtk/Vector.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Vector.h 26 Feb 2004 21:52:29 -0000 1.2 --- Vector.h 28 Feb 2004 07:39:43 -0000 1.3 *************** *** 43,46 **** --- 43,48 ---- #define _RTK_VECTOR_H_ 1 + #include "conf.h" + namespace Rtk { *************** *** 178,182 **** @return the reference to the item, no range checking is done */ ! inline void*& operator[](int idx) { return _data[idx]; } /////////////////////////////////////////////////////////////// --- 180,184 ---- @return the reference to the item, no range checking is done */ ! RTK_INLINE void*& operator[](int idx) { return _data[idx]; } /////////////////////////////////////////////////////////////// *************** *** 185,194 **** /** Simulate a stack push */ ! inline void Push(void* obj) { Add(obj); } /** Simulate a stack pop. When the stack is empty returns 0 typecasted to void* */ ! inline void* Pop() { if (_count == 0) return (void*)0; return _data[--_count]; --- 187,196 ---- /** Simulate a stack push */ ! RTK_INLINE void Push(void* obj) { Add(obj); } /** Simulate a stack pop. When the stack is empty returns 0 typecasted to void* */ ! RTK_INLINE void* Pop() { if (_count == 0) return (void*)0; return _data[--_count]; *************** *** 196,200 **** /** Returns the top of the stack */ ! inline void* Top() const { return _data[_count-1]; } /////////////////////////////////////////////////////////////// --- 198,202 ---- /** Returns the top of the stack */ ! RTK_INLINE void* Top() const { return _data[_count-1]; } /////////////////////////////////////////////////////////////// *************** *** 203,207 **** /** Adds an item to the end of the queue */ ! inline void Queue(void* obj) { Add(obj); } /** Removes and returns the item from the head of the queue */ --- 205,209 ---- /** Adds an item to the end of the queue */ ! RTK_INLINE void Queue(void* obj) { Add(obj); } /** Removes and returns the item from the head of the queue */ Index: conf.h =================================================================== RCS file: /cvsroot/rtk/rtk/rtk/conf.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** conf.h 22 Feb 2004 10:21:29 -0000 1.5 --- conf.h 28 Feb 2004 07:39:44 -0000 1.6 *************** *** 2,40 **** #define __RTK_CONFIG_H__ 1 ! // Define macros for i18n ! // Will be moved to Translation.h or Locale.h or .. ! // _TR - Translate text ! #define _TR(x) x ! // _NOP - Notify translation parser for string to translate. Used in static RCHAR arrays ! #define _NOP(x) x #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) # define _RTK_WIN32_ 1 #endif // Define this, if the platform uses UNICODE ! #undef UNICODE ! #undef _UNICODE ! #undef MBCS // Not supported ! #undef _MBCS // Not supported ! #undef SBCS ! #undef _SBCS ! #define UNICODE 1 ! #if defined(UNICODE) // Be sure that _UNICODE is also defined (but only on Win32!) - # if defined(_RTK_WIN32_) # define _UNICODE 1 ! # else ! # undef _UNICODE ! # endif ! ! #else /* UNICODE */ ! ! // Singlebyte defined # define SBCS 1 # define _SBCS 1 - #endif --- 2,80 ---- #define __RTK_CONFIG_H__ 1 ! /************************************************************************* ! * Platform and compiler support detection ! */ ! #if defined(__GNUC__) ! # define _RTK_CC_GCC_ ! #elif defined(__SUNPRO_C) ! # define _RTK_CC_SUNPRO_ ! #elif defined(__SUNPRO_CC) ! # define _RTK_CC_SUNPRO_ ! # define __SUNPRO_C __SUNPRO_CC ! #elif defined(__xlC__) || defined(__IBMC__) || defined(__IBMCPP__) ! # define _RTK_CC_XLC_ ! #elif defined(_AIX) && !defined(__GNUC__) ! # define _RTK_CC_XLC_ /* Workaround for old xlc */ ! #elif defined(__DECC) || defined(__DECCXX) ! # define _RTK_CC_DECC_ ! #elif defined(__osf__) && defined(__LANGUAGE_C__) ! # define _RTK_CC_DECC_ /* Workaround for old DEC C compilers */ ! #elif defined(_MSC_VER) ! # define _RTK_CC_MSVC_ ! #elif defined(__BORLANDC__) ! # define _RTK_CC_BCB_ ! #endif ! ! /************************************************************************* ! * Detect whether we support inline ! */ ! #if defined(__cplusplus) ! # define RTK_INLINE inline ! #elif defined(RTK_CC_GCC) ! # define RTK_INLINE __inline__ ! #elif defined(TRIO_CC_MSVC) ! # define RTK_INLINE _inline ! #elif defined(TRIO_CC_BCB) ! # define RTK_INLINE __inline ! #else ! # define RTK_INLINE ! #endif #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) # define _RTK_WIN32_ 1 + #else + # define _RTK_LINUX_ 1 + #endif + + #if defined(_WIN32_WCE) + # define _RTK_WINCE_ 1 + #endif + + // Prevent Visual C++ 6.0 from printing out stupid warnings + #if defined(_RTK_CC_MSVC_) && (_MSC_VER >= 600) + # pragma warning(disable: 4550) + # pragma warning(disable: 4244) #endif // Define this, if the platform uses UNICODE ! //#define UNICODE 1 ! #if defined(_RTK_WIN32_) ! // UNICODE is default WIN32, but not must ! # define UNICODE 1 ! #endif ! #if defined(_RTK_WINCE_) && !defined(UNICODE) ! // UNICODE is MUST under WinCE ! # define UNICODE 1 ! #endif ! ! #if defined(UNICODE) && defined(_RTK_WIN32_) && !defined(_UNICODE) // Be sure that _UNICODE is also defined (but only on Win32!) # define _UNICODE 1 ! #else ! // Singlebyte defined (ASCII) # define SBCS 1 # define _SBCS 1 #endif Index: conf.h.in =================================================================== RCS file: /cvsroot/rtk/rtk/rtk/conf.h.in,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** conf.h.in 21 Feb 2004 23:49:04 -0000 1.4 --- conf.h.in 28 Feb 2004 07:39:44 -0000 1.5 *************** *** 2,17 **** #define __RTK_CONFIG_H__ 1 - // --- RTK BUILD CONFIG (automatic) definitions - #define RTK_BC_HAVE_WCSCMP @RTK_BC_HAVE_WCSCMP@ ! // Define macros for i18n ! // Will be moved to Translation.h or Locale.h or .. ! // _TR - Translate text ! #define _TR(x) x ! // _NOP - Notify translation parser for string to translate. Used in static RCHAR arrays ! #define _NOP(x) x #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) # define _RTK_WIN32_ 1 #endif --- 2,59 ---- #define __RTK_CONFIG_H__ 1 ! /************************************************************************* ! * Platform and compiler support detection ! */ ! #if defined(__GNUC__) ! # define _RTK_CC_GCC_ ! #elif defined(__SUNPRO_C) ! # define _RTK_CC_SUNPRO_ ! #elif defined(__SUNPRO_CC) ! # define _RTK_CC_SUNPRO_ ! # define __SUNPRO_C __SUNPRO_CC ! #elif defined(__xlC__) || defined(__IBMC__) || defined(__IBMCPP__) ! # define _RTK_CC_XLC_ ! #elif defined(_AIX) && !defined(__GNUC__) ! # define _RTK_CC_XLC_ /* Workaround for old xlc */ ! #elif defined(__DECC) || defined(__DECCXX) ! # define _RTK_CC_DECC_ ! #elif defined(__osf__) && defined(__LANGUAGE_C__) ! # define _RTK_CC_DECC_ /* Workaround for old DEC C compilers */ ! #elif defined(_MSC_VER) ! # define _RTK_CC_MSVC_ ! #elif defined(__BORLANDC__) ! # define _RTK_CC_BCB_ ! #endif ! ! /************************************************************************* ! * Detect whether we support inline ! */ ! #if defined(__cplusplus) ! # define RTK_INLINE inline ! #elif defined(RTK_CC_GCC) ! # define RTK_INLINE __inline__ ! #elif defined(TRIO_CC_MSVC) ! # define RTK_INLINE _inline ! #elif defined(TRIO_CC_BCB) ! # define RTK_INLINE __inline ! #else ! # define RTK_INLINE ! #endif #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) # define _RTK_WIN32_ 1 + #else + # define _RTK_LINUX_ 1 + #endif + + #if defined(_WIN32_WCE) + # define _RTK_WINCE_ 1 + #endif + + // Prevent Visual C++ 6.0 from printing out stupid warnings + #if defined(_RTK_CC_MSVC_) && (_MSC_VER >= 600) + # pragma warning(disable: 4550) + # pragma warning(disable: 4244) #endif *************** *** 19,33 **** //#define UNICODE 1 ! #if defined(UNICODE) // Be sure that _UNICODE is also defined (but only on Win32!) - # if defined(_RTK_WIN32_) # define _UNICODE 1 - # else - # undef _UNICODE - # endif #else ! // Multibyte defined ! //# define MBCS 1 ! //# define _MBCS 1 #endif --- 61,81 ---- //#define UNICODE 1 ! #if defined(_RTK_WIN32_) ! // UNICODE is default WIN32, but not must ! # define UNICODE 1 ! #endif ! ! #if defined(_RTK_WINCE_) && !defined(UNICODE) ! // UNICODE is MUST under WinCE ! # define UNICODE 1 ! #endif ! ! #if defined(UNICODE) && defined(_RTK_WIN32_) && !defined(_UNICODE) // Be sure that _UNICODE is also defined (but only on Win32!) # define _UNICODE 1 #else ! // Singlebyte defined (ASCII) ! # define SBCS 1 ! # define _SBCS 1 #endif Index: debug.h =================================================================== RCS file: /cvsroot/rtk/rtk/rtk/debug.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** debug.h 21 Feb 2004 23:49:04 -0000 1.2 --- debug.h 28 Feb 2004 07:39:44 -0000 1.3 *************** *** 56,60 **** * @param msg the message (format) */ ! inline void DBG(int prior, int mask, const RCHAR * msg, ...) { if (prior <= DEBUG_LEVEL) { // this will be optimized compile time --- 56,60 ---- * @param msg the message (format) */ ! static RTK_INLINE void DBG(int prior, int mask, const RCHAR * msg, ...) { if (prior <= DEBUG_LEVEL) { // this will be optimized compile time *************** *** 74,78 **** * @param msg the message */ ! inline void DBG(const RCHAR * msg) { if (DEBUG_LEVEL >= 0) --- 74,78 ---- * @param msg the message */ ! static RTK_INLINE void DBG(const RCHAR * msg) { if (DEBUG_LEVEL >= 0) Index: rchar_ascii.h =================================================================== RCS file: /cvsroot/rtk/rtk/rtk/rchar_ascii.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** rchar_ascii.h 26 Feb 2004 20:02:16 -0000 1.4 --- rchar_ascii.h 28 Feb 2004 07:39:44 -0000 1.5 *************** *** 21,25 **** // Get #define rfgets fgets - // Not recomended #define rgets gets #define rgetchar getchar --- 21,24 ---- *************** *** 45,53 **** #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 *************** *** 91,106 **** // is* #define risascii isascii ! #define riscntrl iswcntrl ! #define risgraph iswgraph ! #define rislower iswlower ! #define risprint iswprint ! #define rispunct iswpunct ! #define risspace iswspace ! #define risupper iswupper ! #define risxdigit iswxdigit // case conversions ! #define rtolower towlower ! #define rtoupper towupper //#define rstrlwr strlwr //#define rstrupr strupr --- 90,108 ---- // is* #define risascii isascii ! #define riscntrl iscntrl ! #define risgraph isgraph ! #define rislower islower ! #define risprint isprint ! #define rispunct ispunct ! #define risspace isspace ! #define risupper isupper ! #define risxdigit isxdigit ! #define risdigit isdigit ! #define risalpha isalpha // case conversions ! #define rtolower tolower ! #define rtoupper toupper ! //#define rstrlwr strlwr //#define rstrupr strupr Index: rchar_unicode.h =================================================================== RCS file: /cvsroot/rtk/rtk/rtk/rchar_unicode.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** rchar_unicode.h 23 Feb 2004 20:16:43 -0000 1.3 --- rchar_unicode.h 28 Feb 2004 07:39:44 -0000 1.4 *************** *** 48,52 **** #define rputtchar putwchar //#define rputs putws ! inline int rputs(const RCHAR* str) { fputws(str, stdout); } // str <-> number conversions --- 48,52 ---- #define rputtchar putwchar //#define rputs putws ! static RTK_INLINE int rputs(const RCHAR* str) { fputws(str, stdout); } // str <-> number conversions *************** *** 62,67 **** #define rstrtoul wcstoul // 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); --- 62,68 ---- #define rstrtoul wcstoul + #if !defined(_RTK_WIN32_) && defined(UNICODE) + // printf like int rvsnprintf(RCHAR* dst, int max_len, const RCHAR* fmt, va_list args); int rvfprintf(FILE* f, const RCHAR* fmt, va_list args); *************** *** 78,85 **** --- 79,102 ---- int rfscanf(FILE* f, const RCHAR* fmt, ...); int rscanf(const RCHAR* fmt, ...); + + #else + + // 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 #define rscanf wscanf + #endif + // File // todo: what about linux? *************** *** 113,118 **** // is* ! //#define risascii iswascii ! inline int risascii(RCHAR c) { return !(c & 0x7f); } #define riscntrl iswcntrl #define risgraph iswgraph --- 130,134 ---- // is* ! #define risascii iswascii #define riscntrl iswcntrl #define risgraph iswgraph *************** *** 123,130 **** --- 139,149 ---- #define risupper iswupper #define risxdigit iswxdigit + #define risdigit iswdigit + #define risalpha iswalpha // case conversions #define rtolower towlower #define rtoupper towupper + //#define rstrlwr _wcslwr //#define rstrupr _wcsupr Index: rtkdef.h =================================================================== RCS file: /cvsroot/rtk/rtk/rtk/rtkdef.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** rtkdef.h 22 Feb 2004 10:21:29 -0000 1.8 --- rtkdef.h 28 Feb 2004 07:39:44 -0000 1.9 *************** *** 48,62 **** */ ! #ifndef _RTK_RTKDEFS_H_ ! #define _RTK_RTKDEFS_H_ 1 ! #include <rtk/Export.h> ! namespace Rtk ! { ! /// ! /// RTK version definitions ! /// #define RTK_VER_MAJOR 0 #define RTK_VER_MINOR 1 --- 48,60 ---- */ ! #ifndef _RTK_RTKDEF_H_ ! #define _RTK_RTKDEF_H_ 1 ! #include "Export.h" ! #include "conf.h" ! namespace Rtk { ! // RTK version definitions #define RTK_VER_MAJOR 0 #define RTK_VER_MINOR 1 *************** *** 66,74 **** RTK_VER_RELEASE * 0.0001f) ! /// /// Common types - /// ! #if defined(_WIN32) && !defined(__GNUC__) typedef unsigned __int64 ulonglong; typedef __int64 longlong; --- 64,71 ---- RTK_VER_RELEASE * 0.0001f) ! //////////////////////////////// /// Common types ! #if defined(_RTK_WIN32_) && !defined(_RTK_CC_GCC_) typedef unsigned __int64 ulonglong; typedef __int64 longlong; *************** *** 83,92 **** typedef unsigned short ushort; ! #if defined(_WIN32) ! # undef dirsep ! # define dirsep '\\' #else ! # undef dirsep ! # define dirsep '/' #endif --- 80,89 ---- typedef unsigned short ushort; ! #if defined(_RTK_WIN32_) ! # undef dirsep ! # define dirsep '\\' #else ! # undef dirsep ! # define dirsep '/' #endif *************** *** 99,114 **** typedef int (*CmpFunction)(const void *item1, const void *item2); - /// - /// Prevent Visual C++ 6.0 from printing out stupid warnings - /// - #if defined(_MSC_VER) && (_MSC_VER >= 600) - # pragma warning(disable: 4550) - # pragma warning(disable: 4244) - #endif - #define TestFlag(flag, inflags) ( ((flag)&(inflags))!=0 ) #define ClearFlag(flag, inflags) (inflags = ((inflags)&~(flag)) ) ! }; // Rtk namespace #endif --- 96,103 ---- typedef int (*CmpFunction)(const void *item1, const void *item2); #define TestFlag(flag, inflags) ( ((flag)&(inflags))!=0 ) #define ClearFlag(flag, inflags) (inflags = ((inflags)&~(flag)) ) ! } // Rtk namespace #endif |
From: <laz...@us...> - 2004-02-28 07:56:53
|
Update of /cvsroot/rtk/rtk/test/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17692/test/core Modified Files: string0.cpp vector0.cpp Log Message: - Fixed string stuff for W32..... - printf convert defined as macro and uses alloca now PLEASE do not ANY GNU GCC specific code, e.g. in test.h PRINTF macro.. There's no way in this world compile vector test.. So, I changed PRINTF macro to what MS VCPP support, though no idea about gcc... Index: string0.cpp =================================================================== RCS file: /cvsroot/rtk/rtk/test/core/string0.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** string0.cpp 23 Feb 2004 20:16:43 -0000 1.10 --- string0.cpp 28 Feb 2004 07:39:44 -0000 1.11 *************** *** 110,115 **** #if UNICODE // Now small cyrillic test - "Best regards to all RTK fans" ! String sCyr = L"ÐоздÑав Ñвим ÑÑбиÑеÑима RTK-а\n"; ! wprintf(sCyr.c_str()); #endif --- 110,115 ---- #if UNICODE // Now small cyrillic test - "Best regards to all RTK fans" ! //String sCyr = L"ÐоздÑав Ñвим ÑÑбиÑеÑима RTK-а\n"; ! //wprintf(sCyr.c_str()); #endif *************** *** 117,120 **** --- 117,121 ---- } + #if 0 // This is dummy function // Just to check declarations of functions at compile time *************** *** 151,160 **** // scanf's ! rfscanf(0,0,0); rsscanf(0,0); rscanf(0,0); rvfscanf(0,0,0); rvsscanf(0,0,0); ! rvscanf(0,0); // File --- 152,161 ---- // scanf's ! /*rfscanf(0,0,0); rsscanf(0,0); rscanf(0,0); rvfscanf(0,0,0); rvsscanf(0,0,0); ! rvscanf(0,0);*/ // File *************** *** 201,207 **** rtolower(0); rtoupper(0); ! rstrlwr(0); ! rstrupr(0); } /** --- 202,209 ---- rtolower(0); rtoupper(0); ! //rstrlwr(0); ! //rstrupr(0); } + #endif /** Index: vector0.cpp =================================================================== RCS file: /cvsroot/rtk/rtk/test/core/vector0.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** vector0.cpp 26 Feb 2004 21:52:27 -0000 1.2 --- vector0.cpp 28 Feb 2004 07:39:44 -0000 1.3 *************** *** 1,4 **** - #include <rtk/Vector.h> #include <rtk/TVector.h> #include "../test.h" --- 1,4 ---- #include <rtk/TVector.h> + #include "../test.h" *************** *** 13,18 **** { public: ! A() { PRINTF(_R("A::A\n")); } ! ~A() { PRINTF(_R("A::~A\n")); } }; --- 13,22 ---- { public: ! A() { ! PRINTF( (_R("A::A\n")) ); ! } ! ~A() { ! PRINTF( (_R("A::~A\n")) ); ! } }; |
From: <laz...@us...> - 2004-02-28 07:56:53
|
Update of /cvsroot/rtk/rtk/ide/vcpp6/rtk_static In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17692/ide/vcpp6/rtk_static Modified Files: rtk_static.dsp Log Message: - Fixed string stuff for W32..... - printf convert defined as macro and uses alloca now PLEASE do not ANY GNU GCC specific code, e.g. in test.h PRINTF macro.. There's no way in this world compile vector test.. So, I changed PRINTF macro to what MS VCPP support, though no idea about gcc... Index: rtk_static.dsp =================================================================== RCS file: /cvsroot/rtk/rtk/ide/vcpp6/rtk_static/rtk_static.dsp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** rtk_static.dsp 22 Feb 2004 10:21:29 -0000 1.7 --- rtk_static.dsp 28 Feb 2004 07:39:43 -0000 1.8 *************** *** 114,117 **** --- 114,121 ---- # Begin Source File + SOURCE=..\..\..\src\core\rchar.cpp + # End Source File + # Begin Source File + SOURCE=..\..\..\src\core\SList.cpp # End Source File *************** *** 128,131 **** --- 132,139 ---- SOURCE=..\..\..\src\core\Variant.cpp # End Source File + # Begin Source File + + SOURCE=..\..\..\src\core\Vector.cpp + # End Source File # End Group # Begin Group "Header Files" *************** *** 150,153 **** --- 158,165 ---- # Begin Source File + SOURCE=..\..\..\rtk\DList.h + # End Source File + # Begin Source File + SOURCE=..\..\..\rtk\error.h # End Source File *************** *** 206,215 **** --- 218,239 ---- # Begin Source File + SOURCE=..\..\..\rtk\TArray.h + # End Source File + # Begin Source File + SOURCE=..\..\..\rtk\Thread.h # End Source File # Begin Source File + SOURCE=..\..\..\rtk\TVector.h + # End Source File + # Begin Source File + SOURCE=..\..\..\rtk\Variant.h # End Source File + # Begin Source File + + SOURCE=..\..\..\rtk\Vector.h + # End Source File # End Group # End Target |