diff --git a/checkin_notes b/checkin_notes index 0ea7baabcb..3d8cc450c4 100755 --- a/checkin_notes +++ b/checkin_notes @@ -1,16 +1,44 @@ -David 2 Jan 2007 - - make disk pie charts work on Linux - (from Frank Weiler) +Reinhard 2 Jan 2007 + - fixed build of clientgui [in consultation with the Author, Frank Weiler] + * corrected unicode-string handling with wxString() in ViewTransfersGrid.cpp and ViewWorkGrid.cpp + * corrected wxString handling in BOINCGridCtrl.cpp + * add missing files BOINCGridCtrl.[cpp|h] to Makefile.am - clientgui/ - wxPieCtrl.cpp + clientgui/ + Makefile.am + BOINCGridCtrl.cpp + ViewTransfersGrid.cpp + ViewWorkGrid.cpp + +Rom 2 Jan 2007 + - Win SETUP: Incorporate a custom action to migrate CPDNBBC data files to the + destination BOINC directory. + + win_build/installerv2/ + BOINC.ism + win_build/installerv2/redist/Windows/src/boinccas/ + CADetectOldInstaller.cpp, .h (Removed) + CAMigrateCPDNBBC.cpp, .h (Added) + boinccas.rc + boinccas95.def + boinccas95.vcproj + win_build/installerv2/redist/Windows/x86/ + boinccas.dll + boinccas95.dll + +David 2 Jan 2007 + - make disk pie charts work on Linux + (from Frank Weiler) + + clientgui/ + wxPieCtrl.cpp Reinhard 2 Jan 2007 - - install lib/common_defs.h + - install lib/common_defs.h - lib/ - Makefile.am + lib/ + Makefile.am Charlie 2 Jan 2007 - MGR: Fix 2 compiler warnings caused by actual coding errors. @@ -53,15 +81,15 @@ Matt 3 Jan 2007 project.inc Reinhard 4 Jan 2007 - - applied Bernd's patch: - * restore extern "C" protection to graphics_api.h, for ANSI-C projects - * include boinc_api.h in graphics_impl.C to declare worker_thread_handle() - * remove garbage from graphics_lib.C to allow compilation under _WIN32 and __APPLE__ + - applied Bernd's patch: + * restore extern "C" protection to graphics_api.h, for ANSI-C projects + * include boinc_api.h in graphics_impl.C to declare worker_thread_handle() + * remove garbage from graphics_lib.C to allow compilation under _WIN32 and __APPLE__ - api/ - graphics_api.h - graphics_impl.C - graphics_lib.C + api/ + graphics_api.h + graphics_impl.C + graphics_lib.C David 4 Jan 2007 - change "Preempted" to "Waiting" in GUI ("preempted" is geek-speak) @@ -92,20 +120,20 @@ Kevin 4 Jan 2007 clientgui/sg_DlgPreferences.cpp David 4 Jan 2007 - - core client: if an app fails to start, - it could be that the executable has been munged. - So verify the files; this will find the bad file - and download it again. - - Manager: in Attach to Account Manager wizard, add some text saying - if they want to just attach to a single project, - use the Attach to Project wizard instead. - Some users tried to attach SETI@home using the acct mgr wizard - and got all bent outta shape when it didn't work. + - core client: if an app fails to start, + it could be that the executable has been munged. + So verify the files; this will find the bad file + and download it again. + - Manager: in Attach to Account Manager wizard, add some text saying + if they want to just attach to a single project, + use the Attach to Project wizard instead. + Some users tried to attach SETI@home using the acct mgr wizard + and got all bent outta shape when it didn't work. - client/ - app_start.C - clientgui/ - WelcomePage.cpp + client/ + app_start.C + clientgui/ + WelcomePage.cpp Rom 5 Jan 2007 - Win SETUP: Add custom actions for saving and restoring user preferences @@ -168,12 +196,12 @@ Rom 5 Jan 2007 SkinManager.cpp, .h David 5 Jan 2007 - - manager: improved grid views from Frank Weiler; - improved message when detach from project mgr + - manager: improved grid views from Frank Weiler; + improved message when detach from project mgr - clientgui/ - BOINCGridCtrl.cpp,h - WelcomPage.cpp + clientgui/ + BOINCGridCtrl.cpp,h + WelcomPage.cpp Rom 5 Jan 2007 - MGR: Fix the help handling code for the Mac UI conventions. @@ -208,17 +236,17 @@ Walt 6 Jan 2007 sg_DlgMessages.cpp David 7 Jan 2007 - - manager: fixes for new task/transfer tabs - (from Frank Weiler) + - manager: fixes for new task/transfer tabs + (from Frank Weiler) - clientgui/ - BOINCGridCtrl.cpp,h - MainDocument.cpp,h - ViewTransfersGrid.cpp,h - ViewWorkGrid.cpp,h - res/ - sortascending.xpm - sortdescending.xpm + clientgui/ + BOINCGridCtrl.cpp,h + MainDocument.cpp,h + ViewTransfersGrid.cpp,h + ViewWorkGrid.cpp,h + res/ + sortascending.xpm + sortdescending.xpm David 7 Jan 2007 - core client: if swap space is zero, it must not have been @@ -257,18 +285,18 @@ Charlie 8 Jan 2007 ViewTransfersGrid.cpp David 8 Jan 2007 - - manager: performance enhancement to grid views - (from Frank Weiler) + - manager: performance enhancement to grid views + (from Frank Weiler) - clientgui/ - AdvancedFrame.cpp - BOINCGridCtrl.cpp,h - Events.h - MainDocument.cpp,h - ViewMessagesGrid.cpp, h (new) - ViewProjectsGrid.cpp,h - ViewTransfersGrid.pp - ViewWOrkGrid.cpp + clientgui/ + AdvancedFrame.cpp + BOINCGridCtrl.cpp,h + Events.h + MainDocument.cpp,h + ViewMessagesGrid.cpp, h (new) + ViewProjectsGrid.cpp,h + ViewTransfersGrid.pp + ViewWOrkGrid.cpp Rom 8 Jan 2007 - Win SETUP: Make Windows XP or better require passwords for the @@ -287,16 +315,16 @@ David 8 Jan 2007 prefs.inc David 8 Jan 2007 - - core client: fixed crashing bug that happens when attaching - to a project with wrong URL (e.g. setiathome.ssl.berkeley.edu). - The fix allows the project to attach but prints a warning. - It would be better to not allow the attach; - I'll get back to this later + - core client: fixed crashing bug that happens when attaching + to a project with wrong URL (e.g. setiathome.ssl.berkeley.edu). + The fix allows the project to attach but prints a warning. + It would be better to not allow the attach; + I'll get back to this later - client/ - client_types.h - cs_scheduler.C - scheduler_op.C + client/ + client_types.h + cs_scheduler.C + scheduler_op.C Charlie 8 Jan 2007 - Mac: update XCode project for new ViewMessagesGrid, ViewProjectsGrid @@ -341,16 +369,16 @@ Walt 9 Jan 2007 procinfo_unix.cpp David 9 Jan 2007 - - Manager: get rid of "CPU throttled" messages - - Manager: enhancements to Statistics tab - (can click on project name in multi-project view) - from Mifistor_x + - Manager: get rid of "CPU throttled" messages + - Manager: enhancements to Statistics tab + (can click on project name in multi-project view) + from Mifistor_x - clientgui/ - ViewStatistics.cpp,h - ViewWork.cpp - ViewWorkGrid.cpp - stdwx.h + clientgui/ + ViewStatistics.cpp,h + ViewWork.cpp + ViewWorkGrid.cpp + stdwx.h David 9 Jan 2007 - user web: "old news" was broken @@ -362,11 +390,11 @@ David 9 Jan 2007 news.inc David 9 Jan 2007 - - core: if we're preempting an app and leave it in memory - because no checkpoint yet, say so in message + - core: if we're preempting an app and leave it in memory + because no checkpoint yet, say so in message - client/ - app_control.C + client/ + app_control.C Charlie 9 Jan 2007 - MGR: Updates to disk usage pie charts from Frank Weiler. @@ -377,42 +405,42 @@ Charlie 9 Jan 2007 wxPieCtrl.cpp,h David 10 Jan 2007 - - core client: fix problems when user aborts result - (mark it as CPU_SCHED_PREEMPTED so scheduler doesn't - try to preempt it; that confuses things) - - changed format of Deferring Comm messages + - core client: fix problems when user aborts result + (mark it as CPU_SCHED_PREEMPTED so scheduler doesn't + try to preempt it; that confuses things) + - changed format of Deferring Comm messages - client/ - app_control.C - cs_scheduler.C + client/ + app_control.C + cs_scheduler.C David 10 Jan 2007 - - core client: backwards > in PROJECT::some_download_stalled(). - This caused the client to keep fetching work - from a project with stalled downloads. + - core client: backwards > in PROJECT::some_download_stalled(). + This caused the client to keep fetching work + from a project with stalled downloads. - client/ - client_types.C + client/ + client_types.C David 10 Jan 2007 - - manager: fix Unicode build problems - (from Frank Weiler) + - manager: fix Unicode build problems + (from Frank Weiler) - clientgui/ - ViewStatistics.cpp + clientgui/ + ViewStatistics.cpp David 10 Jan 2007 - - manager: various fixes - (from Frank Weiler) + - manager: various fixes + (from Frank Weiler) - clientgui/ - BOINCGridCtrl.cpp,h - ViewMessagesGrid.cpp - ViewProjectsGrid.cpp - ViewResourcesGrid.cpp - ViewStatistics.cpp - ViewTransfersGrid.cpp - ViewWorkGrid.cpp + clientgui/ + BOINCGridCtrl.cpp,h + ViewMessagesGrid.cpp + ViewProjectsGrid.cpp + ViewResourcesGrid.cpp + ViewStatistics.cpp + ViewTransfersGrid.cpp + ViewWorkGrid.cpp David 10 Jan 2007 - core client: sort daily stats records in case they get @@ -423,11 +451,11 @@ David 10 Jan 2007 cs_account.C David 10 Jan 2007 - - manager: use user-friendly app names + - manager: use user-friendly app names - clientgui/ - ViewWork.cpp - ViewWorkGrid.cpp + clientgui/ + ViewWork.cpp + ViewWorkGrid.cpp Rom 10 Jan 2007 - SCR: Disable the diagnostic support for release builds of the @@ -457,11 +485,11 @@ David 11 Jan 2007 cache_parameters.inc David 11 Jan 2007 - - manager: use user-friendly app names (fix to work w/ 5.4.11) + - manager: use user-friendly app names (fix to work w/ 5.4.11) - clientgui/ - ViewWork.cpp - ViewWorkGrid.cpp + clientgui/ + ViewWork.cpp + ViewWorkGrid.cpp Rom 11 Jan 2007 - MGR: Fix build break for Unicode support. @@ -545,3 +573,25 @@ Reinhard 14 Jan 2007 sched/ validator.C + +David 15 Jan 2007 + - core client: lots of debugging messages for cpu_sched (may remove later) + - Manager: check for ERR_DB_NOT_UNIQUE, not ERR_NONUNIQUE_EMAIL + - add boinc_UnzipToMemory() (from Reinhard Prix) + + client/ + cpu_sched.C + clientgui/ + ProjectProcessingPage.cpp + html/ops/ + sample_server_status.php + lib/ + common_defs.h + error_numbers.h + gui_rpc_client_print.C + util.C + zip/ + Makefile.am + boinc_zip.cpp,h + unzip/ + api.C diff --git a/checkin_notes_2006 b/checkin_notes_2006 index 038e2d7c9c..ef37d510ea 100755 --- a/checkin_notes_2006 +++ b/checkin_notes_2006 @@ -13902,31 +13902,3 @@ Rytis 30 Dec 2006 html/user/ forum_thread.php - -Reinhard 2 Jan 2007 - - fixed build of clientgui [in consultation with the Author, Frank Weiler] - * corrected unicode-string handling with wxString() in ViewTransfersGrid.cpp and ViewWorkGrid.cpp - * corrected wxString handling in BOINCGridCtrl.cpp - * add missing files BOINCGridCtrl.[cpp|h] to Makefile.am - - clientgui/ - Makefile.am - BOINCGridCtrl.cpp - ViewTransfersGrid.cpp - ViewWorkGrid.cpp - -Rom 2 Jan 2007 - - Win SETUP: Incorporate a custom action to migrate CPDNBBC data files to the - destination BOINC directory. - - win_build/installerv2/ - BOINC.ism - win_build/installerv2/redist/Windows/src/boinccas/ - CADetectOldInstaller.cpp, .h (Removed) - CAMigrateCPDNBBC.cpp, .h (Added) - boinccas.rc - boinccas95.def - boinccas95.vcproj - win_build/installerv2/redist/Windows/x86/ - boinccas.dll - boinccas95.dll diff --git a/client/cpu_sched.C b/client/cpu_sched.C index 25e28d2671..bb05ec37eb 100644 --- a/client/cpu_sched.C +++ b/client/cpu_sched.C @@ -581,6 +581,13 @@ bool CLIENT_STATE::enforce_schedule() { if (log_flags.cpu_sched_debug) { msg_printf(0, MSG_INFO, "[cpu_sched_debug] enforce_schedule(): start"); + for (i=0; iproject, MSG_INFO, + "[cpu_sched_debug] want to run: %s", + rp->name + ); + } } // set temporary variables @@ -633,6 +640,11 @@ bool CLIENT_STATE::enforce_schedule() { // for (i=0; iproject, MSG_INFO, + "[cpu_sched_debug] processing %s", rp->name + ); + } // See if the result is already running. // @@ -653,6 +665,12 @@ bool CLIENT_STATE::enforce_schedule() { } } if (atp) { + if (log_flags.cpu_sched_debug) { + msg_printf(rp->project, MSG_INFO, + "[cpu_sched_debug] %s is already running", rp->name + ); + } + // the scheduled result is already running. // see if it fits in mem // @@ -669,11 +687,12 @@ bool CLIENT_STATE::enforce_schedule() { } else { ram_left -= atp->procinfo.working_set_size_smoothed; atp->too_large = false; - continue; } + continue; } - // if the result already has a (non-running) active task, + // Here if the result is not already running. + // If it already has a (non-running) active task, // see if it fits in mem // atp = lookup_active_task_by_result(rp); @@ -699,18 +718,19 @@ bool CLIENT_STATE::enforce_schedule() { bool need_to_preempt = (nrunning==ncpus) && running_tasks.size(); // the 2nd half of the above is redundant if (need_to_preempt) { + // examine the most preemptable task. + // Preempt it if either + // 1) it's completed its time slice and has checkpointed recently + // 2) the scheduled result is in deadline trouble + // atp = running_tasks[0]; - bool running_beyond_sched_period = - gstate.now - atp->run_interval_start_wall_time - > gstate.global_prefs.cpu_scheduling_period_minutes*60; - bool checkpointed_recently = - (now - atp->checkpoint_wall_time < 10); + double time_running = now - atp->run_interval_start_wall_time; + bool running_beyond_sched_period = time_running > global_prefs.cpu_scheduling_period_minutes*60; + double time_since_checkpoint = now - atp->checkpoint_wall_time; + bool checkpointed_recently = time_since_checkpoint < 10; if (rp->project->deadlines_missed || (running_beyond_sched_period && checkpointed_recently) ) { - // only deadlines_missed results from a project - // will qualify for immediate enforcement. - // if (rp->project->deadlines_missed) { rp->project->deadlines_missed--; } @@ -723,6 +743,19 @@ bool CLIENT_STATE::enforce_schedule() { ); running_tasks.pop_back(); run_task = true; + if (log_flags.cpu_sched_debug) { + msg_printf(rp->project, MSG_INFO, + "[cpu_sched_debug] preempting %s", + atp->result->name + ); + } + } else { + if (log_flags.cpu_sched_debug) { + msg_printf(rp->project, MSG_INFO, + "[cpu_sched_debug] didn't preempt %s: tr %f tsc %f", + atp->result->name, time_running, time_since_checkpoint + ); + } } } else { run_task = true; @@ -734,6 +767,12 @@ bool CLIENT_STATE::enforce_schedule() { ram_left -= atp->procinfo.working_set_size_smoothed; } } + if (log_flags.cpu_sched_debug) { + msg_printf(0, MSG_INFO, + "[cpu_sched_debug] finished preempt loop, nrunning %d", + nrunning + ); + } // make sure we don't exceed RAM limits // @@ -784,6 +823,12 @@ bool CLIENT_STATE::enforce_schedule() { // for (i=0; iresult->project, MSG_INFO, + "[cpu_sched_debug] %s state %d next %d", + atp->result->name, atp->scheduler_state, atp->next_scheduler_state + ); + } if (atp->scheduler_state == CPU_SCHED_SCHEDULED && atp->next_scheduler_state == CPU_SCHED_PREEMPTED ) { @@ -822,13 +867,16 @@ bool CLIENT_STATE::enforce_schedule() { } atp->scheduler_state = CPU_SCHED_SCHEDULED; atp->run_interval_start_wall_time = now; - app_started = gstate.now; + app_started = now; swap_left -= atp->procinfo.swap_size; } } if (action) { set_client_state_dirty("enforce_cpu_schedule"); } + if (log_flags.cpu_sched_debug) { + msg_printf(0, MSG_INFO, "[cpu_sched_debug] enforce_schedule: end"); + } return action; } diff --git a/clientgui/ProjectProcessingPage.cpp b/clientgui/ProjectProcessingPage.cpp index 7fd4d6b125..34922ad825 100644 --- a/clientgui/ProjectProcessingPage.cpp +++ b/clientgui/ProjectProcessingPage.cpp @@ -456,7 +456,7 @@ void CProjectProcessingPage::OnStateChange( CProjectProcessingPageEvent& WXUNUSE } else { SetProjectCommunitcationsSucceeded(false); - if ((ERR_NONUNIQUE_EMAIL == ao->error_num) || CHECK_DEBUG_FLAG(WIZDEBUG_ERRACCOUNTALREADYEXISTS)) { + if ((ERR_DB_NON_UNIQUE == ao->error_num) || CHECK_DEBUG_FLAG(WIZDEBUG_ERRACCOUNTALREADYEXISTS)) { SetProjectAccountAlreadyExists(true); } else { SetProjectAccountAlreadyExists(false); diff --git a/doc/boinc_dev.php b/doc/boinc_dev.php index cf9cfc0f06..398bfb216f 100644 --- a/doc/boinc_dev.php +++ b/doc/boinc_dev.php @@ -121,6 +121,11 @@ with file deletion according to project policy.
  • Server/Back End:
      +
    • When using HR, if the scheduler has sent one result of a WU + using a particular app version, + it should use the same app version for other results from that WU. + Need to change protocol to specify version num; + need to change client to use this.
    • Implement a mechanism so that server software detects incompatible database format
    • diff --git a/doc/help_vol.php b/doc/help_vol.php index 17a1657fa8..fcc4265eea 100644 --- a/doc/help_vol.php +++ b/doc/help_vol.php @@ -87,8 +87,7 @@ function email_contact($vol) { "; list_start(); list_item( - "Your email address
      Optional, but $vol->name - won't be able to reply unless you include it", + "Your email address", input("email_addr", "") ); list_item("Subject
      Include 'BOINC' in the subject so $vol->name will know it's not spam", input("subject", "")); @@ -117,15 +116,19 @@ if ($send_email) { error_page("No such volunteer $volid"); } $msg = stripslashes($_GET['message']); + if (!$msg) { + error_page("You must supply a message"); + } $body = "The following message was sent by a BOINC Help user.\n"; $email_addr = $_GET['email_addr']; - if ($email_addr) { - $body .= "(email address: $email_addr)\n"; + if (!$email_addr) { + error_page("You need to specify your email address"); } + $reply = "\r\nreply-to: $email_addr"; $body .= "\n\n"; $body .= $msg; if (!$subject) $subject = "BOINC Help request"; - mail($vol->email_addr, $subject, $body, "From: BOINC"); + mail($vol->email_addr, $subject, $body, "From: BOINC".$reply); page_head("Message sent"); echo "Your message has been sent to $vol->name"; page_tail(); diff --git a/doc/test_matrix.php b/doc/test_matrix.php index 68b6ccd82a..9772334188 100644 --- a/doc/test_matrix.php +++ b/doc/test_matrix.php @@ -64,8 +64,7 @@ do it only if you know what you're doing.
    • Attach to SETI@home or other projects, and make sure work is downloaded and started.
    • From the time of installation to the time that work is begun - there should be no long delays, - errors, confusing messages, + there should be no long delays, errors, confusing messages, or anything else that might bother a naive, non-technical computer owner. If there is, report it as a a bug. diff --git a/html/ops/sample_server_status.php b/html/ops/sample_server_status.php index 18fa09a59b..5e771b3374 100644 --- a/html/ops/sample_server_status.php +++ b/html/ops/sample_server_status.php @@ -81,7 +81,7 @@ function daemon_status($host, $pidname, $progname, $disabled) { } $foo = exec($command); if ($foo) { - if (strstr($foo, $progname)) $running = 1; + if (strstr($foo, $pid)) $running = 1; } } } diff --git a/lib/common_defs.h b/lib/common_defs.h index 7e3726457e..21abf8b845 100644 --- a/lib/common_defs.h +++ b/lib/common_defs.h @@ -34,6 +34,8 @@ // restore permanent mode - used only in set_X_mode() GUI RPC // values of ACTIVE_TASK::scheduler_state and ACTIVE_TASK::next_scheduler_state +// "SCHEDULED" is synonymous with "executing" except when CPU throttling +// is in use. #define CPU_SCHED_UNINITIALIZED 0 #define CPU_SCHED_PREEMPTED 1 #define CPU_SCHED_SCHEDULED 2 diff --git a/lib/error_numbers.h b/lib/error_numbers.h index b129d90999..bd3ced7ffc 100755 --- a/lib/error_numbers.h +++ b/lib/error_numbers.h @@ -152,7 +152,6 @@ #define ERR_IN_PROGRESS -204 #define ERR_BAD_EMAIL_ADDR -205 #define ERR_BAD_PASSWD -206 -#define ERR_NONUNIQUE_EMAIL -207 #define ERR_ACCT_CREATION_DISABLED -208 #define ERR_ATTACH_FAIL_INIT -209 #define ERR_ATTACH_FAIL_DOWNLOAD -210 diff --git a/lib/gui_rpc_client_print.C b/lib/gui_rpc_client_print.C index 404e0abda7..552a9e14ec 100644 --- a/lib/gui_rpc_client_print.C +++ b/lib/gui_rpc_client_print.C @@ -139,6 +139,11 @@ void FILE_TRANSFER::print() { printf(" upload when present: %s\n", upload_when_present?"yes":"no"); printf(" sticky: %s\n", sticky?"yes":"no"); printf(" generated locally: %s\n", generated_locally?"yes":"no"); + printf(" pers xfer active: %s\n", pers_xfer_active?"yes":"no"); + printf(" xfer active: %s\n", xfer_active?"yes":"no"); + printf(" time_so_far: %f\n", time_so_far); + printf(" bytes_xferred: %f\n", bytes_xferred); + printf(" xfer_speed: %f\n", xfer_speed); } void MESSAGE::print() { diff --git a/lib/util.C b/lib/util.C index 6db2b2294f..4a88b96eb4 100755 --- a/lib/util.C +++ b/lib/util.C @@ -1068,7 +1068,6 @@ const char* boincerror(int which_error) { case ERR_USER_PERMISSION: return "user permission"; case ERR_BAD_EMAIL_ADDR: return "bad email address"; case ERR_BAD_PASSWD: return "bad password"; - case ERR_NONUNIQUE_EMAIL: return "email address is already in use"; case ERR_SHMEM_NAME: return "can't get shared mem segment name"; case ERR_NO_NETWORK_CONNECTION: return "no available network connection"; case ERR_ATTACH_FAIL_INIT: return "Couldn't start master page download"; diff --git a/zip/Makefile.am b/zip/Makefile.am index 7160dbbe29..bc3b9f24af 100644 --- a/zip/Makefile.am +++ b/zip/Makefile.am @@ -31,6 +31,7 @@ libboinc_zip_a_SOURCES = boinc_zip.cpp \ ./unzip/unshrink.c \ ./unzip/unzip.c \ ./unzip/zipinfo.c \ +./unzip/api.c \ ./zip/deflate.c \ ./zip/trees.c \ ./zip/util.c \ diff --git a/zip/boinc_zip.cpp b/zip/boinc_zip.cpp index f436f1938b..4d82c60d03 100644 --- a/zip/boinc_zip.cpp +++ b/zip/boinc_zip.cpp @@ -9,8 +9,11 @@ extern { #endif int unzip_main(int argc, char** argv); int zip_main(int argc, char** argv); +#include "./unzip/unzip.h" } +#include "./zip/zip.h" + #ifdef _WIN32 #include #else @@ -20,9 +23,6 @@ int zip_main(int argc, char** argv); using std::string; #endif -#include "./unzip/unzip.h" -#include "./zip/zip.h" - #include "boinc_zip.h" #include "filesys.h" // from BOINC for DirScan #include @@ -304,5 +304,32 @@ bool boinc_filelist(const std::string directory, return true; } +int +boinc_UnzipToMemory ( char *zip, char *file, string &retstr ) +{ + UzpOpts opts = {}; /* options for UzpUnzipToMemory() */ + UzpCB funcs = {}; /* function pointers for UzpUnzipToMemory() */ + UzpBuffer buf; + int ret; + + /* Read compressed file to memory. */ + funcs.structlen = sizeof(UzpCB); + funcs.msgfn = (MsgFn *)printf; + funcs.inputfn = (InputFn *)scanf; + funcs.pausefn = (PauseFn *)( 0x01 ); + funcs.passwdfn = (PasswdFn *)( NULL ); + + ret = UzpUnzipToMemory( zip, file, &opts, &funcs, &buf ); + + if ( ret ) + retstr = (string) buf.strptr; + + if ( buf.strptr) free ( buf.strptr ); + + return ret; + +} // boinc_UnzipToMemory() + + const char *BOINC_RCSID_bdf38b2dfb = "$Id$"; diff --git a/zip/boinc_zip.h b/zip/boinc_zip.h index 33c1f970cc..10c38c9064 100644 --- a/zip/boinc_zip.h +++ b/zip/boinc_zip.h @@ -57,6 +57,8 @@ bool boinc_filelist(const std::string directory, const bool bClear = true); int boinc_zip(int bZipType, const std::string szFileZip, const ZipFileList* pvectszFileIn); int boinc_zip(int bZipType, const std::string szFileZip, const std::string szFileIn); + +int boinc_UnzipToMemory ( char *zip, char *file, std::string &retstr ); extern "C" #else extern diff --git a/zip/unzip/api.c b/zip/unzip/api.c index 8a98427778..655175fbe2 100644 --- a/zip/unzip/api.c +++ b/zip/unzip/api.c @@ -33,7 +33,7 @@ You must define `DLL' in order to include the API extensions. ---------------------------------------------------------------------------*/ - +#define DLL #ifdef OS2 # define INCL_DOSMEMMGR