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: Mikko L. <laz...@us...> - 2004-06-13 07:41:26
|
Update of /cvsroot/rtk/rtk/src/core/platform/linux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30504 Modified Files: File.cpp Log Message: minor Index: File.cpp =================================================================== RCS file: /cvsroot/rtk/rtk/src/core/platform/linux/File.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** File.cpp 12 Jun 2004 20:34:40 -0000 1.5 --- File.cpp 13 Jun 2004 07:41:16 -0000 1.6 *************** *** 47,62 **** #include <rtk/File.h> - #include <stdlib.h> //free - ! namespace Rtk ! { #include <fcntl.h> #include <unistd.h> #include <sys/file.h> ! #ifndef INVALID_SET_FILE_POINTER ! #define INVALID_SET_FILE_POINTER 0xFFFFFFFF ! #endif #ifndef INVALID_HANDLE_VALUE --- 47,58 ---- #include <rtk/File.h> ! #include <stdlib.h> #include <fcntl.h> #include <unistd.h> #include <sys/file.h> ! namespace Rtk ! { #ifndef INVALID_HANDLE_VALUE |
From: Dejan L. <le...@us...> - 2004-06-12 22:49:52
|
Update of /cvsroot/rtk/rtk/test/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27803 Modified Files: CMakeLists.txt Log Message: Added buffer0.cpp to tests and removed necessary comments from CMakeLists.txt file. Index: CMakeLists.txt =================================================================== RCS file: /cvsroot/rtk/rtk/test/core/CMakeLists.txt,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** CMakeLists.txt 12 Jun 2004 20:35:30 -0000 1.7 --- CMakeLists.txt 12 Jun 2004 22:49:42 -0000 1.8 *************** *** 41,67 **** FOREACH(NAME vector0 dlist0 debug0 list0 variant0 array0 dict0 error0 ! string0 file0) ADD_EXECUTABLE(test_core_${NAME} ${NAME}.cpp) TARGET_LINK_LIBRARIES(test_core_${NAME} ${RTK_LIBRTK}) ENDFOREACH(NAME) - # vv--- ??? ---^^ !!! - - # T0D0: debug test - #ADD_EXECUTABLE(test_core_debug0 debug0.cpp) - #TARGET_LINK_LIBRARIES(test_core_debug0 rtk) - - # T0D0: flags test - # ADD_EXECUTABLE(test_core_flags0 flags0.cpp) - # TARGET_LINK_LIBRARIES(test_core_flags0 rtk) - - # T0D0: error test - #ADD_EXECUTABLE(test_core_error0 error0.cpp) - #TARGET_LINK_LIBRARIES(test_core_error0 rtk) - - # Dict test - #ADD_EXECUTABLE(test_core_dict0 dict0.cpp) - #TARGET_LINK_LIBRARIES(test_core_dict0 ${RTK_LIBRTK}) - ######### ## LOG ############################################################ --- 41,49 ---- FOREACH(NAME vector0 dlist0 debug0 list0 variant0 array0 dict0 error0 ! string0 file0 buffer0) ADD_EXECUTABLE(test_core_${NAME} ${NAME}.cpp) TARGET_LINK_LIBRARIES(test_core_${NAME} ${RTK_LIBRTK}) ENDFOREACH(NAME) ######### ## LOG ############################################################ |
From: Dejan L. <de...@us...> - 2004-06-12 22:48:41
|
Update of /cvsroot/rtk/rtk/ide/devcxx In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26585/ide/devcxx Modified Files: Makefile.mingw librtk.dev librtk_private.h librtk_private.rc Log Message: Latest Buffer code and Dev-C++ project files. Index: librtk_private.h =================================================================== RCS file: /cvsroot/rtk/rtk/ide/devcxx/librtk_private.h,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** librtk_private.h 11 Jun 2004 23:13:16 -0000 1.14 --- librtk_private.h 12 Jun 2004 22:48:29 -0000 1.15 *************** *** 6,23 **** // VERSION DEFINITIONS ! #define VER_STRING "0.1.1.79" #define VER_MAJOR 0 #define VER_MINOR 1 #define VER_RELEASE 1 ! #define VER_BUILD 79 ! #define COMPANY_NAME "" #define FILE_VERSION "" #define FILE_DESCRIPTION "Developed using the Dev-C++ IDE" ! #define INTERNAL_NAME "" ! #define LEGAL_COPYRIGHT "" #define LEGAL_TRADEMARKS "" #define ORIGINAL_FILENAME "" ! #define PRODUCT_NAME "" ! #define PRODUCT_VERSION "" #endif //LIBRTK_PRIVATE_H --- 6,23 ---- // VERSION DEFINITIONS ! #define VER_STRING "0.1.1.101" #define VER_MAJOR 0 #define VER_MINOR 1 #define VER_RELEASE 1 ! #define VER_BUILD 101 ! #define COMPANY_NAME "RTK Team" #define FILE_VERSION "" #define FILE_DESCRIPTION "Developed using the Dev-C++ IDE" ! #define INTERNAL_NAME "RTK" ! #define LEGAL_COPYRIGHT "Copyright (C) 2003-2004, RTK Team" #define LEGAL_TRADEMARKS "" #define ORIGINAL_FILENAME "" ! #define PRODUCT_NAME "RTK" ! #define PRODUCT_VERSION "0.1" #endif //LIBRTK_PRIVATE_H Index: librtk_private.rc =================================================================== RCS file: /cvsroot/rtk/rtk/ide/devcxx/librtk_private.rc,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** librtk_private.rc 11 Jun 2004 23:13:16 -0000 1.14 --- librtk_private.rc 12 Jun 2004 22:48:29 -0000 1.15 *************** *** 9,14 **** // 1 VERSIONINFO ! FILEVERSION 0,1,1,79 ! PRODUCTVERSION 0,1,1,79 FILETYPE VFT_DLL { --- 9,14 ---- // 1 VERSIONINFO ! FILEVERSION 0,1,1,101 ! PRODUCTVERSION 0,1,1,101 FILETYPE VFT_DLL { *************** *** 17,29 **** BLOCK "040904E4" { ! VALUE "CompanyName", "" VALUE "FileVersion", "" VALUE "FileDescription", "Developed using the Dev-C++ IDE" ! VALUE "InternalName", "" ! VALUE "LegalCopyright", "" VALUE "LegalTrademarks", "" VALUE "OriginalFilename", "" ! VALUE "ProductName", "" ! VALUE "ProductVersion", "" } } --- 17,29 ---- BLOCK "040904E4" { ! VALUE "CompanyName", "RTK Team" VALUE "FileVersion", "" VALUE "FileDescription", "Developed using the Dev-C++ IDE" ! VALUE "InternalName", "RTK" ! VALUE "LegalCopyright", "Copyright (C) 2003-2004, RTK Team" VALUE "LegalTrademarks", "" VALUE "OriginalFilename", "" ! VALUE "ProductName", "RTK" ! VALUE "ProductVersion", "0.1" } } Index: Makefile.mingw =================================================================== RCS file: /cvsroot/rtk/rtk/ide/devcxx/Makefile.mingw,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Makefile.mingw 11 Jun 2004 23:13:16 -0000 1.1 --- Makefile.mingw 12 Jun 2004 22:48:29 -0000 1.2 *************** *** 8,17 **** OBJ = ../../obj/SList.o ../../obj/String.o ../../obj/Variant.o ../../obj/Dict.o ../../obj/Thread.o ../../obj/Mutex.o ../../obj/Array.o ../../obj/File.o ../../obj/Vector.o ../../obj/Buffer.o $(RES) LINKOBJ = ../../obj/SList.o ../../obj/String.o ../../obj/Variant.o ../../obj/Dict.o ../../obj/Thread.o ../../obj/Mutex.o ../../obj/Array.o ../../obj/File.o ../../obj/Vector.o ../../obj/Buffer.o $(RES) ! LIBS = -L"../../lib" -L"../../bin" --no-export-all-symbols --add-stdcall-alias ! INCS = -I"../.." -I"../../rtk" ! CXXINCS = -I"../.." -I"../../rtk" BIN = ../../bin/librtk.dll ! CXXFLAGS = $(CXXINCS) -DRTK_DLL=1 -DRTK_EXPORTS=1 -D_RTK_WIN32_=1 -DRTK_UNICODE=1 -O3 ! CFLAGS = $(INCS) -DBUILDING_DLL=1 -DRTK_DLL=1 -DRTK_EXPORTS=1 -D_RTK_WIN32_=1 -DRTK_UNICODE=1 -O3 .PHONY: all all-before all-after clean clean-custom --- 8,17 ---- OBJ = ../../obj/SList.o ../../obj/String.o ../../obj/Variant.o ../../obj/Dict.o ../../obj/Thread.o ../../obj/Mutex.o ../../obj/Array.o ../../obj/File.o ../../obj/Vector.o ../../obj/Buffer.o $(RES) LINKOBJ = ../../obj/SList.o ../../obj/String.o ../../obj/Variant.o ../../obj/Dict.o ../../obj/Thread.o ../../obj/Mutex.o ../../obj/Array.o ../../obj/File.o ../../obj/Vector.o ../../obj/Buffer.o $(RES) ! LIBS = -L"C:/GNU/devcxx/lib" -L"../../lib" -L"../../bin" --no-export-all-symbols --add-stdcall-alias ! INCS = -I"/mingw/include" -I"../.." -I"../../rtk" ! CXXINCS = -I"/mingw/include/c++" -I"/mingw/include/c++/mingw32" -I"/mingw/include/c++/backward" -I"/mingw/lib/gcc-lib/mingw32/3.2/include" -I"/mingw/include" -I"../.." -I"../../rtk" BIN = ../../bin/librtk.dll ! CXXFLAGS = $(CXXINCS)-DRTK_DLL=1 -DRTK_EXPORTS=1 -D_RTK_WIN32_=1 -DRTK_UNICODE=1 -O3 ! CFLAGS = $(INCS)-DBUILDING_DLL=1 -DRTK_DLL=1 -DRTK_EXPORTS=1 -D_RTK_WIN32_=1 -DRTK_UNICODE=1 -O3 .PHONY: all all-before all-after clean clean-custom Index: librtk.dev =================================================================== RCS file: /cvsroot/rtk/rtk/ide/devcxx/librtk.dev,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** librtk.dev 11 Jun 2004 23:13:16 -0000 1.13 --- librtk.dev 12 Jun 2004 22:48:29 -0000 1.14 *************** *** 11,16 **** ResourceIncludes= MakeIncludes= ! Compiler=-DBUILDING_DLL=1_@@_-DRTK_DLL=1_@@_-DRTK_EXPORTS=1_@@_-D_RTK_WIN32_=1_@@_-DRTK_UNICODE=1_@@_ ! CppCompiler=-DRTK_DLL=1_@@_-DRTK_EXPORTS=1_@@_-D_RTK_WIN32_=1_@@_-DRTK_UNICODE=1_@@_ Linker=--no-export-all-symbols --add-stdcall-alias_@@_ IsCpp=1 --- 11,16 ---- ResourceIncludes= MakeIncludes= ! Compiler=-DBUILDING_DLL=1_@@_-DRTK_DLL=1_@@_-DRTK_EXPORTS=1_@@_-D_RTK_WIN32_=1_@@_-DRTK_UNICODE=1_@@_-D_DEBUG=1_@@_ ! CppCompiler=-DRTK_DLL=1_@@_-DRTK_EXPORTS=1_@@_-D_RTK_WIN32_=1_@@_-DRTK_UNICODE=1_@@_-D_DEBUG=1_@@_ Linker=--no-export-all-symbols --add-stdcall-alias_@@_ IsCpp=1 *************** *** 28,32 **** SupportXPThemes=0 CompilerSet=0 ! CompilerSettings=0000000000001000000000 [Unit2] --- 28,32 ---- SupportXPThemes=0 CompilerSet=0 ! CompilerSettings=0000000000001101000000 [Unit2] *************** *** 47,63 **** Build=35 ======= ! Build=79 >>>>>>> 1.8 LanguageID=1033 CharsetID=1252 ! CompanyName= FileVersion= FileDescription=Developed using the Dev-C++ IDE ! InternalName= ! LegalCopyright= LegalTrademarks= OriginalFilename= ! ProductName= ! ProductVersion= AutoIncBuildNr=1 --- 47,63 ---- Build=35 ======= ! Build=101 >>>>>>> 1.8 LanguageID=1033 CharsetID=1252 ! CompanyName=RTK Team FileVersion= FileDescription=Developed using the Dev-C++ IDE ! InternalName=RTK ! LegalCopyright=Copyright (C) 2003-2004, RTK Team LegalTrademarks= OriginalFilename= ! ProductName=RTK ! ProductVersion=0.1 AutoIncBuildNr=1 |
From: Dejan L. <de...@us...> - 2004-06-12 22:48:40
|
Update of /cvsroot/rtk/rtk/rtk In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26585/rtk Modified Files: Buffer.h Log Message: Latest Buffer code and Dev-C++ project files. Index: Buffer.h =================================================================== RCS file: /cvsroot/rtk/rtk/rtk/Buffer.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Buffer.h 12 Jun 2004 07:33:29 -0000 1.8 --- Buffer.h 12 Jun 2004 22:48:29 -0000 1.9 *************** *** 49,58 **** #include "Export.h" #include "Array.h" #include "rtkdef.h" - #ifdef _DEBUG - #include "String.h" - #endif - namespace Rtk { --- 49,55 ---- #include "Export.h" #include "Array.h" + #include "IO.h" #include "rtkdef.h" namespace Rtk { *************** *** 119,127 **** void Fill(uchar arg_char); ! ! #ifdef _DEBUG ! void FromFile(const String& arg_fname); ! void ToFile(const String& arg_fname) const; ! #endif }; // Buffer }; // Rtk namespace --- 116,123 ---- void Fill(uchar arg_char); ! ! // This should be removed after testing... ! void From(IO* arg_io); ! void To(IO* arg_io); }; // Buffer }; // Rtk namespace |
From: Dejan L. <de...@us...> - 2004-06-12 22:48:39
|
Update of /cvsroot/rtk/rtk/src/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26585/src/core Modified Files: Buffer.cpp Log Message: Latest Buffer code and Dev-C++ project files. Index: Buffer.cpp =================================================================== RCS file: /cvsroot/rtk/rtk/src/core/Buffer.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Buffer.cpp 12 Jun 2004 07:32:53 -0000 1.7 --- Buffer.cpp 12 Jun 2004 22:48:29 -0000 1.8 *************** *** 42,51 **** #include <string.h> /* memcpy() */ #include <stdlib.h> /* malloc() */ - #include <rtk/Buffer.h> ! #ifdef _DEBUG ! #include <rtk/debug.h> ! #include <rtk/File.h> #endif --- 42,49 ---- #include <string.h> /* memcpy() */ #include <stdlib.h> /* malloc() */ #include <rtk/Buffer.h> ! #if _DEBUG ! #include <rtk/debug.h> #endif *************** *** 68,79 **** if(!_data) _data = (uchar*)malloc(_allocated); ! else _data = (uchar*)realloc(_data, _allocated); ! ! /* ! uchar* newdata = (uchar*) malloc(_allocated); ! memcpy(newdata, _data, _size); ! free(_data); ! _data = newdata; ! */ } // if return (_data + _size); --- 66,70 ---- if(!_data) _data = (uchar*)malloc(_allocated); ! else _data = (uchar*)realloc(_data, _allocated); } // if return (_data + _size); *************** *** 113,143 **** } // Fill() ! #ifdef _DEBUG ! // Code taken from eFLTK ... ! ! void Buffer::FromFile(const String& arg_fname) { ! File f(arg_fname, File::READ|File::BINARY); ! if(!f.IsOpen()) return; // Some error checks should be here... ! f.Seek(0, IO::END); ! long size = f.Tell(); ! f.Seek(0, IO::BEGIN); Allocate(size+1); _data[size] = '\0'; ! _size = f.Read(_data, size); ! f.Close(); ! } ! void Buffer::ToFile(const String& arg_fname) const { ! if(!_size) return; ! File f(arg_fname, File::WRITE|File::CREATE|File::BINARY); ! if(f.IsOpen()) { ! f.Write(_data, _size); ! f.Close(); } ! } ! #endif }; // Rtk --- 104,127 ---- } // Fill() ! void Buffer::From(IO* arg_io) { ! if(!arg_io->CanRead()) return; // Some error checks should be here... ! arg_io->Seek(0, IO::END); ! long size = arg_io->Tell(); ! arg_io->Seek(0, IO::BEGIN); Allocate(size+1); _data[size] = '\0'; ! _size = arg_io->Read(_data, size); ! } // From() ! void Buffer::To(IO* arg_io) { ! if (!_size) return; ! if (arg_io->CanWrite()) ! { ! arg_io->Write(_data, _size); } ! } // To() }; // Rtk |
From: Dejan L. <de...@us...> - 2004-06-12 22:47:07
|
Update of /cvsroot/rtk/rtk/test/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24893/test/core Modified Files: buffer0.cpp Log Message: Changed buffer0.cpp to use new Buffer::To() method and added Mikko as author. Index: buffer0.cpp =================================================================== RCS file: /cvsroot/rtk/rtk/test/core/buffer0.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** buffer0.cpp 12 Jun 2004 07:32:12 -0000 1.2 --- buffer0.cpp 12 Jun 2004 22:46:58 -0000 1.3 *************** *** 33,48 **** * Authors (chronological order): * Dejan Lekic, de...@nu... * Contributors (chronological order): * $fname $lname, $email ***** ! * Important note: This file, test_core.cpp shouldn't be EVER overwritten ! * in our CVS. It is actually template for test_* projects in our IDEs. ! * RTK developers should work on this file in their working environments, and ! * when they are satisfied with developed file they should save it with ! * PROPER name to /test/* directory. ***************************************************************************/ #include "../test.h" #include <rtk/Buffer.h> using namespace Rtk; --- 33,47 ---- * Authors (chronological order): * Dejan Lekic, de...@nu... + * Mikko Lahteenmaki, mikko§rtk.cx * Contributors (chronological order): * $fname $lname, $email ***** ! * T0D0: Writte better Buffer test than this... ***************************************************************************/ #include "../test.h" #include <rtk/Buffer.h> + #include <rtk/File.h> + #include <stdio.h> using namespace Rtk; *************** *** 51,54 **** --- 50,54 ---- { Buffer buf; + File f("dump.dat", File::WRITE|File::CREATE|File::BINARY); printf("Initial allocated: %d\n", buf.GetAllocated()); *************** *** 61,67 **** buf.Fill(1); ! #if 0 ! buf.ToFile("C:\\dump"); ! #endif getchar(); --- 61,66 ---- buf.Fill(1); ! buf.To(&f); ! f.Close(); getchar(); |
From: Mikko L. <laz...@us...> - 2004-06-12 20:35:39
|
Update of /cvsroot/rtk/rtk/test/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26002/core Modified Files: CMakeLists.txt Log Message: Added file test to CMake Index: CMakeLists.txt =================================================================== RCS file: /cvsroot/rtk/rtk/test/core/CMakeLists.txt,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** CMakeLists.txt 26 Feb 2004 20:13:15 -0000 1.6 --- CMakeLists.txt 12 Jun 2004 20:35:30 -0000 1.7 *************** *** 40,44 **** LINK_DIRECTORIES(${RTK_SOURCE_DIR}/lib ${RTK_SOURCE_DIR}/src/core/lib ${RTK_SOURCE_DIR}/src/core) ! FOREACH(NAME vector0 dlist0 debug0 list0 variant0 array0 dict0 error0 string0) ADD_EXECUTABLE(test_core_${NAME} ${NAME}.cpp) TARGET_LINK_LIBRARIES(test_core_${NAME} ${RTK_LIBRTK}) --- 40,45 ---- LINK_DIRECTORIES(${RTK_SOURCE_DIR}/lib ${RTK_SOURCE_DIR}/src/core/lib ${RTK_SOURCE_DIR}/src/core) ! FOREACH(NAME vector0 dlist0 debug0 list0 variant0 array0 dict0 error0 ! string0 file0) ADD_EXECUTABLE(test_core_${NAME} ${NAME}.cpp) TARGET_LINK_LIBRARIES(test_core_${NAME} ${RTK_LIBRTK}) |
From: Mikko L. <laz...@us...> - 2004-06-12 20:34:49
|
Update of /cvsroot/rtk/rtk/src/core/platform/linux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25085/core/platform/linux Modified Files: File.cpp Log Message: File works now under linux. (locking does not..) Index: File.cpp =================================================================== RCS file: /cvsroot/rtk/rtk/src/core/platform/linux/File.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** File.cpp 12 Jun 2004 20:12:03 -0000 1.4 --- File.cpp 12 Jun 2004 20:34:40 -0000 1.5 *************** *** 64,68 **** #endif ! #define FD *((int*)_handle) File::File() --- 64,68 ---- #endif ! #define FD ((int)_handle) File::File() *************** *** 213,217 **** if(_mode & SYNC) open_flags |= O_SYNC; ! _handle = (void*) open(afile, open_flags); if(_mode & LOCKED) --- 213,217 ---- if(_mode & SYNC) open_flags |= O_SYNC; ! _handle = (void*) open(afile, open_flags, 0666); if(_mode & LOCKED) *************** *** 272,277 **** int read_bytes = 0; ! if( (read_bytes=read(FD, buffer, buffer_len)) >= 0) ! { _eos = (read_bytes == 0); return read_bytes; --- 272,278 ---- int read_bytes = 0; ! read_bytes = ::read(FD, buffer, buffer_len); ! //printf("FD = %d, read %d\n", FD, read_bytes); ! if (read_bytes >= 0) { _eos = (read_bytes == 0); return read_bytes; |
From: Mikko L. <laz...@us...> - 2004-06-12 20:12:12
|
Update of /cvsroot/rtk/rtk/src/core/platform/linux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30800 Modified Files: File.cpp Log Message: One more UNICODE fix Index: File.cpp =================================================================== RCS file: /cvsroot/rtk/rtk/src/core/platform/linux/File.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** File.cpp 12 Jun 2004 18:37:02 -0000 1.3 --- File.cpp 12 Jun 2004 20:12:03 -0000 1.4 *************** *** 242,247 **** if(close(FD)<0) return false; //remove temporary file ! if (_mode & TEMP) unlink(_filename.c_str()); _handle = INVALID_HANDLE_VALUE; --- 242,258 ---- if(close(FD)<0) return false; + const RCHAR *file = _filename.c_str(); + const char *afile = NULL; + + #ifdef UNICODE + W2A(file, afile); + if(afile==NULL) return false; + #else + afile = file; + #endif + //remove temporary file ! if (_mode & TEMP) ! unlink(afile); _handle = INVALID_HANDLE_VALUE; |
From: Dejan L. <de...@us...> - 2004-06-12 18:52:39
|
Update of /cvsroot/rtk/rtk/rtk In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13918/rtk Modified Files: File.h Log Message: Changed #include lines. Index: File.h =================================================================== RCS file: /cvsroot/rtk/rtk/rtk/File.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** File.h 21 Feb 2004 19:18:10 -0000 1.2 --- File.h 12 Jun 2004 18:52:31 -0000 1.3 *************** *** 43,48 **** #define _RTK_FILE_H_ 1 ! #include <rtk/String.h> ! #include <rtk/IO.h> namespace Rtk --- 43,48 ---- #define _RTK_FILE_H_ 1 ! #include "String.h" ! #include "IO.h" namespace Rtk |
From: Mikko L. <laz...@us...> - 2004-06-12 18:37:12
|
Update of /cvsroot/rtk/rtk/src/core/platform/linux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29388 Modified Files: File.cpp Log Message: Should compile now Index: File.cpp =================================================================== RCS file: /cvsroot/rtk/rtk/src/core/platform/linux/File.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** File.cpp 12 Jun 2004 18:33:31 -0000 1.2 --- File.cpp 12 Jun 2004 18:37:02 -0000 1.3 *************** *** 172,175 **** --- 172,176 ---- #ifdef UNICODE + // Convert WCHAR -> CHAR, destination allocated in stack! (no need to free) #define W2A(src, dst) do { \ int src_len = rstrlen(src); \ *************** *** 179,183 **** if(wcstombs(_dst, src, src_len)==-1) break; \ _dst[dst_len] = '\0'; \ ! dst = _dst; \ } while(0) #endif --- 180,184 ---- if(wcstombs(_dst, src, src_len)==-1) break; \ _dst[dst_len] = '\0'; \ ! dst = (const char*)_dst; \ } while(0) #endif *************** *** 186,190 **** { const RCHAR *file = _filename.c_str(); ! char *afile = NULL; #ifdef UNICODE --- 187,191 ---- { const RCHAR *file = _filename.c_str(); ! const char *afile = NULL; #ifdef UNICODE *************** *** 234,238 **** //unlock the file ! if (_mode & LOCK) flock(FD, LOCK_UN); //close file --- 235,240 ---- //unlock the file ! if (_mode & LOCKED) ! flock(FD, LOCK_UN); //close file *************** *** 259,263 **** int read_bytes = 0; ! if( (read_bytes=read(_handle, buffer, buffer_len)) >= 0) { _eos = (read_bytes == 0); --- 261,265 ---- int read_bytes = 0; ! if( (read_bytes=read(FD, buffer, buffer_len)) >= 0) { _eos = (read_bytes == 0); *************** *** 277,281 **** _eos = false; ! if( (writen_bytes=write(FD, buffer, buffer_len)) > 0) { return written_bytes; --- 279,283 ---- _eos = false; ! if( (written_bytes=write(FD, buffer, buffer_len)) > 0) { return written_bytes; |
From: Mikko L. <laz...@us...> - 2004-06-12 18:33:40
|
Update of /cvsroot/rtk/rtk/src/core/platform/linux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25120 Modified Files: File.cpp Log Message: Made some blind changes, w/o even try to compile yet.. Anyway, now there's better change to compile :) Index: File.cpp =================================================================== RCS file: /cvsroot/rtk/rtk/src/core/platform/linux/File.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** File.cpp 11 Jun 2004 22:14:18 -0000 1.1 --- File.cpp 12 Jun 2004 18:33:31 -0000 1.2 *************** *** 89,93 **** uint flags=0; _eos = false; ! _handle = (void*)(fd=fileno(file)); val=fcntl(FD,F_GETFL,0); --- 89,93 ---- uint flags=0; _eos = false; ! _handle = (void*)fileno(file); val=fcntl(FD,F_GETFL,0); *************** *** 171,177 **** --- 171,198 ---- } + #ifdef UNICODE + #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) + #endif + bool File::Open() { const RCHAR *file = _filename.c_str(); + char *afile = NULL; + + #ifdef UNICODE + W2A(file, afile); + if(afile==NULL) return false; + #else + afile = file; + #endif + if (_handle!=INVALID_HANDLE_VALUE) return false; *************** *** 180,186 **** if(_mode & READ) { ! if (_mode & WRITE) open_flags |= O_RDWR; ! else open_flags |= O_RDONLY; ! } else if(_mode & WRITE) open_flags |= O_WRONLY; if(_mode & CREATE) open_flags |= O_CREAT; --- 201,209 ---- if(_mode & READ) { ! if (_mode & WRITE) open_flags |= O_RDWR; ! else open_flags |= O_RDONLY; ! } ! else if(_mode & WRITE) ! open_flags |= O_WRONLY; if(_mode & CREATE) open_flags |= O_CREAT; *************** *** 189,195 **** if(_mode & SYNC) open_flags |= O_SYNC; ! _handle = (void*) open(file, open_flags); ! else if(_mode & LOCKED) if (flock(FD, LOCK_EX|LOCK_NB) == -1) { --- 212,219 ---- if(_mode & SYNC) open_flags |= O_SYNC; ! _handle = (void*) open(afile, open_flags); ! if(_mode & LOCKED) ! { if (flock(FD, LOCK_EX|LOCK_NB) == -1) { *************** *** 197,200 **** --- 221,226 ---- return false; } + } + return IsOpen(); } *************** *** 233,241 **** int read_bytes = 0; ! if((read_bytes=read(_handle, buffer, buffer_len))<0) ! { ! _eos = (read_bytes == 0); ! return read_bytes; ! } _eos = true;//(GetLastError()==ERROR_HANDLE_EOF); --- 259,267 ---- int read_bytes = 0; ! if( (read_bytes=read(_handle, buffer, buffer_len)) >= 0) ! { ! _eos = (read_bytes == 0); ! return read_bytes; ! } _eos = true;//(GetLastError()==ERROR_HANDLE_EOF); *************** *** 251,258 **** _eos = false; ! if((writen_bytes=write(FD, buffer, buffer_len))<0) ! { ! return written_bytes; ! } return -1; --- 277,284 ---- _eos = false; ! if( (writen_bytes=write(FD, buffer, buffer_len)) > 0) ! { ! return written_bytes; ! } return -1; *************** *** 261,268 **** long File::Seek(long pos, IO::SeekMethod method) { - if(_handle==INVALID_HANDLE_VALUE) return -1; if(!CanSeek()) return -1; - int seek_method = SEEK_SET; --- 287,292 ---- *************** *** 272,276 **** default: break; }; ! return (long) lseek(i_handle, pos, seek_method); } --- 296,300 ---- default: break; }; ! return (long) lseek(FD, pos, seek_method); } *************** *** 280,284 **** if(!CanSeek()) return -1; ! return (long) lseek(i_handle, 0, SEEK_CUR); } --- 304,308 ---- if(!CanSeek()) return -1; ! return (long) lseek(FD, 0, SEEK_CUR); } |
From: Dejan L. <le...@us...> - 2004-06-12 16:32:33
|
Update of /cvsroot/rtk/rtk/src/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21069 Modified Files: CMakeLists.txt Log Message: Added File.cpp to both Linux and Windows build system. Index: CMakeLists.txt =================================================================== RCS file: /cvsroot/rtk/rtk/src/core/CMakeLists.txt,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** CMakeLists.txt 11 Jun 2004 13:15:08 -0000 1.14 --- CMakeLists.txt 12 Jun 2004 16:32:20 -0000 1.15 *************** *** 45,49 **** error.cpp String.cpp Array.cpp rchar.cpp Vector.cpp Variant.cpp ! PriorityQueue.cpp ) --- 45,49 ---- error.cpp String.cpp Array.cpp rchar.cpp Vector.cpp Variant.cpp ! PriorityQueue.cpp Buffer.cpp ) *************** *** 53,60 **** --- 53,62 ---- SET(RTK_CORE_LINUX_SFILES platform/linux/Thread.cpp platform/linux/Mutex.cpp + platform/linux/File.cpp ) # Windows SET(RTK_CORE_WIN32_SFILES platform/win32/Thread.cpp platform/win32/Mutex.cpp + platform/win32/File.cpp ) |
From: Dejan L. <le...@us...> - 2004-06-12 16:31:14
|
Update of /cvsroot/rtk/rtk/src/core/platform/linux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19620 Modified Files: CMakeLists.txt Log Message: Added File.cpp . Index: CMakeLists.txt =================================================================== RCS file: /cvsroot/rtk/rtk/src/core/platform/linux/CMakeLists.txt,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** CMakeLists.txt 10 Mar 2004 12:17:05 -0000 1.4 --- CMakeLists.txt 12 Jun 2004 16:31:06 -0000 1.5 *************** *** 37,41 **** # - 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 --- 37,41 ---- # - It's IMHO (Dejan) handy to have them in one variable # ! SET(RTK_CORE_LINUX_SFILES Thread.cpp Mutex.cpp File.cpp) # Now we can put 'em in main RTK_CORE_SFILES variable |
From: Mikko L. <laz...@us...> - 2004-06-12 07:33:53
|
Update of /cvsroot/rtk/rtk/rtk In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2645 Modified Files: Buffer.h List.h String.h Log Message: - Fixed Buffer in several cases. - Some minor changes to get things compiled Index: Buffer.h =================================================================== RCS file: /cvsroot/rtk/rtk/rtk/Buffer.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Buffer.h 11 Jun 2004 23:13:17 -0000 1.7 --- Buffer.h 12 Jun 2004 07:33:29 -0000 1.8 *************** *** 50,57 **** #include "Array.h" #include "rtkdef.h" - #include <stdlib.h> /* malloc() */ - #include <string.h> /* memcpy() */ ! #if _DEBUG #include "String.h" #endif --- 50,55 ---- #include "Array.h" #include "rtkdef.h" ! #ifdef _DEBUG #include "String.h" #endif *************** *** 65,70 **** { uchar* _data; /// Internal pointer to Buffer memory-block. ! uint _allocated; /// Size of Buffer object in bytes. ! uint _size; /// Number of data-bytes in Buffer object. /** --- 63,68 ---- { uchar* _data; /// Internal pointer to Buffer memory-block. ! ulong _allocated; /// Size of Buffer object in bytes. ! ulong _size; /// Number of data-bytes in Buffer object. /** *************** *** 72,76 **** * @returns uchar* pointer to new memory block. */ ! uchar* Allocate(uint arg_num); public: --- 70,74 ---- * @returns uchar* pointer to new memory block. */ ! uchar* Allocate(ulong arg_num); public: *************** *** 80,101 **** Buffer(): _size(0), _data(0), _allocated(0) { } ! ~Buffer() { free(_data); } /** * Returns pointer to internal data memory-block. ! * @returns pointer to the data buffer. */ ! const uchar* Data() ! { ! if (_size == _allocated) ! Allocate(1); ! _data[_size] = '\0'; // i think this would be usefull ! return _data; ! } // Data() ! /** Returns current size of Buffer. ! * @returns uint current size of Buffer. */ ! uint GetSize() const { return _size; } /** --- 78,104 ---- Buffer(): _size(0), _data(0), _allocated(0) { } ! virtual ~Buffer(); /** + * Clear the buffer and free all it's resources. + */ + void Clear(); + + /** * Returns pointer to internal data memory-block. ! * @returns pointer to the data buffer. ! * @note return value value may be NULL, if buffer is not allocated yet */ ! const uchar* Data() const { return _data; } ! /** Returns current number of written data bytes in Buffer. ! * @returns ulong current size of Buffer. */ ! ulong GetSize() const { return _size; } ! ! /** Returns number of bytes allocated by Buffer currently ! * @returns ulong current internal size of Buffer. ! */ ! ulong GetAllocated() const { return _allocated; } /** *************** *** 103,107 **** * @returns int 0 if everything OK. */ ! int SetSize(uchar arg_size); /** Writes one single byte to the Buffer object --- 106,110 ---- * @returns int 0 if everything OK. */ ! int SetSize(ulong arg_size); /** Writes one single byte to the Buffer object *************** *** 113,121 **** * Writes arbitrary number of bytes to the Buffer object. */ ! void Write(const uchar* arg_byte_array, uint arg_num); ! void Buffer::Fill(uchar arg_char); ! #if _DEBUG void FromFile(const String& arg_fname); void ToFile(const String& arg_fname) const; --- 116,124 ---- * Writes arbitrary number of bytes to the Buffer object. */ ! void Write(const uchar* arg_byte_array, ulong arg_num); ! void Fill(uchar arg_char); ! #ifdef _DEBUG void FromFile(const String& arg_fname); void ToFile(const String& arg_fname) const; Index: List.h =================================================================== RCS file: /cvsroot/rtk/rtk/rtk/List.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** List.h 28 Feb 2004 07:39:43 -0000 1.6 --- List.h 12 Jun 2004 07:33:29 -0000 1.7 *************** *** 43,46 **** --- 43,47 ---- //--------------------------------------------------------------------------- #include "Export.h" + #include "conf.h" //--------------------------------------------------------------------------- Index: String.h =================================================================== RCS file: /cvsroot/rtk/rtk/rtk/String.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** String.h 11 Jun 2004 17:47:19 -0000 1.8 --- String.h 12 Jun 2004 07:33:29 -0000 1.9 *************** *** 40,43 **** --- 40,45 ---- #define _RTK_STRING_H_ 1 + #include <stdlib.h> /* free() */ + #include "Export.h" #include "rchar.h" |
From: Mikko L. <laz...@us...> - 2004-06-12 07:33:02
|
Update of /cvsroot/rtk/rtk/src/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2008 Modified Files: Buffer.cpp Log Message: Fixed Buffer in several cases. Index: Buffer.cpp =================================================================== RCS file: /cvsroot/rtk/rtk/src/core/Buffer.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Buffer.cpp 11 Jun 2004 23:13:17 -0000 1.6 --- Buffer.cpp 12 Jun 2004 07:32:53 -0000 1.7 *************** *** 40,108 **** ***************************************************************************/ #include <rtk/Buffer.h> ! #if _DEBUG #include <rtk/debug.h> #endif namespace Rtk { ! uchar* Buffer::Allocate(uint arg_num) { ! uint newsize = _size + arg_num; if (newsize > _allocated) { ! _allocated *= 2; if (_allocated < newsize) _allocated = newsize; uchar* newdata = (uchar*) malloc(_allocated); memcpy(newdata, _data, _size); free(_data); _data = newdata; } // if ! return _data + _size; } // Allocate() ! void Buffer::Write(const uchar* arg_byte_array, uint arg_num) { memcpy(Allocate(arg_num), arg_byte_array, arg_num); _size += arg_num; } // Write() ! int Buffer::SetSize(uchar arg_size) { ! if (arg_size) { ! uchar* newdata = (uchar*) realloc(_data, arg_size + 1); ! if (!newdata) ! return -1; ! _data = newdata; ! _allocated = arg_size; ! } // if ! _size = 0; } void Buffer::Fill(uchar arg_char) { ! memset(_data, arg_char, _allocated); ! _size = _allocated; } // Fill() ! #if _DEBUG // Code taken from eFLTK ... void Buffer::FromFile(const String& arg_fname) { ! FILE *f = fopen(fileName,"rb"); ! if (!f) return; // Some error checks should be here... ! fseek(f,0,SEEK_END); ! int size = ftell(f); ! fseek(f,0,SEEK_SET); Allocate(size+1); _data[size] = '\0'; ! _size = fread(_data, 1 , size, f); ! fclose(f); } #endif --- 40,142 ---- ***************************************************************************/ + #include <string.h> /* memcpy() */ + #include <stdlib.h> /* malloc() */ + #include <rtk/Buffer.h> ! #ifdef _DEBUG #include <rtk/debug.h> + #include <rtk/File.h> #endif namespace Rtk { ! Buffer::~Buffer() { ! Clear(); ! } ! ! uchar* Buffer::Allocate(ulong arg_num) { ! ulong newsize = _size + arg_num; if (newsize > _allocated) { ! if(_allocated) _allocated *= 2; ! else _allocated = RTK_BUFFER_SIZE; ! if (_allocated < newsize) _allocated = newsize; + + if(!_data) _data = (uchar*)malloc(_allocated); + else _data = (uchar*)realloc(_data, _allocated); + + /* uchar* newdata = (uchar*) malloc(_allocated); memcpy(newdata, _data, _size); free(_data); _data = newdata; + */ } // if ! return (_data + _size); } // Allocate() ! void Buffer::Write(const uchar* arg_byte_array, ulong arg_num) { memcpy(Allocate(arg_num), arg_byte_array, arg_num); _size += arg_num; } // Write() + + void Buffer::Clear() + { + if(_data) free(_data); + _size = 0; + _allocated = 0; + _data = 0; + } ! int Buffer::SetSize(ulong arg_size) { ! if (arg_size == 0) { ! Clear(); ! } else { ! Allocate(arg_size); ! _size = arg_size; ! } ! return 0; } void Buffer::Fill(uchar arg_char) { ! if(_data) { ! memset(_data, arg_char, _size); ! } } // Fill() ! #ifdef _DEBUG // Code taken from eFLTK ... void Buffer::FromFile(const String& arg_fname) { ! File f(arg_fname, File::READ|File::BINARY); ! if(!f.IsOpen()) return; // Some error checks should be here... ! f.Seek(0, IO::END); ! long size = f.Tell(); ! f.Seek(0, IO::BEGIN); Allocate(size+1); _data[size] = '\0'; ! _size = f.Read(_data, size); ! f.Close(); } + + void Buffer::ToFile(const String& arg_fname) const + { + if(!_size) return; + File f(arg_fname, File::WRITE|File::CREATE|File::BINARY); + if(f.IsOpen()) { + f.Write(_data, _size); + f.Close(); + } + } #endif |
From: Mikko L. <laz...@us...> - 2004-06-12 07:32:20
|
Update of /cvsroot/rtk/rtk/test/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1506 Modified Files: buffer0.cpp Log Message: small change Index: buffer0.cpp =================================================================== RCS file: /cvsroot/rtk/rtk/test/core/buffer0.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** buffer0.cpp 14 Mar 2004 12:01:30 -0000 1.1 --- buffer0.cpp 12 Jun 2004 07:32:12 -0000 1.2 *************** *** 51,59 **** { Buffer buf; ! printf("Initial size: %d", buf.GetSize()); buf.SetSize(256); ! printf("After resizing: %d", buf.GetSize()); getchar(); } // main() --- 51,71 ---- { Buffer buf; ! ! printf("Initial allocated: %d\n", buf.GetAllocated()); ! printf("Initial size: %d\n", buf.GetSize()); buf.SetSize(256); ! ! printf("After resizing allocated: %d\n", buf.GetAllocated()); ! printf("After resizing size: %d\n", buf.GetSize()); ! ! buf.Fill(1); ! ! #if 0 ! buf.ToFile("C:\\dump"); ! #endif getchar(); + + return 0; /* make compiler happy */ } // main() |
From: Dejan L. <de...@us...> - 2004-06-11 23:13:27
|
Update of /cvsroot/rtk/rtk/src/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31041/src/core Modified Files: Buffer.cpp Log Message: Latest Buffer class and Dev-C++ project files. Now RTK can be (again) used to develop RTK (thanks to Mikko for fix in String.h) Index: Buffer.cpp =================================================================== RCS file: /cvsroot/rtk/rtk/src/core/Buffer.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Buffer.cpp 11 Jun 2004 17:09:45 -0000 1.5 --- Buffer.cpp 11 Jun 2004 23:13:17 -0000 1.6 *************** *** 45,48 **** --- 45,49 ---- #include <rtk/debug.h> #endif + namespace Rtk { |
From: Dejan L. <de...@us...> - 2004-06-11 23:13:27
|
Update of /cvsroot/rtk/rtk/ide/devcxx In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31041/ide/devcxx Modified Files: librtk.dev librtk_private.h librtk_private.rc Added Files: Makefile.mingw Log Message: Latest Buffer class and Dev-C++ project files. Now RTK can be (again) used to develop RTK (thanks to Mikko for fix in String.h) Index: librtk_private.h =================================================================== RCS file: /cvsroot/rtk/rtk/ide/devcxx/librtk_private.h,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** librtk_private.h 11 Jun 2004 15:52:23 -0000 1.13 --- librtk_private.h 11 Jun 2004 23:13:16 -0000 1.14 *************** *** 6,14 **** // VERSION DEFINITIONS ! #define VER_STRING "0.1.1.72" #define VER_MAJOR 0 #define VER_MINOR 1 #define VER_RELEASE 1 ! #define VER_BUILD 72 #define COMPANY_NAME "" #define FILE_VERSION "" --- 6,14 ---- // VERSION DEFINITIONS ! #define VER_STRING "0.1.1.79" #define VER_MAJOR 0 #define VER_MINOR 1 #define VER_RELEASE 1 ! #define VER_BUILD 79 #define COMPANY_NAME "" #define FILE_VERSION "" Index: librtk_private.rc =================================================================== RCS file: /cvsroot/rtk/rtk/ide/devcxx/librtk_private.rc,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** librtk_private.rc 11 Jun 2004 15:52:23 -0000 1.13 --- librtk_private.rc 11 Jun 2004 23:13:16 -0000 1.14 *************** *** 9,14 **** // 1 VERSIONINFO ! FILEVERSION 0,1,1,72 ! PRODUCTVERSION 0,1,1,72 FILETYPE VFT_DLL { --- 9,14 ---- // 1 VERSIONINFO ! FILEVERSION 0,1,1,79 ! PRODUCTVERSION 0,1,1,79 FILETYPE VFT_DLL { --- NEW FILE: Makefile.mingw --- # Project: librtk # Makefile created by Dev-C++ 4.9.8.10 CPP = g++.exe CC = gcc.exe WINDRES = windres.exe RES = librtk_private.res OBJ = ../../obj/SList.o ../../obj/String.o ../../obj/Variant.o ../../obj/Dict.o ../../obj/Thread.o ../../obj/Mutex.o ../../obj/Array.o ../../obj/File.o ../../obj/Vector.o ../../obj/Buffer.o $(RES) LINKOBJ = ../../obj/SList.o ../../obj/String.o ../../obj/Variant.o ../../obj/Dict.o ../../obj/Thread.o ../../obj/Mutex.o ../../obj/Array.o ../../obj/File.o ../../obj/Vector.o ../../obj/Buffer.o $(RES) LIBS = -L"../../lib" -L"../../bin" --no-export-all-symbols --add-stdcall-alias INCS = -I"../.." -I"../../rtk" CXXINCS = -I"../.." -I"../../rtk" BIN = ../../bin/librtk.dll CXXFLAGS = $(CXXINCS) -DRTK_DLL=1 -DRTK_EXPORTS=1 -D_RTK_WIN32_=1 -DRTK_UNICODE=1 -O3 CFLAGS = $(INCS) -DBUILDING_DLL=1 -DRTK_DLL=1 -DRTK_EXPORTS=1 -D_RTK_WIN32_=1 -DRTK_UNICODE=1 -O3 .PHONY: all all-before all-after clean clean-custom all: all-before ../../bin/librtk.dll all-after clean: clean-custom rm -f $(OBJ) $(BIN) DLLWRAP=dllwrap.exe DEFFILE=../../bin/liblibrtk.def STATICLIB=../../bin/liblibrtk.a $(BIN): $(LINKOBJ) $(DLLWRAP) --output-def $(DEFFILE) --driver-name c++ --implib $(STATICLIB) $(LINKOBJ) $(LIBS) -o $(BIN) ../../obj/SList.o: ../../src/core/SList.cpp $(CPP) -c ../../src/core/SList.cpp -o ../../obj/SList.o $(CXXFLAGS) ../../obj/String.o: ../../src/core/String.cpp $(CPP) -c ../../src/core/String.cpp -o ../../obj/String.o $(CXXFLAGS) ../../obj/Variant.o: ../../src/core/Variant.cpp $(CPP) -c ../../src/core/Variant.cpp -o ../../obj/Variant.o $(CXXFLAGS) ../../obj/Dict.o: ../../src/core/Dict.cpp $(CPP) -c ../../src/core/Dict.cpp -o ../../obj/Dict.o $(CXXFLAGS) ../../obj/Thread.o: ../../src/core/platform/win32/Thread.cpp $(CPP) -c ../../src/core/platform/win32/Thread.cpp -o ../../obj/Thread.o $(CXXFLAGS) ../../obj/Mutex.o: ../../src/core/platform/win32/Mutex.cpp $(CPP) -c ../../src/core/platform/win32/Mutex.cpp -o ../../obj/Mutex.o $(CXXFLAGS) ../../obj/Array.o: ../../src/core/Array.cpp $(CPP) -c ../../src/core/Array.cpp -o ../../obj/Array.o $(CXXFLAGS) ../../obj/File.o: ../../src/core/platform/win32/File.cpp $(CPP) -c ../../src/core/platform/win32/File.cpp -o ../../obj/File.o $(CXXFLAGS) ../../obj/Vector.o: ../../src/core/Vector.cpp $(CPP) -c ../../src/core/Vector.cpp -o ../../obj/Vector.o $(CXXFLAGS) ../../obj/Buffer.o: ../../src/core/Buffer.cpp $(CPP) -c ../../src/core/Buffer.cpp -o ../../obj/Buffer.o $(CXXFLAGS) librtk_private.res: librtk_private.rc $(WINDRES) -i librtk_private.rc -I rc -o librtk_private.res -O coff Index: librtk.dev =================================================================== RCS file: /cvsroot/rtk/rtk/ide/devcxx/librtk.dev,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** librtk.dev 11 Jun 2004 15:52:23 -0000 1.12 --- librtk.dev 11 Jun 2004 23:13:16 -0000 1.13 *************** *** 47,51 **** Build=35 ======= ! Build=71 >>>>>>> 1.8 LanguageID=1033 --- 47,51 ---- Build=35 ======= ! Build=79 >>>>>>> 1.8 LanguageID=1033 |
From: Dejan L. <de...@us...> - 2004-06-11 23:13:26
|
Update of /cvsroot/rtk/rtk/rtk In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31041/rtk Modified Files: Buffer.h Log Message: Latest Buffer class and Dev-C++ project files. Now RTK can be (again) used to develop RTK (thanks to Mikko for fix in String.h) Index: Buffer.h =================================================================== RCS file: /cvsroot/rtk/rtk/rtk/Buffer.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Buffer.h 11 Jun 2004 16:50:58 -0000 1.6 --- Buffer.h 11 Jun 2004 23:13:17 -0000 1.7 *************** *** 47,56 **** #define _RTK_BUFFER_H_ 1 ! #include <rtk/Export.h> ! #include <rtk/Array.h> ! #include <rtk/rtkdef.h> #if _DEBUG ! #include <rtk/String.h> #endif --- 47,58 ---- #define _RTK_BUFFER_H_ 1 ! #include "Export.h" ! #include "Array.h" ! #include "rtkdef.h" ! #include <stdlib.h> /* malloc() */ ! #include <string.h> /* memcpy() */ #if _DEBUG ! #include "String.h" #endif *************** *** 76,86 **** * Default Buffer constructor. */ ! Buffer():_size(0) ! { ! _data = (uchar*) malloc(_allocated = RTK_BUFFER_SIZE); ! Fill('\0'); ! } ! ~Buffer() { delete[] _data; } /** --- 78,84 ---- * Default Buffer constructor. */ ! Buffer(): _size(0), _data(0), _allocated(0) { } ! ~Buffer() { free(_data); } /** *************** *** 101,104 **** --- 99,108 ---- uint GetSize() const { return _size; } + /** + * Resizes Buffer. + * @returns int 0 if everything OK. + */ + int SetSize(uchar arg_size); + /** Writes one single byte to the Buffer object * @param c uchar Byte to be written. |
From: Dejan L. <dlo...@us...> - 2004-06-11 22:14:28
|
Update of /cvsroot/rtk/rtk/src/core/platform/linux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10698/src/core/platform/linux Added Files: File.cpp Log Message: Linux FILE & IO TODO: add NOCTTY and NONBLOCK funcionality --- NEW FILE: File.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/File.cpp,v $ ***** * Authors (chronological order): * Dejan Lekic, de...@rt... * Dejan Lozanovic, null§rtk.cx * Contributors (chronological order): * $fname $lname, $email ***** * T0D0 List: * - ***************************************************************************/ /** * @file src/core/platform/win32/File.cpp * Implementation of the File (IO) class. */ #include <rtk/File.h> #include <stdlib.h> //free namespace Rtk { #include <fcntl.h> #include <unistd.h> #include <sys/file.h> #ifndef INVALID_SET_FILE_POINTER #define INVALID_SET_FILE_POINTER 0xFFFFFFFF #endif #ifndef INVALID_HANDLE_VALUE #define INVALID_HANDLE_VALUE ((void*)-1) #endif #define FD *((int*)_handle) File::File() { _eos = false; _handle = INVALID_HANDLE_VALUE; SetFlags(CAN_SEEK|CAN_WRITE|CAN_READ); _mode = READ | WRITE; } File::File(const String &filename, int mode) { _eos = false; _handle = INVALID_HANDLE_VALUE; SetFlags(CAN_SEEK|CAN_WRITE|CAN_READ); _filename = filename; SetMode(mode); Open(); } File::File(FILE *file) { int val; uint flags=0; _eos = false; _handle = (void*)(fd=fileno(file)); val=fcntl(FD,F_GETFL,0); // access flags if (val & O_RDWR) { _flags = CAN_READ | CAN_WRITE; _mode = READ | WRITE; } else if (val & O_RDONLY) { _flags = CAN_READ; _mode = READ; } else if (val & O_WRONLY) { _flags = CAN_WRITE; _mode = WRITE; } if (lseek(FD, 0, SEEK_CUR) != -1) _flags |= CAN_SEEK; _flags |= EXTERN_HANDLE; if (val & O_APPEND) _mode |= APPEND; if (val & O_SYNC) _mode |= SYNC; } File::File(int fd) { int val; uint flags=0; _eos = false; _handle = (void*)(fd); val=fcntl(FD,F_GETFL,0); // access flags if (val & O_RDWR) { _flags = CAN_READ | CAN_WRITE; _mode = READ | WRITE; } else if (val & O_RDONLY) { _flags = CAN_READ; _mode = READ; } else if (val & O_WRONLY) { _flags = CAN_WRITE; _mode = WRITE; } if (lseek(FD, 0, SEEK_CUR) != -1) _flags |= CAN_SEEK; _flags |= EXTERN_HANDLE; if (val & O_APPEND) _mode |= APPEND; if (val & O_SYNC) _mode |= SYNC; } File::~File() { Close(); } void File::SetMode(int mode) { ClearFlag(CAN_READ | CAN_WRITE, _flags); if(mode & READ) _flags |= CAN_READ; if(mode & WRITE) _flags |= CAN_WRITE; _mode = mode; } bool File::Open() { const RCHAR *file = _filename.c_str(); if (_handle!=INVALID_HANDLE_VALUE) return false; int open_flags = 0; if(_mode & READ) { if (_mode & WRITE) open_flags |= O_RDWR; else open_flags |= O_RDONLY; } else if(_mode & WRITE) open_flags |= O_WRONLY; if(_mode & CREATE) open_flags |= O_CREAT; if(_mode & TRUNCATE) open_flags |= O_TRUNC; if(_mode & APPEND) open_flags |= O_APPEND; if(_mode & SYNC) open_flags |= O_SYNC; _handle = (void*) open(file, open_flags); else if(_mode & LOCKED) if (flock(FD, LOCK_EX|LOCK_NB) == -1) { close(FD); return false; } return IsOpen(); } bool File::Close() { int ret; // return value // Do not close external handle! if (_flags & EXTERN_HANDLE) return false; if (_handle==INVALID_HANDLE_VALUE) return false; //unlock the file if (_mode & LOCK) flock(FD, LOCK_UN); //close file if(close(FD)<0) return false; //remove temporary file if (_mode & TEMP) unlink(_filename.c_str()); _handle = INVALID_HANDLE_VALUE; return true; } bool File::IsOpen() const { return (_handle!=INVALID_HANDLE_VALUE); } int File::Read(void *buffer, int buffer_len) { if(!CanRead()) return false; if(_handle==INVALID_HANDLE_VALUE) return -1; int read_bytes = 0; if((read_bytes=read(_handle, buffer, buffer_len))<0) { _eos = (read_bytes == 0); return read_bytes; } _eos = true;//(GetLastError()==ERROR_HANDLE_EOF); return -1; } int File::Write(void *buffer, int buffer_len) { if(!CanWrite()) return false; if(_handle==INVALID_HANDLE_VALUE) return -1; int written_bytes = 0; _eos = false; if((writen_bytes=write(FD, buffer, buffer_len))<0) { return written_bytes; } return -1; } long File::Seek(long pos, IO::SeekMethod method) { if(_handle==INVALID_HANDLE_VALUE) return -1; if(!CanSeek()) return -1; int seek_method = SEEK_SET; switch(method) { case IO::END: seek_method = SEEK_END; break; case IO::CURRENT: seek_method = SEEK_CUR; break; default: break; }; return (long) lseek(i_handle, pos, seek_method); } long File::Tell() { if(_handle==INVALID_HANDLE_VALUE) return -1; if(!CanSeek()) return -1; return (long) lseek(i_handle, 0, SEEK_CUR); } bool File::Flush() { if(_handle==INVALID_HANDLE_VALUE) return false; return (fsync(FD)==0); } }; // Rtk |
From: Dejan L. <de...@us...> - 2004-06-11 21:06:48
|
Update of /cvsroot/rtk/rtk/rtk In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27636/rtk Modified Files: IO.h Log Message: Small fix - changed #include rtk/Class.h lines Index: IO.h =================================================================== RCS file: /cvsroot/rtk/rtk/rtk/IO.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** IO.h 11 Jun 2004 20:27:42 -0000 1.7 --- IO.h 11 Jun 2004 21:06:38 -0000 1.8 *************** *** 45,49 **** #include "rtkdef.h" ! #include <rtk/Mutex.h> namespace Rtk --- 45,49 ---- #include "rtkdef.h" ! #include "Mutex.h" namespace Rtk |
From: Dejan L. <le...@us...> - 2004-06-11 20:27:53
|
Update of /cvsroot/rtk/rtk/rtk In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27313/rtk Modified Files: IO.h Log Message: Small fix in SetMutex() . Index: IO.h =================================================================== RCS file: /cvsroot/rtk/rtk/rtk/IO.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** IO.h 11 Jun 2004 16:55:18 -0000 1.6 --- IO.h 11 Jun 2004 20:27:42 -0000 1.7 *************** *** 116,120 **** /** Sets Mutex object for IO */ ! void SetMutex(const Mutex* arg_mutex) { _mutex = arg_mutex; } /** Gets Mutex object from IO */ --- 116,120 ---- /** Sets Mutex object for IO */ ! void SetMutex(Mutex* arg_mutex) { _mutex = arg_mutex; } /** Gets Mutex object from IO */ |
From: Mikko L. <laz...@us...> - 2004-06-11 17:47:28
|
Update of /cvsroot/rtk/rtk/rtk In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30139 Modified Files: String.h Log Message: Fixed bug under MinGW Index: String.h =================================================================== RCS file: /cvsroot/rtk/rtk/rtk/String.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** String.h 10 Mar 2004 12:24:53 -0000 1.7 --- String.h 11 Jun 2004 17:47:19 -0000 1.8 *************** *** 40,46 **** #define _RTK_STRING_H_ 1 ! #include <rtk/Export.h> ! #include <stdlib.h> ! #include <rtk/rchar.h> namespace Rtk { --- 40,45 ---- #define _RTK_STRING_H_ 1 ! #include "Export.h" ! #include "rchar.h" namespace Rtk { *************** *** 102,106 **** @endcode */ ! RTK_API String() : sh(NULL) { } /** Create string filled with chracter c. --- 101,105 ---- @endcode */ ! String() : sh(NULL) { } /** Create string filled with chracter c. *************** *** 108,112 **** * @param repeater How many time 'c' is repeated in string */ ! RTK_API String(RCHAR c, int repeater); /** Create string from ascii/mb character string. --- 107,111 ---- * @param repeater How many time 'c' is repeated in string */ ! String(RCHAR c, int repeater); /** Create string from ascii/mb character string. *************** *** 114,118 **** * @param maxlen Length to copy, if 0 whole string is copied */ ! RTK_API String(const char *s, int maxlen=0); /** Create string from wide character string. --- 113,117 ---- * @param maxlen Length to copy, if 0 whole string is copied */ ! String(const char *s, int maxlen=0); /** Create string from wide character string. *************** *** 120,129 **** * @param maxlen Length to copy, if 0 whole string is copied */ ! RTK_API String(const wchar_t *s, int maxlen=0); /** Copy constructor. */ ! RTK_API String(const String &s); ! RTK_API ~String(); // = Operators --- 119,128 ---- * @param maxlen Length to copy, if 0 whole string is copied */ ! String(const wchar_t *s, int maxlen=0); /** Copy constructor. */ ! String(const String &s); ! ~String(); // = Operators |
From: Dejan L. <de...@us...> - 2004-06-11 17:09:55
|
Update of /cvsroot/rtk/rtk/src/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32322/src/core Modified Files: Buffer.cpp Log Message: Few new methods in Buffer.cpp . Index: Buffer.cpp =================================================================== RCS file: /cvsroot/rtk/rtk/src/core/Buffer.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Buffer.cpp 11 Jun 2004 15:37:46 -0000 1.4 --- Buffer.cpp 11 Jun 2004 17:09:45 -0000 1.5 *************** *** 42,45 **** --- 42,48 ---- #include <rtk/Buffer.h> + #if _DEBUG + #include <rtk/debug.h> + #endif namespace Rtk { *************** *** 52,62 **** if (_allocated < newsize) _allocated = newsize; ! uchar *newdata = new unsigned char[_allocated]; memcpy(newdata, _data, _size); ! delete[] _data; _data = newdata; } // if return _data + _size; ! } void Buffer::Write(const uchar* arg_byte_array, uint arg_num) --- 55,65 ---- if (_allocated < newsize) _allocated = newsize; ! uchar* newdata = (uchar*) malloc(_allocated); memcpy(newdata, _data, _size); ! free(_data); _data = newdata; } // if return _data + _size; ! } // Allocate() void Buffer::Write(const uchar* arg_byte_array, uint arg_num) *************** *** 65,68 **** --- 68,108 ---- _size += arg_num; } // Write() + + int Buffer::SetSize(uchar arg_size) + { + if (arg_size) + { + uchar* newdata = (uchar*) realloc(_data, arg_size + 1); + if (!newdata) + return -1; + _data = newdata; + _allocated = arg_size; + } // if + _size = 0; + } + + void Buffer::Fill(uchar arg_char) + { + memset(_data, arg_char, _allocated); + _size = _allocated; + } // Fill() + + #if _DEBUG + // Code taken from eFLTK ... + + void Buffer::FromFile(const String& arg_fname) + { + FILE *f = fopen(fileName,"rb"); + if (!f) + return; // Some error checks should be here... + fseek(f,0,SEEK_END); + int size = ftell(f); + fseek(f,0,SEEK_SET); + Allocate(size+1); + _data[size] = '\0'; + _size = fread(_data, 1 , size, f); + fclose(f); + } + #endif }; // Rtk |