From 2607ad4877ac0233249c50cb6b20d3cb4a6b30ed Mon Sep 17 00:00:00 2001 From: guy Date: Fri, 28 Mar 2003 15:33:12 +0000 Subject: [PATCH] Patch level : 2.0 nopatch Files correlati : ba1 ba2 Ricompilazione Demo : [ ] Commento : Tolte chiamate a funzioni di os_dep git-svn-id: svn://10.65.10.50/trunk@10953 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- ba/ba1100.cpp | 8 +++----- ba/ba1501.cpp | 4 ++-- ba/ba1600.cpp | 6 +++--- ba/ba1700.cpp | 9 ++++----- ba/ba2200.cpp | 19 ++++++++----------- ba/ba883.cpp | 2 +- 6 files changed, 21 insertions(+), 27 deletions(-) diff --git a/ba/ba1100.cpp b/ba/ba1100.cpp index 802bc5182..74e4debdd 100755 --- a/ba/ba1100.cpp +++ b/ba/ba1100.cpp @@ -848,7 +848,6 @@ void TManutenzione_app::update_dir() prompt << TR("Aggiornamento direttorio della ditta "); prompt << atol(pref) <<"."; } - prompt << TR(" Memoria libera: ") << long(os_get_free_memory()/1024) << " Kbytes."; TProgind p(update_items ? update_items : 1, prompt, FALSE, TRUE); p.setstatus(1); @@ -1121,13 +1120,13 @@ void TManutenzione_app::convert_dir() const int update_items = (orig_items < items) ? orig_items : items; TString s(256); - if (is_com) s = TR("Aggiornamento archivi comuni."); + if (is_com) + s = TR("Aggiornamento archivi comuni."); else { s = TR("Aggiornamento archivi della ditta "); s << atol (pref) << "."; } - s << TR("Memoria libera: ") << long(os_get_free_memory()/1024) << " Kbytes."; TProgind p(update_items ? update_items : 1, s, FALSE, TRUE); p.setstatus(1); @@ -1464,8 +1463,7 @@ void TManutenzione_app::update() const TRecnotype rec = ditte.recno(); const long codditta = ditte.get_long("CODDITTA"); mxs = s; - mxs << TR(" Ditta ") << codditta << TR(". Memoria libera: ") - << long(os_get_free_memory()/1024) << " Kbytes."; + mxs << TR(" Ditta ") << codditta; p.addstatus(1); p.set_text(mxs); if (codditta > _history_firm && prefix().exist(codditta)) diff --git a/ba/ba1501.cpp b/ba/ba1501.cpp index a5d5fea27..108ea9030 100755 --- a/ba/ba1501.cpp +++ b/ba/ba1501.cpp @@ -1,7 +1,7 @@ #include #include #include -#include +//#include #include #include @@ -114,7 +114,7 @@ bool update_dninst(bool force) { TConfig ini("install.ini", "Main"); TFilename remote_name = ini.get("DiskPath"); - if (os_is_removable_drive(remote_name)) + if (xvt_fsys_is_removable_drive(remote_name)) message_box(FR("Assicuratevi che il CD di installazione sia nel lettore %c:"), remote_name[0]); remote_name.add(keys_name); if (remote_name.exist()) diff --git a/ba/ba1600.cpp b/ba/ba1600.cpp index ff1a5dd35..30d2a8c29 100755 --- a/ba/ba1600.cpp +++ b/ba/ba1600.cpp @@ -1801,12 +1801,12 @@ bool TCreadischi_mask::move_file(const TFilename& file, const char* dir) const bool space_ok = FALSE; while (!space_ok) { - space_ok = ::os_test_disk_free_space(dest, filesize); + space_ok = xvt_fsys_test_disk_free_space(dest, filesize) != 0; if (!space_ok) { TString msg(128); msg << TR("Lo spazio sull'unita' e' insufficiente"); - if (::os_is_removable_drive(dest)) + if (xvt_fsys_is_removable_drive(dest)) { msg << TR(":\nInserire un nuovo disco e ritentare?"); if (!yesno_box(msg)) @@ -2097,7 +2097,7 @@ bool TCreadischi_mask::zip_module(const TString& main_module, bool agg, int patc ini.export_paragraph(main_module, sommario,TRUE); // Aggiorna sommario const char drive = toupper(path[0]); - const bool floppy = os_is_removable_drive(path); + const bool floppy = xvt_fsys_is_removable_drive(path) != 0; msg = TR("Creazione file "); msg << archivio; TProgind pi(disks, msg, FALSE, TRUE); diff --git a/ba/ba1700.cpp b/ba/ba1700.cpp index dfcaeb9be..62a8ea527 100755 --- a/ba/ba1700.cpp +++ b/ba/ba1700.cpp @@ -4,7 +4,6 @@ #include #include #include -#include #include #include #include @@ -563,12 +562,12 @@ bool TInstaller_mask::move_file(const TFilename& from, const TFilename& file, co while (!space_ok) { - space_ok = os_test_disk_free_space(dest, filesize); + space_ok = xvt_fsys_test_disk_free_space(dest, filesize) != 0; if (!space_ok) { TString msg; msg << TR("Lo spazio sull'unita' e' insufficiente"); - if (os_is_removable_drive(dest)) + if (xvt_fsys_is_removable_drive(dest)) { msg << TR(":\nInserire un nuovo disco e ritentare?"); if (!yesno_box(msg)) @@ -770,7 +769,7 @@ bool TInstaller_mask::install(const TString& module, int patchlevel) if (ok) { const long required = fsize(chunk) * (dischi-d+1) * 4; - if (!os_test_disk_free_space(tempdir, required)) + if (!xvt_fsys_test_disk_free_space(tempdir, required)) { ok = yesno_box(TR("Lo spazio su disco potrebbe essere insufficiente:\nSi desidera continuare ugualmente?")); } @@ -1211,7 +1210,7 @@ TInstaller_mask::TInstaller_mask() TFilename path = ini.get("DiskPath"); set(F_PATH, path); - const bool floppy = os_is_removable_drive(path); + const bool floppy = xvt_fsys_is_removable_drive(path) != 0; if (path.not_empty() && !floppy && !is_internet_path(path)) autoload(); diff --git a/ba/ba2200.cpp b/ba/ba2200.cpp index 4af48ffff..a2dcb54d3 100755 --- a/ba/ba2200.cpp +++ b/ba/ba2200.cpp @@ -1,12 +1,9 @@ -#include - #include #include #include #include #include -#include #include #include #include @@ -44,8 +41,8 @@ TArchive_mask::TArchive_mask() : TAutomask("ba2200") for (int d = 0; d < 26; d++) { str.format("%c:/", d+'A'); - const bool isrem = os_is_removable_drive(str); - const bool isfix = !isrem && os_is_fixed_drive(str); + const bool isrem = xvt_fsys_is_removable_drive(str) != 0; + const bool isfix = !isrem && xvt_fsys_is_fixed_drive(str); if (isrem || isfix) { str.rtrim(1); // Togli slash finale @@ -245,7 +242,7 @@ bool TArchive_app::can_save_as(const TFilename& src, const TFilename& dst) const if (dst.exist()) remove(dst); long s = fsize(src); - return os_test_disk_free_space(dst.left(3), s); + return xvt_fsys_test_disk_free_space(dst.left(3), s) != 0; } void TArchive_app::save_zip_files(const TFilename& floppy_path, const TString& desc, unsigned long max_chunk) @@ -266,7 +263,7 @@ void TArchive_app::save_zip_files(const TFilename& floppy_path, const TString& d } bool ok = TRUE; - if (os_is_removable_drive(floppy_path.left(3))) + if (xvt_fsys_is_removable_drive(floppy_path.left(3))) { const char* msg = TR("Si desidera procedere con l'operazione di salvataggio?"); if (disk == 1) @@ -343,10 +340,10 @@ void TArchive_app::backup(int mode, long firm, const TFilename& floppy_path, con prefix().set(NULL); // Libera tutti i lock long max_chunk = ~0; - if (os_is_removable_drive(floppy_path)) + if (xvt_fsys_is_removable_drive(floppy_path)) { message_box(FR("Inserire un disco vuoto nel drive %c:"), floppy_path[0]); - max_chunk = os_get_disk_size(floppy_path) - (1024L*64L); + max_chunk = xvt_fsys_get_disk_size(floppy_path, 'K') - (1024L*64L); } _zip_list.destroy(); @@ -438,7 +435,7 @@ void TArchive_app::load_zip_files(const TFilename& floppy_path) if (pi.iscancelled()) break; - if (os_is_removable_drive(floppy_path.left(3))) + if (xvt_fsys_is_removable_drive(floppy_path.left(3))) { if (disk != curr_disk) { @@ -546,7 +543,7 @@ void TArchive_app::interactive_mode() else { TFilename ini_name = floppy_path; ini_name.add("backup.ini"); - if (os_is_removable_drive(floppy_path.left(3))) + if (xvt_fsys_is_removable_drive(floppy_path.left(3))) message_box(FR("Inserire il primo disco del backup nel drive %c"), floppy_path[0]); if (ini_name.exist()) restore(mode, firm, floppy_path); diff --git a/ba/ba883.cpp b/ba/ba883.cpp index b1a9a9ece..77f6fafae 100755 --- a/ba/ba883.cpp +++ b/ba/ba883.cpp @@ -601,7 +601,7 @@ void TBenchmark_application::update_bar(long rec) if (sec > _sec) { TString80 msg; - unsigned long mem = os_get_free_memory() / 1024; + unsigned long mem = xvt_sys_get_free_memory_kb(); rec++; msg.format("%ld record (%ld rec/sec) %lu Kb", rec, long(rec / sec), mem); xvt_statbar_set(msg);